From 29a0e03a13361b7bc7793f443ab81490876225aa Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Thu, 27 Jun 2019 07:24:35 +0200 Subject: [PATCH] Fix display of contact points in ray casting scene of the testbed application --- testbed/scenes/raycast/RaycastScene.cpp | 2 +- testbed/scenes/raycast/RaycastScene.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/testbed/scenes/raycast/RaycastScene.cpp b/testbed/scenes/raycast/RaycastScene.cpp index 02133dcb..1c5bb9c0 100644 --- a/testbed/scenes/raycast/RaycastScene.cpp +++ b/testbed/scenes/raycast/RaycastScene.cpp @@ -33,7 +33,7 @@ using namespace raycastscene; // Constructor RaycastScene::RaycastScene(const std::string& name, EngineSettings& settings) : SceneDemo(name, settings, SCENE_RADIUS, false), mMeshFolderPath("meshes/"), - mRaycastManager(mPhongShader, mMeshFolderPath), mCurrentBodyIndex(-1), + mRaycastManager(mPhongShader, mMeshFolderPath, mContactPoints), mCurrentBodyIndex(-1), mAreNormalsDisplayed(false), mVBOVertices(GL_ARRAY_BUFFER) { mIsContactPointsDisplayed = true; diff --git a/testbed/scenes/raycast/RaycastScene.h b/testbed/scenes/raycast/RaycastScene.h index fe17297c..6de17c45 100644 --- a/testbed/scenes/raycast/RaycastScene.h +++ b/testbed/scenes/raycast/RaycastScene.h @@ -64,17 +64,17 @@ class RaycastManager : public rp3d::RaycastCallback { private: - /// All the visual contact points - std::vector mHitPoints; + /// Reference to the list of contact points of the scene + std::vector& mHitPoints; /// Contact point mesh folder path std::string mMeshFolderPath; public: - RaycastManager(openglframework::Shader& shader, - const std::string& meshFolderPath) - : mMeshFolderPath(meshFolderPath) { + RaycastManager(openglframework::Shader& shader, const std::string& meshFolderPath, + std::vector& hitPoints) + : mMeshFolderPath(meshFolderPath), mHitPoints(hitPoints) { }