CrystalSpace

Public API Reference

csColliderWrapper Class Reference

This is a convenience object that you can use in your own games to attach an iCollider object (from the CD plugin system) to any other csObject (including CS entities). More...

#include <cstool/collider.h>

Inheritance diagram for csColliderWrapper:

Inheritance graph
[legend]
List of all members.

Public Member Functions

bool Collide (iObject *otherObject, csReversibleTransform *pThisTransform=0, csReversibleTransform *pOtherTransform=0)
 Similar to Collide for csColliderWrapper.
bool Collide (csObject &otherObject, csReversibleTransform *pThisTransform=0, csReversibleTransform *pOtherTransform=0)
 Similar to Collide for csColliderWrapper.
bool Collide (csColliderWrapper &pOtherCollider, csReversibleTransform *pThisTransform=0, csReversibleTransform *pOtherTransform=0)
 Check if this collider collides with pOtherCollider.
 csColliderWrapper (iObject *parent, iCollideSystem *collide_system, iCollider *collider)
 Create a collider based on a collider.
 csColliderWrapper (iObject *parent, iCollideSystem *collide_system, iTerraFormer *terrain)
 Create a collider based on a terrain.
 csColliderWrapper (iObject *parent, iCollideSystem *collide_system, iPolygonMesh *mesh)
 Create a collider based on a mesh.
 csColliderWrapper (csObject &parent, iCollideSystem *collide_system, iPolygonMesh *mesh)
 Create a collider based on a mesh.
iColliderGetCollider ()
 Get the collider interface for this object.
iCollideSystemGetCollideSystem ()
 Get the collide system.
virtual ~csColliderWrapper ()
 Destroy the plugin collider object.

Static Public Member Functions

static csColliderWrapperGetColliderWrapper (iObject *object)
 If object has a child of type csColliderWrapper it is returned.
static csColliderWrapperGetColliderWrapper (csObject &object)
 If object has a child of type csColliderWrapper it is returned.

Detailed Description

This is a convenience object that you can use in your own games to attach an iCollider object (from the CD plugin system) to any other csObject (including CS entities).

Use of this object is optional (if you can assign your iCollider's to entities in another manner then this is ok) and the engine will not use this object itself.

Important! After creating an instance of this object you should actually DecRef() the pointer because csColliderWrapper will automatically attach itself to the given object. You can use csColliderWrapper::GetCollider() later to get the collider again.

Definition at line 67 of file collider.h.


Constructor & Destructor Documentation

csColliderWrapper::csColliderWrapper ( csObject parent,
iCollideSystem collide_system,
iPolygonMesh mesh 
)

Create a collider based on a mesh.

csColliderWrapper::csColliderWrapper ( iObject parent,
iCollideSystem collide_system,
iPolygonMesh mesh 
)

Create a collider based on a mesh.

csColliderWrapper::csColliderWrapper ( iObject parent,
iCollideSystem collide_system,
iTerraFormer terrain 
)

Create a collider based on a terrain.

csColliderWrapper::csColliderWrapper ( iObject parent,
iCollideSystem collide_system,
iCollider collider 
)

Create a collider based on a collider.

Note that it is legal to pass in a 0 collider. In that case it indicates that this object has no collider.

virtual csColliderWrapper::~csColliderWrapper (  )  [virtual]

Destroy the plugin collider object.


Member Function Documentation

bool csColliderWrapper::Collide ( iObject otherObject,
csReversibleTransform pThisTransform = 0,
csReversibleTransform pOtherTransform = 0 
)

Similar to Collide for csColliderWrapper.

Calls GetColliderWrapper for otherCollider.

bool csColliderWrapper::Collide ( csObject otherObject,
csReversibleTransform pThisTransform = 0,
csReversibleTransform pOtherTransform = 0 
)

Similar to Collide for csColliderWrapper.

Calls GetColliderWrapper for otherCollider.

bool csColliderWrapper::Collide ( csColliderWrapper pOtherCollider,
csReversibleTransform pThisTransform = 0,
csReversibleTransform pOtherTransform = 0 
)

Check if this collider collides with pOtherCollider.

Returns true if collision detected and adds the pair to the collisions hists vector. This collider and pOtherCollider must be of comparable subclasses, if not false is returned.

iCollider* csColliderWrapper::GetCollider (  )  [inline]

Get the collider interface for this object.

Definition at line 105 of file collider.h.

static csColliderWrapper* csColliderWrapper::GetColliderWrapper ( iObject object  )  [static]

If object has a child of type csColliderWrapper it is returned.

Otherwise 0 is returned.

static csColliderWrapper* csColliderWrapper::GetColliderWrapper ( csObject object  )  [static]

If object has a child of type csColliderWrapper it is returned.

Otherwise 0 is returned.

iCollideSystem* csColliderWrapper::GetCollideSystem (  )  [inline]

Get the collide system.

Definition at line 108 of file collider.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.4.7