![]() |
Public API Reference |
#include <plane2.h>
Public Methods | |
csPlane2 () | |
Initialize to the xy plane. More... | |
csPlane2 (const csVector2 &plane_norm, float c=0) | |
Initialize the plane. More... | |
csPlane2 (float a, float b, float c=0) | |
Initialize the plane. More... | |
void | Set (const csVector2 &v1, const csVector2 &v2) |
Initialize the plane given two vectors. More... | |
void | Set (const csSegment2 &s) |
Initialize the plane given a segment. More... | |
csPlane2 (const csVector2 &v1, const csVector2 &v2) | |
Initialize the plane given two vectors. More... | |
csPlane2 (const csSegment2 &s) | |
Initialize the plane given a segment. More... | |
csVector2 & | Normal () |
Return the normal vector of this plane. More... | |
csVector2 | GetNormal () const |
Return the normal vector of this plane (const version). More... | |
float | A () const |
Return the A component of this plane. More... | |
float | B () const |
Return the B component of this plane. More... | |
float | C () const |
Return the C component of this plane. More... | |
float & | A () |
Return the A component of this plane. More... | |
float & | B () |
Return the B component of this plane. More... | |
float & | C () |
Return the C component of this plane. More... | |
void | Set (float a, float b, float c) |
Set the value of the four plane components. More... | |
float | Classify (const csVector2 &pt) const |
Classify the given vector with regards to this plane. More... | |
float | Distance (const csVector2 &pt) const |
Compute the distance from the given vector to this plane. More... | |
float | SquaredDistance (const csVector2 &pt) const |
Compute the squared distance between the given vector and this plane. More... | |
void | Invert () |
Reverses the direction of the plane while maintianing the plane itself. More... | |
void | Normalize () |
Normalizes the plane equation so that 'norm' is a unit vector. More... | |
Static Public Methods | |
float | Classify (float A, float B, float C, const csVector2 &pt) |
Classify a vector with regards to three plane components. More... | |
Public Attributes | |
csVector2 | norm |
The normal vector (or the (A,B) components). More... | |
float | CC |
The C component of the plane. More... |
The plane is given by the equation AAx + BBy + CCz + DD = 0, Where (AA,BB,CC) is given by the vector 'norm'.
Definition at line 43 of file plane2.h.
|
Initialize to the xy plane.
Definition at line 53 of file plane2.h. References CC. |
|
Initialize the plane.
Definition at line 56 of file plane2.h. References CC. |
|
Initialize the plane.
Definition at line 59 of file plane2.h. References CC. |
|
Initialize the plane given two vectors.
Definition at line 76 of file plane2.h. References Set. |
|
Initialize the plane given a segment.
Definition at line 82 of file plane2.h. References Set. |
|
Return the A component of this plane.
Definition at line 101 of file plane2.h. References csVector2::x. |
|
Return the A component of this plane.
Definition at line 94 of file plane2.h. References csVector2::x. Referenced by Classify. |
|
Return the B component of this plane.
Definition at line 103 of file plane2.h. References csVector2::y. |
|
Return the B component of this plane.
Definition at line 96 of file plane2.h. References csVector2::y. Referenced by Classify. |
|
Return the C component of this plane.
Definition at line 105 of file plane2.h. References CC. |
|
Return the C component of this plane.
Definition at line 98 of file plane2.h. References CC. Referenced by Classify. |
|
Classify a vector with regards to three plane components.
Definition at line 115 of file plane2.h. References A, B, C, csVector2::x, and csVector2::y. |
|
Classify the given vector with regards to this plane.
Definition at line 112 of file plane2.h. References CC. Referenced by Distance, SquaredDistance, and csMath2::Visible. |
|
Compute the distance from the given vector to this plane. This function assumes that 'norm' is a unit vector. If not, the function returns distance times the magnitude of 'norm'. Definition at line 124 of file plane2.h. References Classify. |
|
Return the normal vector of this plane (const version).
|
|
Reverses the direction of the plane while maintianing the plane itself.
Definition at line 139 of file plane2.h. References CC. |
|
Return the normal vector of this plane.
|
|
Normalizes the plane equation so that 'norm' is a unit vector.
Definition at line 142 of file plane2.h. References CC, and csVector2::Norm. |
|
Set the value of the four plane components.
Definition at line 108 of file plane2.h. References CC, csVector2::x, and csVector2::y. |
|
Initialize the plane given a segment.
Definition at line 70 of file plane2.h. References csSegment2::End, Set, and csSegment2::Start. |
|
Initialize the plane given two vectors.
Definition at line 62 of file plane2.h. References CC, csVector2::x, and csVector2::y. |
|
Compute the squared distance between the given vector and this plane. This function works even if the plane is not normalized. Note that the returned distance will be negative if the point is left of the plane and positive otherwise. Definition at line 133 of file plane2.h. References Classify, and csVector2::SquaredNorm. |
|
The C component of the plane.
Definition at line 50 of file plane2.h. Referenced by C, Classify, csPlane2, Invert, Normalize, csIntersect2::PlaneNoTest, csMath2::PlanesEqual, and Set. |
|
The normal vector (or the (A,B) components).
Definition at line 47 of file plane2.h. Referenced by csIntersect2::PlaneNoTest, and csMath2::PlanesEqual. |