diff --git a/interface/src/Avatar.cpp b/interface/src/Avatar.cpp index ccec4cbdee..c2c850c923 100755 --- a/interface/src/Avatar.cpp +++ b/interface/src/Avatar.cpp @@ -290,15 +290,17 @@ void Avatar::updateFromGyrosAndOrWebcam(bool gyroLook, const glm::vec3& amplifyA Webcam* webcam = Application::getInstance()->getWebcam(); glm::vec3 estimatedPosition, estimatedRotation; if (gyros->isActive()) { - if (webcam->isActive()) { - estimatedPosition = webcam->getEstimatedPosition(); - } estimatedRotation = gyros->getEstimatedRotation(); - + } else if (webcam->isActive()) { - estimatedPosition = webcam->getEstimatedPosition(); estimatedRotation = webcam->getEstimatedRotation(); + } else { + return; + } + if (webcam->isActive()) { + estimatedPosition = webcam->getEstimatedPosition(); + // compute and store the joint rotations const JointVector& joints = webcam->getEstimatedJoints(); _joints.clear(); @@ -313,8 +315,6 @@ void Avatar::updateFromGyrosAndOrWebcam(bool gyroLook, const glm::vec3& amplifyA } } } - } else { - return; } _head.setPitch(estimatedRotation.x * amplifyAngle.x); _head.setYaw(estimatedRotation.y * amplifyAngle.y);