ASR::RTSCamera Class Reference

#include <RTSCamera.h>

List of all members.

Public Member Functions

Camera * getCamera ()
 RTSCamera (SceneManager *sceneMgr)
 ~RTSCamera ()
void translate (const Vector3 &vec)
void pitch (const Radian &angle)
void setAspectRatio (Real ratio)

Private Attributes

SceneManager * mSceneMgr
Camera * mCamera
SceneNode * mCamNode
SceneNode * mPitchNode


Detailed Description

Definition at line 18 of file RTSCamera.h.


Constructor & Destructor Documentation

ASR::RTSCamera::RTSCamera ( SceneManager *  sceneMgr  ) 

Definition at line 18 of file RTSCamera.cpp.

References mCamera, mCamNode, and mPitchNode.

00019                 : mSceneMgr ( sceneMgr )
00020         {
00021                 assert ( sceneMgr != NULL );
00022 
00023                 // Create the structure for the camera nodes
00024                 mCamera = sceneMgr->createCamera ( "playerCam" );
00025                 mCamera->setNearClipDistance ( 5.0f );
00026 
00027                 mCamNode = sceneMgr->getRootSceneNode()->createChildSceneNode( "cameraNode" );
00028                 mPitchNode = mCamNode->createChildSceneNode( "cameraPitchNode" );
00029                 mPitchNode->attachObject ( mCamera );
00030 
00031                 // HACK
00032                 mCamNode->setPosition ( 100, 500, 350 );
00033                 //mCamNode->setPosition ( 250, 1500, 1000 );
00034                 //mCamera->setDirection ( 0, 0, -1 );
00035                 mPitchNode->pitch ( Ogre::Degree(-60) );
00036         }

ASR::RTSCamera::~RTSCamera (  ) 

Definition at line 40 of file RTSCamera.cpp.

References mCamera, mCamNode, mPitchNode, and mSceneMgr.

00041         {
00042                 // Remove the camera
00043                 mPitchNode->detachObject ( mCamera );
00044                 mSceneMgr->destroyCamera ( mCamera );
00045 
00046                 // Destroy the node structure
00047                 mCamNode->getParentSceneNode()->removeAndDestroyChild( mCamNode->getName() );
00048         }


Member Function Documentation

Camera* ASR::RTSCamera::getCamera (  )  [inline]

Definition at line 32 of file RTSCamera.h.

References mCamera.

Referenced by ASR::Client::createCamera(), and ASR::Client::createTeam().

00032 { return mCamera; };

void ASR::RTSCamera::pitch ( const Radian &  angle  ) 

Definition at line 59 of file RTSCamera.cpp.

References mPitchNode.

00060         {
00061                 mPitchNode->pitch ( angle );
00062         }

void ASR::RTSCamera::setAspectRatio ( Real  ratio  ) 

Definition at line 66 of file RTSCamera.cpp.

References mCamera.

Referenced by ASR::Client::createCamera().

00067         {
00068                 mCamera->setAspectRatio( ratio );
00069         }

void ASR::RTSCamera::translate ( const Vector3 &  vec  ) 

Definition at line 52 of file RTSCamera.cpp.

References mCamNode.

Referenced by ASR::RTSCameraUpdater::updateBeforeFrame().

00053         {
00054                 mCamNode->translate ( vec );
00055         }


Member Data Documentation

Camera* ASR::RTSCamera::mCamera [private]

Definition at line 25 of file RTSCamera.h.

Referenced by getCamera(), RTSCamera(), setAspectRatio(), and ~RTSCamera().

SceneNode* ASR::RTSCamera::mCamNode [private]

Definition at line 26 of file RTSCamera.h.

Referenced by RTSCamera(), translate(), and ~RTSCamera().

SceneNode* ASR::RTSCamera::mPitchNode [private]

Definition at line 27 of file RTSCamera.h.

Referenced by pitch(), RTSCamera(), and ~RTSCamera().

SceneManager* ASR::RTSCamera::mSceneMgr [private]

Definition at line 24 of file RTSCamera.h.

Referenced by ~RTSCamera().


The documentation for this class was generated from the following files:
Generated on Sun Jun 25 19:23:44 2006 for Valors End by  doxygen 1.4.7