void Body::updateBeforePhysics() { if (!isActive()) { return; } if (mFixturesDirty) { createFixtures(); mFixturesDirty = false; mTransformDirty = true; } if (mTransformDirty) { Actor* actor = getActor(); if (actor) { QPointF pos = actor->position(); mBody->SetTransform(b2Vec2(pos.x(), pos.y()), qDegreesToRadians(actor->rotation())); } mTransformDirty = false; } }
void Entity::createB2Data() { createBody(); createFixtures(); _body->SetUserData(this); }