]> git.localhorst.tv Git - blank.git/commitdiff
use yaw as entity's orientation
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 29 Oct 2015 15:05:58 +0000 (16:05 +0100)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Thu, 29 Oct 2015 15:06:32 +0000 (16:06 +0100)
src/world/world.cpp

index f472da94f2f20a46cfe9d6a1f16fb4c0fbe629e7..08ee294fca5e5a8b72351be8bb3ff3e3e40abdd2 100644 (file)
@@ -128,15 +128,9 @@ Ray Entity::Aim(const Chunk::Pos &chunk_offset) const noexcept {
 
 void Entity::UpdateModel() noexcept {
        state.AdjustHeading();
+       state.orient = glm::quat(glm::vec3(0.0f, state.yaw, 0.0f));
        if (model) {
-               Part::State &body_state = model.BodyState();
-               Part::State &eyes_state = model.EyesState();
-               if (&body_state != &eyes_state) {
-                       body_state.orientation = glm::quat(glm::vec3(0.0f, state.yaw, 0.0f));
-                       eyes_state.orientation = glm::quat(glm::vec3(state.pitch, 0.0f, 0.0f));
-               } else {
-                       eyes_state.orientation = glm::quat(glm::vec3(state.pitch, state.yaw, 0.0f));
-               }
+               model.EyesState().orientation = glm::quat(glm::vec3(state.pitch, 0.0f, 0.0f));
        }
 }