-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[Core] Add scalar versions of Vector*
min/max/clamp/snap(ped)
#89114
Conversation
Vector*
min/max/clamp
Vector*
min/max/clamp/snap(ped)
0ed79a1
to
8af4dfd
Compare
7913fba
to
5dabfc4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation is completely fine and consistent with the existing methods. I just am not sure if having it exposed is strictly necessary.
I'd say these methods are more generally useful than the vector versions, most of the time you want to clamp or snap to the same value, though in GDScript you do have the benefit of being able to do |
5dabfc4
to
4b33c69
Compare
4b33c69
to
d6f254b
Compare
d6f254b
to
dfcd95b
Compare
14d5793
to
6ea6446
Compare
73cb521
to
fc991e7
Compare
fc991e7
to
da81ceb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function is a good idea, it seems very common and useful.
8991e7a
to
cdcf0d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally gave a good look at this thing.
All the changes are very simple and they increase readability a lot, great job!
8ff8abe
to
e0e082e
Compare
Convenience for a number of cases operating on single values
e0e082e
to
308dbb8
Compare
Thanks! |
Thank you! |
For the record, this seems to have broken LTO builds for Windows x86_32 with MinGW-GCC. See #92585 for details. |
Convenience for a number of cases operating on single values
Added a lot of use cases, which I think should justify this addition, it simply saves a lot of code when you use repeated cases, and also reduces risk of copy errors
Optionally bound it to scripting
See also:
Vector*
component-wise and scalarmin/max
to scripting #80223If it gets merged first I will expose the
mini/minf/maxi/maxf
methods as well, and vice-versa