ReactPhysics3D: reactphysics3d::CollisionCallback::CallbackData Class Reference

| ReactPhysics3D v0.10.2 C++ Physics engine library

Loading...
Searching...
No Matches
Public Member Functions | List of all members
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.
ContactPair | getContactPair (uint64 index) const
| Return a given contact pair.

## 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

  index | Index 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:

- include/reactphysics3d/collision/CollisionCallback.h
- src/collision/CollisionCallback.cpp