ReactPhysics3D  v0.10.2
C++ Physics engine library
Loading...
Searching...
No Matches
reactphysics3d::EventListener Class Reference

This class can be used to receive notifications about events that occur during the simulation. More...

#include <include/reactphysics3d/engine/EventListener.h>

Inheritance diagram for reactphysics3d::EventListener:
reactphysics3d::CollisionCallback reactphysics3d::DebugRenderer

Public Member Functions

 EventListener ()=default
 Constructor.
 
virtual ~EventListener () override=default
 Destructor.
 
virtual void onContact (const CollisionCallback::CallbackData &) override
 Called when some contacts occur.
 
virtual void onTrigger (const OverlapCallback::CallbackData &)
 Called when some trigger events occur.
 
- Public Member Functions inherited from reactphysics3d::CollisionCallback
virtual ~CollisionCallback ()=default
 Destructor.
 

Detailed Description

This class can be used to receive notifications about events that occur during the simulation.

In order to receive callbacks, you need to create a new class that inherits from this one and you must override the methods that you need. Then, you will need to register your new event listener class to the physics world using the PhysicsWorld::setEventListener() method.

Member Function Documentation

◆ onContact()

virtual void reactphysics3d::EventListener::onContact ( const CollisionCallback::CallbackData )
inlineoverridevirtual

Called when some contacts occur.

Parameters
callbackDataContains information about all the contacts

Implements reactphysics3d::CollisionCallback.

Reimplemented in reactphysics3d::DebugRenderer.

◆ onTrigger()

virtual void reactphysics3d::EventListener::onTrigger ( const OverlapCallback::CallbackData )
inlinevirtual

Called when some trigger events occur.

Parameters
callbackDataContains information about all the triggers that are colliding

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