From 4556de2c88a3bff222e020a16cdcfca6faede4ed Mon Sep 17 00:00:00 2001 From: Ed Mackey <elm19087@gmail.com> Date: Wed, 20 Mar 2019 14:14:34 -0400 Subject: [PATCH 1/2] Protect Cesium from crashing when the camera goes through terrain. --- Source/Scene/Camera.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Scene/Camera.js b/Source/Scene/Camera.js index 4323052d83e0..66424b457c57 100644 --- a/Source/Scene/Camera.js +++ b/Source/Scene/Camera.js @@ -1781,8 +1781,8 @@ define([ var rotateVertScratchNegate = new Cartesian3(); function rotateVertical(camera, angle) { var position = camera.position; - var p = Cartesian3.normalize(position, rotateVertScratchP); - if (defined(camera.constrainedAxis)) { + if (defined(camera.constrainedAxis) && !Cartesian3.equalsEpsilon(camera.position, Cartesian3.ZERO, CesiumMath.EPSILON2)) { + var p = Cartesian3.normalize(position, rotateVertScratchP); var northParallel = Cartesian3.equalsEpsilon(p, camera.constrainedAxis, CesiumMath.EPSILON2); var southParallel = Cartesian3.equalsEpsilon(p, Cartesian3.negate(camera.constrainedAxis, rotateVertScratchNegate), CesiumMath.EPSILON2); if ((!northParallel && !southParallel)) { From 33ac238618d0de2d56d389a6a6b0590bc14e2283 Mon Sep 17 00:00:00 2001 From: Ed Mackey <elm19087@gmail.com> Date: Wed, 20 Mar 2019 14:25:47 -0400 Subject: [PATCH 2/2] CHANGES.md --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index a2dfb123e38c..1d0e5e8c651c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -18,6 +18,7 @@ Change Log * Fixed the value for `BlendFunction.ONE_MINUS_CONSTANT_COLOR`. [#7624](https://github.com/AnalyticalGraphicsInc/cesium/pull/7624) * Fixed `HeadingPitchRoll.pitch` being `NaN` when using `.fromQuaternion` do to a rounding error for pitches close to +/- 90°. [#7654](https://github.com/AnalyticalGraphicsInc/cesium/pull/7654) +* Fixed a type of crash caused by the camera being rotated through terrain. [#6783](https://github.com/AnalyticalGraphicsInc/cesium/issues/6783) ### 1.55 - 2019-03-01