mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Fix integer vector mul/div operators and bindings.
* Vector2i and Vector3i mul/div by a float results in Vector2 and Vector3 respectively. * Create specializations to allow proper bindings. This fixes #44408 and supersedes #44441 and keeps the same rule of int <op> float returnig float, like with scalars.
This commit is contained in:
@@ -180,12 +180,12 @@
|
||||
</description>
|
||||
</operator>
|
||||
<operator name="operator *">
|
||||
<return type="Vector3i" />
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="right" type="float" />
|
||||
<description>
|
||||
Multiplies each component of the [Vector3i] by the given [float] truncated to an integer.
|
||||
Multiplies each component of the [Vector3i] by the given [float]. Returns a [Vector3].
|
||||
[codeblock]
|
||||
print(Vector3i(10, 20, 30) * 0.9) # Prints "(0, 0, 0)"
|
||||
print(Vector3i(10, 15, 20) * 0.9) # Prints "(9, 13.5, 18)"
|
||||
[/codeblock]
|
||||
</description>
|
||||
</operator>
|
||||
@@ -227,10 +227,10 @@
|
||||
</description>
|
||||
</operator>
|
||||
<operator name="operator /">
|
||||
<return type="Vector3i" />
|
||||
<return type="Vector3" />
|
||||
<argument index="0" name="right" type="float" />
|
||||
<description>
|
||||
Divides each component of the [Vector3i] by the given [float] truncated to an integer.
|
||||
Divides each component of the [Vector3i] by the given [float]. Returns a [Vector3].
|
||||
[codeblock]
|
||||
print(Vector3i(10, 20, 30) / 2.9) # Prints "(5, 10, 15)"
|
||||
[/codeblock]
|
||||
|
||||
Reference in New Issue
Block a user