Fix issue with display of contact points in testbed application

This commit is contained in:
Daniel Chappuis 2019-06-27 07:16:47 +02:00
parent eccc4faa6d
commit 112253cb81
2 changed files with 3 additions and 3 deletions

View File

@ -189,9 +189,6 @@ void Scene::rotate(int xMouse, int yMouse) {
// Called when some contacts occur // Called when some contacts occur
void Scene::onContact(const rp3d::CollisionCallback::CallbackData& callbackData) { void Scene::onContact(const rp3d::CollisionCallback::CallbackData& callbackData) {
// Clear contacts points
mContactPoints.clear();
// For each contact pair // For each contact pair
for (uint p=0; p < callbackData.getNbContactPairs(); p++) { for (uint p=0; p < callbackData.getNbContactPairs(); p++) {

View File

@ -124,6 +124,9 @@ void SceneDemo::update() {
// Can be called several times per frame // Can be called several times per frame
void SceneDemo::updatePhysics() { void SceneDemo::updatePhysics() {
// Clear contacts points
mContactPoints.clear();
if (getDynamicsWorld() != nullptr) { if (getDynamicsWorld() != nullptr) {
// Take a simulation step // Take a simulation step