Public Member Functions | Protected Attributes

sp::scene::ConvexPolyhedron< T, PlaneCount > Class Template Reference

#include <spConvexPolyhedron.hpp>

List of all members.

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]

Detailed Description

template<typename T, s32 PlaneCount>
class sp::scene::ConvexPolyhedron< T, PlaneCount >

A convex polyhedron represents a set of planes (or rather half-spaces) where the plane-normals must point out of the polyhedron.


Constructor & Destructor Documentation

template<typename T, s32 PlaneCount>
sp::scene::ConvexPolyhedron< T, PlaneCount >::ConvexPolyhedron (  )  [inline]
template<typename T, s32 PlaneCount>
sp::scene::ConvexPolyhedron< T, PlaneCount >::ConvexPolyhedron ( const ConvexPolyhedron< T, PlaneCount > &  Other  )  [inline]
template<typename T, s32 PlaneCount>
virtual sp::scene::ConvexPolyhedron< T, PlaneCount >::~ConvexPolyhedron (  )  [inline, virtual]

Member Function Documentation

template<typename T, s32 PlaneCount>
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.

Parameters:
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.
Returns:
True if the intersection test succeeded. Otherwise false.
template<typename T, s32 PlaneCount>
const dim::plane3d<T>& sp::scene::ConvexPolyhedron< T, PlaneCount >::getPlane ( u32  Index  )  const [inline]

Returns a reference of the specified plane.

template<typename T, s32 PlaneCount>
dim::plane3d<T>& sp::scene::ConvexPolyhedron< T, PlaneCount >::getPlane ( u32  Index  )  [inline]
template<typename T, s32 PlaneCount>
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.

template<typename T, s32 PlaneCount>
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.

template<typename T, s32 PlaneCount>
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.

template<typename T, s32 PlaneCount>
void sp::scene::ConvexPolyhedron< T, PlaneCount >::normalize (  )  [inline]

Normalizes all planes.

template<typename T, s32 PlaneCount>
void sp::scene::ConvexPolyhedron< T, PlaneCount >::setPlane ( u32  Index,
const dim::plane3d< T > &  Plane 
) [inline]

Member Data Documentation

template<typename T, s32 PlaneCount>
dim::plane3d<T> sp::scene::ConvexPolyhedron< T, PlaneCount >::Planes_[PlaneCount] [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines