Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Public Attributes | List of all members
om::math::Plane3D< T > Class Template Reference

A class that represents a plane in 3D space. More...

#include <omPlane3D.h>

Public Member Functions

 Plane3D ()
 Create a plane in 3D space with the normal pointing along the positive Z axis with offset = 0. More...
 
 Plane3D (const VectorND< T, 3 > &planeNormal, T planeOffset)
 Create a plane in 3D space with the specified normal and offset from the origin. More...
 
 Plane3D (const VectorND< T, 3 > &planeNormal, const VectorND< T, 3 > &pointOnPlane)
 Create a plane in 3D space from the specified normal and point on the plane. More...
 
 Plane3D (const VectorND< T, 3 > &p1, const VectorND< T, 3 > &p2, const VectorND< T, 3 > &p3)
 Create a plane in 3D space from three points in that plane. More...
 
getDistanceTo (const VectorND< T, 3 > &point) const
 Get the perpendicular distance from the specified point to the plane. More...
 
getSignedDistanceTo (const VectorND< T, 3 > &point) const
 Get the perpendicular distance from the specified point to the plane. More...
 
VectorND< T, 3 > getProjection (const VectorND< T, 3 > &point) const
 Return the projection of the given point onto the plane. More...
 
VectorND< T, 3 > getProjectionNormalized (const VectorND< T, 3 > &point) const
 Return the projection of the given point onto the plane. More...
 
VectorND< T, 3 > getVectorProjection (const VectorND< T, 3 > &vector) const
 Return the projection of the given point onto the plane. More...
 
VectorND< T, 3 > getVectorProjectionNormalized (const VectorND< T, 3 > &vector) const
 Return the projection of the given point onto the plane. More...
 
VectorND< T, 3 > getReflection (const VectorND< T, 3 > &point) const
 Get the reflection of a point over the plane. More...
 
VectorND< T, 3 > getReflectionNormalized (const VectorND< T, 3 > &point) const
 Get the reflection of a point over the plane. More...
 
VectorND< T, 3 > getVectorReflection (const VectorND< T, 3 > &vector) const
 Return the specular reflection of a vector off the plane. More...
 
VectorND< T, 3 > getVectorReflectionNormalized (const VectorND< T, 3 > &vector) const
 Return the specular reflection of a vector off the plane, if the plane has a unit normal vector. More...
 
Plane3D normalize () const
 Normalize the plane's normal vector and correct the offset to match. More...
 
Plane3D operator- () const
 Return the plane with the opposite normal vector and offset. More...
 

Public Attributes

VectorND< T, 3 > normal
 A vector perpendicular to the plane. More...
 
offset
 The distance that the plane is offset from the origin. More...
 

Detailed Description

template<typename T>
class om::math::Plane3D< T >

A class that represents a plane in 3D space.

It uses the normal and offset plane representation as it is the most universally useful in computational mathematics, especially relating to graphics and geometry.

Constructor & Destructor Documentation

template<typename T>
om::math::Plane3D< T >::Plane3D ( )
inline

Create a plane in 3D space with the normal pointing along the positive Z axis with offset = 0.

template<typename T>
om::math::Plane3D< T >::Plane3D ( const VectorND< T, 3 > &  planeNormal,
planeOffset 
)
inline

Create a plane in 3D space with the specified normal and offset from the origin.

template<typename T>
om::math::Plane3D< T >::Plane3D ( const VectorND< T, 3 > &  planeNormal,
const VectorND< T, 3 > &  pointOnPlane 
)
inline

Create a plane in 3D space from the specified normal and point on the plane.

template<typename T>
om::math::Plane3D< T >::Plane3D ( const VectorND< T, 3 > &  p1,
const VectorND< T, 3 > &  p2,
const VectorND< T, 3 > &  p3 
)
inline

Create a plane in 3D space from three points in that plane.

Member Function Documentation

template<typename T>
T om::math::Plane3D< T >::getDistanceTo ( const VectorND< T, 3 > &  point) const
inline

Get the perpendicular distance from the specified point to the plane.

template<typename T>
T om::math::Plane3D< T >::getSignedDistanceTo ( const VectorND< T, 3 > &  point) const
inline

Get the perpendicular distance from the specified point to the plane.

template<typename T>
VectorND<T,3> om::math::Plane3D< T >::getProjection ( const VectorND< T, 3 > &  point) const
inline

Return the projection of the given point onto the plane.

template<typename T>
VectorND<T,3> om::math::Plane3D< T >::getProjectionNormalized ( const VectorND< T, 3 > &  point) const
inline

Return the projection of the given point onto the plane.

The plane is assumed to have a normal vector of unit length. This results in a significantly faster function, however the results are meaningless if the precondition is not met.

template<typename T>
VectorND<T,3> om::math::Plane3D< T >::getVectorProjection ( const VectorND< T, 3 > &  vector) const
inline

Return the projection of the given point onto the plane.

template<typename T>
VectorND<T,3> om::math::Plane3D< T >::getVectorProjectionNormalized ( const VectorND< T, 3 > &  vector) const
inline

Return the projection of the given point onto the plane.

The plane is assumed to have a normal vector of unit length. This results in a significantly faster function, however the results are meaningless if the precondition is not met.

template<typename T>
VectorND<T,3> om::math::Plane3D< T >::getReflection ( const VectorND< T, 3 > &  point) const
inline

Get the reflection of a point over the plane.

template<typename T>
VectorND<T,3> om::math::Plane3D< T >::getReflectionNormalized ( const VectorND< T, 3 > &  point) const
inline

Get the reflection of a point over the plane.

The plane is assumed to have a normal vector of unit length. This results in a significantly faster function, however the results are meaningless if the precondition is not met.

template<typename T>
VectorND<T,3> om::math::Plane3D< T >::getVectorReflection ( const VectorND< T, 3 > &  vector) const
inline

Return the specular reflection of a vector off the plane.

template<typename T>
VectorND<T,3> om::math::Plane3D< T >::getVectorReflectionNormalized ( const VectorND< T, 3 > &  vector) const
inline

Return the specular reflection of a vector off the plane, if the plane has a unit normal vector.

The plane is assumed to have a normal vector of unit length. This results in a significantly faster function, however the results are meaningless if the precondition is not met.

template<typename T>
Plane3D om::math::Plane3D< T >::normalize ( ) const
inline

Normalize the plane's normal vector and correct the offset to match.

template<typename T>
Plane3D om::math::Plane3D< T >::operator- ( ) const
inline

Return the plane with the opposite normal vector and offset.

This plane is mathematically the same as the original plane.

Member Data Documentation

template<typename T>
VectorND<T,3> om::math::Plane3D< T >::normal

A vector perpendicular to the plane.

template<typename T>
T om::math::Plane3D< T >::offset

The distance that the plane is offset from the origin.


The documentation for this class was generated from the following file: