#include <Physics_Collision.h>
Inherits DigitalSpaces::DIObjectBase.
To get access to this information, your implementation needs to have registered with DIPhysics as a DIPhysicsShapeCollisionListener.
Public Member Functions | |
| void | GetPosition (out_Vector3f *pos) |
| Retreive the position of the collision. | |
| void | GetNormal (out_Vector3f *norm) |
| Retreive the normal of the collision. | |
| float | GetPenetration () |
| Retreive the distance which the colliding shapes are penetrating. | |
| DIPhysicsShape * | GetShape () |
| Returns one of the shapes used in the collision. | |
| DIPhysicsShape * | GetOtherShape () |
| Returns one of the shapes used in the collision. | |
| DIPhysicsMaterial * | GetMaterial () |
| Returns the material used to descibe the potential reaction (contact) that will occur due to this collision. | |
| void DigitalSpaces::DIPhysicsCollision::GetPosition | ( | out_Vector3f * | pos | ) |
Retreive the position of the collision.
| [out] | pos | Position of the collision, in world co-ordinates. |
| void DigitalSpaces::DIPhysicsCollision::GetNormal | ( | out_Vector3f * | norm | ) |
Retreive the normal of the collision.
The normal of the collision is the direction between the two shapes. It is the vector/line along which the penetration (as returned from GetPenetration ) is measured.
| [out] | norm | Vector to contain the normal vector of the collision. In world co-ordinates. |
| float DigitalSpaces::DIPhysicsCollision::GetPenetration | ( | ) |
Retreive the distance which the colliding shapes are penetrating.
In theory a value of 0 is possible, meaning the objects are resting against each other. However this does not occur in practice, and objects at "rest" will be slightly interpenetrating.
| DIPhysicsShape* DigitalSpaces::DIPhysicsCollision::GetShape | ( | ) |
Returns one of the shapes used in the collision.
There is no requirement on how the implementation decides which of the shapes should be returned by this function and which by GetOtherShape. However, the value retreived by GetNormal should be pointing out from the shape returned by this function.
| DIPhysicsShape* DigitalSpaces::DIPhysicsCollision::GetOtherShape | ( | ) |
| DIPhysicsMaterial* DigitalSpaces::DIPhysicsCollision::GetMaterial | ( | ) |
Returns the material used to descibe the potential reaction (contact) that will occur due to this collision.
The DIPhysicsShapeCollisionListener implementation can use this to change every aspect about how the simulation will react to the collision, including ignoring it and allowing continuing penetration.
1.5.6