push body up when it is in another bullet body

Please don't post Bullet support questions here, use the above forums instead.
Kalir44
Posts: 1
Joined: Thu Mar 26, 2015 6:50 pm

push body up when it is in another bullet body

Post by Kalir44 »

Hi, I am developing a game where I am using btKinematicCharacterController and, it is a voxel game. You are the btKinematicCharacterController. The problem is, that when you place any voxel i rebuild bullet body for that chunk, but when you place voxel under yourself (you are tall as 2 voxels, so half of your body is in the chunk bullet body, so you are not standing on it, because you are in it...),and that causes falling of btKinematicCharacterController through the bullet body and you have to reset the game. Isn`t there any way to calculate in bullet, when btKinematicCharacterController is "in another body", push up the btKinematicCharacterController to stand on that body(It will stand on bounds of that chunk˘s bullet body).

I cant calculate in just in my code, because it is not a normal terrain, it is voxel terrain, there are some holes in the world and there could be voxels under and above yourself.

Just some info about my bullet code: The chunk`s bullet body is a normal btRigidBody, the btKinematicCharacterController has its btCapsuleShape and btPairCachingGhostObject(well, these are arguments to construct btKinematicCharacterController). They are all in btDiscreteDynamicsWorld and in update i just call

Code: Select all

collissionWorld.stepSimulation(delta, 5); //to simulate the physics

Thanks in advance. btw: If you have anyother advices, feel free to post it here, I would be really pleased.