PixelLightAPI
.
|
A set of planes defines a convex volume (e.g. the frustum, an event area...) More...
#include <PlaneSet.h>
Public Types | |
enum | EViewPlaneOrder { VPNear = 0, VPRight = 1, VPLeft = 2, VPBottom = 3, VPTop = 4, VPFar = 5 } |
Default view plane order. More... | |
Public Member Functions | |
PLMATH_API | PlaneSet () |
Constructor. | |
PLMATH_API | PlaneSet (const PlaneSet &cSource) |
Copy constructor. | |
virtual PLMATH_API | ~PlaneSet () |
Destructor. | |
PLMATH_API Plane * | Create () |
Creates and adds a new plane to the plane set. | |
PLMATH_API void | CreateBox (const Vector3 &vMin, const Vector3 &vMax) |
Creates 6 planes which enclose a box area. | |
PLMATH_API void | CreateViewPlanes (const Matrix4x4 &mViewProjection, bool bInfProj=false) |
Creates view planes using a view projection matrix. | |
PLMATH_API bool | CreateViewPlanes (const PLCore::Array< Vector3 > &lstVertices, const Vector3 &vViewPosition) |
Creates view planes using vertices and a view position. | |
PLMATH_API void | CreateSelectionPlanes (const Vector2 &vStartPos, const Vector2 &vEndPos, int nX, int nY, int nWidth, int nHeight, const Matrix4x4 &mProjection, const Matrix4x4 &mView, bool bInfProj=false) |
Creates selection planes. | |
PLMATH_API void | CreateSelectionPlanes (const Vector2 &vStartPos, const Vector2 &vEndPos, int nX, int nY, int nWidth, int nHeight, const Matrix4x4 &mProjection, const Matrix3x4 &mView, bool bInfProj=false) |
PLMATH_API PLCore::uint32 | GetNumOfPlanes () const |
Returns the number of planes. | |
PLMATH_API const Plane * | operator[] (int nID) const |
Returns a plane. | |
PLMATH_API Plane * | operator[] (int nID) |
Returns a plane. | |
PLMATH_API PLCore::Array< Plane > & | GetList () |
Returns the plane list. | |
PLMATH_API const PLCore::Array < Plane > & | GetList () const |
Returns the plane list. | |
PLMATH_API bool | RemovePlane (PLCore::uint32 nID=0) |
Removes a plane. | |
PLMATH_API void | Clear () |
Clears the plane set. | |
PLMATH_API PlaneSet & | operator= (const PlaneSet &cSource) |
Copy operator. | |
PLMATH_API PlaneSet & | operator*= (const Matrix3x3 &mRot) |
Plane set transformation. | |
PLMATH_API PlaneSet & | operator*= (const Matrix3x4 &mTrans) |
Plane set transformation. | |
PLMATH_API PlaneSet & | operator*= (const Matrix4x4 &mTrans) |
Plane set transformation. | |
PLMATH_API bool | IsConvex () const |
Checks whether the plane set is convex or not. | |
PLMATH_API void | CalculateSphere (Sphere &cSphere) const |
Calculates the sphere surrounding the enclosed area. | |
PLMATH_API void | CalculateBox (Vector3 &vMin, Vector3 &vMax) const |
Calculates the box surrounding the enclosed area. | |
Protected Attributes | |
PLCore::Array< Plane > | m_lstPlane |
A set of planes defines a convex volume (e.g. the frustum, an event area...)
PLMATH_API PLMath::PlaneSet::PlaneSet | ( | ) |
Constructor.
PLMATH_API PLMath::PlaneSet::PlaneSet | ( | const PlaneSet & | cSource | ) |
Copy constructor.
[in] | cSource | Source to copy from |
virtual PLMATH_API PLMath::PlaneSet::~PlaneSet | ( | ) | [virtual] |
Destructor.
PLMATH_API Plane* PLMath::PlaneSet::Create | ( | ) |
Creates and adds a new plane to the plane set.
PLMATH_API void PLMath::PlaneSet::CreateBox | ( | const Vector3 & | vMin, |
const Vector3 & | vMax | ||
) |
Creates 6 planes which enclose a box area.
[in] | vMin | Minimum position of the box |
[in] | vMax | Maximum position of the box |
PLMATH_API void PLMath::PlaneSet::CreateViewPlanes | ( | const Matrix4x4 & | mViewProjection, |
bool | bInfProj = false |
||
) |
Creates view planes using a view projection matrix.
[in] | mViewProjection | View projection matrix |
[in] | bInfProj | Is the projection matrix part infinite? In this case, there's no far plane. |
PLMATH_API bool PLMath::PlaneSet::CreateViewPlanes | ( | const PLCore::Array< Vector3 > & | lstVertices, |
const Vector3 & | vViewPosition | ||
) |
Creates view planes using vertices and a view position.
[in] | lstVertices | Vertices (xyz, counterclockwise) defining a 'portal'-polygon (there must be at least 3 vertices) |
[in] | vViewPosition | View position |
PLMATH_API void PLMath::PlaneSet::CreateSelectionPlanes | ( | const Vector2 & | vStartPos, |
const Vector2 & | vEndPos, | ||
int | nX, | ||
int | nY, | ||
int | nWidth, | ||
int | nHeight, | ||
const Matrix4x4 & | mProjection, | ||
const Matrix4x4 & | mView, | ||
bool | bInfProj = false |
||
) |
Creates selection planes.
[in] | vStartPos | Selection rectangle start position |
[in] | vEndPos | Selection rectangle end position |
[in] | nX | X component of the pixel coordinate of the upper-left corner of the viewport |
[in] | nY | Y component of the pixel coordinate of the upper-left corner of the viewport |
[in] | nWidth | Width of the clip volume, in pixels |
[in] | nHeight | Height of the clip volume, in pixels |
[in] | mProjection | Projection matrix |
[in] | mView | View matrix |
[in] | bInfProj | Is the projection matrix infinite? In this case, there's no far plane. |
PLMATH_API void PLMath::PlaneSet::CreateSelectionPlanes | ( | const Vector2 & | vStartPos, |
const Vector2 & | vEndPos, | ||
int | nX, | ||
int | nY, | ||
int | nWidth, | ||
int | nHeight, | ||
const Matrix4x4 & | mProjection, | ||
const Matrix3x4 & | mView, | ||
bool | bInfProj = false |
||
) |
PLMATH_API PLCore::uint32 PLMath::PlaneSet::GetNumOfPlanes | ( | ) | const |
Returns the number of planes.
PLMATH_API const Plane* PLMath::PlaneSet::operator[] | ( | int | nID | ) | const |
Returns a plane.
[in] | nID | ID of the plane which should be returned |
PLMATH_API Plane* PLMath::PlaneSet::operator[] | ( | int | nID | ) |
Returns a plane.
[in] | nID | ID of the plane which should be returned |
PLMATH_API PLCore::Array<Plane>& PLMath::PlaneSet::GetList | ( | ) |
Returns the plane list.
PLMATH_API const PLCore::Array<Plane>& PLMath::PlaneSet::GetList | ( | ) | const |
Returns the plane list.
PLMATH_API bool PLMath::PlaneSet::RemovePlane | ( | PLCore::uint32 | nID = 0 | ) |
Removes a plane.
[in] | nID | ID of the plane which should be removed |
PLMATH_API void PLMath::PlaneSet::Clear | ( | ) |
Clears the plane set.
Copy operator.
[in] | cSource | Source to copy from |
PLMATH_API bool PLMath::PlaneSet::IsConvex | ( | ) | const |
Checks whether the plane set is convex or not.
PLMATH_API void PLMath::PlaneSet::CalculateSphere | ( | Sphere & | cSphere | ) | const |
Calculates the sphere surrounding the enclosed area.
[out] | cSphere | Will receive the sphere surrounding the enclosed area |
PLMATH_API void PLMath::PlaneSet::CalculateBox | ( | Vector3 & | vMin, |
Vector3 & | vMax | ||
) | const |
Calculates the box surrounding the enclosed area.
[out] | vMin | Will receive the minimum position of the box |
[out] | vMax | Will receive the maximum position of the box |
PLCore::Array<Plane> PLMath::PlaneSet::m_lstPlane [protected] |
Plane list
|