I use Ogre + Bullet + OgreBullet for my application.
it works so far, but the Ogre Object and the collision don't match. Any Ideas?
Scene create:
Code: Select all
Ogre::AxisAlignedBox boundingB = Player.Entity->getBoundingBox();
size = boundingB.getSize();
size *= (Player.node->getScale()); // only the half needed
size /= 2;
size *= 0.96f; // Bullet margin is a bit bigger so we need a smaller size
// after that create the Bullet shape with the calculated size
OgreBulletCollisions::BoxCollisionShape *sceneBoxShape = new OgreBulletCollisions::BoxCollisionShape(size);
Player.Body = new OgreBulletDynamics::RigidBody("PlayerPhys" ,mWorld);
Player.Body->setShape( Player.node,sceneBoxShape,
0.0f, // dynamic body restitution
0.0f,0.1f, // dynamic body friction
Ogre::Vector3(0,0,0), // starting position of the box
Ogre::Quaternion(1,0,0,0));// orientation of the box
Player.Body->setPosition(0,900,0);
Player.Body->setKinematicObject(true);
Player.Body->showDebugShape(true);
boundingB = Floor.Entity->getBoundingBox();
size = boundingB.getSize();
size *= (Floor.node->getScale());
size /=2;// only the half needed
size *= 0.96f; // Bullet margin is a bit bigger so we need a smaller size
// after that create the Bullet shape with the calculated size
Floor.Shape = new OgreBulletCollisions::BoxCollisionShape(size);
Floor.Body = new OgreBulletDynamics::RigidBody("FloorPhys" ,mWorld);
Floor.Body->setStaticShape(Floor.Shape,0.1f,0.0f,Ogre::Vector3(0,0,0));