ReactPhysics3D  v0.10.1
C++ Physics engine library
reactphysics3d::CollisionCallback::CallbackData Class Reference

This class contains data about contacts between bodies. More...

#include <include/reactphysics3d/collision/CollisionCallback.h>

Public Member Functions

uint32 getNbContactPairs () const
 Return the number of contact pairs. More...
 
ContactPair getContactPair (uint64 index) const
 Return a given contact pair. More...
 

Detailed Description

This class contains data about contacts between bodies.

Member Function Documentation

◆ getContactPair()

CollisionCallback::ContactPair CollisionCallback::CallbackData::getContactPair ( uint64  index) const

Return a given contact pair.

Note that the returned ContactPair object is only valid during the call of the CollisionCallback::onContact() method.

Parameters
indexIndex of the contact pair to retrieve
Returns
A contact pair object

Therefore, you need to get contact data from it and make a copy. Do not make a copy of the ContactPair object itself because it won't be valid after the CollisionCallback::onContact() call.

◆ getNbContactPairs()

RP3D_FORCE_INLINE uint32 reactphysics3d::CollisionCallback::CallbackData::getNbContactPairs ( ) const

Return the number of contact pairs.

Returns
The number of contact pairs

The documentation for this class was generated from the following files: