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>

Inherits scfImplementationExt1< csColliderWrapper, csObject, scfFakeInterface< csColliderWrapper > >.

List of all members.

Public Member Functions

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

Static Public Member Functions

static csColliderWrapperGetColliderWrapper (csObject &object)
 If object has a child of type csColliderWrapper it is returned.
static csColliderWrapperGetColliderWrapper (iObject *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 68 of file collider.h.


Constructor & Destructor Documentation

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

Create a collider based on a mesh.

csColliderWrapper::csColliderWrapper ( iObject parent,
iCollideSystem collide_system,
iTriangleMesh 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,
iTerrainSystem 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 ( 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.

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

Similar to Collide for csColliderWrapper.

Calls GetColliderWrapper for otherCollider.

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

Similar to Collide for csColliderWrapper.

Calls GetColliderWrapper for otherCollider.

iCollider* csColliderWrapper::GetCollider (  )  [inline]

Get the collider interface for this object.

Definition at line 114 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 117 of file collider.h.

void csColliderWrapper::UpdateCollider ( iTerraFormer terrain  ) 

Update collider from a terraformer.

void csColliderWrapper::UpdateCollider ( iTriangleMesh mesh  ) 

Update collider from a triangle mesh.


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

Generated for Crystal Space 1.4.1 by doxygen 1.7.1