Osiris Framework  0.3
OCamera Class Reference

Class that represents a camera on the scene. More...

#include <OsirisSDK/OCamera.h>

Public Member Functions

 OCamera (float fieldOfViewDeg=45.0f, float aspectRatio=4.0f/3, float zNear=1.0f, float zFar=5.0f, const OVector3 &pos=OVector3(0.0f, 0.0f,-1.0f), const OVector3 &or=OVector3(0.0f))
 Class constructor. More...
 
virtual ~OCamera ()
 Class destructor.
 
void setFieldOfView (float valueDeg)
 Sets the camera field of view. More...
 
void setAspectRatio (float value)
 Sets camera aspect ratio (width/height).
 
void setCameraLimits (float zNear, float zFar)
 Sets camera depth limits. More...
 
void setPosition (const OVector3 &position)
 Set camera position. More...
 
void changePosition (const OVector3 &displacement)
 Change camera position using a displacement vector. More...
 
void setOrientation (const OVector3 &orientation)
 Set camera orientation. More...
 
float fieldOfViewDegrees () const
 Returns the camera field of view. More...
 
float aspectRatio () const
 Returns screen aspect ratio. More...
 
float nearLimit () const
 Returns camera nearest limit.
 
float farLimit () const
 Returns camera farthest limit.
 
OVector3position ()
 Retrieves the camera position from the state object. More...
 
OVector3 orientation () const
 Retrieves the camera orientation from the state object. More...
 
OStatestate ()
 Direct access to the camera state object.
 
const OMatrixStacktransform ()
 Calculates the perspective and camera transformations. More...
 

Detailed Description

Class that represents a camera on the scene.

Constructor & Destructor Documentation

OCamera::OCamera ( float  fieldOfViewDeg = 45.0f,
float  aspectRatio = 4.0f / 3,
float  zNear = 1.0f,
float  zFar = 5.0f,
const OVector3 pos = OVector3(0.0f , 0.0f, -1.0f),
const OVector3 or = OVector3(0.0f) 
)

Class constructor.

The constructor takes in all the attributes of the scene camera.

Parameters
fieldOfViewDegAngle of the camera's field of view in degrees.
aspectRatioThe aspect ration of the screen (width/height).
zNearNearest camera depth.
zFarFarthest camera depth.
posCamera position.
orCamera orientation vector containing Euler angles: rotations around axes x, y and z. The camera always faces the positive z-axis direction from it's perspective.

Member Function Documentation

float OCamera::aspectRatio ( ) const

Returns screen aspect ratio.

Returns
Screen aspect ratio (width/height)
void OCamera::changePosition ( const OVector3 displacement)

Change camera position using a displacement vector.

Parameters
displacementDisplacement vector.
float OCamera::fieldOfViewDegrees ( ) const

Returns the camera field of view.

Returns
Field of view in degrees.
OVector3 OCamera::orientation ( ) const

Retrieves the camera orientation from the state object.

Returns
Camera orientation vector in terms of Euler angles.
OVector3 & OCamera::position ( )

Retrieves the camera position from the state object.

Returns
Camera position coordinates.
void OCamera::setCameraLimits ( float  zNear,
float  zFar 
)

Sets camera depth limits.

Parameters
zNearNearest camera depth.
zFarFarthest camera depth.
void OCamera::setFieldOfView ( float  valueDeg)

Sets the camera field of view.

Parameters
valueDegField of view in degrees.
void OCamera::setOrientation ( const OVector3 orientation)

Set camera orientation.

Parameters
orientationNew orientation vector given in Euler angles.
void OCamera::setPosition ( const OVector3 position)

Set camera position.

Parameters
positionCamera position coordinates.
const OMatrixStack * OCamera::transform ( )

Calculates the perspective and camera transformations.

Returns
Matrix stack containing the transformation matrix.

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