mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 15:13:28 +02:00
Head look at should update before rig
This commit is contained in:
parent
99aeb4aa2f
commit
f6aa4a2dd4
1 changed files with 15 additions and 12 deletions
|
@ -906,6 +906,21 @@ void MyAvatar::simulate(float deltaTime, bool inView) {
|
||||||
updateViewBoom();
|
updateViewBoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Head's look at blending needs updating
|
||||||
|
// before we perform rig animations and IK.
|
||||||
|
CameraMode mode = qApp->getCamera().getMode();
|
||||||
|
if (_scriptControlsHeadLookAt || mode == CAMERA_MODE_FIRST_PERSON_LOOK_AT || mode == CAMERA_MODE_FIRST_PERSON ||
|
||||||
|
mode == CAMERA_MODE_LOOK_AT || mode == CAMERA_MODE_SELFIE) {
|
||||||
|
if (!_pointAtActive || !_isPointTargetValid) {
|
||||||
|
updateHeadLookAt(deltaTime);
|
||||||
|
} else {
|
||||||
|
resetHeadLookAt();
|
||||||
|
}
|
||||||
|
} else if (_headLookAtActive) {
|
||||||
|
resetHeadLookAt();
|
||||||
|
_headLookAtActive = false;
|
||||||
|
}
|
||||||
|
|
||||||
// update sensorToWorldMatrix for camera and hand controllers
|
// update sensorToWorldMatrix for camera and hand controllers
|
||||||
// before we perform rig animations and IK.
|
// before we perform rig animations and IK.
|
||||||
updateSensorToWorldMatrix();
|
updateSensorToWorldMatrix();
|
||||||
|
@ -957,18 +972,6 @@ void MyAvatar::simulate(float deltaTime, bool inView) {
|
||||||
head->setPosition(headPosition);
|
head->setPosition(headPosition);
|
||||||
head->setScale(getModelScale());
|
head->setScale(getModelScale());
|
||||||
head->simulate(deltaTime);
|
head->simulate(deltaTime);
|
||||||
CameraMode mode = qApp->getCamera().getMode();
|
|
||||||
if (_scriptControlsHeadLookAt || mode == CAMERA_MODE_FIRST_PERSON_LOOK_AT || mode == CAMERA_MODE_FIRST_PERSON ||
|
|
||||||
mode == CAMERA_MODE_LOOK_AT || mode == CAMERA_MODE_SELFIE) {
|
|
||||||
if (!_pointAtActive || !_isPointTargetValid) {
|
|
||||||
updateHeadLookAt(deltaTime);
|
|
||||||
} else {
|
|
||||||
resetHeadLookAt();
|
|
||||||
}
|
|
||||||
} else if (_headLookAtActive){
|
|
||||||
resetHeadLookAt();
|
|
||||||
_headLookAtActive = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Record avatars movements.
|
// Record avatars movements.
|
||||||
|
|
Loading…
Reference in a new issue