Improved using faceshift to turn body

This commit is contained in:
Philip Rosedale 2013-11-22 15:08:16 -08:00
parent 184c0a67d1
commit 582a71990e

View file

@ -384,10 +384,12 @@ void MyAvatar::updateFromGyrosAndOrWebcam(bool turnWithHead) {
// Rotate the body if the head is turned quickly // Rotate the body if the head is turned quickly
if (turnWithHead) { if (turnWithHead) {
glm::vec3 headAngularVelocity = faceshift->getHeadAngularVelocity(); glm::vec3 headAngularVelocity = faceshift->getHeadAngularVelocity();
const float FACESHIFT_YAW_VIEW_SENSITIVITY = 20.f; const float FACESHIFT_YAW_TURN_SENSITIVITY = 0.25f;
const float FACESHIFT_MIN_YAW_VELOCITY = 1.0f; const float FACESHIFT_MIN_YAW_TURN = 10.f;
if (fabs(headAngularVelocity.y) > FACESHIFT_MIN_YAW_VELOCITY) { const float FACESHIFT_MAX_YAW_TURN = 30.f;
_bodyYawDelta += headAngularVelocity.y * FACESHIFT_YAW_VIEW_SENSITIVITY; if ( (fabs(estimatedRotation.y) > FACESHIFT_MIN_YAW_TURN) &&
(fabs(estimatedRotation.y) < FACESHIFT_MAX_YAW_TURN) ) {
_bodyYawDelta += estimatedRotation.y * FACESHIFT_YAW_TURN_SENSITIVITY;
} }
} }
} else if (gyros->isActive()) { } else if (gyros->isActive()) {