Public Types | Public Member Functions

sp::scene::CollisionMesh Class Reference
[Collision System]

#include <spCollisionMesh.hpp>

Inheritance diagram for sp::scene::CollisionMesh:
sp::scene::CollisionNode sp::BaseObject

List of all members.

Public Types

typedef std::vector
< SCollisionFace * > 
TreeNodeDataType

Public Member Functions

 CollisionMesh (CollisionMaterial *Material, scene::Mesh *Mesh, u8 MaxTreeLevel=DEF_KDTREE_LEVEL)
 CollisionMesh (CollisionMaterial *Material, const std::list< Mesh * > &MeshList, u8 MaxTreeLevel=DEF_KDTREE_LEVEL)
 ~CollisionMesh ()
s32 getSupportFlags () const
f32 getMaxMovement () const
void findIntersections (const dim::line3df &Line, std::list< SIntersectionContact > &ContactList) const
bool checkIntersection (const dim::line3df &Line, SIntersectionContact &Contact) const
bool checkIntersection (const dim::line3df &Line, bool ExcludeCorners=false) const
KDTreeNodegetRootTreeNode () const
void setCollFace (const video::EFaceTypes Type)
 Sets the collidable face side. By default video::FACE_FRONT.
video::EFaceTypes getCollFace () const
 Returns the collidable face side.

Detailed Description

CollisionMesh is one of the collision models and represents a complete mesh and has its own kd-Tree for fast collision detection. Each kd-Tree node leaf stores a list of SCollisionFace instances. Thus modifying your mesh does not effect the collision model after it has been already created.


Member Typedef Documentation


Constructor & Destructor Documentation

sp::scene::CollisionMesh::CollisionMesh ( CollisionMaterial Material,
scene::Mesh Mesh,
u8  MaxTreeLevel = DEF_KDTREE_LEVEL 
)
sp::scene::CollisionMesh::CollisionMesh ( CollisionMaterial Material,
const std::list< Mesh * > &  MeshList,
u8  MaxTreeLevel = DEF_KDTREE_LEVEL 
)
sp::scene::CollisionMesh::~CollisionMesh (  ) 

Member Function Documentation

bool sp::scene::CollisionMesh::checkIntersection ( const dim::line3df Line,
SIntersectionContact Contact 
) const [virtual]

Checks for an intersection between this collision object and the given line and stores the result in the specified contact structure.

Parameters:
Line,: Specifies the line which could intersect this object.
Contact,: Specifies the structure where the intersection result will be stored.
Note:
The implementations of this interface function normally only store the point and normal vector of an intersection.

Reimplemented from sp::scene::CollisionNode.

bool sp::scene::CollisionMesh::checkIntersection ( const dim::line3df Line,
bool  ExcludeCorners = false 
) const [virtual]

Returns true if an intersection between this collision object and the given line exists but does not return any further information.

Parameters:
Line,: Specifies the line which could intersect this object.
ExcludeCorners,: Specifies whether the line's corners should be ingored. This can be useful for ray-tracing or lightmapping to avoid self-shadowing.

Reimplemented from sp::scene::CollisionNode.

void sp::scene::CollisionMesh::findIntersections ( const dim::line3df Line,
std::list< SIntersectionContact > &  ContactList 
) const [virtual]

Checks for intersections between this collision object and the given line and stored the result in the specified contact list.

Parameters:
Line,: Specifies the line which could intersect this object.
ContactList,: Specifies the list where all the intersection results will be stored.
Note:
The implementations of this interface function don't sort the resulting contact list.

Reimplemented from sp::scene::CollisionNode.

video::EFaceTypes sp::scene::CollisionMesh::getCollFace (  )  const [inline]

Returns the collidable face side.

f32 sp::scene::CollisionMesh::getMaxMovement (  )  const [virtual]

Returns the maximal movement (e.g. for a sphere it's the radius). This is used internally. A collision node can still be moved faster than this value.

Implements sp::scene::CollisionNode.

KDTreeNode* sp::scene::CollisionMesh::getRootTreeNode (  )  const [inline]
s32 sp::scene::CollisionMesh::getSupportFlags (  )  const [virtual]
void sp::scene::CollisionMesh::setCollFace ( const video::EFaceTypes  Type  )  [inline]

Sets the collidable face side. By default video::FACE_FRONT.


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