|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CFrustum Class ReferenceA Screen frustum, perspective or orthogonal.
More...
#include <frustum.h>
List of all members.
Public Methods |
| CFrustum () |
| Un-initialized frustum. More...
|
| CFrustum (float left, float right, float bottom, float top, float znear, float zfar, bool perspective=true) |
| ctor. More...
|
void | init (float left, float right, float bottom, float top, float znear, float zfar, bool perspective=true) |
| Init a frustum. More...
|
void | init (float width, float height, float znear, float zfar, bool perspective=true) |
| Init a centered frustum. More...
|
void | initPerspective (float fov, float aspectRatio, float znear, float zfar) |
| Setup a perspective frustum, giving a fov in radians. More...
|
void | getValues (float &left, float &right, float &bottom, float &top, float &znear, float &zfar) const |
| Get the value of the frustum. More...
|
CVector | project (const CVector &vec) const |
| project a vector (x,y,z) onto frustum. More...
|
CVector | unProject (const CVector &vec) const |
| unproject a point from screen to the frustum space. More...
|
Public Attributes |
float | Left |
| NB: znear and zfar must be >0 (if perspective). More...
|
float | Right |
| NB: znear and zfar must be >0 (if perspective). More...
|
float | Bottom |
| NB: znear and zfar must be >0 (if perspective). More...
|
float | Top |
| NB: znear and zfar must be >0 (if perspective). More...
|
float | Near |
| NB: znear and zfar must be >0 (if perspective). More...
|
float | Far |
| NB: znear and zfar must be >0 (if perspective). More...
|
bool | Perspective |
Detailed Description
A Screen frustum, perspective or orthogonal.
No default ctor. Usefull for camera. -
Author:
-
Lionel Berenguier , Nevrax France
-
Date:
-
2000
Definition at line 47 of file frustum.h.
Constructor & Destructor Documentation
NL3D::CFrustum::CFrustum |
( |
|
) |
[inline] |
|
NL3D::CFrustum::CFrustum |
( |
float |
left, |
|
|
float |
right, |
|
|
float |
bottom, |
|
|
float |
top, |
|
|
float |
znear, |
|
|
float |
zfar, |
|
|
bool |
perspective = true |
|
) |
[inline] |
|
Member Function Documentation
void NL3D::CFrustum::getValues |
( |
float & |
left, |
|
|
float & |
right, |
|
|
float & |
bottom, |
|
|
float & |
top, |
|
|
float & |
znear, |
|
|
float & |
zfar |
|
) |
const |
|
void NL3D::CFrustum::init |
( |
float |
width, |
|
|
float |
height, |
|
|
float |
znear, |
|
|
float |
zfar, |
|
|
bool |
perspective = true |
|
) |
|
|
void NL3D::CFrustum::init |
( |
float |
left, |
|
|
float |
right, |
|
|
float |
bottom, |
|
|
float |
top, |
|
|
float |
znear, |
|
|
float |
zfar, |
|
|
bool |
perspective = true |
|
) |
|
|
void NL3D::CFrustum::initPerspective |
( |
float |
fov, |
|
|
float |
aspectRatio, |
|
|
float |
znear, |
|
|
float |
zfar |
|
) |
|
|
|
Setup a perspective frustum, 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 56 of file frustum.cpp.
References init, NL3D_MEM_FRUSTRUM, and w. |
CVector NL3D::CFrustum::project |
( |
const CVector & |
vec |
) |
const |
|
|
project a vector (x,y,z) onto frustum.
-
Parameters:
-
vec |
the point in 3D frustum space. Axis is NL3D axis: Xright, Yfront, Ztop. |
-
Returns:
-
the point in 2D: Xright, Ytop, Z=0. Screen is mapped to X:[0..1], Y: [0..1].
Definition at line 77 of file frustum.cpp.
References Bottom, Left, Near, NL3D_MEM_FRUSTRUM, Right, Top, and w. |
CVector NL3D::CFrustum::unProject |
( |
const CVector & |
vec |
) |
const |
|
|
unproject a point from screen to the frustum space.
-
Parameters:
-
vec |
the point on the screen, in Left hand axis (XRight, YTop, ZFront). Z must be in [0..1] and hyperbolic. |
-
Returns:
-
the point in the frustum space (NL3D right hand axis).
Definition at line 124 of file frustum.cpp.
References Bottom, Far, Left, Near, NL3D_MEM_FRUSTRUM, nlstop, Right, Top, and w. |
Member Data Documentation
float NL3D::CFrustum::Bottom
|
|
float NL3D::CFrustum::Far
|
|
float NL3D::CFrustum::Left
|
|
float NL3D::CFrustum::Near
|
|
bool NL3D::CFrustum::Perspective
|
|
float NL3D::CFrustum::Right
|
|
float NL3D::CFrustum::Top
|
|
The documentation for this class was generated from the following files:
|
|