Defines plane. More...
Public Member Functions | |
Plane (const Vec3 &p1, const Vec3 &p2, const Vec3 &p3) | |
Create plane from tree point. More... | |
Plane (const Vec3 &normal, float dist) | |
Create plane from normal and dist. More... | |
Plane (const Vec3 &normal, const Vec3 &point) | |
Create plane from normal and a point on plane. More... | |
Plane () | |
Create a default plan whose normal is (0, 0, 1), and _dist is 0, xoy plan in fact. | |
void | initPlane (const Vec3 &p1, const Vec3 &p2, const Vec3 &p3) |
Init plane from tree point. More... | |
void | initPlane (const Vec3 &normal, float dist) |
Init plane from normal and dist. More... | |
void | initPlane (const Vec3 &normal, const Vec3 &point) |
Init plane from normal and a point on plane. More... | |
float | dist2Plane (const Vec3 &p) const |
Get the specified point's distance to the plane. More... | |
const Vec3 & | getNormal () const |
Gets the plane's normal. More... | |
float | getDist () const |
Gets the distance which origin along its normal reach the plane. More... | |
PointSide | getSide (const Vec3 &point) const |
Return the side where the point is. More... | |
Defines plane.
Create plane from tree point.
The point #1 which's in the plane. The point #2 which's in the plane. The point #3 which's in the plane.
Create plane from normal and dist.
The normal vector of the plane. The distance from the origin along the normal.
Create plane from normal and a point on plane.
The normal vector of the plane. The point which's in the plane.
Init plane from tree point.
The point #1 which's in the plane. The point #2 which's in the plane. The point #3 which's in the plane.
void initPlane | ( | const Vec3 & | normal, |
float | dist | ||
) |
Init plane from normal and dist.
The normal vector of the plane. The distance from the origin.
Init plane from normal and a point on plane.
The normal vector of the plane. The point which's in the plane.
float dist2Plane | ( | const Vec3 & | p | ) | const |
Get the specified point's distance to the plane.
The specified point. The distance, > 0 in the normal side.
|
inline |
Gets the plane's normal.
The normal of the plane.
|
inline |
Gets the distance which origin along its normal reach the plane.
The distance to the origin.