CrystalSpace

Public API Reference

CS::Collisions::CollisionHelper Class Reference

A class to help managing the colliders and physical models of the meshes and scenes. More...

#include <cstool/collisionhelper.h>

List of all members.

Public Member Functions

Concave mesh decomposition



void DecomposeConcaveMesh (iMeshWrapper *mesh, CS::Collisions::iCollider *collider, CS::Collisions::iConvexDecomposer *decomposer) const
 Perform a convex decomposition on the given concave mesh wrapper and compound the resulting convex parts into the given collider.
void DecomposeConcaveMesh (iTriangleMesh *mesh, CS::Collisions::iCollider *collider, CS::Collisions::iConvexDecomposer *decomposer) const
 Perform a convex decomposition on the given concave triangle mesh and compound the resulting convex parts into the given collider.
Finding the collision mesh



iTriangleMeshFindCollisionMesh (iMeshFactoryWrapper *meshFactory) const
 Search for the collision iTriangleMesh of the given mesh factory.
iTriangleMeshFindCollisionMesh (iMeshWrapper *mesh) const
 Search for the collision iTriangleMesh of the given mesh.
Global initialization



bool Initialize (iObjectRegistry *objectRegistry, CS::Collisions::iCollisionSystem *collisionSystem=nullptr, CS::Collisions::iConvexDecomposer *decomposer=nullptr)
 Initialize this collision helper.
Automated setup of the objects of the collision system from a scene



void InitializeCollisionObjects (iSector *sector, iMeshWrapper *mesh) const
 Recursively creates and adds all collision objects of the mesh and it's children to the collision system.
void InitializeCollisionObjects (iSector *sector, iCollection *collection=nullptr) const
 Creates and adds all collision objects of all meshes in the given sector to the collision system.
void InitializeCollisionObjects (iEngine *engine, iCollection *collection=nullptr) const
 Creates and adds all collision objects of all meshes in the given engine to the collision system.
Collision data parsing



csPtr< CS::Collisions::iColliderParseCollider (iDocumentNode *node, csTransform &transform, iLoaderContext *loaderContext, iBase *context) const
 Parse a collider.
csPtr
< CS::Collisions::iCollisionObjectFactory
ParseCollisionObjectFactory (iDocumentNode *node, iLoaderContext *loaderContext, iBase *context) const
 Parse a collision object factory.
csPtr< CS::Physics::iJointFactoryParseJointFactory (iDocumentNode *node, csTransform &transform, iLoaderContext *loaderContext, iBase *context) const
 Parse a joint factory.
csPtr
< CS::Physics::iRigidBodyFactory
ParseRigidBodyFactory (iDocumentNode *node, iLoaderContext *loaderContext, iBase *context) const
 Parse a rigid body factory.
csPtr
< CS::Physics::iSoftBodyFactory
ParseSoftBodyFactory (iDocumentNode *node, iLoaderContext *loaderContext, iBase *context) const
 Parse a soft body factory.

Detailed Description

A class to help managing the colliders and physical models of the meshes and scenes.

Definition at line 64 of file collisionhelper.h.


Member Function Documentation

void CS::Collisions::CollisionHelper::DecomposeConcaveMesh ( iMeshWrapper mesh,
CS::Collisions::iCollider collider,
CS::Collisions::iConvexDecomposer decomposer 
) const

Perform a convex decomposition on the given concave mesh wrapper and compound the resulting convex parts into the given collider.

This is equivalent to a call to FindCollisionMesh() followed by a call to DecomposeConcaveMesh(iTriangleMesh*,CS::Collisions::iCollider*,CS::Collisions::iConvexDecomposer*).

void CS::Collisions::CollisionHelper::DecomposeConcaveMesh ( iTriangleMesh mesh,
CS::Collisions::iCollider collider,
CS::Collisions::iConvexDecomposer decomposer 
) const

Perform a convex decomposition on the given concave triangle mesh and compound the resulting convex parts into the given collider.

iTriangleMesh* CS::Collisions::CollisionHelper::FindCollisionMesh ( iMeshFactoryWrapper meshFactory  )  const

Search for the collision iTriangleMesh of the given mesh factory.

Return nullptr in case there are explicitely none.

iTriangleMesh* CS::Collisions::CollisionHelper::FindCollisionMesh ( iMeshWrapper mesh  )  const

Search for the collision iTriangleMesh of the given mesh.

Return nullptr in case there are explicitely none.

bool CS::Collisions::CollisionHelper::Initialize ( iObjectRegistry objectRegistry,
CS::Collisions::iCollisionSystem collisionSystem = nullptr,
CS::Collisions::iConvexDecomposer decomposer = nullptr 
)

Initialize this collision helper.

void CS::Collisions::CollisionHelper::InitializeCollisionObjects ( iSector sector,
iMeshWrapper mesh 
) const

Recursively creates and adds all collision objects of the mesh and it's children to the collision system.

void CS::Collisions::CollisionHelper::InitializeCollisionObjects ( iSector sector,
iCollection collection = nullptr 
) const

Creates and adds all collision objects of all meshes in the given sector to the collision system.

void CS::Collisions::CollisionHelper::InitializeCollisionObjects ( iEngine engine,
iCollection collection = nullptr 
) const

Creates and adds all collision objects of all meshes in the given engine to the collision system.

csPtr<CS::Collisions::iCollider> CS::Collisions::CollisionHelper::ParseCollider ( iDocumentNode node,
csTransform transform,
iLoaderContext loaderContext,
iBase context 
) const

Parse a collider.

Return nullptr if none are found.

Parameters:
node The document node to parse the collider from.
transform The transform of the collider to be parsed along it.
loaderContext The loader context.
The parent object being currently parsed if any.
csPtr<CS::Collisions::iCollisionObjectFactory> CS::Collisions::CollisionHelper::ParseCollisionObjectFactory ( iDocumentNode node,
iLoaderContext loaderContext,
iBase context 
) const

Parse a collision object factory.

Return nullptr if none are found.

Parameters:
node The document node to parse the factory from.
loaderContext The loader context.
The parent object being currently parsed if any.
csPtr<CS::Physics::iJointFactory> CS::Collisions::CollisionHelper::ParseJointFactory ( iDocumentNode node,
csTransform transform,
iLoaderContext loaderContext,
iBase context 
) const

Parse a joint factory.

Return nullptr if none are found.

Parameters:
node The document node to parse the joint from.
transform The transform of the joint to be parsed along it.
loaderContext The loader context.
The parent object being currently parsed if any.
csPtr<CS::Physics::iRigidBodyFactory> CS::Collisions::CollisionHelper::ParseRigidBodyFactory ( iDocumentNode node,
iLoaderContext loaderContext,
iBase context 
) const

Parse a rigid body factory.

Return nullptr if none are found.

Parameters:
node The document node to parse the factory from.
loaderContext The loader context.
The parent object being currently parsed if any.
csPtr<CS::Physics::iSoftBodyFactory> CS::Collisions::CollisionHelper::ParseSoftBodyFactory ( iDocumentNode node,
iLoaderContext loaderContext,
iBase context 
) const

Parse a soft body factory.

Return nullptr if none are found.

Parameters:
node The document node to parse the factory from.
loaderContext The loader context.
The parent object being currently parsed if any.

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

Generated for Crystal Space 2.1 by doxygen 1.6.1