Created
July 15, 2011 13:51
-
-
Save DarkSector/1084730 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create entities | |
Ogre::Entity* ent1 = mSceneMgr->createEntity("Ogre1","ogrehead.mesh"); | |
Ogre::Entity* ent2 = mSceneMgr->createEntity("Ninja1","ninja.mesh"); | |
//create nodes | |
Ogre::SceneNode* childnode1 = mSceneMgr->createSceneNode("Node1"); | |
//Ogre::SceneNode* childnode2 = mSceneMgr->createSceneNode("Node2"); | |
//attach to RSN | |
mSceneMgr->GetRootSceneNode()->addChild(childnode1); | |
childnode1->attachObject(ent1); | |
//childnode1->addChild(childnode2); | |
Ogre::SceneNode * childnode2 = childnode1->createChildSceneNode("Node2"); | |
childnode2->attachObject(ent2); | |
//set childnode2's position as origin | |
childnode2->setPosition(0,0,0); | |
//yaw for 90 degrees using Radian method and the HALF_PI defined in Ogre::Math | |
childnode2->yaw(Ogre::Radian(Ogre::Math::HALF_PI)); | |
//pitch for 90 degrees using the Degree() | |
childnode2->pitch(Ogre::Degree(-90)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment