Game interface for manipulating Camera. More...
#include <u_camera.h>
Inherits NL3D::UTransform.
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 CCamera * | getObjectPtr () const |
| For advanced usage, get the internal object ptr. | |
Frustum | |
| void | setFrustum (const CFrustum &f) |
| Set the frustum of the camera. | |
| const CFrustum & | getFrustum () 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 |
Game interface for manipulating Camera.
Definition at line 43 of file u_camera.h.
| 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.
| 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().
| 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] |
For advanced usage, get the internal object ptr.
Reimplemented from NL3D::UTransform.
Definition at line 101 of file u_camera.h.
References NL3D::UTransformable::_Object.
Referenced by buildCameraPyramid(), buildCameraPyramidCorners(), NL3D::CSceneUser::deleteCamera(), getFrustum(), isOrtho(), isPerspective(), NL3D::CSceneUser::setCam(), setFrustum(), and setPerspective().
| bool NL3D::UCamera::isOrtho | ( | ) | const |
| bool NL3D::UCamera::isPerspective | ( | ) | const |
| 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().
Setup a perspective camera, giving a fov in radians.
| 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().
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().
1.6.1