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

Method deleteCapsuleShape

src/engine/PhysicsCommon.cpp:408–422  ·  view source on GitHub ↗

Delete a capsule collision shape * @param capsuleShape A pointer to the capsule shape to destroy */

Source from the content-addressed store, hash-verified

406 * @param capsuleShape A pointer to the capsule shape to destroy
407 */
408void PhysicsCommon::deleteCapsuleShape(CapsuleShape* capsuleShape) {
409
410 // If the shape is still part of some colliders
411 if (capsuleShape->mColliders.size() > 0) {
412
413 RP3D_LOG("PhysicsCommon", Logger::Level::Error, Logger::Category::PhysicCommon,
414 "Error when destroying the CapsuleShape because it is still used by some colliders", __FILE__, __LINE__);
415 }
416
417 // Call the destructor of the shape
418 capsuleShape->~CapsuleShape();
419
420 // Release allocated memory
421 mMemoryManager.release(MemoryManager::AllocationType::Pool, capsuleShape, sizeof(CapsuleShape));
422}
423
424// Create and return a convex mesh shape
425/**

Callers

nothing calls this directly

Calls 3

~CapsuleShapeMethod · 0.80
sizeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected