Static Mesh problem

Christian24

21-07-2008 16:47:43

Hi,

I got a little problem with using a mesh in the simple scenes samples. My bounding does not fit the position of the drawn object. So it looks like this:



The code for this is:

node->setOrientation(Quaternion(Radian(0.4),Vector3(1,0,0)));
node->setScale(0.3,0.1,0.4);
node->setPosition(Vector3(0,0.3,-5));

// Create the physical version (just static geometry, it can't move so
// it doesn't need a body) and keep track of it
OgreOde::EntityInformer ei(entity,Matrix4::getTrans(node->getPosition()));
OgreOde::Geometry *geom = ei.createStaticTriangleMesh(_world, _space);node->setOrientation(Quaternion(Radian(0.4),Vector3(1,0,0)));
node->setScale(0.3,0.1,0.4);
node->setPosition(Vector3(0,0.3,-5));

// Create the physical version (just static geometry, it can't move so
// it doesn't need a body) and keep track of it
OgreOde::EntityInformer ei(entity,Matrix4::getTrans(node->getPosition()));
OgreOde::Geometry *geom = ei.createStaticTriangleMesh(_world, _space);



and when I change the code like this:


// node->setOrientation(Quaternion(Radian(0.4),Vector3(1,0,0)));
//node->setScale(0.3,0.1,0.4);
node->setPosition(Vector3(0,0.3,-5));// node->setOrientation(Quaternion(Radian(0.4),Vector3(1,0,0)));
//node->setScale(0.3,0.1,0.4);
node->setPosition(Vector3(0,0.3,-5));


the picture looks fine


but the problem is that I am then not able to scale and rotate the whole thing. Does anyone know how to get that work as well?

Thanks.

Christian24

21-07-2008 19:50:27

Got it working now. Just used this:

OgreOde::EntityInformer ei(entity,node->_getFullTransform());
OgreOde::Geometry *geom = ei.createStaticTriangleMesh(_world, _space); OgreOde::EntityInformer ei(entity,node->_getFullTransform());
OgreOde::Geometry *geom = ei.createStaticTriangleMesh(_world, _space);