//------------------------------------------------------------- //Crea un body cinemático con un fixture rectangular centrado en el origen //------------------------------------------------------------- b2Body* PhysicManager::CreateRectangularKinematicBody(float sizeX, float sizeY){ b2Body* body= CreateKinematicBody(); b2FixtureDef box=CreateRectangularFixtureDef(sizeX,sizeY,0.0f,0.0f,0.0f); body->CreateFixture(&box); return body; }
//------------------------------------------------------------- //Crea un body estático con un fixture rectangular centrado en el origen //------------------------------------------------------------- b2Body* PhysicManager::CreateRectangularStaticBody(float sizeX, float sizeY,float density, float friction, float restitution){ b2Body* body= CreateStaticBody(); b2FixtureDef box=CreateRectangularFixtureDef(sizeX,sizeY,density,friction,restitution); body->CreateFixture(&box); return body; }
b2Body* Game::CreateRectangularStaticBody(b2World *phyWorld, float sizeX, float sizeY){ b2Body* body = CreateStaticBody(phyWorld); b2FixtureDef box = CreateRectangularFixtureDef(sizeX,sizeY,0.0f,0.5f,0.5f); body->CreateFixture(&box); return body; }