You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGES.md
+2
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,8 @@ Change Log
35
35
* Fixed a bug that was incorrectly clamping Latitudes in KML <GroundOverlay>(s) to the range -PI..PI. Now correctly clamps to -PI/2..PI/2.
36
36
* Added `CesiumMath.clampToLatitudeRange`. A convenience function to clamp a passed radian angle to valid Latitudes.
37
37
* Added `DebugCameraPrimitive` to visualize the view frustum of a camera.
38
+
* Added `Rectangle.simpleIntersection`.
39
+
* Removed an unnecessary reprojection of Web Mercator imagery tiles to the Geographic projection on load. This should improve both visual quality and load performance slightly.
Copy file name to clipboardexpand all lines: Source/Core/Rectangle.js
+46-1
Original file line number
Diff line number
Diff line change
@@ -597,7 +597,11 @@ define([
597
597
};
598
598
599
599
/**
600
-
* Computes the intersection of two rectangles
600
+
* Computes the intersection of two rectangles. This function assumes that the rectangle's coordinates are
601
+
* latitude and longitude in radians and produces a correct intersection, taking into account the fact that
602
+
* the same angle can be represented with multiple values as well as the wrapping of longitude at the
603
+
* anti-meridian. For a simple intersection that ignores these factors and can be used with projected
604
+
* coordinates, see {@link Rectangle.simpleIntersection}.
601
605
*
602
606
* @param {Rectangle} rectangle On rectangle to find an intersection
603
607
* @param {Rectangle} otherRectangle Another rectangle to find an intersection
@@ -656,6 +660,47 @@ define([
656
660
returnresult;
657
661
};
658
662
663
+
/**
664
+
* Computes a simple intersection of two rectangles. Unlike {@link Rectangle.intersection}, this function
665
+
* does not attempt to put the angular coordinates into a consistent range or to account for crossing the
666
+
* anti-meridian. As such, it can be used for rectangles where the coordinates are not simply latitude
667
+
* and longitude (i.e. projected coordinates).
668
+
*
669
+
* @param {Rectangle} rectangle On rectangle to find an intersection
670
+
* @param {Rectangle} otherRectangle Another rectangle to find an intersection
671
+
* @param {Rectangle} [result] The object onto which to store the result.
672
+
* @returns {Rectangle|undefined} The modified result parameter, a new Rectangle instance if none was provided or undefined if there is no intersection.
0 commit comments