Destructor
| 72 | |
| 73 | // Destructor |
| 74 | Sphere::~Sphere() { |
| 75 | |
| 76 | if (totalNbSpheres == 1) { |
| 77 | |
| 78 | // Destroy the mesh |
| 79 | destroy(); |
| 80 | |
| 81 | // Destroy the VBOs and VAO |
| 82 | mVBOIndices.destroy(); |
| 83 | mVBOVertices.destroy(); |
| 84 | mVBONormals.destroy(); |
| 85 | mVBOTextureCoords.destroy(); |
| 86 | mVAO.destroy(); |
| 87 | } |
| 88 | |
| 89 | mPhysicsWorld->destroyRigidBody(mBody); |
| 90 | mPhysicsCommon.destroySphereShape(mCollisionShape); |
| 91 | totalNbSpheres--; |
| 92 | } |
| 93 | |
| 94 | // Render the sphere at the correct position and with the correct orientation |
| 95 | void Sphere::render(openglframework::Shader& shader, const openglframework::Matrix4& worldToCameraMatrix) { |
nothing calls this directly
no test coverage detected