From be1fae5958c27ef29ab5cbd15f92f366c889b94e Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Thu, 23 May 2013 11:37:27 -0700 Subject: [PATCH] Move head back to center when moving --- interface/src/Avatar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/src/Avatar.cpp b/interface/src/Avatar.cpp index 51039bbc18..801ce8cf38 100644 --- a/interface/src/Avatar.cpp +++ b/interface/src/Avatar.cpp @@ -378,11 +378,13 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) { // Compute instantaneous acceleration float acceleration = glm::distance(getVelocity(), oldVelocity) / deltaTime; const float ACCELERATION_PITCH_DECAY = 0.4f; + const float ACCELERATION_YAW_DECAY = 0.4f; // Decay HeadPitch as a function of acceleration, so that you look straight ahead when // you start moving, but don't do this with an HMD like the Oculus. if (!OculusManager::isConnected()) { _head.setPitch(_head.getPitch() * (1.f - acceleration * ACCELERATION_PITCH_DECAY * deltaTime)); + _head.setYaw(_head.getYaw() * (1.f - acceleration * ACCELERATION_YAW_DECAY * deltaTime)); } //apply the head lean values to the springy position...