btKinematicCharacterController and Demo

josemarin
Posts: 38
Joined: Fri Aug 12, 2005 5:37 pm

btKinematicCharacterController and Demo

Post by josemarin »

Hi.

btKinematicCharacterController doesn't implements jump, but DynamicCharacterController (from CharacterDemo) does.

Why the class of the lib doesn't include this feature? Isn't implemented correctly on the demo?

Has someone successfully used one of these classes to create characters that can jump and detect it is on the ground?

Thanks

Jose
S.Lundmark
Posts: 50
Joined: Thu Jul 09, 2009 1:46 pm

Re: btKinematicCharacterController and Demo

Post by S.Lundmark »

Hi Jose,

The dynamic and the kinematic character controller are two different solutions to a character controller. The first one is simulated as a dynamic object with no angular motion, whilst the second is simulated separately through world-queries.

I'm experimenting with the kinematic character controller. It is possible to get it to jump by setting its movementspeed to positive in the up-axis for your world. What this essentially means is that you'll have to implement jumping "gamewise" and the character-controller will solve it by trying to step down each frame. I suggest adding a check to disable the step-down feature of the character controller while you are 'jumping' or moving upwards.

I hope this helps,
Simon
Archwyrm
Posts: 2
Joined: Fri Sep 04, 2009 8:10 am

Re: btKinematicCharacterController and Demo

Post by Archwyrm »

Hello, we are using a kinematic controller in our project which has been modified a bit and contains rough jump functionality. You are welcome to take a look at how we did it. One thing the Bullet character controller does not do is implement acceleration, so this is one thing that was added. However, the main thing lacking is taking dt into consideration of calculating the player's next position. So, there can be a bit of bumpiness due to a fluctuating framerate.

I think the btKinematicCharacterController is one area of Bullet that is underloved, so some time in the future I would like to provide some cleaned up patches for things such as jump, implementing the setGravity() call, and collision with other controllers. I find myself pulling more and more of the parent controller class' code into my own derived one, and I would much rather do the opposite! Naturally some things that we have done and will do with our controller aren't suitable for generalization and we will have live with that.