Plane Class Reference

Plane in 3D space. More...

#include <Plane.h>

Collaboration diagram for Plane:

Collaboration graph
[legend]
List of all members.

Public Types

enum  PointClassification { PLANE_FRONT, PLANE_COINCIDE, PLANE_BACK }

Public Member Functions

 Plane (const Vector<> &aPoint, const Vector<> &aV1, const Vector<> &aV2)
 Construct a plane from two direction vectors and a point.
 Plane (const Vector<> &aPoint, const Vector<> &aNormal)
 Construct a plane from a point and a normal vector.
bool contains (const Vector<> &aPoint) const
 Checks whether the plane contains a given point.
Vector normal () const
 Returns the normal vector of this plane.
PointClassification classify (const Vector<> &aPoint) const
 Determines the position of the point relative to the plane.
std::auto_ptr< Vector<> > intersect (const Vector<> &point, const Vector<> &dir) const
 Checks whether the plane intersects the straight line defined by point and dir.
Planeoperator+= (const Vector<> &v)

Private Member Functions

void calcNP ()

Private Attributes

Vector mPoint
Vector mNormal
float mNTimesP
 Stores N*P for faster access.

Detailed Description

Plane in 3D space.

Corresponds to the equation: $ ax + by + cz = d $ , for $ a,b,c \in {\sf R\hspace*{-0.9ex}\rule{0.15ex}{1.5ex}\hspace*{0.9ex}} $

Or, alternatively: $ NX = NP$ for $N, P, X \in {\sf R\hspace*{-0.9ex}\rule{0.15ex}{1.5ex}\hspace*{0.9ex}}^3 $

Or: $ X = P + s * V_1 + t * V_2 $ for all $s, t$ .


Member Enumeration Documentation

enum Plane::PointClassification
 

Enumerator:
PLANE_FRONT  Point is in front of plane.
PLANE_COINCIDE  Point lies on the plane.
PLANE_BACK  Point is in the back of the plane.


Constructor & Destructor Documentation

Plane::Plane const Vector<> &  aPoint,
const Vector<> &  aV1,
const Vector<> &  aV2
 

Construct a plane from two direction vectors and a point.

Plane::Plane const Vector<> &  aPoint,
const Vector<> &  aNormal
 

Construct a plane from a point and a normal vector.


Member Function Documentation

void Plane::calcNP  )  [private]
 

Plane::PointClassification Plane::classify const Vector<> &  aPoint  )  const
 

Determines the position of the point relative to the plane.

bool Plane::contains const Vector<> &  aPoint  )  const
 

Checks whether the plane contains a given point.

std::auto_ptr< Vector<> > Plane::intersect const Vector<> &  point,
const Vector<> &  dir
const
 

Checks whether the plane intersects the straight line defined by point and dir.

Return values:
NULL No intersection
<other> Intersection point

Vector Plane::normal  )  const [inline]
 

Returns the normal vector of this plane.

Plane& Plane::operator+= const Vector<> &  v  )  [inline]
 


Member Data Documentation

Vector Plane::mNormal [private]
 

float Plane::mNTimesP [private]
 

Stores N*P for faster access.

Vector Plane::mPoint [private]
 


The documentation for this class was generated from the following files:
Generated on Mon Dec 19 00:13:44 2005 for Visualization by  doxygen 1.4.5