mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-23 10:54:26 +02:00
Improved using faceshift to turn body
This commit is contained in:
parent
184c0a67d1
commit
582a71990e
1 changed files with 6 additions and 4 deletions
|
@ -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()) {
|
||||||
|
|
Loading…
Reference in a new issue