#include <plane.h>
Collaboration diagram for salt::Plane:
Public Member Functions | |
f_inline | Plane () |
empty constructor for an undefined plane | |
f_inline | Plane (const Vector3f &norm, const Vector3f &pnt) |
constructs a plane from a normal and a point on the plane | |
f_inline | Plane (const Vector3f &norm, const float D) |
constructs a plane from normal and constant D. | |
f_inline | Plane (const Vector3f &v1, const Vector3f &v2, const Vector3f &v3) |
constructs a plane from 3 distinct points | |
f_inline EPlaneSide | GetOrientation (const Vector3f &v, float delta=0.0001f) const |
calculates the orientation of v to the plane | |
f_inline EPlane | GetDominantPlane () const |
calculates the dominant plane | |
f_inline float | GetDistanceTo (const Vector3f &v) const |
calculates the distance from v to the plane | |
EPlaneSide | ClassifyBox (const AABB3 &bb) const |
calculates the relationship between the plane and the box | |
void | Normalize () |
normalizes the plane | |
f_inline void | Set (const Vector3f &norm, const Vector3f &pnt) |
sets up a plane from a normal and a point on the plane | |
f_inline void | Set (const Vector3f &norm, const float D) |
sets up a plane from normal and constant D. | |
f_inline void | Set (const Vector3f &v1, const Vector3f &v2, const Vector3f &v3) |
sets up a plane from 3 distinct points | |
f_inline const Plane & | operator= (const Plane &p) |
the assignment operator for planes | |
Public Attributes | |
Vector3f | normal |
the normal vector of the modeled plane | |
float | d |
the distance |
It can be used to classify points against planes (in front, on plane, etc...). Several useful functions for constructing a plane are provided. A plane is defined by the formula. Ax+By+Cz+D=0. The vector formed by the coefficients <A,B,C> is the normal vector to the plane.
Definition at line 71 of file plane.h.
|
empty constructor for an undefined plane
|
|
constructs a plane from a normal and a point on the plane
Definition at line 87 of file plane.h. References d, normal, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z(). Here is the call graph for this function: ![]() |
|
constructs a plane from normal and constant D. If normal is a unit vector, then D is the distance to the origin |
|
constructs a plane from 3 distinct points
Definition at line 95 of file plane.h. References salt::TVector3< DATATYPE, TYPE >::Cross(), d, salt::TVector< DATATYPE, ELEMENTS, TYPE >::Dot(), normal, and salt::TVector< DATATYPE, ELEMENTS, TYPE >::Normalized(). Here is the call graph for this function: ![]() |
|
calculates the relationship between the plane and the box
Definition at line 25 of file plane.cpp. References GetOrientation(), salt::AABB3::maxVec, salt::AABB3::minVec, normal, salt::PLANESIDE_BACK, salt::PLANESIDE_FRONT, salt::PLANESIDE_SPLIT, salt::TVector3< DATATYPE, TYPE >::Set(), salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z(). Referenced by salt::Frustum::Intersects(). Here is the call graph for this function: ![]() |
|
calculates the distance from v to the plane
Definition at line 106 of file plane.h. References d, salt::TVector< DATATYPE, ELEMENTS, TYPE >::Dot(), and normal. Here is the call graph for this function: ![]() |
|
calculates the dominant plane
Definition at line 103 of file plane.h. References salt::gAbs(), normal, salt::PLANE_XY, salt::PLANE_XZ, salt::PLANE_YZ, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z(). Here is the call graph for this function: ![]() |
|
calculates the orientation of v to the plane
Definition at line 100 of file plane.h. References d, salt::TVector< DATATYPE, ELEMENTS, TYPE >::Dot(), normal, salt::PLANESIDE_BACK, salt::PLANESIDE_FRONT, and salt::PLANESIDE_ONPLANE. Referenced by ClassifyBox(). Here is the call graph for this function: ![]() |
|
normalizes the plane
Definition at line 86 of file plane.cpp. References d, salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), normal, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z(). Referenced by oxygen::Camera::DescribeFrustum(), and salt::Frustum::Set(). Here is the call graph for this function: ![]() |
|
the assignment operator for planes
|
|
sets up a plane from 3 distinct points
Definition at line 126 of file plane.h. References salt::TVector3< DATATYPE, TYPE >::Cross(), d, salt::TVector< DATATYPE, ELEMENTS, TYPE >::Dot(), normal, and salt::TVector< DATATYPE, ELEMENTS, TYPE >::Normalized(). Here is the call graph for this function: ![]() |
|
sets up a plane from normal and constant D. If normal is a unit vector, then D is the distance to the origin |
|
sets up a plane from a normal and a point on the plane
Definition at line 117 of file plane.h. References d, normal, salt::TVector3< DATATYPE, TYPE >::x(), salt::TVector3< DATATYPE, TYPE >::y(), and salt::TVector3< DATATYPE, TYPE >::z(). Here is the call graph for this function: ![]() |
|
the distance
Definition at line 79 of file plane.h. Referenced by oxygen::Camera::DescribeFrustum(), salt::Frustum::Dump(), GetDistanceTo(), GetOrientation(), Normalize(), operator=(), Plane(), Set(), and salt::Frustum::Set(). |
|
the normal vector of the modeled plane
Definition at line 76 of file plane.h. Referenced by ClassifyBox(), oxygen::Camera::DescribeFrustum(), salt::Frustum::Dump(), GetDistanceTo(), GetDominantPlane(), GetOrientation(), Normalize(), operator=(), Plane(), Set(), and salt::Frustum::Set(). |