My Project
|
Defines a plane in 3D space. More...
#include <ParaPlane.h>
Public Types | |
enum | Side { NO_SIDE, POSITIVE_SIDE, NEGATIVE_SIDE, BOTH_SIDE } |
The "positive side" of the plane is the half space to which the plane normal points. More... | |
Public Member Functions | |
Plane () | |
Default constructor - sets everything to 0. | |
Plane (const Plane &rhs) | |
Plane (const Vector3 &rkNormal, float fConstant) | |
Construct a plane through a normal, and a distance to move the plane along the normal. More... | |
Plane (float a, float b, float c, float d) | |
Construct a plane using the 4 constants directly. | |
Plane (const Vector3 &rkNormal, const Vector3 &rkPoint) | |
Plane (const Vector3 &rkPoint0, const Vector3 &rkPoint1, const Vector3 &rkPoint2) | |
Side | getSide (const Vector3 &rkPoint) const |
Side | getSide (const AxisAlignedBox &rkBox) const |
returns the side where the aligneBox is. More... | |
Side | getSide (const CShapeAABB &rkBox) const |
returns the side where the aligneBox is. More... | |
Side | getSide (const Vector3 ¢re, const Vector3 &halfSize) const |
Returns which side of the plane that the given box lies on. More... | |
float | getDistance (const Vector3 &rkPoint) const |
This is a pseudo distance. More... | |
void | redefine (const Vector3 &rkPoint0, const Vector3 &rkPoint1, const Vector3 &rkPoint2) |
Redefine this plane based on 3 points. More... | |
void | redefine (const Vector3 &rkNormal, const Vector3 &rkPoint) |
Redefine this plane based on a normal and a point. More... | |
Plane & | Set (float nx, float ny, float nz, float _d) |
Plane & | Set (const Vector3 &p, const Vector3 &_n) |
Plane & | Set (const Vector3 &p0, const Vector3 &p1, const Vector3 &p2) |
Vector3 | projectVector (const Vector3 &v) const |
Project a vector onto the plane. More... | |
float | normalise (void) |
Normalizes the plane. More... | |
float | PlaneDotCoord (const Vector3 &pV) const |
float | PlaneDotNormal (const Vector3 &pV) const |
Plane | PlaneTransform (const Matrix4 &M) const |
float | a () const |
float | b () const |
float | c () const |
operator Vector3 () const | |
operator Vector4 () const | |
Plane | operator* (const Matrix4 &m) const |
Plane & | operator*= (const Matrix4 &m) |
Plane | operator- () const |
operator const float * () const | |
operator float * () | |
bool | operator== (const Plane &rhs) const |
Comparison operator. | |
bool | operator!= (const Plane &rhs) const |
Public Attributes | |
Vector3 | normal |
float | d |
Friends | |
std::ostream & | operator<< (std::ostream &o, const Plane &p) |
Defines a plane in 3D space.
The "positive side" of the plane is the half space to which the plane normal points.
The "negative side" is the other half space. The flag "no side" indicates the plane itself.
ParaEngine::Plane::Plane | ( | const Vector3 & | rkNormal, |
float | fConstant | ||
) |
Construct a plane through a normal, and a distance to move the plane along the normal.
float ParaEngine::Plane::getDistance | ( | const Vector3 & | rkPoint | ) | const |
This is a pseudo distance.
The sign of the return value is positive if the point is on the positive side of the plane, negative if the point is on the negative side, and zero if the point is on the plane.
Plane::Side ParaEngine::Plane::getSide | ( | const AxisAlignedBox & | rkBox | ) | const |
returns the side where the aligneBox is.
the flag BOTH_SIDE indicates an intersecting box. one corner ON the plane is sufficient to consider the box and the plane intersecting.
Plane::Side ParaEngine::Plane::getSide | ( | const CShapeAABB & | rkBox | ) | const |
returns the side where the aligneBox is.
the flag BOTH_SIDE indicates an intersecting box. one corner ON the plane is sufficient to consider the box and the plane intersecting.
Plane::Side ParaEngine::Plane::getSide | ( | const Vector3 & | centre, |
const Vector3 & | halfSize | ||
) | const |
Returns which side of the plane that the given box lies on.
The box is defined as centre/half-size pairs for effectively.
centre | The centre of the box. |
halfSize | The half-size of the box. |
float ParaEngine::Plane::normalise | ( | void | ) |
Normalizes the plane.
Project a vector onto the plane.
v | The input vector |
void ParaEngine::Plane::redefine | ( | const Vector3 & | rkPoint0, |
const Vector3 & | rkPoint1, | ||
const Vector3 & | rkPoint2 | ||
) |
Redefine this plane based on 3 points.
Redefine this plane based on a normal and a point.