Go to the documentation of this file.00001
00002
00003 #ifndef _PLANE_3D_H_
00004 #define _PLANE_3D_H_
00005
00006 #include <core/Types.h>
00007 #include <core/Vector3d.h>
00008
00009 namespace core
00010 {
00011
00013 class ENGINE_PUBLIC_EXPORT plane3d
00014 {
00015 public:
00016
00017 plane3d();
00018 plane3d(f32 px, f32 py, f32 pz, f32 nx, f32 ny, f32 nz);
00019 plane3d(const vector3d& point1, const vector3d& point2, const vector3d& point3);
00020 plane3d(const vector3d& MPoint, const vector3d& Normal);
00021 plane3d(const plane3d& other);
00022
00023 inline bool operator==(const plane3d& other) const;
00024 inline bool operator!=(const plane3d& other) const;
00025
00026 void setPlane(const vector3d& point, const vector3d& nvector);
00027
00028 void setPlane(const vector3d& nvect, f32 d);
00029
00030 void setPlane(const vector3d& point1, const vector3d& point2, const vector3d& point3);
00031
00034 void recalculateD(const vector3d& MPoint);
00035
00037 vector3d getMemberPoint() const;
00038
00044 bool isFrontFacing(const vector3d& lookDirection) const;
00045
00048 f32 getDistanceTo(const vector3d& point) const;
00049
00054 bool getIntersectionWithLine(const vector3d& linePoint, const vector3d& lineVect, vector3d& outIntersection) const;
00055
00060 bool getIntersectionWithPlane(const plane3d& other, vector3d& outLinePoint, vector3d& outLineVect) const;
00061
00063 bool getIntersectionWithPlanes(const plane3d& o1, const plane3d& o2, vector3d& outPoint) const;
00064
00065 vector3d Normal;
00066 f32 D;
00067 };
00068
00069 }
00070
00071 #endif