Kinematic objects and substeps

Oogst
Posts: 25
Joined: Thu Apr 10, 2008 11:19 am
Location: Utrecht, Netherlands

Kinematic objects and substeps

Post by Oogst »

I am wondering how to handle an issue with btMotionState in combination with kinematic objects and substeps. I have implemented the function getWorldTransform from btMotionState and it is being called. Now the question I have is the following:

If my game logic is executed at 30fps, while Bullet runs its physics on 60fps, then this means two substeps in btDynamicsWorld every frame. I suppose this also means two calls to getWorldTransform in my kinematic object. However, because my game logic has not updated since, these two calls get exactly the same position. This results is that from the point of view of the physics, my object constantly changes its speed from zero to two times the real speed. I would expect this gives odd results in the physics.

I also have a deforming triangle mesh and I suppose the same problem is around there as well. I think this is causing objects to launch into the air when the game logic framerate decreases.

So my question is: is my analysis of how this works correct and what is the best way to handle this issue? Do I need to interpolate something, or will Bullet do some interpolating? I read something about that in the manual, but I did not understand the exact meaning of it.

Thanks in advance!