Collision problem

birmacher

09-08-2008 16:18:14

Hello,

I try to use OgreBullet to simulate a car, but I failed to set up the bounding box. I created 3 screenshots to show you, what is the problem.
I only modify the ->addChildShape function.

1,
BoxCollisionShape* boxShape = new BoxCollisionShape ( ent->getBoundingBox ( ).getHalfSize ( ) );
CompoundCollisionShape* compoundShape = new CompoundCollisionShape ( );
compoundShape->addChildShape ( boxShape, Ogre::Vector3 ( 0, 0, 0 ) );



2,
BoxCollisionShape* boxShape = new BoxCollisionShape ( ent->getBoundingBox ( ).getHalfSize ( ) );
CompoundCollisionShape* compoundShape = new CompoundCollisionShape ( );
compoundShape->addChildShape ( boxShape, ent->getBoundingBox ( ).getCenter ( ) );



3,
BoxCollisionShape* boxShape = new BoxCollisionShape ( ent->getBoundingBox ( ).getHalfSize ( ) );
CompoundCollisionShape* compoundShape = new CompoundCollisionShape ( );
compoundShape->addChildShape ( boxShape, node->getWorldPosition ( ) + ent->getBoundingBox ( ).getCenter ( ) );



the problem is, that I can't get the bounding box on the car, and when I want to shift it, the bounding box just behaves in a very stupid way :x