Fix display of contact points in ray casting scene of the testbed application

This commit is contained in:
Daniel Chappuis 2019-06-27 07:24:35 +02:00
parent 112253cb81
commit 29a0e03a13
2 changed files with 6 additions and 6 deletions

View File

@ -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;

View File

@ -64,17 +64,17 @@ class RaycastManager : public rp3d::RaycastCallback {
private:
/// All the visual contact points
std::vector<SceneContactPoint> mHitPoints;
/// Reference to the list of contact points of the scene
std::vector<SceneContactPoint>& 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<SceneContactPoint>& hitPoints)
: mMeshFolderPath(meshFolderPath), mHitPoints(hitPoints) {
}