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

Method deleteBoxShape

src/engine/PhysicsCommon.cpp:350–364  ·  view source on GitHub ↗

Delete a box collision shape * @param boxShape A pointer to the box shape to destroy */

Source from the content-addressed store, hash-verified

348 * @param boxShape A pointer to the box shape to destroy
349 */
350void PhysicsCommon::deleteBoxShape(BoxShape* boxShape) {
351
352 // If the shape is still part of some colliders
353 if (boxShape->mColliders.size() > 0) {
354
355 RP3D_LOG("PhysicsCommon", Logger::Level::Error, Logger::Category::PhysicCommon,
356 "Error when destroying the BoxShape because it is still used by some colliders", __FILE__, __LINE__);
357 }
358
359 // Call the destructor of the shape
360 boxShape->~BoxShape();
361
362 // Release allocated memory
363 mMemoryManager.release(MemoryManager::AllocationType::Pool, boxShape, sizeof(BoxShape));
364}
365
366// Create and return a capsule shape
367/**

Callers

nothing calls this directly

Calls 3

~BoxShapeMethod · 0.80
sizeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected