ReactPhysics3D
v0.10.2
C++ Physics engine library
|
This class represents the contact between two colliders of the physics world. More...
#include <include/reactphysics3d/collision/CollisionCallback.h>
Public Types | |
enum class | EventType { ContactStart , ContactStay , ContactExit } |
Enumeration EventType that describes the type of contact event. More... | |
Public Member Functions | |
ContactPair (const ContactPair &contactPair)=default | |
Copy constructor. | |
ContactPair & | operator= (const ContactPair &contactPair)=delete |
Assignment operator. | |
~ContactPair ()=default | |
Destructor. | |
uint32 | getNbContactPoints () const |
Return the number of contact points in the contact pair. | |
ContactPoint | getContactPoint (uint32 index) const |
Return a given contact point. | |
Body * | getBody1 () const |
Return a pointer to the first body in contact. | |
Body * | getBody2 () const |
Return a pointer to the second body in contact. | |
Collider * | getCollider1 () const |
Return a pointer to the first collider in contact (in body 1) | |
Collider * | getCollider2 () const |
Return a pointer to the second collider in contact (in body 2) | |
EventType | getEventType () const |
Return the corresponding type of event for this contact pair. | |
This class represents the contact between two colliders of the physics world.
A contact pair contains an array of contact points.
|
strong |
Enumeration EventType that describes the type of contact event.
Body * CollisionCallback::ContactPair::getBody1 | ( | ) | const |
Return a pointer to the first body in contact.
Body * CollisionCallback::ContactPair::getBody2 | ( | ) | const |
Return a pointer to the second body in contact.
Collider * CollisionCallback::ContactPair::getCollider1 | ( | ) | const |
Return a pointer to the first collider in contact (in body 1)
Collider * CollisionCallback::ContactPair::getCollider2 | ( | ) | const |
Return a pointer to the second collider in contact (in body 2)
CollisionCallback::ContactPoint CollisionCallback::ContactPair::getContactPoint | ( | uint32 | index | ) | const |
Return a given contact point.
Note that the returned ContactPoint object is only valid during the call of the CollisionCallback::onContact() method.
index | Index of the contact point to retrieve |
Therefore, you need to get contact data from it and make a copy. Do not make a copy of the ContactPoint object itself because it won't be valid after the CollisionCallback::onContact() call.
CollisionCallback::ContactPair::EventType CollisionCallback::ContactPair::getEventType | ( | ) | const |
Return the corresponding type of event for this contact pair.
RP3D_FORCE_INLINE uint32 reactphysics3d::CollisionCallback::ContactPair::getNbContactPoints | ( | ) | const |
Return the number of contact points in the contact pair.