Drag[en]gine Game Engine  1.21
deCollisionInfo Class Reference

Collision Information. More...

#include <deCollisionInfo.h>

Inheritance diagram for deCollisionInfo:
deObject

Public Types

typedef deTObjectReference< deCollisionInfoRef
 Type holding strong reference. More...
 
- Public Types inherited from deObject
typedef deTObjectReference< deObjectRef
 Type holding strong reference. More...
 

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...
 
deParticleEmitterType::eCollisionResponses GetParticleResponse () const
 Collision response to apply to particle. More...
 
void SetParticleResponse (deParticleEmitterType::eCollisionResponses respone)
 Set collision response to apply to particle. 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...
 
Operator
deCollisionInfooperator= (const deCollisionInfo &info)
 Copy from collision information. 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...
 
 deCollisionInfo (const deCollisionInfo &info)
 Create copy of 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 information 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.

Member Typedef Documentation

◆ Ref

Type holding strong reference.

Constructor & Destructor Documentation

◆ deCollisionInfo() [1/2]

deCollisionInfo::deCollisionInfo ( )

Create collision info.

◆ deCollisionInfo() [2/2]

deCollisionInfo::deCollisionInfo ( const deCollisionInfo info)

Create copy of 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.

◆ 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 information. 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 occurred. For physical collision detection as carried out by the physics module this is the remaining movement time after the collision point.

◆ 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.

◆ GetNormal()

const decVector& deCollisionInfo::GetNormal ( ) const
inline

Hit normal.

◆ GetOwnerBone()

int deCollisionInfo::GetOwnerBone ( ) const
inline

Owner bone or -1 if not applicable.

◆ GetOwnerFace()

int deCollisionInfo::GetOwnerFace ( ) const
inline

Owner face or -1 if not applicable.

◆ GetOwnerShape()

int deCollisionInfo::GetOwnerShape ( ) const
inline

Owner shape or -1 if not applicable.

◆ GetParticleLifetime()

float deCollisionInfo::GetParticleLifetime ( ) const
inline

Particle lifetime.

◆ GetParticleMass()

float deCollisionInfo::GetParticleMass ( ) const
inline

Particle mass.

◆ GetParticlePosition()

const decDVector& deCollisionInfo::GetParticlePosition ( ) const
inline

Particle position.

◆ GetParticleResponse()

deParticleEmitterType::eCollisionResponses deCollisionInfo::GetParticleResponse ( ) const
inline

Collision response to apply to particle.

◆ GetParticleVelocity()

const decVector& deCollisionInfo::GetParticleVelocity ( ) const
inline

Particle velocity.

◆ GetPosition()

const decDVector& deCollisionInfo::GetPosition ( ) const
inline

Hit position.

◆ 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.

◆ GetStopTesting()

bool deCollisionInfo::GetStopTesting ( ) const
inline

Collision detection has to be stopped.

◆ HasCollision()

bool deCollisionInfo::HasCollision ( ) const

Collision found.

◆ IsCollider()

bool deCollisionInfo::IsCollider ( ) const

Collider is set.

◆ IsHTSector()

bool deCollisionInfo::IsHTSector ( ) const

Height terrain sector is set.

◆ operator=()

deCollisionInfo& deCollisionInfo::operator= ( const deCollisionInfo info)

Copy from collision information.

◆ 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.

◆ 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 occurred. For physical collision detection as carried out by the physics module this is the remaining movement time after the collision point.

◆ SetHTSector()

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

Set height terrain sector.

◆ SetImpulse()

void deCollisionInfo::SetImpulse ( float  impulse)

Set hit impulse.

◆ SetNormal()

void deCollisionInfo::SetNormal ( const decVector normal)

Set hit normal.

◆ SetOwnerBone()

void deCollisionInfo::SetOwnerBone ( int  bone)

Set owner bone or -1 if not applicable.

◆ SetOwnerFace()

void deCollisionInfo::SetOwnerFace ( int  face)

Set owner face or -1 if not applicable.

◆ SetOwnerShape()

void deCollisionInfo::SetOwnerShape ( int  shape)

Set owner shape or -1 if not applicable.

◆ SetParticleLifetime()

void deCollisionInfo::SetParticleLifetime ( float  lifetime)

Set particle lifetime.

◆ SetParticleMass()

void deCollisionInfo::SetParticleMass ( float  mass)

Set particle mass.

◆ SetParticlePosition()

void deCollisionInfo::SetParticlePosition ( const decDVector position)

Set particle position.

◆ SetParticleResponse()

void deCollisionInfo::SetParticleResponse ( deParticleEmitterType::eCollisionResponses  respone)

Set collision response to apply to particle.

◆ SetParticleVelocity()

void deCollisionInfo::SetParticleVelocity ( const decVector velocity)

Set particle velocity.

◆ SetPosition()

void deCollisionInfo::SetPosition ( const decDVector position)

Set hit position.

◆ SetStopTesting()

void deCollisionInfo::SetStopTesting ( bool  stopTesting)

Set if collision detection has to be stopped.


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