PixelLightAPI
.
|
#include <Plane.h>
Public Types | |
enum | Component { X = 0, Y = 1, Z = 2, W = 3 } |
Component. More... | |
enum | ESide { Behind = -1, Coinciding = 0, InFront = 1 } |
Plane/point relation. More... | |
Public Member Functions | |
Plane () | |
Default constructor setting all components to 0. | |
Plane (float fA, float fB, float fC, float fD) | |
Constructor. | |
Plane (const Vector3 &vOrigin, const Vector3 &vNormal) | |
Constructor. | |
Plane (const Vector3 &vV1, const Vector3 &vV2, const Vector3 &vV3) | |
Constructor. | |
~Plane () | |
Destructor. | |
Plane & | operator= (const Plane &cSource) |
Copy operator. | |
bool | operator== (const Plane &cPlane) const |
bool | operator!= (const Plane &cPlane) const |
PLMATH_API Plane | operator* (const Matrix3x3 &mRot) const |
PLMATH_API Plane | operator* (const Matrix3x4 &mTrans) const |
PLMATH_API Plane | operator* (const Matrix4x4 &mTrans) const |
PLMATH_API Plane & | operator*= (const Matrix3x3 &mRot) |
PLMATH_API Plane & | operator*= (const Matrix3x4 &mTrans) |
PLMATH_API Plane & | operator*= (const Matrix4x4 &mTrans) |
Plane & | ComputeND (const Vector3 &vOrigin, const Vector3 &vNormal) |
Calculates the plane. | |
PLMATH_API Plane & | ComputeND (const Vector3 &vV1, const Vector3 &vV2, const Vector3 &vV3) |
Calculates the plane. | |
PLMATH_API Plane & | ComputeTangentPlaneOfEllipsoid (const Vector3 &vPointPos, const Vector3 &vEllipsoidPos, const Vector3 &vEllipsoidRadius) |
Computes the tangent plane of an ellipsoid. | |
Plane & | Normalize () |
Normalizes the plane. | |
PLMATH_API Plane | Lerp (const Plane &cP2, float fFactor) |
Calculates the interpolated plane from two other planes. | |
ESide | GetSide (const Vector3 &vPoint) const |
Returns the side of the plane the given point is on. | |
float | GetDistance (const Vector3 &vPoint) const |
Calculates the distance from a point to the plane. | |
float | GetDistance (const Vector4 &vPoint) const |
Calculates the distance from a point to the plane. | |
float | GetDistance (const Vector3 &vRayPos, const Vector3 &vRayDir) const |
Calculates the distance to the ray/intersection point. | |
Vector3 | GetPointOnPlane () const |
Returns a point on the plane. | |
Vector3 | ClipEdge (const Vector3 &vV1, const Vector3 &vV2) const |
Clips an edge by this plane. | |
Public Attributes | |
union { | |
float fVector [4] | |
struct { | |
float a | |
float b | |
float c | |
float d | |
} | |
struct { | |
float fN [3] | |
float fD | |
} | |
}; |
Plane class.
enum PLMath::Plane::ESide |
PLMath::Plane::Plane | ( | ) | [inline] |
Default constructor setting all components to 0.
PLMath::Plane::Plane | ( | float | fA, |
float | fB, | ||
float | fC, | ||
float | fD | ||
) | [inline] |
PLMath::Plane::Plane | ( | const Vector3 & | vOrigin, |
const Vector3 & | vNormal | ||
) | [inline] |
PLMath::Plane::Plane | ( | const Vector3 & | vV1, |
const Vector3 & | vV2, | ||
const Vector3 & | vV3 | ||
) | [inline] |
Constructor.
[in] | vV1 | First vertex on the plane |
[in] | vV2 | Second vertex on the plane |
[in] | vV3 | Third vertex on the plane |
PLMath::Plane::~Plane | ( | ) | [inline] |
Destructor.
Copy operator.
[in] | cSource | Source to copy from |
bool PLMath::Plane::operator== | ( | const Plane & | cPlane | ) | const [inline] |
bool PLMath::Plane::operator!= | ( | const Plane & | cPlane | ) | const [inline] |
Plane & PLMath::Plane::ComputeND | ( | const Vector3 & | vOrigin, |
const Vector3 & | vNormal | ||
) | [inline] |
PLMATH_API Plane& PLMath::Plane::ComputeND | ( | const Vector3 & | vV1, |
const Vector3 & | vV2, | ||
const Vector3 & | vV3 | ||
) |
Calculates the plane.
[in] | vV1 | First vertex on the plane |
[in] | vV2 | Second vertex on the plane |
[in] | vV3 | Third vertex on the plane |
PLMATH_API Plane& PLMath::Plane::ComputeTangentPlaneOfEllipsoid | ( | const Vector3 & | vPointPos, |
const Vector3 & | vEllipsoidPos, | ||
const Vector3 & | vEllipsoidRadius | ||
) |
Computes the tangent plane of an ellipsoid.
[in] | vPointPos | Point on the plane |
[in] | vEllipsoidPos | Ellipsoid position |
[in] | vEllipsoidRadius | Ellipsoid radius |
Plane & PLMath::Plane::Normalize | ( | ) | [inline] |
Normalizes the plane.
PLMATH_API Plane PLMath::Plane::Lerp | ( | const Plane & | cP2, |
float | fFactor | ||
) |
Calculates the interpolated plane from two other planes.
[in] | cP2 | Other plane to interpolate with |
[in] | fFactor | Interpolation factor. 0.0 = this plane, 1.0 = cP2 |
Plane::ESide PLMath::Plane::GetSide | ( | const Vector3 & | vPoint | ) | const [inline] |
Returns the side of the plane the given point is on.
[in] | vPoint | Point to check |
float PLMath::Plane::GetDistance | ( | const Vector3 & | vPoint | ) | const [inline] |
Calculates the distance from a point to the plane.
[in] | vPoint | Point the distance should be calculated |
float PLMath::Plane::GetDistance | ( | const Vector4 & | vPoint | ) | const [inline] |
Calculates the distance from a point to the plane.
[in] | vPoint | Point the distance should be calculated |
float PLMath::Plane::GetDistance | ( | const Vector3 & | vRayPos, |
const Vector3 & | vRayDir | ||
) | const [inline] |
Vector3 PLMath::Plane::GetPointOnPlane | ( | ) | const [inline] |
Returns a point on the plane.
Vector3 PLMath::Plane::ClipEdge | ( | const Vector3 & | vV1, |
const Vector3 & | vV2 | ||
) | const [inline] |
Clips an edge by this plane.
[in] | vV1 | The first vertex of the edge |
[in] | vV2 | The second vertex of the edge |
float PLMath::Plane::fVector[4] |
Coefficients
float PLMath::Plane::a |
float PLMath::Plane::b |
float PLMath::Plane::c |
float PLMath::Plane::d |
Coefficients
float PLMath::Plane::fN[3] |
Plane normal
float PLMath::Plane::fD |
Distance to origin
union { ... } |
|