diff --git a/CHANGES.md b/CHANGES.md index 1e2b2cc0b088..f0651e070b9f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -47,6 +47,7 @@ Change Log * Fixed a crash that could occur when an entity was deleted while the corresponding `Primitive` was being created asynchronously. [#8569](https://github.com/AnalyticalGraphicsInc/cesium/pull/8569) * Fixed a crash when calling `camera.lookAt` with the origin as the target. This could happen when looking at a tileset with the origin as its center. [#8571](https://github.com/AnalyticalGraphicsInc/cesium/pull/8571) * Fixed a bug where `camera.viewBoundingSphere` was modifying the `offset` parameter [#8438](https://github.com/AnalyticalGraphicsInc/cesium/pull/8438) +* Fixed a crash when creating a plane with both position and normal on the Z-axis. [#8576](https://github.com/AnalyticalGraphicsInc/cesium/pull/8576) ### 1.65.0 - 2020-01-06 diff --git a/Source/DataSources/PlaneGeometryUpdater.js b/Source/DataSources/PlaneGeometryUpdater.js index 2524e6005dfa..d3bf65badfb0 100644 --- a/Source/DataSources/PlaneGeometryUpdater.js +++ b/Source/DataSources/PlaneGeometryUpdater.js @@ -240,6 +240,9 @@ import Property from './Property.js'; var up = ellipsoid.geodeticSurfaceNormal(translation, scratchAxis2); if (CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(up, transformedNormal)), 1.0, CesiumMath.EPSILON8)) { up = Cartesian3.clone(Cartesian3.UNIT_Z, up); + if (CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(up, transformedNormal)), 1.0, CesiumMath.EPSILON8)) { + up = Cartesian3.clone(Cartesian3.UNIT_X, up); + } } var left = Cartesian3.cross(up, transformedNormal, scratchAxis);