MCPcopy Create free account
hub / github.com/axmolengine/axmol / doAddBody

Method doAddBody

core/physics/PhysicsWorld.cpp:568–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566}
567
568void PhysicsWorld::doAddBody(PhysicsBody* body)
569{
570 if (body->isEnabled())
571 {
572 // add body to space
573 if (!cpSpaceContainsBody(_cpSpace, body->_cpBody))
574 {
575 cpSpaceAddBody(_cpSpace, body->_cpBody);
576 }
577
578 // add shapes to space
579 for (auto&& shape : body->getShapes())
580 {
581 addShape(dynamic_cast<PhysicsShape*>(shape));
582 }
583 }
584}
585
586void PhysicsWorld::addBodyOrDelay(PhysicsBody* body)
587{

Callers

nothing calls this directly

Calls 4

cpSpaceContainsBodyFunction · 0.85
cpSpaceAddBodyFunction · 0.85
getShapesMethod · 0.80
isEnabledMethod · 0.45

Tested by

no test coverage detected