Om  1.0.0
A universal framework for multimedia simulation
Public Types | Public Member Functions | List of all members
om::graphics::cameras::CameraController Class Reference

A class that controls the motion of an attached camera relative to a point of interest. More...

#include <omGraphicsCameraController.h>

Public Types

enum  MotionType { LOCAL, LOCAL_XZ, GLOBAL }
 An enum that specifies the type of motion that the camera has. More...
 
enum  RotationType { RELATIVE, EULER }
 An enum that specifies the type of motion that the camera has. More...
 

Public Member Functions

 CameraController ()
 Create a new camera controller without any camera to control. More...
 
 CameraController (Camera *camera)
 Create a new camera controller that controls the specified camera. More...
 
CameragetCamera () const
 Return a pointer to the camera that is being controlled. More...
 
void setCamera (Camera *newCamera)
 Set a pointer to the camera that is being controlled. More...
 
const Vector3getPosition () const
 Return the point of interest for the camera controller. More...
 
void setPosition (const Vector3 &newPosition)
 Set the point of interest for the camera controller. More...
 
const Vector3getMotion () const
 Return the current motion vector of the camera controller, indicating the movement effort from -1 to 1 along each axis. More...
 
void setMotion (const Vector3 &newMotion)
 Set the current motion vector of the camera controller, indicating the movement effort from -1 to 1 along each axis. More...
 
const AABB3fgetMotionSpeed () const
 Return the speed in units/second that the camera controller can move along the 6 camera-local axis directions. More...
 
void setMotionSpeed (const AABB3f &newMotionSpeed)
 Set the speed in units/second that the camera controller can move along the 6 camera-local axis directions. More...
 
void setMotionSpeed (Float newMotionSpeed)
 Set the speed in units/second that the camera controller can move along all axis directions. More...
 
const Vector3fgetMotionInertia () const
 Return the time it takes for the camera to change movement speed in seconds. More...
 
void setMotionInertia (const Vector3f &newMotionInertia)
 Set the time it takes for the camera to change movement speed in seconds. More...
 
void setMotionInertia (Float newMotionInertia)
 Set the time it takes for the camera to change movement speed in seconds. More...
 
MotionType getMotionType () const
 Return the type of motion control that this camera uses. More...
 
void setMotionType (MotionType newMotionType)
 Set the type of motion control that this camera uses. More...
 
const Matrix3getOrientation () const
 Return the orientation of the camera that is being controlled. More...
 
void setOrientation (const Matrix3 &newOrientation)
 Set the orientation of the camera that is being controlled. More...
 
const Vector3fgetRotation () const
 Return the current rotation amount of the camera controller, indicating the rotation effort from -1 to 1 around axis. More...
 
void setRotation (const Vector3f &newRotation)
 Set the current rotation amount of the camera controller, indicating the rotation effort from -1 to 1 around axis. More...
 
const Vector3fgetRotationSpeed () const
 Return the speed in radians/second that the camera controller can rotate along the 3 axis directions. More...
 
void setRotationSpeed (const Vector3f &newRotationSpeed)
 Set the speed in radians/second that the camera controller can rotate along the 3 axis directions. More...
 
void setRotationSpeed (Float newRotationSpeed)
 Set the speed in radians/second that the camera controller can rotate along the 3 axis directions. More...
 
const Vector3fgetRotationInertia () const
 Return the time it takes for the camera to change rotation speed in seconds for each axis. More...
 
void setRotationInertia (const Vector3f &newRotationInertia)
 Set the time it takes for the camera to change rotation speed in seconds for each axis. More...
 
void setRotationInertia (Float newRotationInertia)
 Set the time it takes for the camera to change rotation speed in seconds for each axis. More...
 
RotationType getRotationType () const
 Return the type of motion control that this camera uses. More...
 
void setRotationType (RotationType newRotationType)
 Set the type of motion control that this camera uses. More...
 
