From e439694d72b5c791346a255af10178fe31ec424f Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 7 May 2014 22:56:06 -0700 Subject: [PATCH] =?UTF-8?q?reset=20only=20pitch=20and=20roll=20on=20spaceb?= =?UTF-8?q?ar=20so=20that=20you=20don=E2=80=99t=20turn=20away=20from=20som?= =?UTF-8?q?eone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interface/src/avatar/MyAvatar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 1655a17f08..f320a2759d 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -99,7 +99,11 @@ void MyAvatar::reset() { setVelocity(glm::vec3(0.0f)); setThrust(glm::vec3(0.0f)); - setOrientation(glm::quat(glm::vec3(0.0f))); + // Reset the pitch and roll components of the avatar's orientation, preserve yaw direction + glm::vec3 eulers = safeEulerAngles(getOrientation()); + eulers.x = 0.f; + eulers.z = 0.f; + setOrientation(glm::quat(eulers)); } void MyAvatar::update(float deltaTime) {