From: Daniel Karbach Date: Thu, 29 Oct 2015 15:05:58 +0000 (+0100) Subject: use yaw as entity's orientation X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;ds=inline;h=be06fbd6c75dabf411f33ebdeed29e60fb639694;p=blank.git use yaw as entity's orientation --- 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)); } }