-
-
Notifications
You must be signed in to change notification settings - Fork 21.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
AABB::expand_to spamming errors in the portals #56509
Comments
I guess you mean |
Ah yes good point, I only noticed it when checking another issue with latest 3.x, and assumed it was already in 3.4.2, I'll amend. |
This reverts commit d75e580. Fixes godotengine#56509.
Fixed by revert above. |
Why can't you just set the starting AABB to the first entry in the loop of points? Instead of this:
Why not:
(The latter will crash for a zero size list, but the former would also be weird since it returns a negative size AABB, so I'm not sure what the behavior is supposed to be be in that special case). |
Godot version
3.x dev (5th Jan 2022)
System information
All
Issue description
The
AABB::expand_to
function has been changed in #37626 to spam errors when size is negative.This is causing problems because a common method to set AABBs is to set opposite maximums, i.e. set position to maximum, and size to negative maximum, and then loop through points calling expand to for each point. Thus the first point sets the first position and size to zero.
An alternative is to explicitly set the first element in the calling code, or use intermediate code for mins / maxes then set to an AABB later. However it is problematic that AABB can no longer handle this common paradigm.
Steps to reproduce
Create a Room with a static Mesh inside, and convert.
Example use :
RoomManager::_bound_findpoints_mesh_instance
Or more simply, just the following code:
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: