Expose Vector* component-wise and scalar min/max to scripting

This commit is contained in:
A Thousand Ships 2024-05-02 10:45:15 +02:00
parent a0b0b19043
commit 0f5e0d1637
No known key found for this signature in database
GPG key ID: 2033189A662F8BD7
17 changed files with 596 additions and 19 deletions

View file

@ -696,6 +696,7 @@
[codeblock]
max(1, 7, 3, -6, 5) # Returns 7
[/codeblock]
[b]Note:[/b] When using this on vectors it will [i]not[/i] perform component-wise maximum, and will pick the largest value when compared using [code]x < y[/code]. To perform component-wise maximum, use [method Vector2.max], [method Vector2i.max], [method Vector3.max], [method Vector3i.max], [method Vector4.max], and [method Vector4i.max].
</description>
</method>
<method name="maxf">
@ -729,6 +730,7 @@
[codeblock]
min(1, 7, 3, -6, 5) # Returns -6
[/codeblock]
[b]Note:[/b] When using this on vectors it will [i]not[/i] perform component-wise minimum, and will pick the smallest value when compared using [code]x &lt; y[/code]. To perform component-wise minimum, use [method Vector2.min], [method Vector2i.min], [method Vector3.min], [method Vector3i.min], [method Vector4.min], and [method Vector4i.min].
</description>
</method>
<method name="minf">