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) { }