struct Plane
{
Plane();
Plane(const Plane &P);
Plane(float _a, float _b, float _c, float _d);
Plane(const Vec3f &NormalizedNormal, float _d);
static Plane ConstructFromPointNormal(const Vec3f &Pt, const Vec3f &Normal); static Plane ConstructFromPointVectors(const Vec3f &Pt, const Vec3f &V1, const Vec3f &V2); static Plane ConstructFromPoints(const Vec3f &V1, const Vec3f &V2, const Vec3f &V3);
float UnsignedDistance(const Vec3f &Pt) const;
float SignedDistance(const Vec3f &Pt) const;
bool FitToPoints(const Vector<Vec3f> &Points, float &ResidualError);
bool FitToPoints(const Vector<Vec4f> &Points, Vec3f &Basis1, Vec3f &Basis2, float &NormalEigenvalue, float &ResidualError);
Vec3f ClosestPoint(const Vec3f &Point);
Vec3f IntersectLine(const Vec3f &V1, const Vec3f &V2) const; Vec3f IntersectLine(const Vec3f &V1, const Vec3f &V2, bool &Hit) const; float IntersectLineRatio(const Vec3f &V1, const Vec3f &V2); Vec3f IntersectLine(const Line3D &Line) const;
static float Dot(const Plane &P, const Vec4f &V); static float DotCoord(const Plane &P, const Vec3f &V); static float DotNormal(const Plane &P, const Vec3f &V);
Plane Normalize();
__forceinline Vec3f Plane::Normal() const
{
return Vec3f(a, b, c);
}
__forceinline Plane Flip()
{
Plane Result;
Result.a = -a;
Result.b = -b;
Result.c = -c;
Result.d = -d;
return Result;
}
static bool PlanePlaneIntersection(const Plane &P1, const Plane &P2, Line3D &L);
#ifdef USE_D3D
operator D3DXPLANE();
#endif
float a, b, c, d; };