IGeomCollisionContainer Class Reference

Interface that defines collision methods (for units, zones, ammo. More...

#include <GeomCollisionContainer.h>

Inheritance diagram for IGeomCollisionContainer:

Inheritance graph
[legend]

List of all members.

Public Types

enum  EContainerType {
  C3DPHY, UNIT, ZONE, AMMO,
  OTHER
}

Public Member Functions

virtual EContainerType getType () const =0
 Gets the type of the current container.
virtual C3DPhyas3DPhy ()
virtual UnpilotedUnit * asUnit ()
virtual Zone * asZone ()
virtual AmmoasAmmo ()
virtual const char * className () const =0
virtual bool hitBefore (Physics::Contact *pContacts, unsigned int nbContacts, Physics::Contact *pMaxEnergyContact, Physics::Geom &thisGeom, Physics::Geom &otherGeom, Physics::Body *&inout_pThisBody, Physics::Body *&inout_pOtherBody)=0
 Handles a collision for the geom container before a contact joint is created.
virtual void hitAfter (Physics::Contact *pContacts, unsigned int nbContacts, Physics::Contact *pMaxEnergyContact, Physics::Geom &thisGeom, Physics::Geom &otherGeom, bool contactJointCreated)
 Handles a collision after contact joints creations have been decided.

Protected Member Functions

virtual ~IGeomCollisionContainer ()
 Protected destructor forces the object to be deleted by being dereferenced.


Detailed Description

Interface that defines collision methods (for units, zones, ammo.

..).

Note:
Inheritance from osg::Referenced is virtual in order to allow derivates to also be ControlEventHandler's.
Author:
Sukender
Version:
0.2.0

Definition at line 49 of file GeomCollisionContainer.h.


Member Enumeration Documentation

Enumerator:
C3DPHY 
UNIT 
ZONE 
AMMO 
OTHER 

Definition at line 51 of file GeomCollisionContainer.h.


Constructor & Destructor Documentation

virtual IGeomCollisionContainer::~IGeomCollisionContainer (  )  [inline, protected, virtual]

Protected destructor forces the object to be deleted by being dereferenced.

Also avoids the object from beeing created on the stack.

Definition at line 93 of file GeomCollisionContainer.h.


Member Function Documentation

virtual C3DPhy* IGeomCollisionContainer::as3DPhy (  )  [inline, virtual]

Reimplemented in C3DPhy.

Definition at line 54 of file GeomCollisionContainer.h.

Referenced by Ammo::hitAfter(), Explosion::hitBefore(), Ammo::hitBefore(), and Dummy3DPhy::hitBefore().

virtual Ammo* IGeomCollisionContainer::asAmmo (  )  [inline, virtual]

Reimplemented in Ammo.

Definition at line 57 of file GeomCollisionContainer.h.

virtual UnpilotedUnit* IGeomCollisionContainer::asUnit (  )  [inline, virtual]

Definition at line 55 of file GeomCollisionContainer.h.

virtual Zone* IGeomCollisionContainer::asZone (  )  [inline, virtual]

Definition at line 56 of file GeomCollisionContainer.h.

virtual const char* IGeomCollisionContainer::className (  )  const [pure virtual]

Implemented in C3DPhy.

virtual EContainerType IGeomCollisionContainer::getType (  )  const [pure virtual]

Gets the type of the current container.

Implemented in C3DPhy, Ammo, and Explosion.

virtual void IGeomCollisionContainer::hitAfter ( Physics::Contact pContacts,
unsigned int  nbContacts,
Physics::Contact pMaxEnergyContact,
Physics::Geom thisGeom,
Physics::Geom otherGeom,
bool  contactJointCreated 
) [inline, virtual]

Handles a collision after contact joints creations have been decided.

The contactJointCreated parameter tells if joints have been created or not ; other parameters are similar to hitBefore(). This method is guaranteed to be called after hitBefore(), whether the contact is created or not.

Reimplemented in C3DPhy, and Ammo.

Definition at line 86 of file GeomCollisionContainer.h.

Referenced by Physics::NearCallback::operator()().

virtual bool IGeomCollisionContainer::hitBefore ( Physics::Contact pContacts,
unsigned int  nbContacts,
Physics::Contact pMaxEnergyContact,
Physics::Geom thisGeom,
Physics::Geom otherGeom,
Physics::Body *&  inout_pThisBody,
Physics::Body *&  inout_pOtherBody 
) [pure virtual]

Handles a collision for the geom container before a contact joint is created.

The method is NOT ALLOWED to delete elements directly.

Parameters:
pContacts [in] List of contacts, with parameters (method is allowed to modify contact params before contacts really happen). Relative position of the contact is not given (in structure) because it would cause computation overhead for elements that do not need to compute relative position form the world position. Please note that the surface parameters for contact are not set when calling this method.
nbContacts [in] The contact count for this frame and these two geoms.
pMaxEnergyContact [in] The contact that has the most important arithmeticCineticEnergy value.
thisGeom [in] First geom in collision.
otherGeom [in] Second geom in collision.
inout_pOtherBody [in, out] As an input, it is the body attached to otherGeom. As an output, it is the body used for contact joint, if the method returns true. This is useful, for example, to create a "one way" collision, like a camera hitting a 3D-phy : the camera has to collide but the 3D-Phy should not know about it. Set inout_pOtherBody to NULL in that case (NULL means "the world", or "no specific body").
inout_pThisBody [in, out] As an input, it is the body attached to thisGeom. As an output, it is the body used for contact joint, if the method returns true. This is useful, for example, to create a "one way" collision, like a camera hitting a 3D-phy : the camera has to collide but the 3D-Phy should not know about it. Set inout_pOtherBody to NULL in that case (NULL means "the world", or "no specific body").
Returns:
true if the hit must result in the creation of a contact joint, false otherwise. Note that default value shoud be true.

Implemented in C3DPhy, Ammo, Explosion, and Dummy3DPhy.

Referenced by Physics::NearCallback::operator()().


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

Generated on Sun Jan 17 11:39:28 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9