vmmlib  1.12.0
Templatized C++ vector and matrix math library
vmml::Frustum< T > Class Template Reference

Represents a frustum, following OpenGL conventions. More...

#include <frustum.hpp>

+ Collaboration diagram for vmml::Frustum< T >:

Public Member Functions

 Frustum ()
 Construct a default frustum (-1, 1, -1, 1, 0.1, 100). More...
 
 Frustum (T left, T right, T bottom, T top, T nearPlane, T farPlane)
 Construct a frustum with default values.
 
 Frustum (T field_of_view_y, T aspect_ratio, T nearPlane_, T farPlane)
 Construct a frustum using gluPerspective semantics.
 
 Frustum (const Matrix< 4, 4, T > &projection)
 Construct a frustum from a projection matrix.
 
 ~Frustum ()
 Destruct this frustum.
 
bool operator== (const Frustum< T > &other) const
 
bool operator!= (const Frustum< T > &other) const
 
bool equals (const Frustum< T > &other, T tolerance=std::numeric_limits< T >::epsilon()) const
 
Matrix< 4, 4, T > computePerspectiveMatrix () const
 
Matrix< 4, 4, T > computeOrthoMatrix () const
 
void jitter (const vector< 2, T > &jitter_)
 Move the frustum near plane by the given offset "sideways".
 
void adjustNearPlane (const T nearPlane)
 Move the frustum near plane. More...
 
getWidth () const
 
getHeight () const
 
Access to frustum corners
T & left ()
 
left () const
 
T & right ()
 
right () const
 
T & bottom ()
 
bottom () const
 
T & top ()
 
top () const
 
T & nearPlane ()
 
nearPlane () const
 
T & farPlane ()
 
farPlane () const
 

Friends

std::ostream & operator<< (std::ostream &os, const Frustum &f)
 

Detailed Description

template<typename T>
class vmml::Frustum< T >

Represents a frustum, following OpenGL conventions.

Definition at line 42 of file frustum.hpp.

Constructor & Destructor Documentation

template<typename T >
vmml::Frustum< T >::Frustum ( )

Construct a default frustum (-1, 1, -1, 1, 0.1, 100).

Definition at line 142 of file frustum.hpp.

Member Function Documentation

template<typename T >
void vmml::Frustum< T >::adjustNearPlane ( const T  nearPlane)

Move the frustum near plane.

Changes the position of the nearPlane, adjusting the other parameters in a way that the shape of the perspective pyramid stays the same.

Definition at line 277 of file frustum.hpp.

Referenced by vmml::Frustum< T >::~Frustum().

+ Here is the caller graph for this function:

template<typename T >
Matrix< 4, 4, T > vmml::Frustum< T >::computeOrthoMatrix ( ) const
Returns
the orthographic matrix for the given frustum.

Definition at line 241 of file frustum.hpp.

Referenced by vmml::Frustum< T >::~Frustum().

+ Here is the caller graph for this function:

template<typename T >
Matrix< 4, 4, T > vmml::Frustum< T >::computePerspectiveMatrix ( ) const
Returns
the perspective matrix for the given frustum.

Definition at line 212 of file frustum.hpp.

Referenced by vmml::Frustum< T >::~Frustum().

+ Here is the caller graph for this function:

template<typename T >
bool vmml::Frustum< T >::equals ( const Frustum< T > &  other,
tolerance = std::numeric_limits< T >::epsilon( ) 
) const
Returns
true if thw two frusta are identical withing the tolerance

Definition at line 201 of file frustum.hpp.

Referenced by vmml::Frustum< T >::~Frustum().

+ Here is the caller graph for this function:

template<typename T >
T vmml::Frustum< T >::getHeight ( ) const
inline
Returns
the height of this frustum at the near plane

Definition at line 295 of file frustum.hpp.

Referenced by vmml::Frustum< T >::~Frustum().

+ Here is the caller graph for this function:

template<typename T >
T vmml::Frustum< T >::getWidth ( ) const
inline
Returns
the width of this frustum at the near plane

Definition at line 290 of file frustum.hpp.

Referenced by vmml::Frustum< T >::~Frustum().

+ Here is the caller graph for this function:

template<typename T >
bool vmml::Frustum< T >::operator!= ( const Frustum< T > &  other) const
Returns
true if this and the other frustum are not identical

Definition at line 195 of file frustum.hpp.

Referenced by vmml::Frustum< T >::~Frustum().

+ Here is the caller graph for this function:

template<typename T >
bool vmml::Frustum< T >::operator== ( const Frustum< T > &  other) const
Returns
true if this and the other frustum are identical

Definition at line 189 of file frustum.hpp.

Referenced by vmml::Frustum< T >::~Frustum().

+ Here is the caller graph for this function:


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