Collision Information. More...
#include <deCollisionInfo.h>
Public Member Functions | |
Constructors and Destructors | |
| deCollisionInfo () | |
| Creates a new collision info object. | |
| virtual | ~deCollisionInfo () |
| Cleans up the collision info object. | |
Management | |
| deHeightTerrain * | GetHeightTerrain () const |
| Retrieves the height terrain or NULL if no collision occured. | |
| deHeightTerrainSector * | GetHTSector () const |
| Retrieves the height terrain sector or NULL if no collision occured. | |
| deCollider * | GetCollider () const |
| Retrieves the collider or NULL if no collision occured. | |
| int | GetBone () const |
| Retrieves the bone or -1 if no collision occured. | |
| int | GetFace () const |
| Retrieves the face or -1 if no collision occured. | |
| float | GetDistance () const |
| Retrieves the distance travelled along the displacement vector indicated with a value in the range of 0 to 1. | |
| const decVector & | GetNormal () const |
| Retrieves the hit normal. | |
| bool | GetStopTesting () const |
| Determines if the collision detection has to be stopped. | |
| bool | IsHTSector () const |
| Determines if this is a height terrain sector. | |
| bool | IsCollider () const |
| Determines if this is a collider. | |
| bool | HasCollision () const |
| Determines if a collision occured. | |
| void | SetHTSector (deHeightTerrain *heightTerrain, deHeightTerrainSector *sector) |
| Sets the given height terrain sector. | |
| void | SetCollider (deCollider *collider, int bone, int face) |
| Sets the collider. | |
| void | Clear () |
| Clears the collision. | |
| void | SetDistance (float distance) |
| Sets the distance travelled along the displacement vector indicated with a value in the range of 0 to 1. | |
| void | SetNormal (const decVector &normal) |
| Sets the hit normal. | |
| void | SetStopTesting (bool stopTesting) |
| Sets if the collision detection has to be stopped. | |
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.
| deCollisionInfo::deCollisionInfo | ( | ) |
Creates a new collision info object.
| virtual deCollisionInfo::~deCollisionInfo | ( | ) | [virtual] |
Cleans up the collision info object.
| void deCollisionInfo::Clear | ( | ) |
Clears the collision.
| int deCollisionInfo::GetBone | ( | ) | const [inline] |
Retrieves the bone or -1 if no collision occured.
The bone is set if a collider is hit and the collider has bone informations. In all other cases this is -1.
| deCollider* deCollisionInfo::GetCollider | ( | ) | const [inline] |
Retrieves the collider or NULL if no collision occured.
| float deCollisionInfo::GetDistance | ( | ) | const [inline] |
Retrieves the distance travelled along the displacement vector indicated with a value in the range of 0 to 1.
| int deCollisionInfo::GetFace | ( | ) | const [inline] |
Retrieves the face or -1 if no collision occured.
The face is set if a component is hit which has a model assigned to it. In all other cases this is -1.
| deHeightTerrain* deCollisionInfo::GetHeightTerrain | ( | ) | const [inline] |
Retrieves the height terrain or NULL if no collision occured.
| deHeightTerrainSector* deCollisionInfo::GetHTSector | ( | ) | const [inline] |
Retrieves the height terrain sector or NULL if no collision occured.
| const decVector& deCollisionInfo::GetNormal | ( | ) | const [inline] |
Retrieves the hit normal.
| bool deCollisionInfo::GetStopTesting | ( | ) | const [inline] |
Determines if the collision detection has to be stopped.
| bool deCollisionInfo::HasCollision | ( | ) | const |
Determines if a collision occured.
| bool deCollisionInfo::IsCollider | ( | ) | const |
Determines if this is a collider.
| bool deCollisionInfo::IsHTSector | ( | ) | const |
Determines if this is a height terrain sector.
| void deCollisionInfo::SetCollider | ( | deCollider * | collider, |
| int | bone, | ||
| int | face | ||
| ) |
Sets the collider.
Bone is the index of the hit bone if the collider contains bones. Otherwise this is -1 if no particular bone has been hit. The same goes for the face if the collider has a mesh assigned to it.
| void deCollisionInfo::SetDistance | ( | float | distance ) |
Sets the distance travelled along the displacement vector indicated with a value in the range of 0 to 1.
| void deCollisionInfo::SetHTSector | ( | deHeightTerrain * | heightTerrain, |
| deHeightTerrainSector * | sector | ||
| ) |
Sets the given height terrain sector.
| void deCollisionInfo::SetNormal | ( | const decVector & | normal ) |
Sets the hit normal.
| void deCollisionInfo::SetStopTesting | ( | bool | stopTesting ) |
Sets if the collision detection has to be stopped.
1.7.2