Irrlicht 3D Engine
irr::core::plane3d< T > Class Template Reference

Template plane class with some intersection testing methods. More...

#include <plane3d.h>

List of all members.

Public Member Functions

Public Attributes


Detailed Description

template<class T>
class irr::core::plane3d< T >

Template plane class with some intersection testing methods.

It has to be ensured, that the normal is always normalized. The constructors and setters of this class will not ensure this automatically. So any normal passed in has to be normalized in advance. No change to the normal will be made by any of the class methods.

Definition at line 33 of file plane3d.h.


Constructor & Destructor Documentation

template<class T>
irr::core::plane3d< T >::plane3d ( ) [inline]

Definition at line 39 of file plane3d.h.

template<class T>
irr::core::plane3d< T >::plane3d ( const vector3d< T > &  MPoint,
const vector3d< T > &  Normal 
) [inline]

Definition at line 41 of file plane3d.h.

template<class T>
irr::core::plane3d< T >::plane3d ( px,
py,
pz,
nx,
ny,
nz 
) [inline]

Definition at line 43 of file plane3d.h.

template<class T>
irr::core::plane3d< T >::plane3d ( const vector3d< T > &  point1,
const vector3d< T > &  point2,
const vector3d< T > &  point3 
) [inline]

Definition at line 45 of file plane3d.h.

template<class T>
irr::core::plane3d< T >::plane3d ( const vector3d< T > &  normal,
const T  d 
) [inline]

Definition at line 48 of file plane3d.h.


Member Function Documentation

template<class T>
EIntersectionRelation3D irr::core::plane3d< T >::classifyPointRelation ( const vector3d< T > &  point) const [inline]

Classifies the relation of a point to this plane.

Parameters:
pointPoint to classify its relation.
Returns:
ISREL3D_FRONT if the point is in front of the plane, ISREL3D_BACK if the point is behind of the plane, and ISREL3D_PLANAR if the point is within the plane.

Definition at line 135 of file plane3d.h.

template<class T>
bool irr::core::plane3d< T >::existsIntersection ( const plane3d< T > &  other) const [inline]

Tests if there is an intersection with the other plane.

Returns:
True if there is a intersection.

Definition at line 162 of file plane3d.h.

template<class T>
T irr::core::plane3d< T >::getDistanceTo ( const vector3d< T > &  point) const [inline]

Get the distance to a point.

Note that this only works if the normal is normalized.

Definition at line 222 of file plane3d.h.

template<class T>
bool irr::core::plane3d< T >::getIntersectionWithLimitedLine ( const vector3d< T > &  linePoint1,
const vector3d< T > &  linePoint2,
vector3d< T > &  outIntersection 
) const [inline]

Get an intersection with a 3d line, limited between two 3d points.

Parameters:
linePoint1Point 1 of the line.
linePoint2Point 2 of the line.
outIntersectionPlace to store the intersection point, if there is one.
Returns:
True if there was an intersection, false if there was not.

Definition at line 121 of file plane3d.h.

template<class T>
bool irr::core::plane3d< T >::getIntersectionWithLine ( const vector3d< T > &  linePoint,
const vector3d< T > &  lineVect,
vector3d< T > &  outIntersection 
) const [inline]

Get an intersection with a 3d line.

Parameters:
lineVectVector of the line to intersect with.
linePointPoint of the line to intersect with.
outIntersectionPlace to store the intersection point, if there is one.
Returns:
True if there was an intersection, false if there was not.

Definition at line 86 of file plane3d.h.

Referenced by irr::core::plane3d< f32 >::getIntersectionWithLimitedLine(), and irr::core::plane3d< f32 >::getIntersectionWithPlanes().

template<class T>
bool irr::core::plane3d< T >::getIntersectionWithPlane ( const plane3d< T > &  other,
vector3d< T > &  outLinePoint,
vector3d< T > &  outLineVect 
) const [inline]

Intersects this plane with another.

Parameters:
otherOther plane to intersect with.
outLinePointBase point of intersection line.
outLineVectVector of intersection.
Returns:
True if there is a intersection, false if not.

Definition at line 173 of file plane3d.h.

Referenced by irr::core::plane3d< f32 >::getIntersectionWithPlanes().

template<class T>
bool irr::core::plane3d< T >::getIntersectionWithPlanes ( const plane3d< T > &  o1,
const plane3d< T > &  o2,
vector3d< T > &  outPoint 
) const [inline]
template<class T>
f32 irr::core::plane3d< T >::getKnownIntersectionWithLine ( const vector3d< T > &  linePoint1,
const vector3d< T > &  linePoint2 
) const [inline]

Get percentage of line between two points where an intersection with this plane happens.

Only useful if known that there is an intersection.

Parameters:
linePoint1Point1 of the line to intersect with.
linePoint2Point2 of the line to intersect with.
Returns:
Where on a line between two points an intersection with this plane happened. For example, 0.5 is returned if the intersection happened exactly in the middle of the two points.

Definition at line 107 of file plane3d.h.

Referenced by irr::scene::SViewFrustum::clipLine().

template<class T>
vector3d<T> irr::core::plane3d< T >::getMemberPoint ( ) const [inline]

Gets a member point of the plane.

Definition at line 155 of file plane3d.h.

Referenced by irr::core::CMatrix4< T >::transformPlane().

template<class T>
bool irr::core::plane3d< T >::isFrontFacing ( const vector3d< T > &  lookDirection) const [inline]

Test if the triangle would be front or backfacing from any point.

Thus, this method assumes a camera position from which the triangle is definitely visible when looking into the given direction. Note that this only works if the normal is Normalized. Do not use this method with points as it will give wrong results!

Parameters:
lookDirection,:Look direction.
Returns:
True if the plane is front facing and false if it is backfacing.

Definition at line 214 of file plane3d.h.

template<class T>
bool irr::core::plane3d< T >::operator!= ( const plane3d< T > &  other) const [inline]

Definition at line 54 of file plane3d.h.

template<class T>
bool irr::core::plane3d< T >::operator== ( const plane3d< T > &  other) const [inline]

Definition at line 52 of file plane3d.h.

template<class T>
void irr::core::plane3d< T >::recalculateD ( const vector3d< T > &  MPoint) [inline]

Recalculates the distance from origin by applying a new member point to the plane.

Definition at line 149 of file plane3d.h.

Referenced by irr::core::plane3d< f32 >::plane3d(), and irr::core::plane3d< f32 >::setPlane().

template<class T>
void irr::core::plane3d< T >::setPlane ( const vector3d< T > &  point,
const vector3d< T > &  nvector 
) [inline]
template<class T>
void irr::core::plane3d< T >::setPlane ( const vector3d< T > &  nvect,
d 
) [inline]

Definition at line 64 of file plane3d.h.

template<class T>
void irr::core::plane3d< T >::setPlane ( const vector3d< T > &  point1,
const vector3d< T > &  point2,
const vector3d< T > &  point3 
) [inline]

Definition at line 70 of file plane3d.h.


Member Data Documentation


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