]> git.localhorst.tv Git - blank.git/commitdiff
use model -Z for heading when not moving
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 30 Oct 2015 08:46:48 +0000 (09:46 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 30 Oct 2015 08:46:48 +0000 (09:46 +0100)
src/world/world.cpp

index 08ee294fca5e5a8b72351be8bb3ff3e3e40abdd2..bf2abf3315b03eaff6ce31577caf7d47dbd8f749 100644 (file)
@@ -161,8 +161,8 @@ void Entity::UpdateHeading() noexcept {
                heading = Velocity() / speed;
        } else {
                speed = 0.0f;
-               // use -Z (forward axis) of local view transform
-               heading = -glm::vec3(view_transform[2]);
+               // use -Z (forward axis) of model transform (our "chest")
+               heading = -glm::vec3(model_transform[2]);
        }
 }