mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:52:26 +02:00
head model follows HMD for observers
This commit is contained in:
parent
653b0d7789
commit
51e24ea466
1 changed files with 6 additions and 3 deletions
|
@ -296,15 +296,18 @@ void MyAvatar::updateFromTrackers(float deltaTime) {
|
||||||
|
|
||||||
Head* head = getHead();
|
Head* head = getHead();
|
||||||
if (inHmd || isPlaying()) {
|
if (inHmd || isPlaying()) {
|
||||||
head->setDeltaPitch(estimatedRotation.x);
|
if (!isRoomTracking) {
|
||||||
head->setDeltaYaw(estimatedRotation.y);
|
head->setDeltaPitch(estimatedRotation.x);
|
||||||
|
head->setDeltaYaw(estimatedRotation.y);
|
||||||
|
head->setDeltaRoll(estimatedRotation.z);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
float magnifyFieldOfView = qApp->getFieldOfView() /
|
float magnifyFieldOfView = qApp->getFieldOfView() /
|
||||||
_realWorldFieldOfView.get();
|
_realWorldFieldOfView.get();
|
||||||
head->setDeltaPitch(estimatedRotation.x * magnifyFieldOfView);
|
head->setDeltaPitch(estimatedRotation.x * magnifyFieldOfView);
|
||||||
head->setDeltaYaw(estimatedRotation.y * magnifyFieldOfView);
|
head->setDeltaYaw(estimatedRotation.y * magnifyFieldOfView);
|
||||||
|
head->setDeltaRoll(estimatedRotation.z);
|
||||||
}
|
}
|
||||||
head->setDeltaRoll(estimatedRotation.z);
|
|
||||||
|
|
||||||
// Update torso lean distance based on accelerometer data
|
// Update torso lean distance based on accelerometer data
|
||||||
const float TORSO_LENGTH = 0.5f;
|
const float TORSO_LENGTH = 0.5f;
|
||||||
|
|
Loading…
Reference in a new issue