Drag[en]gine Game Engine  1.0
deCollisionInfo Class Reference

Collision Information. More...

#include <deCollisionInfo.h>

Inheritance diagram for deCollisionInfo:
deObject

Public Member Functions

Management
int GetOwnerBone () const
 Owner bone or -1 if not applicable. More...
 
void SetOwnerBone (int bone)
 Set owner bone or -1 if not applicable. More...
 
int GetOwnerShape () const
 Owner shape or -1 if not applicable. More...
 
void SetOwnerShape (int shape)
 Set owner shape or -1 if not applicable. More...
 
int GetOwnerFace () const
 Owner face or -1 if not applicable. More...
 
void SetOwnerFace (int face)
 Set owner face or -1 if not applicable. More...
 
deHeightTerrainGetHeightTerrain () const
 Height terrain or NULL if none is hit. More...
 
deHeightTerrainSectorGetHTSector () const
 Height terrain sector or NULL if none is hit. More...
 
deColliderGetCollider () const
 Collider or NULL if none is hit. More...
 
int GetBone () const
 Bone index or -1 if none is hit. More...
 
int GetFace () const
 Face index or -1 if none is hit. More...
 
int GetShape () const
 Shape index or -1 if none is hit. More...
 
bool IsHTSector () const
 Height terrain sector is set. More...
 
bool IsCollider () const
 Collider is set. More...
 
bool HasCollision () const
 Collision found. More...
 
void SetHTSector (deHeightTerrain *heightTerrain, deHeightTerrainSector *sector)
 Set height terrain sector. More...
 
void SetCollider (deCollider *collider, int bone, int shape, int face)
 Set collider. More...
 
void Clear ()
 Clear collision. More...
 
float GetParticleLifetime () const
 Particle lifetime. More...
 
void SetParticleLifetime (float lifetime)
 Set particle lifetime. More...
 
float GetParticleMass () const
 Particle mass. More...
 
void SetParticleMass (float mass)
 Set particle mass. More...
 
const decDVectorGetParticlePosition () const
 Particle position. More...
 
void SetParticlePosition (const decDVector &position)
 Set particle position. More...
 
const decVectorGetParticleVelocity () const
 Particle velocity. More...
 
void SetParticleVelocity (const decVector &velocity)
 Set particle velocity. More...
 
float GetDistance () const
 Percentage distance or remaining step time. More...
 
void SetDistance (float distance)
 Set percentage distance or remaining step time. More...
 
const decVectorGetNormal () const
 Hit normal. More...
 
void SetNormal (const decVector &normal)
 Set hit normal. More...
 
const decDVectorGetPosition () const
 Hit position. More...
 
void SetPosition (const decDVector &position)
 Set hit position. More...
 
float GetImpulse () const
 Hit impulse. More...
 
void SetImpulse (float impulse)
 Set hit impulse. More...
 
bool GetStopTesting () const
 Collision detection has to be stopped. More...
 
void SetStopTesting (bool stopTesting)
 Set if collision detection has to be stopped. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Constructors and Destructors

 deCollisionInfo ()
 Create collision info. More...
 
virtual ~deCollisionInfo ()
 Clean up collision info. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Collision Information.

Stores informations about a collision between a collider and a height terrain or another collider. This object is reference counted because it does keep references to the collision objects.

Constructor & Destructor Documentation

◆ deCollisionInfo()

deCollisionInfo::deCollisionInfo ( )

Create collision info.

◆ ~deCollisionInfo()

virtual deCollisionInfo::~deCollisionInfo ( )
protectedvirtual

Clean up collision info.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ Clear()

void deCollisionInfo::Clear ( )

Clear collision.

Referenced by GetShape().

◆ GetBone()

int deCollisionInfo::GetBone ( ) const
inline

Bone index or -1 if none is hit.

The bone is set if a collider is hit and the collider has bone informations. In all other cases this is -1.

◆ GetCollider()

deCollider* deCollisionInfo::GetCollider ( ) const
inline

Collider or NULL if none is hit.

◆ GetDistance()

float deCollisionInfo::GetDistance ( ) const
inline

Percentage distance or remaining step time.

For explicite collision tests with a displacement vector the distance is the percentage of the displacement travelled before the collision occured. For physical collision detection as carried out by the physics module this is the remaining movement time after the collision point.

References SetDistance().

◆ GetFace()

int deCollisionInfo::GetFace ( ) const
inline

Face index or -1 if none is hit.

The face is set if a component is hit which has a model assigned to it. In all other cases this is -1.

◆ GetHeightTerrain()

deHeightTerrain* deCollisionInfo::GetHeightTerrain ( ) const
inline

Height terrain or NULL if none is hit.

◆ GetHTSector()

deHeightTerrainSector* deCollisionInfo::GetHTSector ( ) const
inline

Height terrain sector or NULL if none is hit.

◆ GetImpulse()

float deCollisionInfo::GetImpulse ( ) const
inline

Hit impulse.

References SetImpulse().

