csPlane2 Class Reference
[Geometry utilities]
A plane in 2D space.
More...
#include <plane2.h>
Public Methods | |
csPlane2 () | |
Initialize to the xy plane. | |
csPlane2 (const csVector2 &plane_norm, float c=0) | |
Initialize the plane. | |
csPlane2 (float a, float b, float c=0) | |
Initialize the plane. | |
void | Set (const csVector2 &v1, const csVector2 &v2) |
Initialize the plane given two vectors. | |
void | Set (const csSegment2 &s) |
Initialize the plane given a segment. | |
csPlane2 (const csVector2 &v1, const csVector2 &v2) | |
Initialize the plane given two vectors. | |
csPlane2 (const csSegment2 &s) | |
Initialize the plane given a segment. | |
csVector2 & | Normal () |
Return the normal vector of this plane. | |
csVector2 | GetNormal () const |
Return the normal vector of this plane (const version). | |
float | A () const |
Return the A component of this plane. | |
float | B () const |
Return the B component of this plane. | |
float | C () const |
Return the C component of this plane. | |
float & | A () |
Return the A component of this plane. | |
float & | B () |
Return the B component of this plane. | |
float & | C () |
Return the C component of this plane. | |
void | Set (float a, float b, float c) |
Set the value of the four plane components. | |
float | Classify (const csVector2 &pt) const |
Classify the given vector with regards to this plane. | |
float | Distance (const csVector2 &pt) const |
Compute the distance from the given vector to this plane. | |
float | SquaredDistance (const csVector2 &pt) const |
Compute the squared distance between the given vector and this plane. | |
void | Invert () |
Reverses the direction of the plane while maintianing the plane itself. | |
void | Normalize () |
Normalizes the plane equation so that 'norm' is a unit vector. | |
Static Public Methods | |
float | Classify (float A, float B, float C, const csVector2 &pt) |
Classify a vector with regards to three plane components. | |
Public Attributes | |
csVector2 | norm |
The normal vector (or the (A,B) components). | |
float | CC |
The C component of the plane. |
Detailed Description
A plane in 2D space.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 49 of file plane2.h.
Constructor & Destructor Documentation
|
Initialize to the xy plane.
Definition at line 59 of file plane2.h. References CC. |
|
Initialize the plane.
Definition at line 62 of file plane2.h. References CC. |
|
Initialize the plane.
Definition at line 65 of file plane2.h. References CC. |
|
Initialize the plane given two vectors.
Definition at line 82 of file plane2.h. References Set(). |
|
Initialize the plane given a segment.
Definition at line 88 of file plane2.h. References Set(). |
Member Function Documentation
|
Return the A component of this plane.
Definition at line 107 of file plane2.h. References csVector2::x. |
|
Return the A component of this plane.
Definition at line 100 of file plane2.h. References csVector2::x. Referenced by Classify(). |
|
Return the B component of this plane.
Definition at line 109 of file plane2.h. References csVector2::y. |
|
Return the B component of this plane.
Definition at line 102 of file plane2.h. References csVector2::y. Referenced by Classify(). |
|
Return the C component of this plane.
Definition at line 111 of file plane2.h. References CC. |
|
Return the C component of this plane.
Definition at line 104 of file plane2.h. References CC. Referenced by Classify(). |
|
Classify a vector with regards to three plane components.
Definition at line 121 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 118 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 130 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 145 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 148 of file plane2.h. References CC, and csVector2::Norm(). |
|
Set the value of the four plane components.
Definition at line 114 of file plane2.h. References CC, csVector2::x, and csVector2::y. |
|
Initialize the plane given a segment.
Definition at line 76 of file plane2.h. References csSegment2::End(), Set(), and csSegment2::Start(). |
|
Initialize the plane given two vectors.
Definition at line 68 of file plane2.h. References CC, csVector2::x, and csVector2::y. Referenced by csPlane2(), and Set(). |
|
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 139 of file plane2.h. References Classify(), and csVector2::SquaredNorm(). |
Member Data Documentation
|
The C component of the plane.
Definition at line 56 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 53 of file plane2.h. Referenced by csIntersect2::PlaneNoTest(), and csMath2::PlanesEqual(). |
The documentation for this class was generated from the following file:
- csgeom/plane2.h
Generated for Crystal Space by doxygen 1.2.18