From 18d073fc258cb439287d007900e44197afd14d6e Mon Sep 17 00:00:00 2001 From: Larcius Date: Mon, 25 Jan 2016 19:38:56 +0100 Subject: [PATCH 1/4] bug fixed: empty flights when position remains bug fixed: concerning heading/pitch/roll in 2d as well to not wrongly create an empty flight when camera position remains fixes #3457 --- Source/Scene/CameraFlightPath.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Scene/CameraFlightPath.js b/Source/Scene/CameraFlightPath.js index c0ad200c8ec3..687772cb1338 100644 --- a/Source/Scene/CameraFlightPath.js +++ b/Source/Scene/CameraFlightPath.js @@ -305,10 +305,12 @@ define([ empty = empty && CesiumMath.equalsEpsilon(Math.max(frustum.right - frustum.left, frustum.top - frustum.bottom), destination.z, CesiumMath.EPSILON6); empty = empty || (scene.mode !== SceneMode.SCENE2D && - Cartesian3.equalsEpsilon(destination, camera.position, CesiumMath.EPSILON10) && - CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(heading), CesiumMath.negativePiToPi(camera.heading), CesiumMath.EPSILON10) && - CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(pitch), CesiumMath.negativePiToPi(camera.pitch), CesiumMath.EPSILON10) && - CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(roll), CesiumMath.negativePiToPi(camera.roll), CesiumMath.EPSILON10)); + Cartesian3.equalsEpsilon(destination, camera.position, CesiumMath.EPSILON10)); + + empty = empty && + CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(heading), CesiumMath.negativePiToPi(camera.heading), CesiumMath.EPSILON10) && + CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(pitch), CesiumMath.negativePiToPi(camera.pitch), CesiumMath.EPSILON10) && + CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(roll), CesiumMath.negativePiToPi(camera.roll), CesiumMath.EPSILON10); if (empty) { return emptyFlight(complete, cancel); From 0047634a2d2467aa9d5aabe0f8dea2cef60b8f3c Mon Sep 17 00:00:00 2001 From: Larcius Date: Tue, 26 Jan 2016 16:46:16 +0100 Subject: [PATCH 2/4] Fixed bug 'duration is 0 when destination is the same as camera position in 2D' added 'camera.flyTo not working when in 2D mode and only orientation changes' to changes --- CHANGES.md | 1 + Specs/Scene/CameraFlightPathSpec.js | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 0c209da77c92..6a1a0a1fc498 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -24,6 +24,7 @@ Change Log * `GroundPrimitive` now supports batching geometry for better performance. * Added `BoundingSphere.fromEncodedCartesianVertices` to create bounding volumes from parallel arrays of the upper and lower bits of `EncodedCartesian3`s. * Fixed creating bounding volumes for `GroundPrimitive`s whose containing rectangle has a width greater than pi. +* Fixed camera.flyTo not working when in 2D mode and only orientation changes ### 1.17 - 2016-01-04 diff --git a/Specs/Scene/CameraFlightPathSpec.js b/Specs/Scene/CameraFlightPathSpec.js index 194bf477b903..3f62bd0b4e7c 100644 --- a/Specs/Scene/CameraFlightPathSpec.js +++ b/Specs/Scene/CameraFlightPathSpec.js @@ -253,6 +253,7 @@ defineSuite([ camera.up = Cartesian3.clone(Cartesian3.UNIT_Y); camera.right = Cartesian3.cross(camera.direction, camera.up, new Cartesian3()); camera.frustum = createOrthographicFrustum(); + camera.update(scene.mode); var frustum = camera.frustum; var destination = Cartesian3.clone(camera.position); destination.z = Math.max(frustum.right - frustum.left, frustum.top - frustum.bottom); From 532ea16b1593584e8ee16e2ef9dc0b616e7e9524 Mon Sep 17 00:00:00 2001 From: Larcius Date: Mon, 25 Jan 2016 19:38:56 +0100 Subject: [PATCH 3/4] bug fixed: empty flights when position remains bug fixed: concerning heading/pitch/roll in 2d as well to not wrongly create an empty flight when camera position remains fixes #3457 --- Source/Scene/CameraFlightPath.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Scene/CameraFlightPath.js b/Source/Scene/CameraFlightPath.js index c0ad200c8ec3..687772cb1338 100644 --- a/Source/Scene/CameraFlightPath.js +++ b/Source/Scene/CameraFlightPath.js @@ -305,10 +305,12 @@ define([ empty = empty && CesiumMath.equalsEpsilon(Math.max(frustum.right - frustum.left, frustum.top - frustum.bottom), destination.z, CesiumMath.EPSILON6); empty = empty || (scene.mode !== SceneMode.SCENE2D && - Cartesian3.equalsEpsilon(destination, camera.position, CesiumMath.EPSILON10) && - CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(heading), CesiumMath.negativePiToPi(camera.heading), CesiumMath.EPSILON10) && - CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(pitch), CesiumMath.negativePiToPi(camera.pitch), CesiumMath.EPSILON10) && - CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(roll), CesiumMath.negativePiToPi(camera.roll), CesiumMath.EPSILON10)); + Cartesian3.equalsEpsilon(destination, camera.position, CesiumMath.EPSILON10)); + + empty = empty && + CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(heading), CesiumMath.negativePiToPi(camera.heading), CesiumMath.EPSILON10) && + CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(pitch), CesiumMath.negativePiToPi(camera.pitch), CesiumMath.EPSILON10) && + CesiumMath.equalsEpsilon(CesiumMath.negativePiToPi(roll), CesiumMath.negativePiToPi(camera.roll), CesiumMath.EPSILON10); if (empty) { return emptyFlight(complete, cancel); From 4b868785f9bb74629cb3a09391e485ddc0bea80b Mon Sep 17 00:00:00 2001 From: Larcius Date: Tue, 26 Jan 2016 16:46:16 +0100 Subject: [PATCH 4/4] Fixed bug 'duration is 0 when destination is the same as camera position in 2D' added 'camera.flyTo not working when in 2D mode and only orientation changes' to changes --- CHANGES.md | 1 + Specs/Scene/CameraFlightPathSpec.js | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index c6e9e87bbcfd..1cbe08b09224 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,6 +25,7 @@ Change Log * Added `BoundingSphere.fromEncodedCartesianVertices` to create bounding volumes from parallel arrays of the upper and lower bits of `EncodedCartesian3`s. * Fixed creating bounding volumes for `GroundPrimitive`s whose containing rectangle has a width greater than pi. * Fixed incorrect texture coordinates for polygons with large height. +* Fixed camera.flyTo not working when in 2D mode and only orientation changes ### 1.17 - 2016-01-04 diff --git a/Specs/Scene/CameraFlightPathSpec.js b/Specs/Scene/CameraFlightPathSpec.js index 194bf477b903..3f62bd0b4e7c 100644 --- a/Specs/Scene/CameraFlightPathSpec.js +++ b/Specs/Scene/CameraFlightPathSpec.js @@ -253,6 +253,7 @@ defineSuite([ camera.up = Cartesian3.clone(Cartesian3.UNIT_Y); camera.right = Cartesian3.cross(camera.direction, camera.up, new Cartesian3()); camera.frustum = createOrthographicFrustum(); + camera.update(scene.mode); var frustum = camera.frustum; var destination = Cartesian3.clone(camera.position); destination.z = Math.max(frustum.right - frustum.left, frustum.top - frustum.bottom);