GLC_Frustum Class Reference

GLC_Frustum : OpenGL Frustum. More...

#include <glc_frustum.h>

List of all members.

Public Types

enum  Localisation { InFrustum = 0, IntersectFrustum = 1, OutFrustum = 3 }

Public Member Functions

Constructor / Destructor

 GLC_Frustum ()
 Default constructor.
 GLC_Frustum (const GLC_Frustum &)
 Copy constructor.
 ~GLC_Frustum ()
 Destructor.
Get Functions

GLC_Plane leftClippingPlane () const
 Return the left clipping plane.
GLC_Plane rightClippingPlane () const
 Return the Right clipping plane.
GLC_Plane topClippingPlane () const
 Return the top clipping plane.
GLC_Plane bottomClippingPlane () const
 Return the bottom clipping plane.
GLC_Plane nearClippingPlane () const
 Return the near clipping plane.
GLC_Plane farClippingPlane () const
 Return the far clipping plane.
Localisation localizeBoundingBox (const GLC_BoundingBox &) const
 Localize bounding box.
Localisation localizeSphere (const GLC_Point3d &, double) const
 Localize sphere.
Set Functions

void setLeftClippingPlane (const GLC_Plane &plane)
 Set the left clipping plane.
void setRightClippingPlane (const GLC_Plane &plane)
 Set the right clipping plane.
void setTopClippingPlane (const GLC_Plane &plane)
 Set the top clipping plane.
void setBottomClippingPlane (const GLC_Plane &plane)
 Set the bottom clipping plane.
void setNearClippingPlane (const GLC_Plane &plane)
 Set the near clipping plane.
void setFarClippingPlane (const GLC_Plane &plane)
 Set the far clipping plane.
bool update (const GLC_Matrix4x4 &)
 Update the frustum.

Private Types

enum  planeId {
  LeftPlane = 0, RightPlane = 1, TopPlane = 2, BottomPlane = 3,
  NearPlane = 4, FarPlane = 5
}

Private Member Functions

Localisation localizeSphereToPlane (const GLC_Point3d &, double, const GLC_Plane &) const
 localize a sphere to a plane

Private Attributes

QList< GLC_Planem_PlaneList
 The list of frustum plane.
GLC_Matrix4x4 m_PreviousMatrix
 The previous frustum matrix.

Detailed Description

GLC_Frustum : OpenGL Frustum.

GLC_Frustum by 6 planes

Definition at line 39 of file glc_frustum.h.


Member Enumeration Documentation

Enumerator:
InFrustum 
IntersectFrustum 
OutFrustum 

Definition at line 52 of file glc_frustum.h.

enum GLC_Frustum::planeId [private]
Enumerator:
LeftPlane 
RightPlane 
TopPlane 
BottomPlane 
NearPlane 
FarPlane 

Definition at line 42 of file glc_frustum.h.


Constructor & Destructor Documentation

GLC_Frustum::GLC_Frustum (  ) 

Default constructor.

Definition at line 27 of file glc_frustum.cpp.

References m_PlaneList.

GLC_Frustum::GLC_Frustum ( const GLC_Frustum frustum  ) 

Copy constructor.

Definition at line 37 of file glc_frustum.cpp.

GLC_Frustum::~GLC_Frustum (  ) 

Destructor.

Definition at line 44 of file glc_frustum.cpp.


Member Function Documentation

GLC_Plane GLC_Frustum::bottomClippingPlane (  )  const [inline]

Return the bottom clipping plane.

Definition at line 92 of file glc_frustum.h.

GLC_Plane GLC_Frustum::farClippingPlane (  )  const [inline]

Return the far clipping plane.

Definition at line 100 of file glc_frustum.h.

GLC_Plane GLC_Frustum::leftClippingPlane (  )  const [inline]

Return the left clipping plane.

Definition at line 80 of file glc_frustum.h.

GLC_Frustum::Localisation GLC_Frustum::localizeBoundingBox ( const GLC_BoundingBox box  )  const
GLC_Frustum::Localisation GLC_Frustum::localizeSphere ( const GLC_Point3d center,
double  radius 
) const

Localize sphere.

Definition at line 57 of file glc_frustum.cpp.

References InFrustum, localizeSphereToPlane(), m_PlaneList, and OutFrustum.

Referenced by localizeBoundingBox(), and GLC_OctreeNode::updateViewableInstances().

GLC_Frustum::Localisation GLC_Frustum::localizeSphereToPlane ( const GLC_Point3d center,
double  radius,
const GLC_Plane plane 
) const [private]

localize a sphere to a plane

Definition at line 74 of file glc_frustum.cpp.

References GLC_Plane::distanceToPoint(), InFrustum, IntersectFrustum, and OutFrustum.

Referenced by localizeSphere().

GLC_Plane GLC_Frustum::nearClippingPlane (  )  const [inline]

Return the near clipping plane.

Definition at line 96 of file glc_frustum.h.

GLC_Plane GLC_Frustum::rightClippingPlane (  )  const [inline]

Return the Right clipping plane.

Definition at line 84 of file glc_frustum.h.

void GLC_Frustum::setBottomClippingPlane ( const GLC_Plane plane  )  [inline]

Set the bottom clipping plane.

Definition at line 130 of file glc_frustum.h.

void GLC_Frustum::setFarClippingPlane ( const GLC_Plane plane  )  [inline]

Set the far clipping plane.

Definition at line 138 of file glc_frustum.h.

void GLC_Frustum::setLeftClippingPlane ( const GLC_Plane plane  )  [inline]

Set the left clipping plane.

Definition at line 118 of file glc_frustum.h.

void GLC_Frustum::setNearClippingPlane ( const GLC_Plane plane  )  [inline]

Set the near clipping plane.

Definition at line 134 of file glc_frustum.h.

void GLC_Frustum::setRightClippingPlane ( const GLC_Plane plane  )  [inline]

Set the right clipping plane.

Definition at line 122 of file glc_frustum.h.

void GLC_Frustum::setTopClippingPlane ( const GLC_Plane plane  )  [inline]

Set the top clipping plane.

Definition at line 126 of file glc_frustum.h.

GLC_Plane GLC_Frustum::topClippingPlane (  )  const [inline]

Return the top clipping plane.

Definition at line 88 of file glc_frustum.h.

bool GLC_Frustum::update ( const GLC_Matrix4x4 compMatrix  ) 

Update the frustum.

Return true if the frustum as change

Definition at line 92 of file glc_frustum.cpp.

References BottomPlane, FarPlane, GLC_Matrix4x4::getData(), LeftPlane, m_PlaneList, m_PreviousMatrix, NearPlane, RightPlane, and TopPlane.

Referenced by GLC_Viewport::updateFrustum().


Member Data Documentation

The list of frustum plane.

Definition at line 159 of file glc_frustum.h.

Referenced by GLC_Frustum(), localizeSphere(), and update().

The previous frustum matrix.

Definition at line 162 of file glc_frustum.h.

Referenced by update().


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

SourceForge.net Logo

©2005-2011 Laurent Ribon