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 bool | parseXML (IXMLReader *file, Entity *entity) |
Parses for a CameraComponent. |
XML:
<CameraComponent> <!-- Properties --> </CameraComponent>
Definition at line 33 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 55 of file CameraComponent.cpp.
f32 CameraComponent::getAspectRatio | ( | ) | const |
ICameraSceneNode * CameraComponent::getCameraSceneNode | ( | ) |
Returns a direct pointer to the ICameraSceneNode.
Definition at line 49 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 91 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 61 of file CameraComponent.cpp.
const vector3df & CameraComponent::getUpVector | ( | ) | const |
const matrix4 & CameraComponent::getViewMatrix | ( | ) | const |
bool CameraComponent::parseXML | ( | IXMLReader * | file, | |
Entity * | entity | |||
) | [static] |
Parses for a CameraComponent.
Reimplemented from SceneComponent.
Definition at line 223 of file CameraComponent.cpp.
void CameraComponent::setAsMainCamera | ( | ) |
Sets this camera as the main camera.
XML:
<setAsMainCamera />
Definition at line 121 of file CameraComponent.cpp.
void CameraComponent::setAspectRatio | ( | f32 | aspect | ) |
Sets the aspect ratio (default: 4.0f / 3.0f).
XML:
<aspectRatio value="" />
aspect | New aspect ratio. |
Definition at line 127 of file CameraComponent.cpp.
void CameraComponent::setFarValue | ( | f32 | value | ) |
Sets the value of the far clipping plane (default: 2000.0f).
XML:
<farValue value="" />
value | New far value. |
Definition at line 133 of file CameraComponent.cpp.
void CameraComponent::setFOV | ( | f32 | value | ) |
Sets the field of view (Default: PI / 2.5f).
XML:
<FOV value="" />
value | New field of view. |
Definition at line 139 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.
XML:
<FPSMode rotateSpeed="" moveSpeed="" verticalMovement="" jumpSpeed=""/>
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 182 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.
XML:
<MayaMode rotateSpeed="" zoomSpeed="" translationSpeed=""/>
rotateSpeed | Rotation speed of the camera. | |
zoomSpeed | Zoom speed of the camera. | |
translationSpeed | Translation speed of the camera. |
Definition at line 203 of file CameraComponent.cpp.
void CameraComponent::setNearValue | ( | f32 | value | ) |
Sets the value of the near clipping plane. (default: 1.0f).
XML:
<nearValue value="" />
value | New near value. |
Definition at line 145 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 151 of file CameraComponent.cpp.
void CameraComponent::setRotation | ( | const vector3df & | rotation | ) | [virtual] |
Sets the rotation of the node.
rotation | New rotation in degrees. |
Reimplemented from SceneComponent.
Definition at line 157 of file CameraComponent.cpp.
void CameraComponent::setTarget | ( | const vector3df & | position | ) |
Sets the look at target of the camera.
XML:
<target x="" y="" z=""/>
position | New target. |
Definition at line 163 of file CameraComponent.cpp.
void CameraComponent::setUpVector | ( | const vector3df & | position | ) |
Sets the up vector of the camera.
XML:
<upVector x="" y="" z="" />
position | New up vector of the camera. |
Definition at line 169 of file CameraComponent.cpp.