kulebril
03-03-2011 16:57:15
Hi:
I have a model I wish to be afected by physics.
I made:
but my model falls through the ground (while the other Bodies don't).
If I apply a Box Shape, it collides correctly, but when using Trimesh don't.
What do I have to do? What I am missing here?
I have a model I wish to be afected by physics.
I made:
OgreBulletCollisions::CollisionShape *CharShape;
OgreBulletCollisions::AnimatedMeshToShapeConverter * Converter=
new OgreBulletCollisions::AnimatedMeshToShapeConverter(mBodyEnt);
CharShape=Converter->createTrimesh();
OgreBulletDynamics::RigidBody *CharBody =
new OgreBulletDynamics::RigidBody(
"CharRigid",
mPhysicsFrameListener->mWorld);
pos=mBodyNode->getPosition();
CharBody->setShape(
mBodyNode,
CharShape,
0.01f, // dynamic body restitution
0.6f, // dynamic body friction
500.0f,
pos, // starting position
Quaternion(0,1,0,0)// orientation
);
mPhysicsFrameListener->mShapes.push_back(CharShape);
mPhysicsFrameListener->mBodies.push_back(CharBody);
but my model falls through the ground (while the other Bodies don't).
If I apply a Box Shape, it collides correctly, but when using Trimesh don't.
What do I have to do? What I am missing here?