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

Method addBody

core/physics/PhysicsWorld.cpp:548–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548void PhysicsWorld::addBody(PhysicsBody* body)
549{
550 AXASSERT(body != nullptr, "the body can not be nullptr");
551
552 if (body->getWorld() == this)
553 {
554 return;
555 }
556
557 if (body->getWorld() != nullptr)
558 {
559 body->removeFromWorld();
560 }
561
562 addBodyOrDelay(body);
563 _bodies.pushBack(body);
564 body->_world = this;
565 body->setFixedUpdate(_fixedRate > 0);
566}
567
568void PhysicsWorld::doAddBody(PhysicsBody* body)
569{

Callers 1

addToPhysicsWorldMethod · 0.80

Calls 2

removeFromWorldMethod · 0.80
pushBackMethod · 0.80

Tested by

no test coverage detected