From 176f1beb08e56611ec8010f88c8ccd5bd3cfd7a7 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 10 Apr 2015 17:50:41 +0200 Subject: [PATCH] Fix camera quick turn --- examples/libraries/entityCameraTool.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/examples/libraries/entityCameraTool.js b/examples/libraries/entityCameraTool.js index da6a35b273..d27d95c161 100644 --- a/examples/libraries/entityCameraTool.js +++ b/examples/libraries/entityCameraTool.js @@ -448,11 +448,8 @@ CameraManager = function() { var scale = Math.min(dt * EASING_MULTIPLIER, 1.0); - var dYaw = that.targetYaw - that.yaw; - if (dYaw > 180) dYaw -= 360; - if (dYaw < -180) dYaw += 360; - - var dPitch = that.targetPitch - that.pitch; + var dYaw = normalizeDegrees(that.targetYaw - that.yaw); + var dPitch = normalizeDegrees(that.targetPitch - that.pitch); that.yaw += scale * dYaw; that.pitch += scale * dPitch;