Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Plane< T > Class Template Reference

#include <plane.h>

Inheritance diagram for Plane< T >:

Inheritance graph
Collaboration diagram for Plane< T >:

Collaboration graph
List of all members.

Public Member Functions

distanceTo (const Point3< T > &) const
 Plane (const Vector3< T > &, const Point3< T > &)
 Plane (const Vector3< T > &, T)
 Plane (const Plane< T > &)
 Plane ()

Static Public Member Functions

static Point3< T > intersection (const Plane< T > &, const Plane< T > &, const Plane< T > &)

Public Attributes

d
Vector3< T > normal

template<class T>
class Plane< T >


Constructor & Destructor Documentation

template<class T>
Plane< T >::Plane  )  [inline]
 

Definition at line 41 of file plane.h.

00041                                   : normal(0, 0, 1), d(0)
00042 {
00043 }

template<class T>
Plane< T >::Plane const Plane< T > &   )  [inline]
 

Definition at line 45 of file plane.h.

00045                                                    :
00046     normal(p.normal), d(p.d)
00047 {
00048 }

template<class T>
Plane< T >::Plane const Vector3< T > &  ,
[inline]
 

Definition at line 50 of file plane.h.

00050                                                                  :
00051     normal(_normal), d(_d)
00052 {
00053 }

template<class T>
Plane< T >::Plane const Vector3< T > &  ,
const Point3< T > & 
[inline]
 

Definition at line 55 of file plane.h.

References Plane< T >::d.

00055                                                                                     :
00056     normal(_normal)
00057 {
00058     d = _normal.x * _point.x + _normal.y * _point.y + _normal.z * _point.z;
00059 }


Member Function Documentation

template<class T>
T Plane< T >::distanceTo const Point3< T > &   )  const
 

Definition at line 61 of file plane.h.

References Plane< T >::d, and Plane< T >::normal.

Referenced by LODSphereMesh::renderPatches(), and Frustum::testSphere().

00062 {
00063     return normal.x * p.x + normal.y * p.y + normal.z * p.z + d;
00064 }

template<class T>
Point3< T > Plane< T >::intersection const Plane< T > &  ,
const Plane< T > &  ,
const Plane< T > & 
[static]
 

Definition at line 78 of file plane.h.

References cross(), Plane< T >::d, Vector3< T >::x, Vector3< T >::y, and Vector3< T >::z.

00081 {
00082     T d = Matrix3<T>(p0.normal, p1.normal, p2.normal).determinant();
00083 
00084     Vector3<T> v = (p0.d * cross(p1.normal, p2.normal) +
00085                     p1.d * cross(p2.normal, p0.normal) +
00086                     p2.d * cross(p0.normal, p1.normal)) * (1.0f / d);
00087     return Point3<T>(v.x, v.y, v.z);
00088 }


Member Data Documentation

template<class T>
T Plane< T >::d
 

Definition at line 33 of file plane.h.

Referenced by Plane< T >::distanceTo(), Plane< T >::intersection(), Plane< T >::Plane(), Frustum::testSphere(), and Frustum::transform().

template<class T>
Vector3<T> Plane< T >::normal
 

Definition at line 32 of file plane.h.

Referenced by Plane< T >::distanceTo(), Frustum::testSphere(), and Frustum::transform().


The documentation for this class was generated from the following file:
Generated on Sat Jan 14 22:33:31 2006 for Celestia by  doxygen 1.4.1