NL3D::UCamera Class Reference

Game interface for manipulating Camera. More...

#include <u_camera.h>

Inherits NL3D::UTransform.

List of all members.

Public Member Functions

 UCamera ()
 Proxy interface.
 UCamera (class CCamera *object)
void attach (class CCamera *object)
 Attach an object to this proxy.
void detach ()
 Detach the object.
bool empty () const
 Return true if the proxy is empty() (not attached).
class CCameragetObjectPtr () const
 For advanced usage, get the internal object ptr.
Frustum



void setFrustum (const CFrustum &f)
 Set the frustum of the camera.
const CFrustumgetFrustum () const
 Get the frustum of the camera.
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).
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).
void getFrustum (float &left, float &right, float &bottom, float &top, float &znear, float &zfar) const
 Get the camera frustum.
bool isOrtho () const
 Is a ortho camera?
bool isPerspective () const
 Is a perspective camera?
void setPerspective (float fov, float aspectRatio, float znear, float zfar)
 Setup a perspective camera, giving a fov in radians.
Misc



void buildCameraPyramid (std::vector< NLMISC::CPlane > &pyramid, bool useWorldMatrix)
void buildCameraPyramidCorners (std::vector< NLMISC::CVector > &pyramidCorners, bool useWorldMatrix)

Static Public Attributes

Default Camera frustum (perspective).



static const float DefLx = 0.26f
static const float DefLy = 0.2f
static const float DefLzNear = 0.15f
static const float DefLzFar = 1000.0f

Detailed Description

Game interface for manipulating Camera.

Author:
Lionel Berenguier
Nevrax France
Date:
2001

Definition at line 43 of file u_camera.h.


Constructor & Destructor Documentation

NL3D::UCamera::UCamera (  )  [inline]

Proxy interface.

Constructors

Definition at line 92 of file u_camera.h.

References NL3D::UTransformable::_Object.

NL3D::UCamera::UCamera ( class CCamera object  )  [inline]

Definition at line 93 of file u_camera.h.

References NL3D::UTransformable::_Object.


Member Function Documentation

void NL3D::UCamera::attach ( class CCamera object  )  [inline]

Attach an object to this proxy.

Definition at line 95 of file u_camera.h.

References NL3D::UTransformable::_Object.

void NL3D::UCamera::buildCameraPyramid ( std::vector< NLMISC::CPlane > &  pyramid,
bool  useWorldMatrix 
)

Definition at line 104 of file u_camera.cpp.

References getObjectPtr().

void NL3D::UCamera::buildCameraPyramidCorners ( std::vector< NLMISC::CVector > &  pyramidCorners,
bool  useWorldMatrix 
)

Definition at line 111 of file u_camera.cpp.

References getObjectPtr().

void NL3D::UCamera::detach (  )  [inline]

Detach the object.

Reimplemented from NL3D::UTransform.

Definition at line 97 of file u_camera.h.

References NL3D::UTransformable::_Object.

Referenced by NL3D::CSceneUser::deleteCamera().

bool NL3D::UCamera::empty (  )  const [inline]

Return true if the proxy is empty() (not attached).

Reimplemented from NL3D::UTransform.

Definition at line 99 of file u_camera.h.

References NL3D::UTransformable::_Object.

Referenced by NL3D::CWaterEnvMapRenderFromUScene::doRender(), NL3D::CSceneUser::setCam(), and NL3D::CWaterEnvMapRenderFromUScene::setScene().

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

Get the camera frustum.

Definition at line 72 of file u_camera.cpp.

References getObjectPtr().

const CFrustum & NL3D::UCamera::getFrustum (  )  const

Get the frustum of the camera.

Definition at line 48 of file u_camera.cpp.

References getObjectPtr().

Referenced by NL3D::CDriverUser::setMatrixMode3D().

class CCamera* NL3D::UCamera::getObjectPtr (  )  const [inline]
bool NL3D::UCamera::isOrtho (  )  const

Is a ortho camera?

Definition at line 80 of file u_camera.cpp.

References getObjectPtr().

bool NL3D::UCamera::isPerspective (  )  const

Is a perspective camera?

Definition at line 88 of file u_camera.cpp.

References getObjectPtr().

void NL3D::UCamera::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 64 of file u_camera.cpp.

References getObjectPtr().

void NL3D::UCamera::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 56 of file u_camera.cpp.

References getObjectPtr().

void NL3D::UCamera::setFrustum ( const CFrustum f  ) 

Set the frustum of the camera.

Definition at line 40 of file u_camera.cpp.

References getObjectPtr().

Referenced by NL3D::CWaterEnvMapRenderFromUScene::doRender().

void NL3D::UCamera::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 96 of file u_camera.cpp.

References getObjectPtr().


Member Data Documentation

const float NL3D::UCamera::DefLx = 0.26f [static]

Definition at line 48 of file u_camera.h.

Referenced by NL3D::CSceneUser::createCamera().

const float NL3D::UCamera::DefLy = 0.2f [static]

Definition at line 49 of file u_camera.h.

Referenced by NL3D::CSceneUser::createCamera().

const float NL3D::UCamera::DefLzFar = 1000.0f [static]

Definition at line 51 of file u_camera.h.

Referenced by NL3D::CSceneUser::createCamera().

const float NL3D::UCamera::DefLzNear = 0.15f [static]

Definition at line 50 of file u_camera.h.

Referenced by NL3D::CSceneUser::createCamera().


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

Generated on Thu Jan 7 08:30:12 2010 for NeL by  doxygen 1.6.1