Skip to content

Commit

Permalink
Merge pull request #6913 from AnalyticalGraphicsInc/fix-planes
Browse files Browse the repository at this point in the history
Fix plane model matrix calculation
  • Loading branch information
lilleyse authored Aug 13, 2018
2 parents 021405f + be0399a commit d22e21c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/DataSources/PlaneGeometryUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ define([
Cartesian3.normalize(transformedNormal, transformedNormal);

var up = ellipsoid.geodeticSurfaceNormal(translation, scratchAxis2);
if (Cartesian3.equalsEpsilon(up, transformedNormal, CesiumMath.EPSILON8)) {
if (CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(up, transformedNormal)), 1.0, CesiumMath.EPSILON8)) {
up = Cartesian3.clone(Cartesian3.UNIT_Z, up);
}

Expand All @@ -285,5 +285,10 @@ define([
return Matrix4.fromTranslationQuaternionRotationScale(translation, rotation, scale, result);
}

/**
* @private
*/
PlaneGeometryUpdater.createPrimitiveMatrix = createPrimitiveMatrix;

return PlaneGeometryUpdater;
});

0 comments on commit d22e21c

Please sign in to comment.