yan007
11-04-2006 15:16:01
i have a problem with the position (better orientation) of my collision object, thats my code:
Entity* cil = mSceneMgr->createEntity("Cil", "cilinderMesh.mesh");
SceneNode* cil1 = mSceneMgr->getRootSceneNode()->createChildSceneNode("Cil");
cil1->attachObject(cil);
OgreNewt::Collision* col3 = new OgreNewt::CollisionPrimitives::Cylinder(m_World,19.7,59.1);
OgreNewt::Body* bodyCil = new OgreNewt::Body( m_World, col3 );
delete col3;
bodyCil->attachToNode(cil1);
bodyCil->setPositionOrientation( Ogre::Vector3(50.0, 0.0,50.0), Ogre::Quaternion::IDENTITY );
but my collision object is in a different orientation of my original object, if i use
bodyCil->setPositionOrientation( Ogre::Vector3(50.0, 0.0,50.0), Ogre::Quaternion::IDENTITY * Ogre::Quaternion(Ogre::Degree(90), Ogre::Vector3::UNIT_X));//::IDENTITY );
my original objects rotation changes, but i would like to make that change
on my collision object, how do i do that
Entity* cil = mSceneMgr->createEntity("Cil", "cilinderMesh.mesh");
SceneNode* cil1 = mSceneMgr->getRootSceneNode()->createChildSceneNode("Cil");
cil1->attachObject(cil);
OgreNewt::Collision* col3 = new OgreNewt::CollisionPrimitives::Cylinder(m_World,19.7,59.1);
OgreNewt::Body* bodyCil = new OgreNewt::Body( m_World, col3 );
delete col3;
bodyCil->attachToNode(cil1);
bodyCil->setPositionOrientation( Ogre::Vector3(50.0, 0.0,50.0), Ogre::Quaternion::IDENTITY );
but my collision object is in a different orientation of my original object, if i use
bodyCil->setPositionOrientation( Ogre::Vector3(50.0, 0.0,50.0), Ogre::Quaternion::IDENTITY * Ogre::Quaternion(Ogre::Degree(90), Ogre::Vector3::UNIT_X));//::IDENTITY );
my original objects rotation changes, but i would like to make that change
on my collision object, how do i do that