MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / deleteSphereShape

Method deleteSphereShape

src/engine/PhysicsCommon.cpp:300–314  ·  view source on GitHub ↗

Delete a sphere collision shape * @param sphereShape A pointer to the sphere collision shape to destroy */

Source from the content-addressed store, hash-verified

298 * @param sphereShape A pointer to the sphere collision shape to destroy
299 */
300void PhysicsCommon::deleteSphereShape(SphereShape* sphereShape) {
301
302 // If the shape is still part of some colliders
303 if (sphereShape->mColliders.size() > 0) {
304
305 RP3D_LOG("PhysicsCommon", Logger::Level::Error, Logger::Category::PhysicCommon,
306 "Error when destroying the SphereShape because it is still used by some colliders", __FILE__, __LINE__);
307 }
308
309 // Call the destructor of the shape
310 sphereShape->~SphereShape();
311
312 // Release allocated memory
313 mMemoryManager.release(MemoryManager::AllocationType::Pool, sphereShape, sizeof(SphereShape));
314}
315
316// Create and return a box collision shape
317/**

Callers

nothing calls this directly

Calls 3

~SphereShapeMethod · 0.80
sizeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected