Osiris Framework  0.1
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, 0,-1), const OVector3 &dir=OVector3(0, 0, 1))
 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 setDirection (const OVector3 &direction)
 Set camera direction. 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.
 
OVector3 position () const
 Returns the camera current position. More...
 
OVector3 direction () const
 Returns the camera looking direction. More...
 
const OMatrixStackperspectiveTransform ()
 Calculates the current perspective transformation matrix. More...
 
const OMatrixStackcameraTransform ()
 Calculates the camera transformation matrix. 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, 0, -1),
const OVector3 dir = OVector3(0, 0, 1) 
)

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.
dirCamera direction vector.

Member Function Documentation

float OCamera::aspectRatio ( ) const

Returns screen aspect ratio.

Returns
Screen aspect ratio (width/height)
const OMatrixStack * OCamera::cameraTransform ( )

Calculates the camera transformation matrix.

Returns
Camera transformation matrix.
OVector3 OCamera::direction ( ) const

Returns the camera looking direction.

Returns
Camera direction vector.
float OCamera::fieldOfViewDegrees ( ) const

Returns the camera field of view.

Returns
Field of view in degrees.
const OMatrixStack * OCamera::perspectiveTransform ( )

Calculates the current perspective transformation matrix.

Returns
Perspective transformation matrix.
OVector3 OCamera::position ( ) const

Returns the camera current position.

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

Sets camera depth limits.

Parameters
zNearNearest camera depth.
zFarFarthest camera depth.
void OCamera::setDirection ( const OVector3 direction)

Set camera direction.

Parameters
directionCamera direction vector.
void OCamera::setFieldOfView ( float  valueDeg)

Sets the camera field of view.

Parameters
valueDegField of view in degrees.
void OCamera::setPosition ( const OVector3 position)

Set camera position.

Parameters
positionCamera position coordinates.

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