ogre_tools::CameraBase Class Reference

Generic interface for a camera. More...

#include <camera_base.h>

Inheritance diagram for ogre_tools::CameraBase:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CameraBase (Ogre::SceneManager *scene_manager)
 Constructor.
virtual void fromString (const std::string &str)=0
 Loads the camera's configure from the supplied string (generated through toString()).
Ogre::Camera * getOgreCamera ()
 Get the Ogre camera associated with this camera object.
virtual Ogre::Quaternion getOrientation ()=0
 Get the orientation of this camera.
virtual Ogre::Vector3 getPosition ()=0
 Get the position of this camera.
virtual void lookAt (const Ogre::Vector3 &point)=0
 Point the camera at the specified point.
virtual void mouseLeftDown (int x, int y)
virtual void mouseLeftDrag (int diff_x, int diff_y, bool ctrl, bool alt, bool shift)=0
 Handle a left mouse button drag.
virtual void mouseLeftUp (int x, int y)
virtual void mouseMiddleDown (int x, int y)
virtual void mouseMiddleDrag (int diff_x, int diff_y, bool ctrl, bool alt, bool shift)=0
 Handle a middle mouse button drag.
virtual void mouseMiddleUp (int x, int y)
virtual void mouseRightDown (int x, int y)
virtual void mouseRightDrag (int diff_x, int diff_y, bool ctrl, bool alt, bool shift)=0
 Handle a right mouse button drag.
virtual void mouseRightUp (int x, int y)
virtual void move (float x, float y, float z)=0
 Move the camera relative to its orientation.
virtual void pitch (float angle)=0
 Pitch the camera.
virtual void relativeNodeChanged ()
 Called when the relative node changes.
virtual void roll (float angle)=0
 Roll the camera.
virtual void scrollWheel (int diff, bool ctrl, bool alt, bool shift)=0
 Handle a scrollwheel change.
virtual void setFrom (CameraBase *camera)=0
 Set the position/orientation of this camera from another camera.
virtual void setOrientation (float x, float y, float z, float w)=0
 Set the orientation of the camera from a quaternion.
virtual void setOrientation (const Ogre::Quaternion &orientation)
 Set the orientation of the camera.
virtual void setPosition (float x, float y, float z)=0
 Set the position of the camera.
virtual void setPosition (const Ogre::Vector3 &position)
 Set the position of the camera.
void setRelativeNode (Ogre::SceneNode *node)
 Set a scene node that all camera transformations should be relative to.
virtual std::string toString ()=0
 Returns a string representation of the camera's configuration.
virtual void update ()=0
virtual void yaw (float angle)=0
 Yaw the camera.
virtual ~CameraBase ()

Protected Attributes

Ogre::Camera * camera_
 Ogre camera associated with this camera object.
Ogre::SceneNode * relative_node_
Ogre::SceneManager * scene_manager_
 Scene manager this camera is part of.

Detailed Description

Generic interface for a camera.

Provides a interface that a camera can override, providing interchangeability between different camera types. Specific implementation is left to the child class.

Definition at line 53 of file camera_base.h.


Constructor & Destructor Documentation

ogre_tools::CameraBase::CameraBase ( Ogre::SceneManager *  scene_manager  ) 

Constructor.

Parameters:
scene_manager Scene manager this camera is displaying

Definition at line 33 of file camera_base.cpp.

ogre_tools::CameraBase::~CameraBase (  )  [virtual]

Definition at line 43 of file camera_base.cpp.


Member Function Documentation

virtual void ogre_tools::CameraBase::fromString ( const std::string &  str  )  [pure virtual]

Loads the camera's configure from the supplied string (generated through toString()).

Parameters:
str The string to load from

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

Ogre::Camera* ogre_tools::CameraBase::getOgreCamera (  )  [inline]

Get the Ogre camera associated with this camera object.

Returns:
The Ogre camera associated with this camera object

Definition at line 67 of file camera_base.h.

virtual Ogre::Quaternion ogre_tools::CameraBase::getOrientation (  )  [pure virtual]

Get the orientation of this camera.

Returns:
The orientation of this camera

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual Ogre::Vector3 ogre_tools::CameraBase::getPosition (  )  [pure virtual]

Get the position of this camera.

Returns:
The position of this camera

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::lookAt ( const Ogre::Vector3 &  point  )  [pure virtual]

Point the camera at the specified point.

Parameters:
point The point to look at

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::mouseLeftDown ( int  x,
int  y 
) [inline, virtual]

Reimplemented in ogre_tools::OrbitCamera.

Definition at line 172 of file camera_base.h.

virtual void ogre_tools::CameraBase::mouseLeftDrag ( int  diff_x,
int  diff_y,
bool  ctrl,
bool  alt,
bool  shift 
) [pure virtual]

Handle a left mouse button drag.

Parameters:
diff_x Pixels the mouse has moved in the (window space) x direction
diff_y Pixels the mouse has moved in the (window space) y direction

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::mouseLeftUp ( int  x,
int  y 
) [inline, virtual]

Reimplemented in ogre_tools::OrbitCamera.

