This is a really cool tutorial. It has the basics you need for creating an RTS game!

Tutorial modifications for Dagon

Getting Started


 mSceneMgr = mRoot->getSceneManager(ST_EXTERIOR_CLOSE);

needs to be

 mSceneMgr = mRoot->createSceneManager(ST_EXTERIOR_CLOSE, "ExampleSMECInstance");

Setting up the Scene


 mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, ST_EXTERIOR_CLOSE);

needs to be

 mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);

William (Aladrin)

Using CEGUI and OIS for terrain selection

I had to make the following changes to my code to get this working with OIS.

1) Set the window width and height for MouseState, eg:

     const OIS::MouseState &ms = mMouse->getMouseState();
     ms.width = width;
     ms.height = height;

If you're using the practical application tutorial (Practical Application - Let's Get Started), you can achieve this simply by calling eg. handler->setWindowExtents(1024,768); after creating the InputHandler.

2) The following:

          Ray mouseRay = mCamera->getCameraToViewportRay( e->getX(), e->getY() );

becomes:

         Ogre::Real normX = Ogre::Real(evt.state.X.abs)/evt.state.width;
         Ogre::Real normY = Ogre::Real(evt.state.Y.abs)/evt.state.height; 
     Ogre::Ray mouseRay = camera->getCameraToViewportRay( normX, normY );

3) This had me scratching my head for a while. You need to initialize the CEGUI mouse cursor at the origin:

     CEGUI::MouseCursor::getSingleton().setPosition(CEGUI::Point(CEGUI::Vector2(0,0))); 

This post on the OIS forum was essential in getting it to work. Maybe someone with more confidence in their understanding can add this information to the tutorial?
--Purrpledone 19:26, 12 March 2007 (CST)

Adding Mouse Look

Find the TutorialFrameListener::mouseMoved function and add the following code just before the return statement:

should be:

Find the MouseQueryListener::mouseMoved function and add the following code just before the return statement:

Just added this pach to the tutorial. : Tautrimas 19:03, 1 March 2008 (GMT)

Terrain Selection

Ogre provides us with Camera::getCameraToViewpointRay; a nice function that...

should be

Ogre provides us with Camera::getCameraToViewportRay; a nice function that...

Also made this correction : Tautrimas 08:49, 2 March 2008 (GMT)


Alias: Talk:Intermediate_Tutorial_2