To identify the different rigid bodies we are going to be adding to the scene, we will add a property to the MeshRenderer class that will specify each object being rendered. Let's look at how to do this:
- In the MeshRenderer.h class, which can be found within the MeshRenderer class, change the constructor of the class to take in a string as the name for the object, as follows:
MeshRenderer(MeshType modelType, std::string _name, Camera *
_camera, btRigidBody* _rigidBody)
- Add a new public property called name of the std::string type and initialize it, as follows:
std::string name = "";
- Next, in the MeshRenderer.cpp file, modify the constructor implementation, as follows:
MeshRenderer::MeshRenderer(MeshType modelType, std::string _name,...
Camera* _camera, btRigidBody* _rigidBody){ name = _name; ... ... }