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

Method deleteHeightFieldShape

src/engine/PhysicsCommon.cpp:536–550  ·  view source on GitHub ↗

Delete a height-field shape * @param heightFieldShape A pointer to the height field shape to destroy */

Source from the content-addressed store, hash-verified

534 * @param heightFieldShape A pointer to the height field shape to destroy
535 */
536void PhysicsCommon::deleteHeightFieldShape(HeightFieldShape* heightFieldShape) {
537
538 // If the shape is still part of some colliders
539 if (heightFieldShape->mColliders.size() > 0) {
540
541 RP3D_LOG("PhysicsCommon", Logger::Level::Error, Logger::Category::PhysicCommon,
542 "Error when destroying the HeightFieldShape because it is still used by some colliders", __FILE__, __LINE__);
543 }
544
545 // Call the destructor of the shape
546 heightFieldShape->~HeightFieldShape();
547
548 // Release allocated memory
549 mMemoryManager.release(MemoryManager::AllocationType::Pool, heightFieldShape, sizeof(HeightFieldShape));
550}
551
552// Create and return a concave mesh shape
553/**

Callers

nothing calls this directly

Calls 3

~HeightFieldShapeMethod · 0.80
sizeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected