Rasterfarm-SDK
Loading...
Searching...
No Matches
Frustum Class Reference

#include <frustum.h>

Inheritance diagram for Frustum:
Display Scene DynamicType

Classes

class  Attribute
 

Public Member Functions

 Frustum (const Attribute &attribute=Attribute(), float nearZClip=0.01f, float farZClip=100.0f)
 
const AttributegetAttribute ()
 
Matrix4f createFullView (GeometricBase *pObject)
 
- Public Member Functions inherited from Display
 Display (const Matrix4f &projectionMatrix, float nearZClip, float farZClip)
 
virtual void addMaterialList (const Surface::MaterialList &pMaterial)
 
virtual void renderMaterialLists ()
 
virtual void clearMaterialLists ()
 
void addPreprocessor (Scene *pScene)
 
void removePreprocessor (Scene *pScene)
 
- Public Member Functions inherited from Scene
 Scene (const Matrix4f &projectionMatrix, float nearZClip, float farZClip)
 
virtual ~Scene ()
 
virtual void removeGeometricObject (GeometricBase *pObject)
 
virtual void removeGeometricObject (Node *pObject)
 
virtual void createModel ()
 
virtual void addMaterials ()
 
void queueGeometricObject (GeometricBase *pObject)
 
void queueGeometricObject (Node *pObject)
 
bool hasFrameBuffer (FrameBuffer *pFrameBuffer)
 
void addFrameBuffer (FrameBuffer *pFrameBuffer)
 
void removeFrameBuffer (FrameBuffer *pFrameBuffer)
 
bool inDisplayArea (GeometricBase *pObject)
 
bool inDisplayArea ()
 
const Matrix4fgetModel (GeometricBase *pObject)
 
const UnorderedMap< Node *, Matrix4f > & getNodeModel () const
 
Primitive3D::AABoundingBox getAABoundingBox ()
 
Primitive3D::AABoundingBox getAABoundingBox (GeometricBase *pObject)
 
Primitive3D::AABoundingBox getNDCAABoundingBox ()
 
Primitive3D::AABoundingBox getNDCAABoundingBox (GeometricBase *pObject)
 
uint getGeometricObjectSize ()
 
const GeometricBaseListgetGeometricObject ()
 
void updateCamera ()
 
void renderMaterialList (Surface::MaterialList &pList, Surface::MaterialSortFunction sortFunction, float clipFactor=1.0f)
 
void renderMaterial (Surface::Material *pMaterial)
 
void setCamera (Camera *pCamera)
 
Camera * getCamera ()
 
const Matrix4fgetProjectionMatrix ()
 
const Matrix4fgetViewMatrix ()
 
float getNearZClip ()
 
float getFarZClip ()
 
bool hasGeometricObject (GeometricBase *pObject)
 
Vertex4f project (const Vertex3f &vertex)
 
Vertex3f unProject (const Vertex4f &vertex)
 
Vertex3f localToNdc (Vertex3f point)
 
Vertex3f ndcToLocal (Vertex3f point, float w)
 
- Public Member Functions inherited from DynamicType
 DynamicType ()
 
template<class C >
void addType ()
 
TypeID getDerivedTypeId () const
 
template<class C >
const bool isType () const
 
template<class C >
const C * cast () const
 
template<class C >
C * cast ()
 
template<class FROM , class TO >
TO * cast ()
 
template<class FROM , class TO >
const TO * cast () const
 

Static Public Member Functions

static Matrix4f createFrustum (float left, float right, float bottom, float top, float nearZ, float farZ)
 
static Matrix4f createMatrix (float fovy=45.0f, float aspect=Application::getAspectRatio(), float nearZ=0.01f, float farZ=100.0f)
 
static Matrix4f createFullView (Primitive3D::AABoundingBox box, Matrix4f projectionMatrix)
 

Protected Attributes

Attribute attribute
 
- Protected Attributes inherited from Scene
float nearZClip
 
float farZClip
 
Matrix4f view
 
Matrix4f projectionMatrix
 
Camera * pCamera
 
GeometricBaseList pGeometricObject
 
UnorderedMap< Node *, Matrix4fnodeModel
 
List< FrameBuffer * > pFrameBuffer
 

Additional Inherited Members

- Public Types inherited from Scene
typedef List< GeometricBase * > GeometricBaseList
 
- Public Attributes inherited from Display
Surface::MaterialList pOpaqueMaterialList
 
Surface::MaterialList pTransparentMaterialList
 
Application::SceneList pPreprocessor
 
- Protected Member Functions inherited from Scene
virtual void addGeometricObject (GeometricBase *pObject)
 

Constructor & Destructor Documentation

◆ Frustum()

Frustum::Frustum ( const Attribute & attribute = Attribute(),
float nearZClip = 0.01f,
float farZClip = 100.0f )

Member Function Documentation

◆ createFrustum()

static Matrix4f Frustum::createFrustum ( float left,
float right,
float bottom,
float top,
float nearZ,
float farZ )
static

Frustum transform matrix.

Parameters
Left-xclip-plane, value must != right-x.
Right-xclip-plane, value must != left-x.
Bottom-yclip-plane, value must != top-y.
Top-yclip-plane, value must != bottom-y.
Near-zclip-plane, value must be > 0.
Far-zclip-plane, value must be > near-z.
Returns
Resulting matrix.

◆ createFullView() [1/2]

Matrix4f Frustum::createFullView ( GeometricBase * pObject)

Calculate the view-transform needed to rasterize an object in full-view, constrained to the Scene's projection. The transform returned is the translation needed to center the object for optimal view.

Parameters
Apointer to the GeometricObject for computation of transform.
Returns
The tranformation-matrix(translation) for rasterizing the object in full-view.

◆ createFullView() [2/2]

static Matrix4f Frustum::createFullView ( Primitive3D::AABoundingBox box,
Matrix4f projectionMatrix )
static

Calculate the view-transform needed to rasterize an axis-alligned bounding-box in full-view, constrained to the Scene's projection. The transform returned is the translation needed to center the object for optimal view.

Parameters
Anaxis-alligned bounding-box for computation of transform.
Returns
The tranformation-matrix(translation) for rasterizing the object in full-view.

◆ createMatrix()

static Matrix4f Frustum::createMatrix ( float fovy = 45.0f,
float aspect = Application::getAspectRatio(),
float nearZ = 0.01f,
float farZ = 100.0f )
static

Normalized (unit-cube) perspective-frustum transform matrix.

Parameters
fovyfield of view angle.
aspectwidth-to-height aspect ratio.
near-zclip-plane, value must be > 0.
far-zclip-plane, value must be > near-z.
Returns
resulting matrix.

◆ getAttribute()

const Attribute & Frustum::getAttribute ( )
inline

Member Data Documentation

◆ attribute

Attribute Frustum::attribute
protected

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