Float getDistance () const
 Return the distance that the camera controller is from the point of interest along the view direction. More...
 
void setDistance (Float newDistance)
 Set the distance that the camera controller is from the point of interest along the view direction. More...
 
Float getZoom () const
 Return the current movement effort of the camera controller along the view direction relative to the point of interest. More...
 
void setZoom (Float newZoom)
 Set the current movement effort of the camera controller along the view direction relative to the point of interest. More...
 
Float getZoomSpeed () const
 Return the movement speed of the camera controller along the view direction relative to the point of interest. More...
 
void setZoomSpeed (Float newZoomSpeed)
 Set the movement speed of the camera controller along the view direction relative to the point of interest. More...
 
Float getZoomInertia () const
 Return the time it takes for the camera to change zoom speed in seconds. More...
 
void setZoomInertia (Float newZoomInertia)
 Set the time it takes for the camera to change zoom speed in seconds. More...
 
void update (Float dt)
 Update the state of this camera controller for the specified time delta in seconds. More...
 

Detailed Description

A class that controls the motion of an attached camera relative to a point of interest.

Member Enumeration Documentation

An enum that specifies the type of motion that the camera has.

Enumerator
LOCAL 

The camera's motion is with respect to the camera's local axes.

LOCAL_XZ 

The camera's motion is with local, but with respect to the global coordinate system's XZ (horizontal) plane.

For horizontal motion, the camera's view vector is projected into the XZ plane. The camera moves along this projected vector (forward/backwards) and perpendicular (left/right). This is the standard convention for a Y-up coordinate system.

GLOBAL 

The camera's motion is with respect to the global coordinate system.

The camera moves along the world axes. This is the same as local motion with an identity orientation.

An enum that specifies the type of motion that the camera has.

Enumerator
RELATIVE 

The camera's rotation is controlled relative to its current orientation.

EULER 

The camera's rotation is controlled by 3 Euler angles for yaw, pitch, and roll.

Constructor & Destructor Documentation

om::graphics::cameras::CameraController::CameraController ( )

Create a new camera controller without any camera to control.

om::graphics::cameras::CameraController::CameraController ( Camera camera)

Create a new camera controller that controls the specified camera.

Member Function Documentation

Camera* om::graphics::cameras::CameraController::getCamera ( ) const
inline

Return a pointer to the camera that is being controlled.

void om::graphics::cameras::CameraController::setCamera ( Camera newCamera)

Set a pointer to the camera that is being controlled.

const Vector3& om::graphics::cameras::CameraController::getPosition ( ) const
inline

Return the point of interest for the camera controller.

This is not necessarily the position of the camera itself.

void om::graphics::cameras::CameraController::setPosition ( const Vector3 newPosition)
inline

Set the point of interest for the camera controller.

const Vector3& om::graphics::cameras::CameraController::getMotion ( ) const
inline

Return the current motion vector of the camera controller, indicating the movement effort from -1 to 1 along each axis.

void om::graphics::cameras::CameraController::setMotion ( const Vector3 newMotion)
inline

Set the current motion vector of the camera controller, indicating the movement effort from -1 to 1 along each axis.

const AABB3f& om::graphics::cameras::CameraController::getMotionSpeed ( ) const
inline

Return the speed in units/second that the camera controller can move along the 6 camera-local axis directions.

void om::graphics::cameras::CameraController::setMotionSpeed ( const AABB3f newMotionSpeed)
inline

Set the speed in units/second that the camera controller can move along the 6 camera-local axis directions.

void om::graphics::cameras::CameraController::setMotionSpeed ( Float  newMotionSpeed)
inline

Set the speed in units/second that the camera controller can move along all axis directions.

const Vector3f& om::graphics::cameras::CameraController::getMotionInertia ( ) const
inline

Return the time it takes for the camera to change movement speed in seconds.

