Getting non interpolated transformations

heodox
Posts: 4
Joined: Fri Oct 17, 2008 3:42 pm

Getting non interpolated transformations

Post by heodox »

Hi,

I have started implementing bullet physics into a multiplayer game (liking it so far :) ), until now we had implementation using PAL (with physx) and i did the fixed time steps myself, i see that bullet actually has the fixed time steps and does interpolation by default. That brings me to my question, is it possible to get the non interpolated transformation data? (which would be used for selective network sync)
chunky
Posts: 145
Joined: Tue Oct 30, 2007 9:23 pm

Re: Getting non interpolated transformations

Post by chunky »

Of course.

To get the transform of a body, just do btTransform t = mRigidBody->getWorldTransform(). Bullet does interpolation, but all the interpolation happens through motionstates. In short:

1) To get the interpolated stuff, use a motionstate
2) To get non-interpolated stuff, query the body directly

Gary (-;
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Getting non interpolated transformations

Post by sparkprime »

You can also get non-interpolated motion through the motion states if you pass in an external timestep that is an integer multiple of the internal timestep, i.e. crimping the delta time yourself.