◆ GetNormal()

const decVector& deCollisionInfo::GetNormal ( ) const
inline

Hit normal.

References SetNormal().

◆ GetOwnerBone()

int deCollisionInfo::GetOwnerBone ( ) const
inline

Owner bone or -1 if not applicable.

References SetOwnerBone().

◆ GetOwnerFace()

int deCollisionInfo::GetOwnerFace ( ) const
inline

Owner face or -1 if not applicable.

References SetOwnerFace().

◆ GetOwnerShape()

int deCollisionInfo::GetOwnerShape ( ) const
inline

Owner shape or -1 if not applicable.

References SetOwnerShape().

◆ GetParticleLifetime()

float deCollisionInfo::GetParticleLifetime ( ) const
inline

Particle lifetime.

References SetParticleLifetime().

◆ GetParticleMass()

float deCollisionInfo::GetParticleMass ( ) const
inline

Particle mass.

References SetParticleMass().

◆ GetParticlePosition()

const decDVector& deCollisionInfo::GetParticlePosition ( ) const
inline

Particle position.

References SetParticlePosition().

◆ GetParticleVelocity()

const decVector& deCollisionInfo::GetParticleVelocity ( ) const
inline

Particle velocity.

References SetParticleVelocity().

◆ GetPosition()

const decDVector& deCollisionInfo::GetPosition ( ) const
inline

Hit position.

References SetPosition().

◆ GetShape()

int deCollisionInfo::GetShape ( ) const
inline

Shape index or -1 if none is hit.

The shape is set if a collider is hit (either rig or bone) and the collider rig or bone has shapes. In all other cases this is -1.

References Clear(), HasCollision(), IsCollider(), IsHTSector(), SetCollider(), and SetHTSector().

◆ GetStopTesting()

bool deCollisionInfo::GetStopTesting ( ) const
inline

Collision detection has to be stopped.

References SetStopTesting().

◆ HasCollision()

bool deCollisionInfo::HasCollision ( ) const

Collision found.

Referenced by GetShape().

◆ IsCollider()

bool deCollisionInfo::IsCollider ( ) const

Collider is set.

Referenced by GetShape().

◆ IsHTSector()

bool deCollisionInfo::IsHTSector ( ) const

Height terrain sector is set.

Referenced by GetShape().

◆ SetCollider()

void deCollisionInfo::SetCollider ( deCollider collider,
int  bone,
int  shape,
int  face 
)

Set collider.

Parameters
[in]boneIndex of the hit bone if otherwise -1.
[in]shapeIndex of hit rig or bone shape otherwsie -1.
[in]faceIndex of hit face otherwise -1.

Referenced by GetShape().

◆ SetDistance()

void deCollisionInfo::SetDistance ( float  distance)

Set percentage distance or remaining step time.

For explicite collision tests with a displacement vector the distance is the percentage of the displacement travelled before the collision occured. For physical collision detection as carried out by the physics module this is the remaining movement time after the collision point.

Referenced by GetDistance().

◆ SetHTSector()

void deCollisionInfo::SetHTSector ( deHeightTerrain heightTerrain,
deHeightTerrainSector sector 
)

Set height terrain sector.

Referenced by GetShape().

◆ SetImpulse()

void deCollisionInfo::SetImpulse ( float  impulse)

Set hit impulse.

Referenced by GetImpulse().

◆ SetNormal()

void deCollisionInfo::SetNormal ( const decVector normal)

Set hit normal.

Referenced by GetNormal().

◆ SetOwnerBone()

void deCollisionInfo::SetOwnerBone ( int  bone)

Set owner bone or -1 if not applicable.

Referenced by GetOwnerBone().

◆ SetOwnerFace()

void deCollisionInfo::SetOwnerFace ( int  face)

Set owner face or -1 if not applicable.

Referenced by GetOwnerFace().

◆ SetOwnerShape()

void deCollisionInfo::SetOwnerShape ( int  shape)

Set owner shape or -1 if not applicable.

Referenced by GetOwnerShape().

◆ SetParticleLifetime()

void deCollisionInfo::SetParticleLifetime ( float  lifetime)

Set particle lifetime.

Referenced by GetParticleLifetime().

◆ SetParticleMass()

void deCollisionInfo::SetParticleMass ( float  mass)

Set particle mass.

Referenced by GetParticleMass().

◆ SetParticlePosition()

void deCollisionInfo::SetParticlePosition ( const decDVector position)

Set particle position.

Referenced by GetParticlePosition().

◆ SetParticleVelocity()

void deCollisionInfo::SetParticleVelocity ( const decVector velocity)

Set particle velocity.

Referenced by GetParticleVelocity().

◆ SetPosition()

void deCollisionInfo::SetPosition ( const decDVector position)

Set hit position.

Referenced by GetPosition().

◆ SetStopTesting()

void deCollisionInfo::SetStopTesting ( bool  stopTesting)

Set if collision detection has to be stopped.

Referenced by GetStopTesting().


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