Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglFrustum Class Template Reference

#include <sglFrustum.hpp>

Inheritance diagram for sglFrustum::

List of all members.

Public Types

enum  {
  eLEFT = 0,
  eUP = 1,
  eRIGHT = 2,
  eDOWN = 3,
  eFRONT = 4,
  eBACK = 5,
  eNUM_PLANES = 6
}

Public Methods

 sglFrustum ()
template<class S>  sglFrustum (const sglFrustum< S > &rhs)
virtual ~sglFrustum ()
template<class S> sglFrustum& operator= (const sglFrustum< S > &rhs)
bool getOrthoFlag () const
double getAspect () const
double getFOVY () const
bool build (sglMat4< T > &projection_matrix)
bool buildPerspective (double fovY, double aspect, double near_clip, double far_clip)
bool buildPerspective (double near_left, double near_right, double near_bottom, double near_top, double near_clip, double far_clip)
bool buildOrtho (double left, double right, double bottom, double top, double near_clip, double far_clip)

Detailed Description

template<class T> class sglFrustum

The sglFrustum class is a subclass of sglPolytope that has six planes that usually either defines a truncated pyramid corresponding to the volume "seen" with a perspective view or a rectangular solid volume corresponding to an orthographic view.

Definition at line 52 of file sglFrustum.hpp.


Member Enumeration Documentation

template<class T>
anonymous enum
 

Indices to access the individual planes of the polytope.

Definition at line 56 of file sglFrustum.hpp.


Constructor & Destructor Documentation

template<class T>
sglFrustum<T>::sglFrustum<T> ( ) [inline]
 

Default constructor.

Definition at line 61 of file sglFrustum.hpp.

template<class T>
template<class S>
sglFrustum<T>::sglFrustum<T> ( const sglFrustum< S > & rhs ) [inline]
 

Copy constructor.

Definition at line 65 of file sglFrustum.hpp.

template<class T>
sglFrustum<T>::~sglFrustum<T> ( ) [inline, virtual]
 

Destructor.

Definition at line 72 of file sglFrustum.hpp.


Member Function Documentation

template<class T>
template<class S>
sglFrustum<T> & sglFrustum<T>::operator= ( const sglFrustum< S > & rhs ) [inline]
 

assignment operator.

Definition at line 76 of file sglFrustum.hpp.

template<class T>
bool sglFrustum<T>::getOrthoFlag ( ) const [inline]
 

Query whether or not this is orthographic

Returns:
True if orthographic, else false.

Definition at line 90 of file sglFrustum.hpp.

Referenced by operator=().

template<class T>
double sglFrustum<T>::getAspect ( ) const [inline]
 

Query the aspect ratio of the frustum: width/height

Returns:
The current aspect ratio.

Definition at line 95 of file sglFrustum.hpp.

template<class T>
double sglFrustum<T>::getFOVY ( ) const [inline]
 

Query the current vertical field of view (FOV) in radians.

Returns:
The vertical FOV angle in radians. If this is not a perspective frustum, -1 is returned.

Definition at line 101 of file sglFrustum.hpp.

Referenced by operator=().

template<class T>
bool sglFrustum< T >::build ( sglMat4< T > & projectionMatrix ) [inline]
 

This computes a frustum/polytope based on an OpenGL format projection matrix.

Parameters:
projection_matrix   The project matrix (as OpenGL would expect it).
Returns:
true if it is not a degenerate matrix, else false.

Definition at line 172 of file sglFrustum.hpp.

template<class T>
bool sglFrustum< T >::buildPerspective ( double fovy,
double aspect,
double near_clip,
double far_clip ) [inline]
 

Compute a perspective frustum (from arguments to gluPerspective)

Parameters:
fovY   Vertical field of view in radians.
aspect   width/height ratio of view.
near_clip   Distance from view point to near clipping plane.
far_clip   Distance from view point to far clipping plane.

Definition at line 297 of file sglFrustum.hpp.

template<class T>
bool sglFrustum< T >::buildPerspective ( double near_left,
double near_right,
double near_bottom,
double near_top,
double near_clip,
double far_clip ) [inline]
 

Compute a perspective frustum (from arguments to glFrustum). The volume is defined by the parameters (left, bottom, -near) and (right, top, -near)

Parameters:
near_left   Left coordinate of near clipping plane.
near_right   Right coordinate of near clipping plane.
near_top   Top coordinate of near clipping plane.
near_bottom   Bottom coordinate of near clipping plane.
near_clip   Distance from view point to near clipping plane.
far_clip   Distance from view point to far clipping plane.

Definition at line 274 of file sglFrustum.hpp.

template<class T>
bool sglFrustum< T >::buildOrtho ( double left,
double right,
double bottom,
double top,
double near_clip,
double far_clip ) [inline]
 

Compute an orthographic view volume (from arguments to glOrtho)

Parameters:
left   Coordinate of left clipping plane.
right   Coordinate of right clipping plane.
top   Coordinate of top clipping plane.
bottom   Coordinate of bottom clipping plane.
near_clip   Distance from view point to near clipping plane.
far_clip   Distance from view point to far clipping plane.

Definition at line 407 of file sglFrustum.hpp.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:07 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001