From be06fbd6c75dabf411f33ebdeed29e60fb639694 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 29 Oct 2015 16:05:58 +0100 Subject: [PATCH] use yaw as entity's orientation --- src/world/world.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/world/world.cpp b/src/world/world.cpp index f472da9..08ee294 100644 --- a/src/world/world.cpp +++ b/src/world/world.cpp @@ -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)); } } -- 2.39.2