Time for action — making the camera work again

We have already created our camera; now we are going to use it in combination with user input as follows:

  1. Extend the constructor of the Framelistener to get a pointer to our camera:
    Example30FrameListener(Ogre::SceneNode* node,RenderWindow* win,Ogre::Camera* cam)
    
  2. Also add a member variable for storing the camera pointer:
    Ogre::Camera* _Cam;
    
  3. Then assign the parameter to the member:
    _Cam = cam;
    
  4. Modify the instantiation of the FrameListener to add the camera pointer:
    Ogre::FrameListener* FrameListener = new Example30FrameListener(_SinbadNode,mWindow,mCamera);
    
  5. To move the camera, we need to get mouse input. So create a new member variable for storing the mouse:
    OIS::Mouse* _mouse;
    
  6. In the constructor, init ...

Get Ogre 3D 1.7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.