From ab11e06b65f40d7bad1969492e04e1521551b31a Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 22 Mar 2016 14:31:31 -0400 Subject: [PATCH] Use inverse instead of inverseTransformation --- Source/Scene/Camera.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index 461467a412ca..1732768749c7 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -275,7 +275,10 @@ define([ viewMatrix[15] = 1.0; Matrix4.multiply(viewMatrix, camera._actualInvTransform, camera._viewMatrix); - Matrix4.inverseTransformation(camera._viewMatrix, camera._invViewMatrix); + + // Camera vectors may not be orthonormal when the camera clamps to the terrain + // so apply inverse instead of inverseTransformation + Matrix4.inverse(camera._viewMatrix, camera._invViewMatrix); } var scratchCartographic = new Cartographic();