Bullet physics character

Started by
13 comments, last by tmason 9 years, 10 months ago
So i tried kinematic character controller from bullet physics and i don't have a problem yet. I used the code from characterdemo of bullet physics and managed to walk in the direction where player is looking, but there is no code in the demo for moving left or right. How can i achieve this?
Advertisement

So i tried kinematic character controller from bullet physics and i don't have a problem yet. I used the code from characterdemo of bullet physics and managed to walk in the direction where player is looking, but there is no code in the demo for moving left or right. How can i achieve this?

You have an up vector and you have the forward vector. Do a cross product on these to get the right vector. Then just move the controller by multiples of this vector, either adding or subtracting.

If this is a bit beyond you, I'd suggest learning a bit about vector maths. Bullet is not easy to use without a bit of understanding of the basic maths.

Best of luck. I found this unsolvable. Its a shame as on flat surfaces, you can get away with using a rigid body as a character controller fairly well, but the slope sliding is a deal breaker for me.

Bold part makes me unhappy.

Luckily i did not scrap kinematic ctrl. so i can always go back.

Although currently its fine as it is for my needs.

So i tried kinematic character controller from bullet physics and i don't have a problem yet. I used the code from characterdemo of bullet physics and managed to walk in the direction where player is looking, but there is no code in the demo for moving left or right. How can i achieve this?


You have an up vector and you have the forward vector. Do a cross product on these to get the right vector. Then just move the controller by multiples of this vector, either adding or subtracting.

If this is a bit beyond you, I'd suggest learning a bit about vector maths. Bullet is not easy to use without a bit of understanding of the basic maths.

Well i do understand that and i will try it. (I already knew that cross product of two vectors yields another vector which is perpendicular to both vector. I just didn't knew how to let bullet know that i want to move left or right.)

EDIT : I got it working, thanks.

Such a timely post!

I too would like to get some character controller working out of the Bullet Physics Engine.

I am currently trying the KinematicCharacterController but as others said it is a mess; I have a log of static mesh loaded via btBvhTriangleMeshShapes but either that doesn't work well with the KinematicCharacterController, I am doing something wrong, or who knows what.

I'd love to hear how people are implementing their own Character Controllers.

Specifically, how are people walking up steps?

Thank you for your time.

This topic is closed to new replies.

Advertisement