Character Controller Collision

SwapX
Posts: 2
Joined: Fri Dec 28, 2012 12:41 am

Character Controller Collision

Post by SwapX »

Hi,

I am relatively new to Bullet physics.

I have a basic scene with a static box with zero mass for the floor, a small dynamics object with lower mass and a large kinematic box object and a character controller.

I noticed this...

1) The kinematic character controller cannot move the dynamic box, even if it is low mass

2) The large kinematic object is affected by gravity (that's okay in this case) and can push both the dynamic object and the character controller if I use kinematicBox->translate(...)

3) The kinematic object collides with the static object (the floor) and that is useful for this case.

So basically I was wondering if there is a way of using a kinematic character controller with a dynamic object aligned to the controller (similar to the dynamic character controller) with the special feature that the kinematic character controller has a mask that prevents it from colliding with the object that is aligned to it. Even alignment of a dynamic object during an OnTick() function would be possible, however the code would be much *easier if I did not have to set the locations of the aligned object explicitly.

This way I would have the feature I need for the kinematic character controller to push the small and very light dynamic object.

(Another alternative would be to implement a good collision algorithm (i.e quake bsp collision) and use a rigid body aligned to the player to interact with the physics world, however I am hoping there is an easier solution)
CireNeikual
Posts: 19
Joined: Thu Jun 28, 2012 5:06 pm

Re: Character Controller Collision

Post by CireNeikual »

Perhaps this will be useful for you. It is a partially kinematic character controller (still uses dynamic bodies). Ignore all the things that say "scene", they are just used to link the controller to the rendering engine.

DynamicCharacterController.h and DynamicCharacterController.cpp in https://github.com/222464/EvolvedVirtua ... ts/Physics
SwapX
Posts: 2
Joined: Fri Dec 28, 2012 12:41 am

Re: Character Controller Collision

Post by SwapX »

Thanks for the reply, I'll look into it.

The project itself is also quite interesting ... evolving creatures ... would be good to get a skinning system for them :)