I am using Bullet physics along with Irrlicht. My program consistently crashes when
maxSubSteps is not set to zero when calling
stepSimulation. I believe it has something to do with the time between the stepSimulation calls because when I stopped Irrlicht from drawing the scene, Bullet worked perfectly fine. Here is my
The segfault crashing does not occur when the
maxSubSteps is zero. I would like to find a better solution to this as I have read that disabling substepping is experimental. Does anyone know how to fix this?
The parameters I am using when calling bullet's
const irr::u32 then = device->getTimer()->getTime(); ... const irr::u32 now = device->getTimer()->getTime(); const irr::f32 frame_delta_time = (irr::f32)(now-then)/1000.f;
The value of
frame_delta_time when the program crashes is 0.009.
fixedTimeStep is the default 1/60.
Values other than 0 I have set
maxSubSteps to are 1 (the default), 10 and 100.
The gdb stack trace indicates the program is crashing at releasePredivtiveContacts():
Program received signal SIGSEGV, Segmentation fault. #0 0x000055555557463b in btDiscreteDynamicsWorld::releasePredictiveContacts() () #1 0x00005555555746fc in btDiscreteDynamicsWorld::createPredictiveContacts(double) () #2 0x0000555555573c8f in btDiscreteDynamicsWorld::internalSingleStepSimulation(double) () #3 0x0000555555575335 in btDiscreteDynamicsWorld::stepSimulation(double, int, double) ()
Edit: The full code is on Github: https://github.com/morgenm/PMC-Game/tree/master/src