Definition at line 175 of file camera_base.h.

virtual void ogre_tools::CameraBase::mouseMiddleDown ( int  x,
int  y 
) [inline, virtual]

Reimplemented in ogre_tools::OrbitCamera.

Definition at line 173 of file camera_base.h.

virtual void ogre_tools::CameraBase::mouseMiddleDrag ( int  diff_x,
int  diff_y,
bool  ctrl,
bool  alt,
bool  shift 
) [pure virtual]

Handle a middle mouse button drag.

Parameters:
diff_x Pixels the mouse has moved in the (window space) x direction
diff_y Pixels the mouse has moved in the (window space) y direction

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::mouseMiddleUp ( int  x,
int  y 
) [inline, virtual]

Reimplemented in ogre_tools::OrbitCamera.

Definition at line 176 of file camera_base.h.

virtual void ogre_tools::CameraBase::mouseRightDown ( int  x,
int  y 
) [inline, virtual]

Reimplemented in ogre_tools::OrbitCamera.

Definition at line 174 of file camera_base.h.

virtual void ogre_tools::CameraBase::mouseRightDrag ( int  diff_x,
int  diff_y,
bool  ctrl,
bool  alt,
bool  shift 
) [pure virtual]

Handle a right mouse button drag.

Parameters:
diff_x Pixels the mouse has moved in the (window space) x direction
diff_y Pixels the mouse has moved in the (window space) y direction

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::mouseRightUp ( int  x,
int  y 
) [inline, virtual]

Reimplemented in ogre_tools::OrbitCamera.

Definition at line 177 of file camera_base.h.

virtual void ogre_tools::CameraBase::move ( float  x,
float  y,
float  z 
) [pure virtual]

Move the camera relative to its orientation.

Parameters:
x Distance to move along the X-axis
y Distance to move along the Y-axis
z Distance to move along the Z-axis

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::pitch ( float  angle  )  [pure virtual]

Pitch the camera.

Calls to pitch are cumulative, so: pitch(PI); pitch(PI);

is equivalent to pitch(2*PI);

Parameters:
angle Angle to pitch, in radians

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::relativeNodeChanged (  )  [inline, virtual]

Called when the relative node changes.

Reimplemented in ogre_tools::FPSCamera.

Definition at line 77 of file camera_base.h.

virtual void ogre_tools::CameraBase::roll ( float  angle  )  [pure virtual]

Roll the camera.

Calls to roll are cumulative, so: roll(PI); roll(PI);

is equivalent to roll(2*PI);

Parameters:
angle Angle to roll, in radians

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::scrollWheel ( int  diff,
bool  ctrl,
bool  alt,
bool  shift 
) [pure virtual]

Handle a scrollwheel change.

Parameters:
diff Number of "units" the scrollwheel has moved
Todo:
Probably need to pass in how many units there are in a "click" of the wheel

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::setFrom ( CameraBase camera  )  [pure virtual]

Set the position/orientation of this camera from another camera.

Parameters:
camera The camera to set from

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::setOrientation ( float  x,
float  y,
float  z,
float  w 
) [pure virtual]

Set the orientation of the camera from a quaternion.

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

void ogre_tools::CameraBase::setOrientation ( const Ogre::Quaternion &  orientation  )  [virtual]

Set the orientation of the camera.

Definition at line 62 of file camera_base.cpp.

virtual void ogre_tools::CameraBase::setPosition ( float  x,
float  y,
float  z 
) [pure virtual]

Set the position of the camera.

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

void ogre_tools::CameraBase::setPosition ( const Ogre::Vector3 &  position  )  [virtual]

Set the position of the camera.

Definition at line 57 of file camera_base.cpp.

void ogre_tools::CameraBase::setRelativeNode ( Ogre::SceneNode *  node  ) 

Set a scene node that all camera transformations should be relative to.

Parameters:
node The node

Definition at line 48 of file camera_base.cpp.

virtual std::string ogre_tools::CameraBase::toString (  )  [pure virtual]

Returns a string representation of the camera's configuration.

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.

virtual void ogre_tools::CameraBase::update (  )  [pure virtual]
virtual void ogre_tools::CameraBase::yaw ( float  angle  )  [pure virtual]

Yaw the camera.

Calls to yaw are cumulative, so: yaw(PI); yaw(PI);

is equivalent to yaw(2*PI);

Parameters:
angle Angle to yaw, in radians

Implemented in ogre_tools::FPSCamera, ogre_tools::OrbitCamera, and ogre_tools::OrthoCamera.


Member Data Documentation

Ogre::Camera* ogre_tools::CameraBase::camera_ [protected]

Ogre camera associated with this camera object.

Definition at line 219 of file camera_base.h.

Ogre::SceneNode* ogre_tools::CameraBase::relative_node_ [protected]

Definition at line 222 of file camera_base.h.

Ogre::SceneManager* ogre_tools::CameraBase::scene_manager_ [protected]

Scene manager this camera is part of.

Definition at line 220 of file camera_base.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines


ogre_tools
Author(s): Josh Faust
autogenerated on Fri Jan 11 09:10:16 2013