#include <GeomCollisionContainer.h>
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 C3DPhy * | as3DPhy () |
virtual UnpilotedUnit * | asUnit () |
virtual Zone * | asZone () |
virtual Ammo * | asAmmo () |
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. |
..).
Definition at line 49 of file GeomCollisionContainer.h.
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.
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] |
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] |
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.
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"). |
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()().