You.i Engine
CYICameraController Class Reference

#include <renderer/YiCameraController.h>

Public Types

enum  CAMERA_CENTER_RULES {
  CENTER_VERTICAL,
  CENTER_HORIZONTAL,
  CENTER
}
 

Public Member Functions

 CYICameraController ()
 
 ~CYICameraController ()
 
void SetDynamicCamera (CYIAbstractCameraSceneNode *pCamera)
 
const CYIAbstractCameraSceneNodeGetDynamicCamera () const
 
void CenterCameraOn (CYISceneNode *pTarget, CAMERA_CENTER_RULES eCenterRule, const glm::vec3 &staticOffset=glm::vec3())
 
void AnimateCenterCameraOn (CYISceneNode *pTarget, CAMERA_CENTER_RULES eCenterRule, float fVelocity, const glm::vec3 &staticOffset=glm::vec3())
 
void AnimateScrollBy (const glm::vec3 &offset)
 
void ScrollBy (const glm::vec3 &offset)
 
bool Update ()
 
void ReleaseDynamicCamera ()
 
void SetDynamicCameraRange (float fMaximumRange)
 
float GetDynamicCameraRange ()
 

Member Enumeration Documentation

When centering the camera on a node, these flags may be used to restrict the camera movement such that centering only occurs in one axis

Enumerator
CENTER_VERTICAL 

Will center the node vertically, restricting the camera's x motion

CENTER_HORIZONTAL 

Will center the node horizontally, restricting the camera's y motion

CENTER 

Will center the node bidirectionally, no restrictions on its movement

Constructor & Destructor Documentation

CYICameraController::CYICameraController ( )
CYICameraController::~CYICameraController ( )

Member Function Documentation

void CYICameraController::AnimateCenterCameraOn ( CYISceneNode pTarget,
CAMERA_CENTER_RULES  eCenterRule,
float  fVelocity,
const glm::vec3 &  staticOffset = glm::vec3() 
)

Similar in function to CenterCameraOn, this function takes an additional parameter which is a velocity in world units per second and will animate to the destination at this velocity.

void CYICameraController::AnimateScrollBy ( const glm::vec3 &  offset)

Apply a relative offset to the camera's destination. The camera will animate to this new destination.

void CYICameraController::CenterCameraOn ( CYISceneNode pTarget,
CAMERA_CENTER_RULES  eCenterRule,
const glm::vec3 &  staticOffset = glm::vec3() 
)

Center the scene's camera on the target node. Requires a dynamic camera to be set. This function is not intended to be used per-frame.

const CYIAbstractCameraSceneNode* CYICameraController::GetDynamicCamera ( ) const

Get the camera being controlled by this controller

float CYICameraController::GetDynamicCameraRange ( )

Get the maximum distance from the starting position that the camera is allowed to move. A range of zero implies no limit.

void CYICameraController::ReleaseDynamicCamera ( )

Release the dynamic camera. This will animate the camera back to its pre-animation position and release the pointer.

void CYICameraController::ScrollBy ( const glm::vec3 &  offset)

Apply a relative offset to the camera's current position. The camera will snap to this position.

void CYICameraController::SetDynamicCamera ( CYIAbstractCameraSceneNode pCamera)

Set the dynamic camera, this camera will be affected by the subsequent animations

void CYICameraController::SetDynamicCameraRange ( float  fMaximumRange)

Set the maximum distance from the starting point that the camera is allowed to move. A range of zero implies no limit

bool CYICameraController::Update ( )

Drive the animations. Returns true if the camera position or target changed.


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