Frapper  1.0a
Public Member Functions | Private Attributes | List of all members
Frapper::ViewingParameters Class Reference

Class representing a collection of parameters for viewing a 3D scene. More...

#include <ViewingParameters.h>

Public Member Functions

 ViewingParameters ()
 Constructor of the ViewingParameters class.
 
 ~ViewingParameters ()
 Destructor of the ViewingParameters class.
 
void reset ()
 Resets the viewing parameter's to the default view.
 
void translate (float dx, float dy)
 Translates the camera by the given translation values.
 
void rotate (float dPhi, float dTheta)
 Modifies the camera's viewing angles by the given angle values.
 
void dolly (float delta, bool wheel=false)
 Dollies the camera by the given delta value.
 
void update ()
 Updates the viewing parameters according to the currently set viewing angles.
 
void applyTo (ViewingParameters *viewingParameters)
 Applies the current viewing parameters to the given viewing parameters.
 
void applyTo (Node *node)
 Applies the current viewing parameters to the parameters of the given node.
 
void applyTo (Ogre::SceneNode *sceneNode, bool lookAtOrigin=false, bool center=false)
 Applies the current viewing parameters to the given scene node.
 
void applyTo (Ogre::Camera *camera)
 Applies the current viewing parameters to the given camera.
 
void applyFrom (Node *node)
 Applies the current viewing parameters from the given node to the this viewing parameters.
 
unsigned int getCanvasWidth () const
 Returns the width of the canvas stored in the viewing parameters.
 
unsigned int getCanvasHeight () const
 Returns the height of the canvas stored in the viewing parameters.
 
void setCanvasSize (unsigned int width, unsigned int height)
 Sets the size of the canvas to store in the viewing parameters.
 

Private Attributes

Ogre::Real m_viewRadius
 Spherical coordinate Rho used to calculate the eye point of the camera.
 
Ogre::Degree m_viewAnglePhi
 Spherical coordinate Phi used to calculate the eye point of the camera.
 
Ogre::Degree m_viewAngleTheta
 Spherical coordinate Theta used to calculate the eye point of the camera.
 
Ogre::Vector3 m_eye
 The camera's position in 3D space.
 
Ogre::Vector3 m_center
 The position to look at in 3D space.
 
Ogre::Vector3 m_up
 The viewing up vector in 3D space.
 
Ogre::Radian m_fieldOfView
 The camera's field of view setting.
 
Ogre::Real m_nearClipping
 The camera's near clipping plane value.
 
Ogre::Real m_farClipping
 The camera's far clipping plane value.
 
unsigned int m_canvasWidth
 The width of the canvas stored in the viewing parameters.
 
unsigned int m_canvasHeight
 The height of the canvas stored in the viewing parameters.
 

Detailed Description

Class representing a collection of parameters for viewing a 3D scene.

Constructor & Destructor Documentation

Frapper::ViewingParameters::ViewingParameters ( )

Constructor of the ViewingParameters class.

Constructors and Destructors.

Frapper::ViewingParameters::~ViewingParameters ( )

Destructor of the ViewingParameters class.

Member Function Documentation

void Frapper::ViewingParameters::reset ( )

Resets the viewing parameter's to the default view.

Public Functions.

void Frapper::ViewingParameters::translate ( float  dx,
float  dy 
)

Translates the camera by the given translation values.

Parameters
dxThe translation to apply in X.
dyThe translation to apply in Y.
void Frapper::ViewingParameters::rotate ( float  phi,
float  theta 
)

Modifies the camera's viewing angles by the given angle values.

Parameters
dPhiThe angle by which to rotate the viewing phi angle.
dThetaThe angle by which to rotate the viewing theta angle.
phiThe angle by which to rotate the viewing phi angle.
thetaThe angle by which to rotate the viewing theta angle.
void Frapper::ViewingParameters::dolly ( float  delta,
bool  wheel = false 
)

Dollies the camera by the given delta value.

Parameters
deltaThe delta value to apply to the viewing radius.
wheelFlag to control whether to dolly by mouse wheel.
void Frapper::ViewingParameters::update ( )

Updates the viewing parameters according to the currently set viewing angles.

void Frapper::ViewingParameters::applyTo ( ViewingParameters viewingParameters)

Applies the current viewing parameters to the given viewing parameters.

Parameters
viewingParametersThe target instance to apply the viewing parameters to.
void Frapper::ViewingParameters::applyTo ( Node node)

Applies the current viewing parameters to the parameters of the given node.

Parameters
nodeThe node to apply the viewing parameters to.
void Frapper::ViewingParameters::applyTo ( Ogre::SceneNode sceneNode,
bool  lookAtOrigin = false,
bool  center = false 
)

Applies the current viewing parameters to the given scene node.

Parameters
sceneNodeThe scene node to apply the viewing parameters to.
lookAtOriginFlag to control whether the scene node should be oriented towards the coordinate system's origin.
centerFlag to control whether to place the scene node at the coordinate system's origin.
void Frapper::ViewingParameters::applyTo ( Ogre::Camera *  camera)

Applies the current viewing parameters to the given camera.

Parameters
cameraThe camera to apply the viewing parameters to.
void Frapper::ViewingParameters::applyFrom ( Node node)

Applies the current viewing parameters from the given node to the this viewing parameters.

Parameters
nodeThe node to apply the viewing parameters from.
unsigned int Frapper::ViewingParameters::getCanvasWidth ( ) const

Returns the width of the canvas stored in the viewing parameters.

Returns
The width of the canvas stored in the viewing parameters.
unsigned int Frapper::ViewingParameters::getCanvasHeight ( ) const

Returns the height of the canvas stored in the viewing parameters.

Returns
The height of the canvas stored in the viewing parameters.
void Frapper::ViewingParameters::setCanvasSize ( unsigned int  width,
unsigned int  height 
)

Sets the size of the canvas to store in the viewing parameters.

Parameters
widthThe width of the canvas to store in the viewing parameters.
heightThe height of the canvas to store in the viewing parameters.

Member Data Documentation

Ogre::Real Frapper::ViewingParameters::m_viewRadius
private

Spherical coordinate Rho used to calculate the eye point of the camera.

Ogre::Degree Frapper::ViewingParameters::m_viewAnglePhi
private

Spherical coordinate Phi used to calculate the eye point of the camera.

Ogre::Degree Frapper::ViewingParameters::m_viewAngleTheta
private

Spherical coordinate Theta used to calculate the eye point of the camera.

Ogre::Vector3 Frapper::ViewingParameters::m_eye
private

The camera's position in 3D space.

Ogre::Vector3 Frapper::ViewingParameters::m_center
private

The position to look at in 3D space.

Ogre::Vector3 Frapper::ViewingParameters::m_up
private

The viewing up vector in 3D space.

Ogre::Radian Frapper::ViewingParameters::m_fieldOfView
private

The camera's field of view setting.

Ogre::Real Frapper::ViewingParameters::m_nearClipping
private

The camera's near clipping plane value.

Ogre::Real Frapper::ViewingParameters::m_farClipping
private

The camera's far clipping plane value.

unsigned int Frapper::ViewingParameters::m_canvasWidth
private

The width of the canvas stored in the viewing parameters.

unsigned int Frapper::ViewingParameters::m_canvasHeight
private

The height of the canvas stored in the viewing parameters.


The documentation for this class was generated from the following files: