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 CameraComponentrefFactory (Entity *parent)
 Will be used to instanciate objects of this class.
static CameraComponentrefFactory (Entity *parent, const vector3df &lookat)
 Will be used to instanciate objects of this class.


Detailed Description

Component wrapper of Irrlicht's ICameraSceneNode.

Definition at line 26 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 41 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 66 of file CameraComponent.cpp.

f32 CameraComponent::getAspectRatio (  )  const

Gets the aspect ratio of the camera.

Definition at line 78 of file CameraComponent.cpp.

ICameraSceneNode * CameraComponent::getCameraSceneNode (  ) 

Returns a direct pointer to the ICameraSceneNode.

Note:
Not available in AngelScript.

Definition at line 60 of file CameraComponent.cpp.

f32 CameraComponent::getFarValue (  )  const

Gets the value of the far plane of the camera.

Definition at line 84 of file CameraComponent.cpp.

f32 CameraComponent::getFOV (  )  const

Gets the field of view of the camera.

Definition at line 90 of file CameraComponent.cpp.

bool CameraComponent::getIsOrthogonal (  )  const

Checks if the camera is orthogonal.

Definition at line 126 of file CameraComponent.cpp.

f32 CameraComponent::getNearValue (  )  const

Gets the value of the near plane of the camera.

Definition at line 96 of file CameraComponent.cpp.

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

Gets the current look at target of the camera.

Definition at line 108 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 72 of file CameraComponent.cpp.

const vector3df & CameraComponent::getUpVector (  )  const

Gets the up vector of the camera.

Definition at line 114 of file CameraComponent.cpp.

const matrix4 & CameraComponent::getViewMatrix (  )  const

Gets the current view matrix of the camera.

Definition at line 120 of file CameraComponent.cpp.

CameraComponent * CameraComponent::refFactory ( Entity parent,
const vector3df &  lookat 
) [static]

Will be used to instanciate objects of this class.

Note:
For internal use only!

Definition at line 54 of file CameraComponent.cpp.

CameraComponent * CameraComponent::refFactory ( Entity parent  )  [static]

Will be used to instanciate objects of this class.

Note:
For internal use only!

Reimplemented from SceneComponent.

Definition at line 48 of file CameraComponent.cpp.

void CameraComponent::setAsMainCamera (  ) 

Sets this camera as the main camera.

Definition at line 132 of file CameraComponent.cpp.

void CameraComponent::setAspectRatio ( f32  aspect  ) 

Sets the aspect ratio (default: 4.0f / 3.0f).

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

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

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

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

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 214 of file CameraComponent.cpp.

void CameraComponent::setNearValue ( f32  value  ) 

Sets the value of the near clipping plane. (default: 1.0f).

Parameters:
value New near value.

Definition at line 156 of file CameraComponent.cpp.

void CameraComponent::setNormalMode (  ) 

Sets the camera to normal mode.

Definition at line 186 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 162 of file CameraComponent.cpp.

void CameraComponent::setRotation ( const vector3df &  rotation  ) 

Sets the rotation of the node.

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

Parameters:
position New target.

Definition at line 174 of file CameraComponent.cpp.

void CameraComponent::setUpVector ( const vector3df &  position  ) 

Sets the up vector of the camera.

Parameters:
position New up vector of the camera.

Definition at line 180 of file CameraComponent.cpp.


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

Generated on Wed Jun 10 22:26:25 2009 for Sirrf - Simple Irrlicht Framework by  doxygen 1.5.8