In file include/csgeom/frustrum.h:

class csFrustrum

A frustrum

Inheritance:


Public Methods

void AddVertex(const csVector3& v)
Add a vertex to the frustrum polygon
void ClipPolyToPlane(csPlane* plane)
Clip the polygon of this frustrum to the postive side of an arbitrary plane (which should be specified relative to the origin of the frustrum)
void ClipToPlane(csVector3& v1, csVector3& v2)
Clip this frustrum to the positive side of a plane formed by the origin of this frustum, and the two given vertices
bool Contains(const csVector3& point)
Check if a point (given relative to the origin of the frustrum) is inside the frustrum
csFrustrum(csVector3& o, csVector3* verts, int num_verts, csPlane* backp = NULL)
Create a frustrum given a polygon and a backplane
csFrustrum(const csFrustrum ©)
Copy constructor.
csFrustrum(csVector3& o)
Create a new empty frustrum.
csPlane* GetBackPlane()
Get the back plane
int GetNumVertices()
Get the number of vertices
csVector3& GetOrigin()
Get the origin of this frustrum.
csVector3& GetVertex(int idx)
Get a vertex
csVector3* GetVertices()
Get the array of vertices
csFrustrum* Intersect(csVector3* poly, int num)
Intersect a convex polygon with this volume
csFrustrum* Intersect(const csFrustrum& other)
Intersect with another frustrum
bool IsEmpty()
Return true if frustrum is empty.
bool IsInfinite()
Return true if frustrum is infinite.
bool IsMirrored()
Is this frustrum mirrored?
bool IsWide()
Return true if frustrum is infinitely wide but it can still have a back plane.
void MakeEmpty()
Make the frustrum empty
void MakeInfinite()
Make the frustrum infinite (i
void RemoveBackPlane()
Remove the back plane of this frustrum
void SetBackPlane(csPlane& plane)
Set the back plane of this frustrum
void SetMirrored(bool m)
Enable/disable mirroring
void SetOrigin(csVector3& o)
Set the origin of this frustrum.
void Transform(csTransform* trans)
Apply a transformation to this frustrum
virtual ~csFrustrum()

Private Fields

bool mirrored
If true we have a mirrored frustrum where the direction of the polygon is reversed
bool wide
If true we have a total wide frustrum

Documentation

A frustrum. This consist of a center point (origin), a frustrum polygon in 3D space (relative to center point) and a plane. The planes which go through the center and every edge of the polygon form the frustrum. The plane is the back plane of the frustrum. It is also possible to have an infinite frustrum in which case the polygon will be NULL (not specified). The back plane can also be NULL.
bool wide
If true we have a total wide frustrum. A frustrum like this does not have a polygon defining the planes but it can have a back plane. The value of this boolean is only used if there is no polygon. In other words, if the polygon is present in this frustrum then 'wide' is simply ignored and can have any value.

bool mirrored
If true we have a mirrored frustrum where the direction of the polygon is reversed

csFrustrum(csVector3& o)
Create a new empty frustrum.

csFrustrum(csVector3& o, csVector3* verts, int num_verts, csPlane* backp = NULL)
Create a frustrum given a polygon and a backplane. The polygon is given relative to the origin 'o'. If the given polygon is NULL then we create an empty frustrum.

csFrustrum(const csFrustrum ©)
Copy constructor.

virtual ~csFrustrum()

void SetOrigin(csVector3& o)
Set the origin of this frustrum.

csVector3& GetOrigin()
Get the origin of this frustrum.

void SetMirrored(bool m)
Enable/disable mirroring. If mirroring is enabled this means that the frustrum polygon is given in anti-clockwise order.

bool IsMirrored()
Is this frustrum mirrored?

void SetBackPlane(csPlane& plane)
Set the back plane of this frustrum. The given plane is copied to this structure and can thus be reused/freed later. The plane should be specified relative to the origin point.

csPlane* GetBackPlane()
Get the back plane

void RemoveBackPlane()
Remove the back plane of this frustrum

void AddVertex(const csVector3& v)
Add a vertex to the frustrum polygon

int GetNumVertices()
Get the number of vertices

csVector3& GetVertex(int idx)
Get a vertex

csVector3* GetVertices()
Get the array of vertices

void Transform(csTransform* trans)
Apply a transformation to this frustrum

void ClipToPlane(csVector3& v1, csVector3& v2)
Clip this frustrum to the positive side of a plane formed by the origin of this frustum, and the two given vertices. 'v1' and 'v2' are given relative to that origin.

void ClipPolyToPlane(csPlane* plane)
Clip the polygon of this frustrum to the postive side of an arbitrary plane (which should be specified relative to the origin of the frustrum). Note that this clips the polygon which forms the frustrum. It does not clip the frustrum itself.

csFrustrum* Intersect(const csFrustrum& other)
Intersect with another frustrum. The other frustrum must have the same origin as this one. Otherwise the result is undefined. Returns new frustrum which you should delete after usage. If there is no intersection this function returns NULL.

csFrustrum* Intersect(csVector3* poly, int num)
Intersect a convex polygon with this volume. The convex polygon is given relative to the center point (origin) of this frustrum.

Returns a new frustrum which exactly covers the intersection of the polygon with the frustrum (i.e. the smallest frustrum which is part of this frustrum and which 'sees' exactly the same of the given polygon as this frustrum).

This function returns NULL if there is no intersection.

Note that the frustrum polygon of the returned csFrustrum is guaranteed to be coplanar with the given polygon.

bool Contains(const csVector3& point)
Check if a point (given relative to the origin of the frustrum) is inside the frustrum

bool IsEmpty()
Return true if frustrum is empty.

bool IsInfinite()
Return true if frustrum is infinite.

bool IsWide()
Return true if frustrum is infinitely wide but it can still have a back plane.

void MakeInfinite()
Make the frustrum infinite (i.e. clear the polygon and the back plane).

void MakeEmpty()
Make the frustrum empty


Direct child classes:
csShadowFrustrum

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de