sakshi2212
13-02-2009 07:21:40
Ogre::AxisAlignedBox box = blk->getEntity()->getBoundingBox();
Ogre::Vector3 scale = blk->getSceneNode()->getScale();
OgreOde::EntityInformer ei(blk->getEntity(), blk->getSceneNode()->_getFullTransform());
OgreOde::Geometry *geom = ei.createSingleStaticBox(_world, _space);
geom->setPosition(Ogre::Vector3(blk->getOffset().x, box.getCenter().y, blk->getOffset().z));
geom->setOrientation(Ogre::Quaternion(
Ogre::Degree(orientOffset.y * 90.0), Ogre::Vector3::UNIT_Y));
OgreOde::TransformGeometry* tgeom = new OgreOde::TransformGeometry(_world, _space);
blk->setGeometry(geom);
blk->setTransGeometry(tgeom);
tgeom->setDebug(true);
geom->setDebug(true);
blk->getEntity()->setUserObject(blk->getGeometry());Above is my code for defining a simple box geometry for an entity. I used transform geometry so that I could apply setPosition and setOrientation to the geometry. Before creating the geometry I apply all the transforms to the entity and its scene node. OrientOffset is some multiple of 90.0, by which the entity is rotated about the Y axis. So I apply the same thing to the geometyr also. But it makes no difference. The geometry's orientation remain the same. What am I doing wrong?