From 9849205ca03e47c4968f43a250669699ec552d99 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Wed, 23 Oct 2019 12:32:16 -0700 Subject: [PATCH] Add perf timer to code block --- interface/src/avatar/MyAvatar.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index fa3f6c2461..55ce778b4f 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -908,17 +908,21 @@ void MyAvatar::simulate(float deltaTime, bool inView) { // 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 { + { + 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; } - } else if (_headLookAtActive) { - resetHeadLookAt(); - _headLookAtActive = false; } // update sensorToWorldMatrix for camera and hand controllers