Destructor
| 72 | |
| 73 | // Destructor |
| 74 | Capsule::~Capsule() { |
| 75 | |
| 76 | if (totalNbCapsules == 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.destroyCapsuleShape(mCapsuleShape); |
| 91 | |
| 92 | totalNbCapsules--; |
| 93 | } |
| 94 | |
| 95 | // Render the sphere at the correct position and with the correct orientation |
| 96 | void Capsule::render(openglframework::Shader& shader, const openglframework::Matrix4& worldToCameraMatrix) { |
nothing calls this directly
no test coverage detected