void MoveDemoApplication::createAxes() { Ogre::ManualObject* pManualObject = mSceneMgr-> createManualObject( "ManualGridObj "); if (pManualObject) { int nLength = 160 ; pManualObject-> begin( "", Ogre::RenderOperation::OT_LINE_LIST); pManualObject-> position(0, 0, 0); pManualObject-> colour(Ogre::ColourValue::Red); pManualObject-> position(nLength*4, 0, 0); pManualObject-> position(0, 0, 0); pManualObject-> colour(Ogre::ColourValue::Green); pManualObject-> position(0, nLength, 0); pManualObject-> position(0, 0, 0); pManualObject-> colour(Ogre::ColourValue::Blue); pManualObject-> position(0, 0, nLength); pManualObject-> end(); pManualObject->getSection(0)->getTechnique()->getPass(0)->setLightingEnabled(false); Ogre::SceneNode*pSceneNode = mSceneMgr->getRootSceneNode()->createChildSceneNode( "ManualGridNode "); if(pSceneNode) pSceneNode-> attachObject(pManualObject); } }
void MoveDemoApplication::createPath() { Ogre::ManualObject* pManualObject = mSceneMgr-> createManualObject( "PathObj"); if (pManualObject) { pManualObject-> begin( "", Ogre::RenderOperation::OT_LINE_LIST); pManualObject-> colour(Ogre::ColourValue(1.0 , 1.0 , 0 )); pManualObject-> position(Vector3( 0.0f, 1.0f, 25.0f )); pManualObject-> position(Vector3( 550.0f, 1.0f, 50.0f )); pManualObject-> position(Vector3( 550.0f, 1.0f, 50.0f )); pManualObject-> position(Vector3(-100.0f, 1.0f, -200.0f ) ); pManualObject-> position(Vector3(-100.0f, 1.0f, -200.0f ) ); pManualObject-> position(Vector3( 0.0f, 1.0f, 25.0f )); pManualObject-> end(); pManualObject->getSection(0)->getTechnique()->getPass(0)->setLightingEnabled(false); Ogre::SceneNode*pSceneNode = mSceneMgr->getRootSceneNode()->createChildSceneNode( "PathNode "); if(pSceneNode) pSceneNode-> attachObject(pManualObject); } }
void MoveDemoApplication::createGrid() { Ogre::ManualObject* pManualObject = mSceneMgr-> createManualObject( "TestManualObject "); if (NULL == pManualObject) return ; pManualObject-> begin( " ", Ogre::RenderOperation::OT_LINE_LIST); { int startX=-1000 ; int startZ = -1000; int endX=1000 ; int endZ = 1000; int step = 50; //int nLength = 160 ; pManualObject-> colour(Ogre::ColourValue(0.5,0.5,0.5) ); for (int idx = 0 ; idx< (endX - startX)/step ; ++idx ) { pManualObject-> position(startX+step*idx, 0, startZ); pManualObject-> position(startX+step*idx, 0, endZ); } for (int idx = 0 ; idx< (endZ - startZ)/step ; ++idx ) { pManualObject-> position(startX, 0, startZ+step*idx ); pManualObject-> position(endX, 0, startZ+step*idx); } } pManualObject-> end(); pManualObject->getSection(0)->getTechnique()->getPass(0)->setLightingEnabled(false); Ogre::SceneNode* pSceneNode = mSceneMgr->getRootSceneNode()->createChildSceneNode( "TestSceneNode "); if (NULL == pSceneNode) return ; pSceneNode-> attachObject(pManualObject); }