summaryrefslogtreecommitdiffhomepage
path: root/Opcode/Ice/IcePlane.h
diff options
context:
space:
mode:
Diffstat (limited to 'Opcode/Ice/IcePlane.h')
-rw-r--r--Opcode/Ice/IcePlane.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/Opcode/Ice/IcePlane.h b/Opcode/Ice/IcePlane.h
index d514e68..1a447ce 100644
--- a/Opcode/Ice/IcePlane.h
+++ b/Opcode/Ice/IcePlane.h
@@ -14,28 +14,28 @@
#define PLANE_EPSILON (1.0e-7f)
- class ICEMATHS_API Plane
+ class ICEMATHS_API IcePlane
{
public:
//! Constructor
- inline_ Plane() { }
+ inline_ IcePlane() { }
//! Constructor from a normal and a distance
- inline_ Plane(float nx, float ny, float nz, float d) { Set(nx, ny, nz, d); }
+ inline_ IcePlane(float nx, float ny, float nz, float d) { Set(nx, ny, nz, d); }
//! Constructor from a point on the plane and a normal
- inline_ Plane(const IcePoint& p, const IcePoint& n) { Set(p, n); }
+ inline_ IcePlane(const IcePoint& p, const IcePoint& n) { Set(p, n); }
//! Constructor from three points
- inline_ Plane(const IcePoint& p0, const IcePoint& p1, const IcePoint& p2) { Set(p0, p1, p2); }
+ inline_ IcePlane(const IcePoint& p0, const IcePoint& p1, const IcePoint& p2) { Set(p0, p1, p2); }
//! Constructor from a normal and a distance
- inline_ Plane(const IcePoint& _n, float _d) { n = _n; d = _d; }
+ inline_ IcePlane(const IcePoint& _n, float _d) { n = _n; d = _d; }
//! Copy constructor
- inline_ Plane(const Plane& plane) : n(plane.n), d(plane.d) { }
+ inline_ IcePlane(const IcePlane& plane) : n(plane.n), d(plane.d) { }
//! Destructor
- inline_ ~Plane() { }
+ inline_ ~IcePlane() { }
- inline_ Plane& Zero() { n.Zero(); d = 0.0f; return *this; }
- inline_ Plane& Set(float nx, float ny, float nz, float _d) { n.Set(nx, ny, nz); d = _d; return *this; }
- inline_ Plane& Set(const IcePoint& p, const IcePoint& _n) { n = _n; d = - p | _n; return *this; }
- Plane& Set(const IcePoint& p0, const IcePoint& p1, const IcePoint& p2);
+ inline_ IcePlane& Zero() { n.Zero(); d = 0.0f; return *this; }
+ inline_ IcePlane& Set(float nx, float ny, float nz, float _d) { n.Set(nx, ny, nz); d = _d; return *this; }
+ inline_ IcePlane& Set(const IcePoint& p, const IcePoint& _n) { n = _n; d = - p | _n; return *this; }
+ IcePlane& Set(const IcePoint& p0, const IcePoint& p1, const IcePoint& p2);
inline_ float Distance(const IcePoint& p) const { return (p | n) + d; }
inline_ bool Belongs(const IcePoint& p) const { return fabsf(Distance(p)) < PLANE_EPSILON; }
@@ -58,14 +58,14 @@
inline_ operator HPoint() const { return HPoint(n, d); }
// Arithmetic operators
- inline_ Plane operator*(const Matrix4x4& m) const
+ inline_ IcePlane operator*(const Matrix4x4& m) const
{
// Old code from Irion. Kept for reference.
- Plane Ret(*this);
+ IcePlane Ret(*this);
return Ret *= m;
}
- inline_ Plane& operator*=(const Matrix4x4& m)
+ inline_ IcePlane& operator*=(const Matrix4x4& m)
{
// Old code from Irion. Kept for reference.
IcePoint n2 = HPoint(n, 0.0f) * m;
@@ -77,14 +77,14 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
- * Transforms a plane by a 4x4 matrix. Same as Plane * Matrix4x4 operator, but faster.
+ * Transforms a plane by a 4x4 matrix. Same as IcePlane * Matrix4x4 operator, but faster.
* \param transformed [out] transformed plane
* \param plane [in] source plane
* \param transform [in] transform matrix
* \warning the plane normal must be unit-length
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- inline_ void TransformPlane(Plane& transformed, const Plane& plane, const Matrix4x4& transform)
+ inline_ void TransformPlane(IcePlane& transformed, const IcePlane& plane, const Matrix4x4& transform)
{
// Rotate the normal using the rotation part of the 4x4 matrix
transformed.n = plane.n * Matrix3x3(transform);
@@ -95,13 +95,13 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
- * Transforms a plane by a 4x4 matrix. Same as Plane * Matrix4x4 operator, but faster.
+ * Transforms a plane by a 4x4 matrix. Same as IcePlane * Matrix4x4 operator, but faster.
* \param plane [in/out] source plane (transformed on return)
* \param transform [in] transform matrix
* \warning the plane normal must be unit-length
*/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- inline_ void TransformPlane(Plane& plane, const Matrix4x4& transform)
+ inline_ void TransformPlane(IcePlane& plane, const Matrix4x4& transform)
{
// Rotate the normal using the rotation part of the 4x4 matrix
plane.n *= Matrix3x3(transform);