Trimesh falling thru

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:

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.

tuan kuranes

19-09-2006 13:43:34

strange, as test_heightfield works with trimesh.
did you try with a bigger trimesh ?

syedhs

19-09-2006 16:09:40

I have tried it with gun.mesh (mesh supplied with demo), it still falls thru. But I am not sure with the scale though.. I will have to double check and will post any progress.