#include <spConvexPolyhedron.hpp>
Public Member Functions | |
ConvexPolyhedron () | |
ConvexPolyhedron (const ConvexPolyhedron< T, PlaneCount > &Other) | |
virtual | ~ConvexPolyhedron () |
bool | isPointInside (const dim::vector3d< T > &Point, const T Radius=T(0)) const |
Returns true if the specified 3D point is inside the polyhedron. | |
bool | isBoundBoxInsideInv (const dim::aabbox3d< T > &Box, const dim::matrix4< T > &InvMatrix) const |
bool | isBoundBoxInside (const dim::aabbox3d< T > &Box, const dim::matrix4< T > &Matrix) const |
bool | checkLineIntersection (const dim::line3d< T > &Line, dim::line3d< T > &Intersection) const |
void | normalize () |
Normalizes all planes. | |
const dim::plane3d< T > & | getPlane (u32 Index) const |
Returns a reference of the specified plane. | |
dim::plane3d< T > & | getPlane (u32 Index) |
void | setPlane (u32 Index, const dim::plane3d< T > &Plane) |
Protected Attributes | |
dim::plane3d< T > | Planes_ [PlaneCount] |
A convex polyhedron represents a set of planes (or rather half-spaces) where the plane-normals must point out of the polyhedron.
sp::scene::ConvexPolyhedron< T, PlaneCount >::ConvexPolyhedron | ( | ) | [inline] |
sp::scene::ConvexPolyhedron< T, PlaneCount >::ConvexPolyhedron | ( | const ConvexPolyhedron< T, PlaneCount > & | Other | ) | [inline] |
virtual sp::scene::ConvexPolyhedron< T, PlaneCount >::~ConvexPolyhedron | ( | ) | [inline, virtual] |
bool sp::scene::ConvexPolyhedron< T, PlaneCount >::checkLineIntersection | ( | const dim::line3d< T > & | Line, | |
dim::line3d< T > & | Intersection | |||
) | const [inline] |
Makes an intersection tests with the specified line and this convex polyhedron.
Line,: | Specifies the line which is to be tested against this convex polyhedron. | |
Intersection,: | Specifies the reference where the resulting intersection line will be stored. |
const dim::plane3d<T>& sp::scene::ConvexPolyhedron< T, PlaneCount >::getPlane | ( | u32 | Index | ) | const [inline] |
Returns a reference of the specified plane.
dim::plane3d<T>& sp::scene::ConvexPolyhedron< T, PlaneCount >::getPlane | ( | u32 | Index | ) | [inline] |
bool sp::scene::ConvexPolyhedron< T, PlaneCount >::isBoundBoxInside | ( | const dim::aabbox3d< T > & | Box, | |
const dim::matrix4< T > & | Matrix | |||
) | const [inline] |
Returns true if the specified box is inside the polyhedron. It is not required that the box is completely inside the polyhedron.
bool sp::scene::ConvexPolyhedron< T, PlaneCount >::isBoundBoxInsideInv | ( | const dim::aabbox3d< T > & | Box, | |
const dim::matrix4< T > & | InvMatrix | |||
) | const [inline] |
Returns true if the specified box (with inverse transformation matrix) is inside the polyhedron. It is not required that the box is completely inside the polyhedron.
bool sp::scene::ConvexPolyhedron< T, PlaneCount >::isPointInside | ( | const dim::vector3d< T > & | Point, | |
const T | Radius = T(0) | |||
) | const [inline] |
Returns true if the specified 3D point is inside the polyhedron.
void sp::scene::ConvexPolyhedron< T, PlaneCount >::normalize | ( | ) | [inline] |
Normalizes all planes.
void sp::scene::ConvexPolyhedron< T, PlaneCount >::setPlane | ( | u32 | Index, | |
const dim::plane3d< T > & | Plane | |||
) | [inline] |
dim::plane3d<T> sp::scene::ConvexPolyhedron< T, PlaneCount >::Planes_[PlaneCount] [protected] |