From 112253cb8136e571ab2dc60920797daf95ef65a0 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Thu, 27 Jun 2019 07:16:47 +0200 Subject: [PATCH] Fix issue with display of contact points in testbed application --- testbed/src/Scene.cpp | 3 --- testbed/src/SceneDemo.cpp | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testbed/src/Scene.cpp b/testbed/src/Scene.cpp index a89fa7c9..4f6e31d9 100644 --- a/testbed/src/Scene.cpp +++ b/testbed/src/Scene.cpp @@ -189,9 +189,6 @@ void Scene::rotate(int xMouse, int yMouse) { // Called when some contacts occur void Scene::onContact(const rp3d::CollisionCallback::CallbackData& callbackData) { - // Clear contacts points - mContactPoints.clear(); - // For each contact pair for (uint p=0; p < callbackData.getNbContactPairs(); p++) { diff --git a/testbed/src/SceneDemo.cpp b/testbed/src/SceneDemo.cpp index 97e4a2e9..d4fa3fcc 100644 --- a/testbed/src/SceneDemo.cpp +++ b/testbed/src/SceneDemo.cpp @@ -124,6 +124,9 @@ void SceneDemo::update() { // Can be called several times per frame void SceneDemo::updatePhysics() { + // Clear contacts points + mContactPoints.clear(); + if (getDynamicsWorld() != nullptr) { // Take a simulation step