bounci
23-08-2007 22:54:44
Hi,
I have created a scene node an attached here an entity and a geometry (OgreOde).
The geometry and the visualized mesh does not have the same position. Why?
I want to generate a geometry that is at the same position as the mesh, because I want collision with that mesh.
Do someone has an idea how I can generate the geometry for the entity at the same position and scaled the same and so on like I've done with the node before?
Here is my code:
Entity* entity = mSceneMgr->createEntity( objName, meshName);
SceneNode* node;
node = mSceneMgr->getRootSceneNode()->createChildSceneNode(objName+"Node");
node->scale(0.2,0.2,0.2);
node->attachObject(entity);
node->setPosition(newPos);
entity->setNormaliseNormals(true);
OgreOde::EntityInformer ei(entity,node->_getFullTransform());
OgreOde::Geometry *geom = ei.createStaticTriangleMesh(mWorld,mSpace);
geom->setPosition(node->getWorldPosition());
I have created a scene node an attached here an entity and a geometry (OgreOde).
The geometry and the visualized mesh does not have the same position. Why?
I want to generate a geometry that is at the same position as the mesh, because I want collision with that mesh.
Do someone has an idea how I can generate the geometry for the entity at the same position and scaled the same and so on like I've done with the node before?
Here is my code:
Entity* entity = mSceneMgr->createEntity( objName, meshName);
SceneNode* node;
node = mSceneMgr->getRootSceneNode()->createChildSceneNode(objName+"Node");
node->scale(0.2,0.2,0.2);
node->attachObject(entity);
node->setPosition(newPos);
entity->setNormaliseNormals(true);
OgreOde::EntityInformer ei(entity,node->_getFullTransform());
OgreOde::Geometry *geom = ei.createStaticTriangleMesh(mWorld,mSpace);
geom->setPosition(node->getWorldPosition());