Removed old input events from client

This commit is contained in:
stiffly
2015-12-15 17:22:46 +01:00
parent 9b348a7d97
commit 082b3fd3df
4 changed files with 10 additions and 61 deletions
+5 -3
View File
@@ -2,7 +2,7 @@
void PlayerSystem::UpdateComponent(World * world, ComponentWrapper & player, double dt)
{
(glm::vec3)player["Velocity"] = glm::vec3(0.f);
(glm::vec3)player["Velocity"] = glm::vec3(0.f, 0.f, 0.f);
if (player["Forward"]) {
((glm::vec3&)player["Velocity"]).z = m_Speed * float(dt) * -1;
}
@@ -16,6 +16,8 @@ void PlayerSystem::UpdateComponent(World * world, ComponentWrapper & player, dou
((glm::vec3&)player["Velocity"]).x = m_Speed * float(dt);
}
ComponentWrapper& transform = world->GetComponent(player.EntityID, "Transform");
(glm::vec3&)transform["Position"] += (glm::vec3)player["Velocity"];
if ((glm::vec3)player["Velocity"] != glm::vec3(0.f)) {
ComponentWrapper& transform = world->GetComponent(player.EntityID, "Transform");
(glm::vec3&)transform["Position"] += (glm::vec3)player["Velocity"];
}
}