Template plane class with some intersection testing methods. More...
#include <plane3d.h>
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.
irr::core::plane3d< T >::plane3d | ( | ) | [inline] |
irr::core::plane3d< T >::plane3d | ( | const vector3d< T > & | MPoint, |
const vector3d< T > & | Normal | ||
) | [inline] |
irr::core::plane3d< T >::plane3d | ( | T | px, |
T | py, | ||
T | pz, | ||
T | nx, | ||
T | ny, | ||
T | nz | ||
) | [inline] |
irr::core::plane3d< T >::plane3d | ( | const vector3d< T > & | point1, |
const vector3d< T > & | point2, | ||
const vector3d< T > & | point3 | ||
) | [inline] |
irr::core::plane3d< T >::plane3d | ( | const vector3d< T > & | normal, |
const T | d | ||
) | [inline] |
EIntersectionRelation3D irr::core::plane3d< T >::classifyPointRelation | ( | const vector3d< T > & | point | ) | const [inline] |
Classifies the relation of a point to this plane.
point | Point to classify its relation. |
bool irr::core::plane3d< T >::existsIntersection | ( | const plane3d< T > & | other | ) | const [inline] |
T irr::core::plane3d< T >::getDistanceTo | ( | const vector3d< T > & | point | ) | const [inline] |
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.
linePoint1 | Point 1 of the line. |
linePoint2 | Point 2 of the line. |
outIntersection | Place to store the intersection point, if there is one. |
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.
lineVect | Vector of the line to intersect with. |
linePoint | Point of the line to intersect with. |
outIntersection | Place to store the intersection point, if there is one. |
Definition at line 86 of file plane3d.h.
Referenced by irr::core::plane3d< f32 >::getIntersectionWithLimitedLine(), and irr::core::plane3d< f32 >::getIntersectionWithPlanes().
bool irr::core::plane3d< T >::getIntersectionWithPlane | ( | const plane3d< T > & | other, |
vector3d< T > & | outLinePoint, | ||
vector3d< T > & | outLineVect | ||
) | const [inline] |
Intersects this plane with another.
other | Other plane to intersect with. |
outLinePoint | Base point of intersection line. |
outLineVect | Vector of intersection. |
Definition at line 173 of file plane3d.h.
Referenced by irr::core::plane3d< f32 >::getIntersectionWithPlanes().
bool irr::core::plane3d< T >::getIntersectionWithPlanes | ( | const plane3d< T > & | o1, |
const plane3d< T > & | o2, | ||
vector3d< T > & | outPoint | ||
) | const [inline] |
Get the intersection point with two other planes if there is one.
Definition at line 195 of file plane3d.h.
Referenced by irr::scene::SViewFrustum::getFarLeftDown(), irr::scene::SViewFrustum::getFarLeftUp(), irr::scene::SViewFrustum::getFarRightDown(), irr::scene::SViewFrustum::getFarRightUp(), irr::scene::SViewFrustum::getNearLeftDown(), irr::scene::SViewFrustum::getNearLeftUp(), irr::scene::SViewFrustum::getNearRightDown(), and irr::scene::SViewFrustum::getNearRightUp().
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.
linePoint1 | Point1 of the line to intersect with. |
linePoint2 | Point2 of the line to intersect with. |
Definition at line 107 of file plane3d.h.
Referenced by irr::scene::SViewFrustum::clipLine().
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().
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!
lookDirection,: | Look direction. |
bool irr::core::plane3d< T >::operator!= | ( | const plane3d< T > & | other | ) | const [inline] |
bool irr::core::plane3d< T >::operator== | ( | const plane3d< T > & | other | ) | const [inline] |
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().
void irr::core::plane3d< T >::setPlane | ( | const vector3d< T > & | point, |
const vector3d< T > & | nvector | ||
) | [inline] |
Definition at line 58 of file plane3d.h.
Referenced by irr::core::plane3d< f32 >::plane3d(), and irr::core::CMatrix4< T >::transformPlane().
void irr::core::plane3d< T >::setPlane | ( | const vector3d< T > & | nvect, |
T | d | ||
) | [inline] |
void irr::core::plane3d< T >::setPlane | ( | const vector3d< T > & | point1, |
const vector3d< T > & | point2, | ||
const vector3d< T > & | point3 | ||
) | [inline] |
T irr::core::plane3d< T >::D |
Distance from origin.
Definition at line 231 of file plane3d.h.
Referenced by irr::core::CMatrix4< T >::buildShadowMatrix(), irr::core::aabbox3d< f32 >::classifyPlaneRelation(), irr::core::plane3d< f32 >::classifyPointRelation(), irr::core::plane3d< f32 >::getDistanceTo(), irr::core::plane3d< f32 >::getIntersectionWithLine(), irr::core::plane3d< f32 >::getIntersectionWithPlane(), irr::core::plane3d< f32 >::getKnownIntersectionWithLine(), irr::core::plane3d< f32 >::getMemberPoint(), irr::core::plane3d< f32 >::operator==(), irr::core::plane3d< f32 >::recalculateD(), irr::scene::SViewFrustum::setFrom(), and irr::core::plane3d< f32 >::setPlane().
vector3d<T> irr::core::plane3d< T >::Normal |
Normal vector of the plane.
Definition at line 228 of file plane3d.h.
Referenced by irr::core::CMatrix4< T >::buildShadowMatrix(), irr::core::aabbox3d< f32 >::classifyPlaneRelation(), irr::core::plane3d< f32 >::classifyPointRelation(), irr::core::plane3d< f32 >::existsIntersection(), irr::core::plane3d< f32 >::getDistanceTo(), irr::core::plane3d< f32 >::getIntersectionWithLine(), irr::core::plane3d< f32 >::getIntersectionWithPlane(), irr::core::plane3d< f32 >::getKnownIntersectionWithLine(), irr::core::plane3d< f32 >::getMemberPoint(), irr::core::plane3d< f32 >::isFrontFacing(), irr::core::plane3d< f32 >::operator==(), irr::core::plane3d< f32 >::recalculateD(), irr::scene::SViewFrustum::setFrom(), irr::core::plane3d< f32 >::setPlane(), and irr::core::CMatrix4< T >::transformPlane().