# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CCamera Class Reference

A Camera node, based on a CTransform node. More...

#include <camera.h>

Inheritance diagram for NL3D::CCamera

Inheritance graph
[legend]
Collaboration diagram for NL3D::CCamera:

Collaboration graph
[legend]
List of all members.

Public Types

enum  TAnimValues {
  OwnerBit = CTransform::AnimValueLast,
  FovValue,
  TargetValue,
  RollValue,
  AnimValueLast
}
 Added values. More...


Public Methods

void setFrustum (const CFrustum &f)
 Set the frustum of the camera. More...

const CFrustumgetFrustum () const
 Get the frustum of the camera. More...

void setFrustum (float left, float right, float bottom, float top, float znear, float zfar, bool perspective= true)
 Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective). More...

void setFrustum (float width, float height, float znear, float zfar, bool perspective= true)
 Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective). More...

void getFrustum (float &left, float &right, float &bottom, float &top, float &znear, float &zfar) const
 Get the camera frustum. More...

bool isOrtho () const
 Is a ortho camera? More...

bool isPerspective () const
 Is a perspective camera? More...

void setPerspective (float fov, float aspectRatio, float znear, float zfar)
 Setup a perspective camera, giving a fov in radians. More...

bool enableFovAnimation (bool en, float aspectRatio= 4.0f / 3.0f)
 enable FOV animation. More...

bool enableTargetAnimation (bool en)
 enable Target/Roll animation. More...

virtual IAnimatedValuegetValue (uint valueId)
 From IAnimatable. More...

virtual const char* getValueName (uint valueId) const
 From IAnimatable. More...

virtual ITrackgetDefaultTrack (uint valueId)
 Default Track Values for are identity (roll= 0, target= CVector::Null, fov=Pi/2). More...

virtual void registerToChannelMixer (CChannelMixer *chanMixer, const std::string &prefix)
 register camera channels (in global anim mode). More...


Static Public Methods

void registerBasic ()
 Call at the begining of the program, to register the model, and the basic observers. More...

const char* getFovValueName ()
 Return the name of the fov track. More...

const char* getTargetValueName ()
 Return the name of the target track. This target is in the parent space of camera. More...

const char* getRollValueName ()
 Return the name of the roll track. More...


Protected Methods

 CCamera ()
 Constructor. More...

virtual ~CCamera ()
 Destructor. More...

virtual void update ()
 Implement the update method. More...


Protected Attributes

CFrustum _Frustum

Private Attributes

bool _FovAnimationEnabled
bool _TargetAnimationEnabled
float _FovAnimationAspectRatio
CAnimatedValueFloat _Fov
CAnimatedValueVector _Target
CAnimatedValueFloat _Roll

Static Private Methods

IModelcreator ()

Static Private Attributes

CTrackDefaultFloat DefaultFov
CTrackDefaultVector DefaultTarget
CTrackDefaultFloat DefaultRoll

Detailed Description

A Camera node, based on a CTransform node.

The camera look in his local Y direction (see CScene).

No observer is provided, since a camera:

  • has default behavior of a transform.
  • can't be clipped (well... :) ).
  • is not lightable
  • is not renderable
    Author(s):
    Lionel Berenguier , Nevrax France
    Date:
    2000

Definition at line 56 of file camera.h.


Member Enumeration Documentation

enum NL3D::CCamera::TAnimValues
 

Added values.

Enumeration values:
OwnerBit  
FovValue  
TargetValue  
RollValue  
AnimValueLast  

Reimplemented from NL3D::ITransformable.

Definition at line 123 of file camera.h.


Constructor & Destructor Documentation

NL3D::CCamera::CCamera ( ) [protected]
 

Constructor.

Definition at line 41 of file camera.cpp.

NL3D::CCamera::~CCamera ( ) [inline, protected, virtual]
 

Destructor.

Definition at line 149 of file camera.h.


Member Function Documentation

IModel * NL3D::CCamera::creator ( ) [inline, static, private]
 

Reimplemented from NL3D::CTransform.

Definition at line 160 of file camera.h.

bool NL3D::CCamera::enableFovAnimation ( bool en,
float aspectRatio = 4.0f / 3.0f ) [inline]
 

enable FOV animation.

(default is false). see setPerspective(). znear and zfar are kept from previous setup. NB: as setPerspective(), fov is the full horizontal angle of camera (in radians).

Definition at line 91 of file camera.h.

bool NL3D::CCamera::enableTargetAnimation ( bool en ) [inline]
 

enable Target/Roll animation.

(default is false). TTransform mode is forced to RotQuatMode. Roll is forced to 0. The camera builds the rot matrix from the animated target/roll.

Definition at line 100 of file camera.h.

ITrack * NL3D::CCamera::getDefaultTrack ( uint valueId ) [virtual]
 