void om::graphics::cameras::CameraController::setMotionInertia ( const Vector3f newMotionInertia)
inline

Set the time it takes for the camera to change movement speed in seconds.

void om::graphics::cameras::CameraController::setMotionInertia ( Float  newMotionInertia)
inline

Set the time it takes for the camera to change movement speed in seconds.

MotionType om::graphics::cameras::CameraController::getMotionType ( ) const
inline

Return the type of motion control that this camera uses.

void om::graphics::cameras::CameraController::setMotionType ( MotionType  newMotionType)
inline

Set the type of motion control that this camera uses.

const Matrix3& om::graphics::cameras::CameraController::getOrientation ( ) const
inline

Return the orientation of the camera that is being controlled.

void om::graphics::cameras::CameraController::setOrientation ( const Matrix3 newOrientation)
inline

Set the orientation of the camera that is being controlled.

const Vector3f& om::graphics::cameras::CameraController::getRotation ( ) const
inline

Return the current rotation amount of the camera controller, indicating the rotation effort from -1 to 1 around axis.

void om::graphics::cameras::CameraController::setRotation ( const Vector3f newRotation)
inline

Set the current rotation amount of the camera controller, indicating the rotation effort from -1 to 1 around axis.

const Vector3f& om::graphics::cameras::CameraController::getRotationSpeed ( ) const
inline

Return the speed in radians/second that the camera controller can rotate along the 3 axis directions.

void om::graphics::cameras::CameraController::setRotationSpeed ( const Vector3f newRotationSpeed)
inline

Set the speed in radians/second that the camera controller can rotate along the 3 axis directions.

void om::graphics::cameras::CameraController::setRotationSpeed ( Float  newRotationSpeed)
inline

Set the speed in radians/second that the camera controller can rotate along the 3 axis directions.

const Vector3f& om::graphics::cameras::CameraController::getRotationInertia ( ) const
inline

Return the time it takes for the camera to change rotation speed in seconds for each axis.

void om::graphics::cameras::CameraController::setRotationInertia ( const Vector3f newRotationInertia)
inline

Set the time it takes for the camera to change rotation speed in seconds for each axis.

void om::graphics::cameras::CameraController::setRotationInertia ( Float  newRotationInertia)
inline

Set the time it takes for the camera to change rotation speed in seconds for each axis.

RotationType om::graphics::cameras::CameraController::getRotationType ( ) const
inline

Return the type of motion control that this camera uses.

void om::graphics::cameras::CameraController::setRotationType ( RotationType  newRotationType)
inline

Set the type of motion control that this camera uses.

Float om::graphics::cameras::CameraController::getDistance ( ) const
inline

Return the distance that the camera controller is from the point of interest along the view direction.

void om::graphics::cameras::CameraController::setDistance ( Float  newDistance)
inline

Set the distance that the camera controller is from the point of interest along the view direction.

Float om::graphics::cameras::CameraController::getZoom ( ) const
inline

Return the current movement effort of the camera controller along the view direction relative to the point of interest.

void om::graphics::cameras::CameraController::setZoom ( Float  newZoom)
inline

Set the current movement effort of the camera controller along the view direction relative to the point of interest.

Float om::graphics::cameras::CameraController::getZoomSpeed ( ) const
inline

Return the movement speed of the camera controller along the view direction relative to the point of interest.

void om::graphics::cameras::CameraController::setZoomSpeed ( Float  newZoomSpeed)
inline

Set the movement speed of the camera controller along the view direction relative to the point of interest.

Float om::graphics::cameras::CameraController::getZoomInertia ( ) const
inline

Return the time it takes for the camera to change zoom speed in seconds.

void om::graphics::cameras::CameraController::setZoomInertia ( Float  newZoomInertia)
inline

Set the time it takes for the camera to change zoom speed in seconds.

void om::graphics::cameras::CameraController::update ( Float  dt)

Update the state of this camera controller for the specified time delta in seconds.


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