# 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:

NL3D::CTransform NL3D::IModel NL3D::ITransformable NLMISC::CRefCount NL3D::IAnimatable List of all members.

From Ianimatable.

enum  TAnimValues {
  OwnerBit = CTransform::AnimValueLast, FovValue, TargetValue, RollValue,
  AnimValueLast
}
 Added values. 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...


Public Types


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


Static Public Methods

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

Get some track name
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

Static Private Methods

IModelcreator ()

Private Attributes

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

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:
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 125 of file camera.h.


Constructor & Destructor Documentation

NL3D::CCamera::CCamera   [protected]
 

Constructor.

Definition at line 43 of file camera.cpp.

References _Fov, _FovAnimationAspectRatio, _FovAnimationEnabled, _Roll, _Target, _TargetAnimationEnabled, AnimValueLast, and setFrustum.

Referenced by creator.

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

Destructor.

Definition at line 151 of file camera.h.


Member Function Documentation

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

Reimplemented from NL3D::CTransform.

Definition at line 162 of file camera.h.

References CCamera, and NL3D::IModel::IModel.

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.

References _FovAnimationAspectRatio, and _FovAnimationEnabled.

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 101 of file camera.h.

References _Roll, _TargetAnimationEnabled, and NL3D::ITransformable::setTransformMode.

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 137 of file camera.cpp.

References DefaultFov, DefaultRoll, DefaultTarget, FovValue, RollValue, and TargetValue.

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 115 of file camera.h.

Referenced by getValueName.

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

Get the camera frustum.

Definition at line 75 of file camera.cpp.

References _Frustum.

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

Get the frustum of the camera.

Definition at line 68 of file camera.h.

References _Frustum.

Referenced by NL3D::CCloudScape::render.

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

Return the name of the roll track.

Definition at line 119 of file camera.h.

Referenced by getValueName.

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 117 of file camera.h.

Referenced by getValueName.

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

From IAnimatable.

Reimplemented from NL3D::ITransformable.

Definition at line 105 of file camera.cpp.

References _Fov, _Roll, _Target, FovValue, RollValue, and TargetValue.

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

From IAnimatable.

Reimplemented from NL3D::ITransformable.

Definition at line 118 of file camera.cpp.

References FovValue, getFovValueName, getRollValueName, getTargetValueName, RollValue, and TargetValue.

bool NL3D::CCamera::isOrtho   const
 

Is a ortho camera?

Definition at line 85 of file camera.cpp.

References _Frustum.

bool NL3D::CCamera::isPerspective   const
 

Is a perspective camera?

Definition at line 90 of file camera.cpp.

References _Frustum.

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 36 of file camera.cpp.

References NL3D::CameraId, and NL3D::TransformId.

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 150 of file camera.cpp.

References NL3D::IAnimatable::addValue, FovValue, OwnerBit, RollValue, and TargetValue.

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 65 of file camera.cpp.

References _Frustum, height, and width.

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 60 of file camera.cpp.

References _Frustum.

void NL3D::CCamera::setFrustum const CFrustum   f [inline]
 

Set the frustum of the camera.

Definition at line 66 of file camera.h.

References _Frustum.

Referenced by CCamera.

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 70 of file camera.cpp.

References _Frustum.

Referenced by update.

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

Implement the update method.

Reimplemented from NL3D::CTransform.

Definition at line 163 of file camera.cpp.

References _Fov, _FovAnimationAspectRatio, _FovAnimationEnabled, _Frustum, _Roll, _Target, _TargetAnimationEnabled, FovValue, OwnerBit, RollValue, setPerspective, NL3D::ITransformable::setRotQuat, and TargetValue.


Member Data Documentation

CAnimatedValueFloat NL3D::CCamera::_Fov [private]
 

Definition at line 171 of file camera.h.

Referenced by CCamera, getValue, and update.

float NL3D::CCamera::_FovAnimationAspectRatio [private]
 

Definition at line 168 of file camera.h.

Referenced by CCamera, enableFovAnimation, and update.

bool NL3D::CCamera::_FovAnimationEnabled [private]
 

Definition at line 166 of file camera.h.

Referenced by CCamera, enableFovAnimation, and update.

CFrustum NL3D::CCamera::_Frustum [protected]
 

Definition at line 154 of file camera.h.

Referenced by getFrustum, isOrtho, isPerspective, setFrustum, setPerspective, and update.

CAnimatedValueFloat NL3D::CCamera::_Roll [private]
 

Definition at line 173 of file camera.h.

Referenced by CCamera, enableTargetAnimation, getValue, and update.

CAnimatedValueVector NL3D::CCamera::_Target [private]
 

Definition at line 172 of file camera.h.

Referenced by CCamera, getValue, and update.

bool NL3D::CCamera::_TargetAnimationEnabled [private]
 

Definition at line 167 of file camera.h.

Referenced by CCamera, enableTargetAnimation, and update.

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

Referenced by getDefaultTrack.

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

Referenced by getDefaultTrack.

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

Referenced by getDefaultTrack.


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