Drag[en]gine Game Engine
1.21
|
Collision Information. More...
#include <deCollisionInfo.h>
Public Types | |
typedef deTObjectReference< deCollisionInfo > | Ref |
Type holding strong reference. More... | |
Public Types inherited from deObject | |
typedef deTObjectReference< deObject > | Ref |
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... | |
deHeightTerrain * | GetHeightTerrain () const |
Height terrain or NULL if none is hit. More... | |
deHeightTerrainSector * | GetHTSector () const |
Height terrain sector or NULL if none is hit. More... | |
deCollider * | GetCollider () 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 decDVector & | GetParticlePosition () const |
Particle position. More... | |
void | SetParticlePosition (const decDVector &position) |
Set particle position. More... | |
const decVector & | GetParticleVelocity () 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 decVector & | GetNormal () const |
Hit normal. More... | |
void | SetNormal (const decVector &normal) |
Set hit normal. More... | |
const decDVector & | GetPosition () 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 | |
deCollisionInfo & | operator= (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... | |
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.
Type holding strong reference.
deCollisionInfo::deCollisionInfo | ( | ) |
Create collision info.
deCollisionInfo::deCollisionInfo | ( | const deCollisionInfo & | info | ) |
Create copy of collision info.
|
protectedvirtual |
Clean up collision info.
void deCollisionInfo::Clear | ( | ) |
Clear collision.
|
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.
|
inline |
Collider or NULL if none is hit.
|
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.
|
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.
|
inline |
Height terrain or NULL if none is hit.
|
inline |
Height terrain sector or NULL if none is hit.
|
inline |
Hit impulse.
|
inline |
Hit normal.
|
inline |
Owner bone or -1 if not applicable.
|
inline |
Owner face or -1 if not applicable.
|
inline |
Owner shape or -1 if not applicable.
|
inline |
Particle lifetime.
|
inline |
Particle mass.
|
inline |
Particle position.
|
inline |
Collision response to apply to particle.
|
inline |
Particle velocity.
|
inline |
Hit position.
|
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.
|
inline |
Collision detection has to be stopped.
bool deCollisionInfo::HasCollision | ( | ) | const |
Collision found.
bool deCollisionInfo::IsCollider | ( | ) | const |
Collider is set.
bool deCollisionInfo::IsHTSector | ( | ) | const |
Height terrain sector is set.
deCollisionInfo& deCollisionInfo::operator= | ( | const deCollisionInfo & | info | ) |
Copy from collision information.
void deCollisionInfo::SetCollider | ( | deCollider * | collider, |
int | bone, | ||
int | shape, | ||
int | face | ||
) |
Set collider.
[in] | bone | Index of the hit bone if otherwise -1. |
[in] | shape | Index of hit rig or bone shape otherwsie -1. |
[in] | face | Index of hit face otherwise -1. |
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.
void deCollisionInfo::SetHTSector | ( | deHeightTerrain * | heightTerrain, |
deHeightTerrainSector * | sector | ||
) |
Set height terrain sector.
void deCollisionInfo::SetImpulse | ( | float | impulse | ) |
Set hit impulse.
void deCollisionInfo::SetNormal | ( | const decVector & | normal | ) |
Set hit normal.
void deCollisionInfo::SetOwnerBone | ( | int | bone | ) |
Set owner bone or -1 if not applicable.
void deCollisionInfo::SetOwnerFace | ( | int | face | ) |
Set owner face or -1 if not applicable.
void deCollisionInfo::SetOwnerShape | ( | int | shape | ) |
Set owner shape or -1 if not applicable.
void deCollisionInfo::SetParticleLifetime | ( | float | lifetime | ) |
Set particle lifetime.
void deCollisionInfo::SetParticleMass | ( | float | mass | ) |
Set particle mass.
void deCollisionInfo::SetParticlePosition | ( | const decDVector & | position | ) |
Set particle position.
void deCollisionInfo::SetParticleResponse | ( | deParticleEmitterType::eCollisionResponses | respone | ) |
Set collision response to apply to particle.
void deCollisionInfo::SetParticleVelocity | ( | const decVector & | velocity | ) |
Set particle velocity.
void deCollisionInfo::SetPosition | ( | const decDVector & | position | ) |
Set hit position.
void deCollisionInfo::SetStopTesting | ( | bool | stopTesting | ) |
Set if collision detection has to be stopped.