Hi everyone,
I am tearing my hair out with the kinematic character controller. I managed to get it initialized and running but I can only get it to collide with static objects. How can I get it to collide with dynamic objects?
If the kinematic character controller is not the way to go then can someone point me to a working character controller for bullet.
Thanks.
Kinematic character controller
-
- Posts: 350
- Joined: Sat Jul 04, 2015 10:33 am
- Location: Bern, Switzerland
Re: Kinematic character controller
Hi codeman_nz,
Do you know about the older kinematic character controller? I never did anything with the controller, but I know that only recently there was a rewrite/update to the character controller which seems to mess up a lot of people's code. Try to get a version of it and check if it does collide with dynamic objects. If it does, we could find out why the never does not work anymore and then fix it in the new controller.
Do you know about the older kinematic character controller? I never did anything with the controller, but I know that only recently there was a rewrite/update to the character controller which seems to mess up a lot of people's code. Try to get a version of it and check if it does collide with dynamic objects. If it does, we could find out why the never does not work anymore and then fix it in the new controller.
-
- Posts: 4
- Joined: Thu Aug 25, 2016 3:50 am
Re: Kinematic character controller
Is there an example of how it is used? I downloaded the latest bullet and I can't see one.benelot wrote:Hi codeman_nz,
Do you know about the older kinematic character controller? I never did anything with the controller, but I know that only recently there was a rewrite/update to the character controller which seems to mess up a lot of people's code. Try to get a version of it and check if it does collide with dynamic objects. If it does, we could find out why the never does not work anymore and then fix it in the new controller.
-
- Posts: 350
- Joined: Sat Jul 04, 2015 10:33 am
- Location: Bern, Switzerland
Re: Kinematic character controller
Yes, unfortunately that one is not yet ported. It is in the old_demos branch here:
https://github.com/bulletphysics/bullet ... racterDemo
I will port it soon to the newest example framework, but I am not sure if it still works with the newest btKinematicCharacterController. If you are about to test it, you might be basically about to port it into a new example of the example browser. Just tell me if you want to port it, otherwise good luck with the example.
https://github.com/bulletphysics/bullet ... racterDemo
I will port it soon to the newest example framework, but I am not sure if it still works with the newest btKinematicCharacterController. If you are about to test it, you might be basically about to port it into a new example of the example browser. Just tell me if you want to port it, otherwise good luck with the example.
-
- Posts: 10
- Joined: Wed Oct 11, 2017 4:45 am
Re: Kinematic character controller
It's been a year, I wonder if it works now. I see this test for the kinematic controller
I initialize the controller
In the update loop
I tried to move the character when click the mouse
But... Of course I failed, the code crash when this code is called
So... What's your solution for character controller?
If I just set a plain capsule shape for my character, then my character can't even walk, it just roll - like a soulless capsule.
I try it anywayFor now only a simple test that it initializes correctly.
I initialize the controller
Code: Select all
//Members
btRigidBody* m_pTommyRigid;
btCollisionShape* m_pTommyShape;
/*Controller for Tommy*/
btPairCachingGhostObject* ghostObject = new btPairCachingGhostObject();
m_pTommyController = new btKinematicCharacterController(ghostObject, static_cast<btCapsuleShape*>(m_pTommyShape), 1);
//Of course there is m_pTommyRigid, I've tried to convert m_pTommyRigid to btPairCachingGhostObject, but I can't, any idea...
Code: Select all
if (m_pTommyController)
m_pTommyController->updateAction(m_dynamicsWorld, timeSinceLast);
Code: Select all
m_pTommyController->setWalkDirection(moveVec);
m_pTommyController->applyImpulse(moveVec);
Code: Select all
if (m_pTommyController)
m_pTommyController->updateAction(m_dynamicsWorld, timeSinceLast);
If I just set a plain capsule shape for my character, then my character can't even walk, it just roll - like a soulless capsule.