Add rigidBodyUpdated function to EventListener
This commit is contained in:
parent
5c736565a7
commit
890f6a3f97
@ -229,6 +229,9 @@ void DynamicsWorld::updateBodiesState() {
|
||||
|
||||
// Update the broad-phase state of the body
|
||||
bodies[b]->updateBroadPhaseState();
|
||||
|
||||
// Notify the event listener that the body has been updated
|
||||
if (mEventListener != nullptr) { mEventListener->rigidBodyUpdated(bodies[b]); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,6 +66,11 @@ class EventListener {
|
||||
/// engine will do several internal simulation steps. This method is
|
||||
/// called at the end of each internal simulation step.
|
||||
virtual void endInternalTick() {}
|
||||
|
||||
/// Called every time a RigidBody is updated as part of the
|
||||
/// DynamicsWorld::update() step. The pointer provided as a parameter
|
||||
/// to this function is the RigidBody that has been updated.
|
||||
virtual void rigidBodyUpdated(const RigidBody* body) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user