btKinematicCharacterController walk direction

ewencp
Posts: 1
Joined: Tue Dec 13, 2011 7:17 pm

btKinematicCharacterController walk direction

Post by ewencp »

I'm adding avatar support to my application and I'm starting from the sample btKinematicCharacterController. At first I thought it wasn't taking into account the dt step since calling setWalkDirection() caused it to follow a path in playerStep() which used m_walkDirection without multiplying by dt. But then I found that in the demo, the timestep is premultiplied before calling setWalkDirection.

Is this approach correct? Isn't it possible that dt is bigger than the internal sim step so the btActionInterface methods will be called multiple times, resulting in moving, e.g., 2x or 3x as far as intended? Is there a reason walk direction isn't just treated as a velocity in this case, just as it is in the setVelocityForTimeInterval() case?

The fix for this is simple and only seems to affect the CharacterDemo, but I wanted to check before submitting a patch.