mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-09 21:52:11 +02:00
Merge pull request #16386 from luiscuenca/fixStrafingError
DEV-2475: Fix head twitching when strafing
This commit is contained in:
commit
3268fa7a9f
1 changed files with 19 additions and 12 deletions
|
@ -906,6 +906,25 @@ void MyAvatar::simulate(float deltaTime, bool inView) {
|
|||
updateViewBoom();
|
||||
}
|
||||
|
||||
// Head's look at blending needs updating
|
||||
// before we perform rig animations and IK.
|
||||
{
|
||||
PerformanceTimer perfTimer("lookat");
|
||||
|
||||
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
|
||||
// before we perform rig animations and IK.
|
||||
updateSensorToWorldMatrix();
|
||||
|
@ -957,18 +976,6 @@ void MyAvatar::simulate(float deltaTime, bool inView) {
|
|||
head->setPosition(headPosition);
|
||||
head->setScale(getModelScale());
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue