How to interpolate position when using only a ghost object?

andreww
Posts: 2
Joined: Thu Apr 24, 2008 6:30 pm

How to interpolate position when using only a ghost object?

Post by andreww »

Hi,

I'm writing a character controller class using a ghostObject and my own velocity vector. My character controller class has inherited the btActionInterface class, so when the world steps, it updates the character controller as well (I've put the movement/collision detection/collision response logic in the inherited updateAction(collisionWorld,deltaTimeStep) method).

I want to calculate the interpolated position so that I can draw the player moving smoothly (e.g. ghostObject.position + velocity * interpolation;).

But where in Bullet can get the interpolated value from?

Thanks.
LEgregius
Posts: 26
Joined: Tue Oct 14, 2008 1:34 am

Re: How to interpolate position when using only a ghost obje

Post by LEgregius »

I'm having the exact same problem. I've been trying to find a workaround, but nothing yet. It seems that the time data is private.

I thought about just calling update on it myself outside of the physics engine.