[solved]TriangleMesh and setScale

dedesite

02-07-2008 14:53:06

Hi all,

I've got a problem when I call setScale on a mesh wich is also a triangle mesh.
The viewable mesh is scale at the right proportion, but the triangleMesh keep the standard proportion (which correspond to the 1, 1, 1 proportion).

Here is how I create my triangle mesh :


StaticMeshToShapeConverter *trimeshConverter = new StaticMeshToShapeConverter(entity);
TriangleMeshCollisionShape *sceneTriMeshShape = trimeshConverter->createTrimesh();
delete trimeshConverter;
RigidBody *sceneRigid = new RigidBody(
entity->getName() + "Rigid" + StringConverter::toString(mNumEntitiesInstanced),
mWorld);

sceneRigid->setStaticShape(node, sceneTriMeshShape, bodyRestitution, bodyFriction, pos);
//sceneRigid->getBulletObject()->getWorldTransform()
mEntities.push_back(entity);
mBodies.push_back(sceneRigid);
mNumEntitiesInstanced++;

return sceneRigid;


I can't find a method to set the size of a TriangleMeshCollisionShape.

Thanks,
Andréas

dedesite

04-07-2008 12:32:14

Hi,

I solve the problem by not rescaling my Mesh ;).

Before, I couldn't do that because I use 3DS Max and oFusion export the scale coordinates not in the .mesh file but in the .OSM, so the setScale was obliged.
I found the "Reset XForm" modifier and it solve the problem :D.

Thanks anyway,
Andréas