Movement code not buggy anymore. Also changed package to not allocate more data than needed.

This commit is contained in:
stiffly
2015-12-16 13:52:16 +01:00
parent a2d55feed1
commit 50ccf96268
3 changed files with 10 additions and 8 deletions
+5 -5
View File
@@ -2,17 +2,17 @@
void PlayerSystem::UpdateComponent(World * world, ComponentWrapper & player, double dt)
{
(glm::vec3)player["Velocity"] = glm::vec3(0.f, 0.f, 0.f);
if (static_cast<bool>(player["Forward"])== true) {
player["Velocity"] = glm::vec3(0.f, 0.f, 0.f);
if ((bool&)player["Forward"] == true) {
((glm::vec3&)player["Velocity"]).z = m_Speed * float(dt) * -1;
}
if (static_cast<bool>(player["Left"]) == true) {
if ((bool&)player["Left"] == true) {
((glm::vec3&)player["Velocity"]).x = m_Speed * float(dt) * -1;
}
if (static_cast<bool>(player["Back"]) == true) {
if ((bool&)player["Back"] == true) {
((glm::vec3&)player["Velocity"]).z = m_Speed * float(dt);
}
if (static_cast<bool>(player["Right"]) == true) {
if ((bool&)player["Right"] == true) {
((glm::vec3&)player["Velocity"]).x = m_Speed * float(dt);
}