#include <gauge3d/3dmath/plane.h>
Public Methods | |
GPlane () | |
Creates an uninitialized plane. | |
GPlane (const GVector &point,const GVector &normal) | |
Creates a plane with the given normal that contains the given point. | |
GPlane (const GVector &normal,GCoordinate _d) | |
Initialized n and d to the given values. | |
bool | IsFacing (const GVector &point)const |
Returns true if the plane is facing the point. More... | |
bool | FindIntersection (GVector *result,const GLine &line)const |
Finds the intersection between the plane and a line. More... | |
bool | FindIntersection (GLine *result,const GPlane &other)const |
Finds the intersection between two planes. More... | |
bool | FindIntersection (GVector *result,const GPlane &other1,GPlane &other2)const |
Finds the intersection between three planes. More... | |
bool | Contains (const GVector &point)const |
Returns true if the point is on the plane. | |
GCoordinate | FindDistance (const GVector &point)const |
Finds the shortest distance between the plane and the point. | |
GCoordinate | FindSquareDistance (const GVector &point)const |
Finds the square of the shortest distance between the plane and the point (faster). More... | |
const GPlane& | operator+= (const GVector &vec) |
Moves the plane a certain distance. | |
const GPlane& | operator-= (const GVector &vec) |
Moves the plane a certain distance. | |
Public Attributes | |
GVector | n |
Normal vector to plane. | |
GCoordinate | d |
Umm... d... it's d... yeah... |
The plane is represented as a normal vector and a scalar so that n * p + d = 0 for all points p on the plane.
|
Returns true if the plane is facing the point. The plane is considered to be "facing" the point if the normal vector of the plane points in the direction of the point from any point on the plane. In other (non-)words: (point * n + d >= 0) |
|
Finds the intersection between the plane and a line.
|
|
Finds the intersection between two planes.
|
|
Finds the intersection between three planes.
|
|
Finds the square of the shortest distance between the plane and the point (faster). This is faster because the square root of the result does not need to be found. |