Movement code not buggy anymore. Also changed package to not allocate more data than needed.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user