Public Member Functions | |
CameraComponent (Entity *parent, const vector3df &lookat=vector3df(0, 0, 100)) | |
Constructor (default). | |
~CameraComponent () | |
Deconstructor. | |
ICameraSceneNode * | getCameraSceneNode () |
Returns a direct pointer to the ICameraSceneNode. | |
void | bindTargetAndRotation (bool bound) |
Binds the camera component's rotation to its target position and vice vera, or unbinds them. bool bound Value to enable or disable this option. | |
bool | getTargetAndRotationBinding () const |
Queries if the camera component's rotation and its target position are bound together. | |
f32 | getAspectRatio () const |
Gets the aspect ratio of the camera. | |
f32 | getFarValue () const |
Gets the value of the far plane of the camera. | |
f32 | getFOV () const |
Gets the field of view of the camera. | |
f32 | getNearValue () const |
Gets the value of the near plane of the camera. | |
const matrix4 & | getProjectionMatrix () const |
Gets the current projection matrix of the camera. | |
const vector3df & | getTarget () const |
Gets the current look at target of the camera. | |
const vector3df & | getUpVector () const |
Gets the up vector of the camera. | |
const matrix4 & | getViewMatrix () const |
Gets the current view matrix of the camera. | |
bool | getIsOrthogonal () const |
Checks if the camera is orthogonal. | |
void | setAsMainCamera () |
Sets this camera as the main camera. | |
void | setAspectRatio (f32 aspect) |
Sets the aspect ratio (default: 4.0f / 3.0f). | |
void | setFarValue (f32 value) |
Sets the value of the far clipping plane (default: 2000.0f). | |
void | setFOV (f32 value) |
Sets the field of view (Default: PI / 2.5f). | |
void | setNearValue (f32 value) |
Sets the value of the near clipping plane. (default: 1.0f). | |
void | setProjectionMatrix (const matrix4 &projection, bool isOrthogonal=false) |
Sets the projection matrix of the camera. | |
void | setRotation (const vector3df &rotation) |
Sets the rotation of the node. | |
void | setTarget (const vector3df &position) |
Sets the look at target of the camera. | |
void | setUpVector (const vector3df &position) |
Sets the up vector of the camera. | |
void | setNormalMode () |
Sets the camera to normal mode. | |
void | setFPSMode (f32 rotateSpeed=100.0f, f32 moveSpeed=0.5f, bool verticalMovement=false, f32 jumpSpeed=0.0f) |
Sets the camera to FPS mode. | |
void | setMayaMode (f32 rotateSpeed=-1500.0f, f32 zoomSpeed=200.0f, f32 translationSpeed=1500.0f) |
Sets the camera to Maya mode. | |
Static Public Member Functions | |
static CameraComponent * | refFactory (Entity *parent) |
Will be used to instanciate objects of this class. | |
static CameraComponent * | refFactory (Entity *parent, const vector3df &lookat) |
Will be used to instanciate objects of this class. |
Definition at line 26 of file CameraComponent.h.
CameraComponent::CameraComponent | ( | Entity * | parent, | |
const vector3df & | lookat = vector3df(0, 0, 100) | |||
) |
Constructor (default).
parent | The parent entity to which the component should be added. | |
lookat | Position where the camera will look at. |
Definition at line 23 of file CameraComponent.cpp.
CameraComponent::~CameraComponent | ( | ) |
void CameraComponent::bindTargetAndRotation | ( | bool | bound | ) |
Binds the camera component's rotation to its target position and vice vera, or unbinds them. bool bound Value to enable or disable this option.
Definition at line 66 of file CameraComponent.cpp.
f32 CameraComponent::getAspectRatio | ( | ) | const |
ICameraSceneNode * CameraComponent::getCameraSceneNode | ( | ) |
Returns a direct pointer to the ICameraSceneNode.
Definition at line 60 of file CameraComponent.cpp.
f32 CameraComponent::getFarValue | ( | ) | const |
f32 CameraComponent::getFOV | ( | ) | const |
bool CameraComponent::getIsOrthogonal | ( | ) | const |
f32 CameraComponent::getNearValue | ( | ) | const |
const matrix4 & CameraComponent::getProjectionMatrix | ( | ) | const |
Gets the current projection matrix of the camera.
Definition at line 102 of file CameraComponent.cpp.
const vector3df & CameraComponent::getTarget | ( | ) | const |
bool CameraComponent::getTargetAndRotationBinding | ( | ) | const |
Queries if the camera component's rotation and its target position are bound together.
Definition at line 72 of file CameraComponent.cpp.
const vector3df & CameraComponent::getUpVector | ( | ) | const |
const matrix4 & CameraComponent::getViewMatrix | ( | ) | const |
CameraComponent * CameraComponent::refFactory | ( | Entity * | parent, | |
const vector3df & | lookat | |||
) | [static] |
Will be used to instanciate objects of this class.
Definition at line 54 of file CameraComponent.cpp.
CameraComponent * CameraComponent::refFactory | ( | Entity * | parent | ) | [static] |
Will be used to instanciate objects of this class.
Reimplemented from SceneComponent.
Definition at line 48 of file CameraComponent.cpp.
void CameraComponent::setAsMainCamera | ( | ) |
void CameraComponent::setAspectRatio | ( | f32 | aspect | ) |
Sets the aspect ratio (default: 4.0f / 3.0f).
aspect | New aspect ratio. |
Definition at line 138 of file CameraComponent.cpp.
void CameraComponent::setFarValue | ( | f32 | value | ) |
Sets the value of the far clipping plane (default: 2000.0f).
value | New far value. |
Definition at line 144 of file CameraComponent.cpp.
void CameraComponent::setFOV | ( | f32 | value | ) |
Sets the field of view (Default: PI / 2.5f).
value | New field of view. |
Definition at line 150 of file CameraComponent.cpp.
void CameraComponent::setFPSMode | ( | f32 | rotateSpeed = 100.0f , |
|
f32 | moveSpeed = 0.5f , |
|||
bool | verticalMovement = false , |
|||
f32 | jumpSpeed = 0.0f | |||
) |
Sets the camera to FPS mode.
rotateSpeed | Speed in degress with which the camera is rotated. | |
moveSpeed | Speed in units per millisecond with which the camera is moved. | |
verticalMovement | Is vertical movement by the camera allowed? | |
jumpSpeed | Speed with which the camera is moved when jumping. |
Definition at line 193 of file CameraComponent.cpp.
void CameraComponent::setMayaMode | ( | f32 | rotateSpeed = -1500.0f , |
|
f32 | zoomSpeed = 200.0f , |
|||
f32 | translationSpeed = 1500.0f | |||
) |
Sets the camera to Maya mode.
rotateSpeed | Rotation speed of the camera. | |
zoomSpeed | Zoom speed of the camera. | |
translationSpeed | Translation speed of the camera. |
Definition at line 214 of file CameraComponent.cpp.
void CameraComponent::setNearValue | ( | f32 | value | ) |
Sets the value of the near clipping plane. (default: 1.0f).
value | New near value. |
Definition at line 156 of file CameraComponent.cpp.
void CameraComponent::setNormalMode | ( | ) |
void CameraComponent::setProjectionMatrix | ( | const matrix4 & | projection, | |
bool | isOrthogonal = false | |||
) |
Sets the projection matrix of the camera.
projection | The new projection matrix of the camera. | |
isOrthogonal | Set this to true if the matrix is an orthogonal one |
Definition at line 162 of file CameraComponent.cpp.
void CameraComponent::setRotation | ( | const vector3df & | rotation | ) |
Sets the rotation of the node.
rotation | New rotation in degrees. |
Reimplemented from SceneComponent.
Definition at line 168 of file CameraComponent.cpp.
void CameraComponent::setTarget | ( | const vector3df & | position | ) |
Sets the look at target of the camera.
position | New target. |
Definition at line 174 of file CameraComponent.cpp.
void CameraComponent::setUpVector | ( | const vector3df & | position | ) |
Sets the up vector of the camera.
position | New up vector of the camera. |
Definition at line 180 of file CameraComponent.cpp.