This is an event class used to track collsions in the physics world. More...
#include <collision.h>
Public Member Functions | |
Collision () | |
Default Constructor. | |
Collision (const Collision &Other) | |
Copy Constructor. More... | |
virtual | ~Collision () |
Class Destructor. More... | |
virtual void | _SetProxyA (CollidableProxy *A) |
Sets the first Collidable this collision applies to. More... | |
virtual void | _SetProxyB (CollidableProxy *B) |
Sets the second Collidable this collision applies to. More... | |
virtual Whole | GetAge (const Whole &Point) |
Gets the number of simulation steps the contact point has existed. More... | |
virtual Real | GetAppliedImpulse (const Whole &Point) |
Gets the amount of force of the collision. More... | |
virtual Real | GetDistance (const Whole &Point) |
Gets the penetration depth of the collision. More... | |
virtual Vector3 | GetLocalALocation (const Whole &Point) |
Gets the location in ObjectA's local space where the collision occured. More... | |
virtual Vector3 | GetLocalBLocation (const Whole &Point) |
Gets the location in ObjectB's local space where the collision occured. More... | |
virtual Vector3 | GetNormal (const Whole &Point) |
GEts the collision normal for a contact point. More... | |
virtual Whole | GetNumContactPoints () |
Gets the number of contact points this collision is storing. More... | |
virtual WorldObject * | GetObjectA () const |
Gets the parent Object of CollidableProxy A. More... | |
virtual WorldObject * | GetObjectB () const |
Gets the parent Object of CollidableProxy B. More... | |
virtual CollidableProxy * | GetProxyA () const |
Gets the first CollidableProxy this collision applies to. More... | |
virtual CollidableProxy * | GetProxyB () const |
Gets the second CollidableProxy this collision applies to. More... | |
virtual Vector3 | GetWorldLocation (const Whole &Point) |
Gets the location in the world where the collision occured. More... | |
virtual bool | PairsMatch (WorldObject *A, WorldObject *B) const |
Convenience function to see if the provided WorldObject pair match the pair in this class. More... | |
virtual bool | PairsMatch (CollidableProxy *A, CollidableProxy *B) const |
Convenience function to see if the provided CollidableProxy pair match the pair in this class. More... | |
virtual void | Update () |
Updates this collisions contact point data if it needs updating. | |
Protected Member Functions | |
Collision (CollidableProxy *A, CollidableProxy *B, btCollisionAlgorithm *PhysicsAlgo) | |
Class Constructor. More... | |
btManifoldPoint & | GetManifoldPoint (const Whole &Index) |
Internal function responsible for fetching the appropriate contact point. More... | |
void | UpdatePenetrationDistances () |
Updates the PenetrationDistances vector on this object. More... | |
Protected Attributes | |
btCollisionAlgorithm * | InternalAlgo |
The internal collision class this event is based on. More... | |
CollisionInternalData * | InternalData |
Array of manifolds that apply to this collision. More... | |
std::vector< Real > | PenetrationDistances |
This stores the distance of each contact point in this collision, for using to track updates. More... | |
CollidableProxy * | ProxyA |
The first CollidableProxy involved in the collision. More... | |
CollidableProxy * | ProxyB |
The second CollidableProxy invovled in the collision. More... | |
Friends | |
class | Mezzanine::Physics::CollisionDispatcher |
class | Mezzanine::Physics::ParallelCollisionDispatcher |
class | Mezzanine::Physics::PhysicsManager |
This is an event class used to track collsions in the physics world.
This class will be used for tracking collisions in the physics world and will keep track of basic data related to the collision. This class stores the information in the form of contact points. Often when a collision occurs there will be more then one place where the collision occured, this is a contact point. Internally collisions only store up to a maximum of 4 contact points. When querying for collision information, you have to provide the desired contact point index, and it must be valid. If the requested index isn't valid an exception will be thrown. So always make sure to verify with GetNumContactPoints().
Definition at line 72 of file collision.h.
|
protected |
Class Constructor.
This will construct a basic event class with the minimum data needed.
A | The first CollidableProxy involved in the collision. |
B | The second CollidableProxy invovled in the collision. |
PhysicsAlgo | The internal algorithm used for generating collision data. |
Definition at line 67 of file collision.cpp.
Mezzanine::Physics::Collision::Collision | ( | const Collision & | Other) |
Copy Constructor.
Other | The other Collision to copy |
Definition at line 95 of file collision.cpp.
|
virtual |
|
virtual |
Sets the first Collidable this collision applies to.
A | The first Object in this event. |
Definition at line 258 of file collision.cpp.
|
virtual |
Sets the second Collidable this collision applies to.
B | The second Object in this event. |
Definition at line 271 of file collision.cpp.
Gets the number of simulation steps the contact point has existed.
Point | The index of the contact point for this collision. |
Definition at line 252 of file collision.cpp.
Gets the amount of force of the collision.
Point | The index of the contact point for this collision. |
Definition at line 246 of file collision.cpp.
Gets the penetration depth of the collision.
Point | The index of the contact point for this collision. |
Definition at line 249 of file collision.cpp.
Gets the location in ObjectA's local space where the collision occured.
Point | The index of the contact point for this collision. |
Definition at line 237 of file collision.cpp.
Gets the location in ObjectB's local space where the collision occured.
Point | The index of the contact point for this collision. |
Definition at line 240 of file collision.cpp.
|
protected |
Internal function responsible for fetching the appropriate contact point.
Definition at line 123 of file collision.cpp.
GEts the collision normal for a contact point.
Point | The index of the contact point for this collision. |
Definition at line 243 of file collision.cpp.
|
virtual |
Gets the number of contact points this collision is storing.
Definition at line 227 of file collision.cpp.
|
virtual |
Gets the parent Object of CollidableProxy A.
Definition at line 157 of file collision.cpp.
|
virtual |
Gets the parent Object of CollidableProxy B.
Definition at line 160 of file collision.cpp.
|
virtual |
Gets the first CollidableProxy this collision applies to.
Definition at line 151 of file collision.cpp.
|
virtual |
Gets the second CollidableProxy this collision applies to.
Definition at line 154 of file collision.cpp.
Gets the location in the world where the collision occured.
Point | The index of the contact point for this collision. |
Definition at line 230 of file collision.cpp.
|
virtual |
Convenience function to see if the provided WorldObject pair match the pair in this class.
A | The first WorldObject to be compared. Will be checked against both objects in this collision. |
B | The second WorldObject to be compared. Will be checked against both objects in this collision. |
Definition at line 163 of file collision.cpp.
|
virtual |
Convenience function to see if the provided CollidableProxy pair match the pair in this class.
A | The first CollidableProxy to be compared. Will be checked against both objects in this collision. |
B | The second CollidableProxy to be compared. Will be checked against both objects in this collision. |
Definition at line 176 of file collision.cpp.
|
protected |
Updates the PenetrationDistances vector on this object.
Definition at line 137 of file collision.cpp.
|
protected |
The internal collision class this event is based on.
Definition at line 81 of file collision.h.
|
protected |
Array of manifolds that apply to this collision.
Definition at line 84 of file collision.h.
|
protected |
This stores the distance of each contact point in this collision, for using to track updates.
Definition at line 93 of file collision.h.
|
protected |
The first CollidableProxy involved in the collision.
Definition at line 87 of file collision.h.
|
protected |
The second CollidableProxy invovled in the collision.
Definition at line 90 of file collision.h.