CameraComponent Class Reference

Component wrapper of Irrlicht's ICameraSceneNode. More...

Inheritance diagram for CameraComponent:

Inheritance graph
[legend]
Collaboration diagram for CameraComponent:

Collaboration graph
[legend]

List of all members.

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.


Detailed Description

Component wrapper of Irrlicht's ICameraSceneNode.

XML:

 <CameraComponent>
    <!-- Properties -->
 </CameraComponent>

Definition at line 33 of file CameraComponent.h.


Constructor & Destructor Documentation

CameraComponent::CameraComponent ( Entity parent,
const vector3df &  lookat = vector3df(0, 0, 100) 
)

Constructor (default).

Parameters:
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 (  ) 

Deconstructor.

Definition at line 42 of file CameraComponent.cpp.


Member Function Documentation

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

Gets the aspect ratio of the camera.

Definition at line 67 of file CameraComponent.cpp.

ICameraSceneNode * CameraComponent::getCameraSceneNode (  ) 

Returns a direct pointer to the ICameraSceneNode.

Note:
Not available in AngelScript.

Definition at line 49 of file CameraComponent.cpp.

f32 CameraComponent::getFarValue (  )  const

Gets the value of the far plane of the camera.

Definition at line 73 of file CameraComponent.cpp.

f32 CameraComponent::getFOV (  )  const

Gets the field of view of the camera.

Definition at line 79 of file CameraComponent.cpp.

bool CameraComponent::getIsOrthogonal (  )  const

Checks if the camera is orthogonal.

Definition at line 115 of file CameraComponent.cpp.

f32 CameraComponent::getNearValue (  )  const

Gets the value of the near plane of the camera.

Definition at line 85 of file CameraComponent.cpp.

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

Gets the current look at target of the camera.

Definition at line 97 of file CameraComponent.cpp.

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

Gets the up vector of the camera.

Definition at line 103 of file CameraComponent.cpp.

const matrix4 & CameraComponent::getViewMatrix (  )  const

Gets the current view matrix of the camera.

Definition at line 109 of file CameraComponent.cpp.

bool CameraComponent::parseXML ( IXMLReader *  file,
Entity entity 
) [static]

Parses for a CameraComponent.

Note:
For internal use only!

Reimplemented from SceneComponent.

Definition at line 223 of file CameraComponent.cpp.

void CameraComponent::setAsMainCamera (  ) 

Sets this camera as the main camera.

XML:

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="" />

Parameters:
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="" />

Parameters:
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="" />

Parameters:
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=""/>

Parameters:
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.
Note:
Don't forget to call SceneComponent::setCanAffectParent when you switch to this mode.

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=""/>

Parameters:
rotateSpeed Rotation speed of the camera.
zoomSpeed Zoom speed of the camera.
translationSpeed Translation speed of the camera.
Note:
Don't forget to call SceneComponent::setCanAffectParent when you switch to this mode.

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="" />

Parameters:
value New near value.

Definition at line 145 of file CameraComponent.cpp.

void CameraComponent::setNormalMode (  ) 

Sets the camera to normal mode.

Definition at line 175 of file CameraComponent.cpp.

void CameraComponent::setProjectionMatrix ( const matrix4 &  projection,
bool  isOrthogonal = false 
)

Sets the projection matrix of the camera.

Parameters:
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.

Parameters:
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=""/>

Parameters:
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="" />

Parameters:
position New up vector of the camera.

Definition at line 169 of file CameraComponent.cpp.


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

Generated on Fri Aug 21 23:55:13 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8