density added in physics Component
This commit is contained in:
+11
-11
@@ -39,20 +39,20 @@ enum Type
|
||||
|
||||
bool Calculate = false;
|
||||
float GravityScale = 0.f;
|
||||
float Density = 10.f;
|
||||
|
||||
|
||||
CollisionLayer::Type Category = CollisionLayer::Type::Other;
|
||||
CollisionLayer::Type Mask = static_cast<CollisionLayer::Type>(
|
||||
CollisionLayer::Pad
|
||||
| CollisionLayer::Ball
|
||||
| CollisionLayer::Brick
|
||||
| CollisionLayer::Water
|
||||
| CollisionLayer::PowerUp
|
||||
| CollisionLayer::Wall
|
||||
| CollisionLayer::Other
|
||||
);
|
||||
};
|
||||
|
||||
CollisionLayer::Type Mask = static_cast<CollisionLayer::Type>(
|
||||
CollisionLayer::Pad
|
||||
| CollisionLayer::Ball
|
||||
| CollisionLayer::Brick
|
||||
| CollisionLayer::Water
|
||||
| CollisionLayer::PowerUp
|
||||
| CollisionLayer::Wall
|
||||
| CollisionLayer::Other
|
||||
);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user