void DynamicsWorld::AddRigidBody(RigidBody &body, short group, short mask) { auto prevWorld = body.GetWorld(); if (prevWorld != nullptr) { prevWorld->RemoveRigidBody(body); } body.SetWorld(this); this->world.addRigidBody(&body, group, mask); }
void DynamicsWorld::RemoveRigidBody(RigidBody &body) { body.SetWorld(nullptr); this->world.removeRigidBody(&body); }