#include <RTSCamera.h>
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 |
Definition at line 18 of file RTSCamera.h.
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 }
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 }
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] |
SceneManager* ASR::RTSCamera::mSceneMgr [private] |