Debug Drawer "lags" behind rigidbody position if using maxSubSteps ≠ 0

Post Reply
Tatjam
Posts: 1
Joined: Sat Dec 07, 2019 1:13 pm

Debug Drawer "lags" behind rigidbody position if using maxSubSteps ≠ 0

Post by Tatjam »

I'm building a space simulation game using a combination of bullet physics for vessel dynamics and custom physics code for the solar system and vessel movement through space.

Everything works fine using bullet compiled to use doubles at very high velocites and far away from the origin, but the debug drawing exhibits problems whenever I step the world with a maxSubStep value that is not equal to 0. It seems to "lag behind" the rigid-body in a non-uniform manner, snapping back and forwards, but always behind the vehicle. I assume this is caused by the interpolation system.

This effect only becomes evident when moving extremely fast, which is neccesary in my game.

Here are a few photos, the vehicle is moving at around 50 km/s, physics work perfectly but the debug drawers do not (unless i set maxSubSteps to 0 which I assume shuts down the interpolation system).

Here is an example with maxSubSteps = 0:
Image

And here it's using maxSubSteps = 32, you can see the debug drawers way behind the rendered object, which gets positioned using the motion state.
Image

Is there any way to set the debug drawers to use the motion state? Maybe I'm better off writing my own wrapper which calls the functions with the correct btTransform.
Post Reply