Removed old input events from client
This commit is contained in:
@@ -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"];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user