density added in physics Component

This commit is contained in:
viktorljung
2015-10-08 11:37:13 +02:00
parent f085e6a387
commit 33ecbaaab3
2 changed files with 12 additions and 18 deletions
+1 -7
View File
@@ -326,7 +326,7 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity)
fixtureDef.shape = pShape;
fixtureDef.density = 10.f;
fixtureDef.density = physicsComponent->Density;
fixtureDef.restitution = 1.0f;
fixtureDef.friction = 0.0f;
body->CreateFixture(&fixtureDef);
@@ -334,12 +334,6 @@ void dd::Systems::PhysicsSystem::CreateBody(EntityID entity)
delete pShape;
/* if(physicsComponent->Static) {
body->SetType(b2BodyType::b2_staticBody);
} else if (! physicsComponent->Static) {
body->SetType(b2BodyType::b2_dynamicBody);
}*/
body->SetGravityScale(physicsComponent->GravityScale);
m_EntitiesToBodies.insert(std::make_pair(entity, body));
m_BodiesToEntities.insert(std::make_pair(body, entity));