mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 15:30:38 +02:00
Fix for combined gyro/depth camera.
This commit is contained in:
parent
c43994fe03
commit
c5c9debed5
1 changed files with 7 additions and 7 deletions
|
@ -290,15 +290,17 @@ void Avatar::updateFromGyrosAndOrWebcam(bool gyroLook, const glm::vec3& amplifyA
|
||||||
Webcam* webcam = Application::getInstance()->getWebcam();
|
Webcam* webcam = Application::getInstance()->getWebcam();
|
||||||
glm::vec3 estimatedPosition, estimatedRotation;
|
glm::vec3 estimatedPosition, estimatedRotation;
|
||||||
if (gyros->isActive()) {
|
if (gyros->isActive()) {
|
||||||
if (webcam->isActive()) {
|
|
||||||
estimatedPosition = webcam->getEstimatedPosition();
|
|
||||||
}
|
|
||||||
estimatedRotation = gyros->getEstimatedRotation();
|
estimatedRotation = gyros->getEstimatedRotation();
|
||||||
|
|
||||||
} else if (webcam->isActive()) {
|
} else if (webcam->isActive()) {
|
||||||
estimatedPosition = webcam->getEstimatedPosition();
|
|
||||||
estimatedRotation = webcam->getEstimatedRotation();
|
estimatedRotation = webcam->getEstimatedRotation();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (webcam->isActive()) {
|
||||||
|
estimatedPosition = webcam->getEstimatedPosition();
|
||||||
|
|
||||||
// compute and store the joint rotations
|
// compute and store the joint rotations
|
||||||
const JointVector& joints = webcam->getEstimatedJoints();
|
const JointVector& joints = webcam->getEstimatedJoints();
|
||||||
_joints.clear();
|
_joints.clear();
|
||||||
|
@ -313,8 +315,6 @@ void Avatar::updateFromGyrosAndOrWebcam(bool gyroLook, const glm::vec3& amplifyA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
_head.setPitch(estimatedRotation.x * amplifyAngle.x);
|
_head.setPitch(estimatedRotation.x * amplifyAngle.x);
|
||||||
_head.setYaw(estimatedRotation.y * amplifyAngle.y);
|
_head.setYaw(estimatedRotation.y * amplifyAngle.y);
|
||||||
|
|
Loading…
Reference in a new issue