Default Track Values for are identity (roll= 0, target= CVector::Null, fov=Pi/2).

Reimplemented from NL3D::CTransform.

Definition at line 135 of file camera.cpp.

const char * NL3D::CCamera::getFovValueName ( ) [inline, static]
 

Return the name of the fov track.

NB: as setPerspective(), fov is the full horizontal angle of camera (in radians).

Definition at line 113 of file camera.h.

void NL3D::CCamera::getFrustum ( float & left,
float & right,
float & bottom,
float & top,
float & znear,
float & zfar ) const
 

Get the camera frustum.

Definition at line 73 of file camera.cpp.

const CFrustum & NL3D::CCamera::getFrustum ( ) const [inline]
 

Get the frustum of the camera.

Definition at line 68 of file camera.h.

const char * NL3D::CCamera::getRollValueName ( ) [inline, static]
 

Return the name of the roll track.

Definition at line 117 of file camera.h.

const char * NL3D::CCamera::getTargetValueName ( ) [inline, static]
 

Return the name of the target track. This target is in the parent space of camera.

Definition at line 115 of file camera.h.

IAnimatedValue * NL3D::CCamera::getValue ( uint valueId ) [virtual]
 

From IAnimatable.

Reimplemented from NL3D::ITransformable.

Definition at line 103 of file camera.cpp.

const char * NL3D::CCamera::getValueName ( uint valueId ) const [virtual]
 

From IAnimatable.

Reimplemented from NL3D::ITransformable.

Definition at line 116 of file camera.cpp.

bool NL3D::CCamera::isOrtho ( ) const
 

Is a ortho camera?

Definition at line 83 of file camera.cpp.

bool NL3D::CCamera::isPerspective ( ) const
 

Is a perspective camera?

Definition at line 88 of file camera.cpp.

void NL3D::CCamera::registerBasic ( ) [static]
 

Call at the begining of the program, to register the model, and the basic observers.

Reimplemented from NL3D::CTransform.

Definition at line 34 of file camera.cpp.

void NL3D::CCamera::registerToChannelMixer ( CChannelMixer * chanMixer,
const std::string & prefix ) [virtual]
 

register camera channels (in global anim mode).

Reimplemented from NL3D::CTransform.

Definition at line 148 of file camera.cpp.

void NL3D::CCamera::setFrustum ( float width,
float height,
float znear,
float zfar,
bool perspective = true )
 

Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective).

Definition at line 63 of file camera.cpp.

void NL3D::CCamera::setFrustum ( float left,
float right,
float bottom,
float top,
float znear,
float zfar,
bool perspective = true )
 

Setup the camera mode as a perspective/ortho camera. NB: znear and zfar must be >0 (if perspective).

Definition at line 58 of file camera.cpp.

void NL3D::CCamera::setFrustum ( const CFrustum & f ) [inline]
 

Set the frustum of the camera.

Definition at line 66 of file camera.h.

void NL3D::CCamera::setPerspective ( float fov,
float aspectRatio,
float znear,
float zfar )
 

Setup a perspective camera, giving a fov in radians.

Parameters:
fov   the horizontal angle of view, in radians. (Pi/2 as example)
aspectRatio   the ratio horizontal/vertical (1.33 as example).
znear   the front clipping plane distance.
zfar   the back clipping plane distance.

Definition at line 68 of file camera.cpp.

void NL3D::CCamera::update ( ) [protected, virtual]
 

Implement the update method.

Reimplemented from NL3D::CTransform.

Definition at line 161 of file camera.cpp.


Member Data Documentation

CTrackDefaultFloat NL3D::CCamera::DefaultFov [static, private]
 

Definition at line 175 of file camera.h.

CTrackDefaultFloat NL3D::CCamera::DefaultRoll [static, private]
 

Definition at line 177 of file camera.h.

CTrackDefaultVector NL3D::CCamera::DefaultTarget [static, private]
 

Definition at line 176 of file camera.h.

CAnimatedValueFloat NL3D::CCamera::_Fov [private]
 

Definition at line 169 of file camera.h.

float NL3D::CCamera::_FovAnimationAspectRatio [private]
 

Definition at line 166 of file camera.h.

bool NL3D::CCamera::_FovAnimationEnabled [private]
 

Definition at line 164 of file camera.h.

CFrustum NL3D::CCamera::_Frustum [protected]
 

Definition at line 152 of file camera.h.

CAnimatedValueFloat NL3D::CCamera::_Roll [private]
 

Definition at line 171 of file camera.h.

CAnimatedValueVector NL3D::CCamera::_Target [private]
 

Definition at line 170 of file camera.h.

bool NL3D::CCamera::_TargetAnimationEnabled [private]
 

Definition at line 165 of file camera.h.


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