syedhs
19-09-2006 10:12:44
Any idea? The trimesh sits on the terrain created using TerrainGeometry. Have changed the weight from 5.0 down to 0.01, it still falls thru. Below is the code:
The thing is, the collision went fine if I replace the trimesh with primitive box collision.
OgreOde::Body* body = new OgreOde::Body();
node->attachObject(body);
ent->setNormaliseNormals(true);
// Set the mass and geometry to match the visual representation
OgreOde::Geometry* geom = 0;
OgreOde::BoxMass mass;
Ogre::Real massReal = StringConverter::parseReal(valueMass);
OgreOde::EntityInformer ei(ent, node->_getFullTransform());
geom = ei.createStaticTriangleMesh(mWorld->getDefaultSpace());
Vector3 size = ei.getSize();
size *= scale;
mass = OgreOde::BoxMass(massReal, size);
mass.setDensity(5, size);
body->setMass(mass);
// Tie the collision geometry to the physical body
geom->setBody(body);
The thing is, the collision went fine if I replace the trimesh with primitive box collision.