-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove Rectangle.intersectWith and Rectangle.isEmpty #2314
Comments
Hello, |
Moreover the behaviour of Rectangle.intersection is a little strange when we add the third parameter (result):
I think that in the second case, the third parameter should be undefined. |
@kaktus40 We expect the |
I don't have a use case from master to reproduce and it's not a really a I'm working with TerrainProvider that must implements My remark is just a suggestion and I can use a workaround (like I said My remark about undefined is also an inconsistency problem (my point of
It's only my point of view and it's not a bug. I know you have others On 09/12/2014 22:47, Dan Bagnell wrote:
|
@kaktus40 Is it possible to use For your remark about the result parameter, do you mean that we should set the results properties to undefined? Because it would be impossible to set the parameter to undefined. I know the use of a result parameter is odd, but we use it throughout Cesium to reduce the amount of memory used and garbage collection overhead. In this case its not required, so I expect the most common use to be var intersection = Cesium.Rectangle.intersection(rectangle1, rectangle2);
if (Cesium.defined(intersection)) {
// handle intersection
} The pattern we use throughout Cesium is var scratchRectangle = new Cesium.Rectangle(); // declared in file scope and used for intermediate values
// ...
var intersection = Cesium.Rectangle.intersection(rectangle1, rectangle2, scratchRectangle);
if (Cesium.defined(intersection)) {
// handle intersection
} If the function was a success, then This is consistent with other intersection tests as well (see IntersectionTests). |
From #2313:
Rectangle.intersectWith
was deprecated in Cesium 1.5. It will be removed in Cesium 1.6. UseRectangle.intersection
, which is the same but returnsundefined
when two rectangles do not intersect.Rectangle.isEmpty
was deprecated in Cesium 1.5. It will be removed in Cesium 1.6.The text was updated successfully, but these errors were encountered: