summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2023-04-17 14:05:59 +0200
committerGitHub <noreply@github.com>2023-04-17 14:05:59 +0200
commit0f24f015c6d94bd8bd96d423cc84bb9b0ba7e298 (patch)
tree11774747ccea57c0f8ce9e4fea2ba779a4192842
parent23b24fea62d19946453444c50ed510b21c1f5f6c (diff)
parent6cd8e706fae5dacc908efd1a823e3447e01bfa56 (diff)
downloadredot-engine-0f24f015c6d94bd8bd96d423cc84bb9b0ba7e298.tar.gz
Merge pull request #76049 from timothyqiu/equality
Unify descriptions of vector methods
-rw-r--r--core/variant/variant_call.cpp2
-rw-r--r--doc/classes/Vector2.xml4
-rw-r--r--doc/classes/Vector4.xml11
-rw-r--r--doc/classes/Vector4i.xml3
4 files changed, 11 insertions, 9 deletions
diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp
index 13e9da37f2..5a4a017abe 100644
--- a/core/variant/variant_call.cpp
+++ b/core/variant/variant_call.cpp
@@ -1921,7 +1921,7 @@ static void _register_variant_builtin_methods() {
bind_method(Vector4, distance_squared_to, sarray("to"), varray());
bind_method(Vector4, dot, sarray("with"), varray());
bind_method(Vector4, inverse, sarray(), varray());
- bind_method(Vector4, is_equal_approx, sarray("with"), varray());
+ bind_method(Vector4, is_equal_approx, sarray("to"), varray());
bind_method(Vector4, is_zero_approx, sarray(), varray());
bind_method(Vector4, is_finite, sarray(), varray());
diff --git a/doc/classes/Vector2.xml b/doc/classes/Vector2.xml
index 35ccac120f..73f6f4be47 100644
--- a/doc/classes/Vector2.xml
+++ b/doc/classes/Vector2.xml
@@ -214,7 +214,7 @@
<return type="bool" />
<param index="0" name="to" type="Vector2" />
<description>
- Returns [code]true[/code] if this vector and [code]v[/code] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component.
+ Returns [code]true[/code] if this vector and [param to] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component.
</description>
</method>
<method name="is_finite" qualifiers="const">
@@ -288,7 +288,7 @@
<return type="Vector2" />
<description>
Returns the result of scaling the vector to unit length. Equivalent to [code]v / v.length()[/code]. See also [method is_normalized].
- [b]Note:[/b] This function may return incorrect values if the initial vector length is near zero.
+ [b]Note:[/b] This function may return incorrect values if the input vector length is near zero.
</description>
</method>
<method name="orthogonal" qualifiers="const">
diff --git a/doc/classes/Vector4.xml b/doc/classes/Vector4.xml
index ea00ddaae1..cf829194e5 100644
--- a/doc/classes/Vector4.xml
+++ b/doc/classes/Vector4.xml
@@ -131,9 +131,9 @@
</method>
<method name="is_equal_approx" qualifiers="const">
<return type="bool" />
- <param index="0" name="with" type="Vector4" />
+ <param index="0" name="to" type="Vector4" />
<description>
- Returns [code]true[/code] if this vector and [param with] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component.
+ Returns [code]true[/code] if this vector and [param to] are approximately equal, by running [method @GlobalScope.is_equal_approx] on each component.
</description>
</method>
<method name="is_finite" qualifiers="const">
@@ -164,7 +164,8 @@
<method name="length_squared" qualifiers="const">
<return type="float" />
<description>
- Returns the squared length (squared magnitude) of this vector. This method runs faster than [method length].
+ Returns the squared length (squared magnitude) of this vector.
+ This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
<method name="lerp" qualifiers="const">
@@ -198,14 +199,14 @@
<return type="Vector4" />
<param index="0" name="mod" type="float" />
<description>
- Returns a new vector composed of the [method @GlobalScope.fposmod] of this vector's components and [param mod].
+ Returns a vector composed of the [method @GlobalScope.fposmod] of this vector's components and [param mod].
</description>
</method>
<method name="posmodv" qualifiers="const">
<return type="Vector4" />
<param index="0" name="modv" type="Vector4" />
<description>
- Returns a new vector composed of the [method @GlobalScope.fposmod] of this vector's components and [param modv]'s components.
+ Returns a vector composed of the [method @GlobalScope.fposmod] of this vector's components and [param modv]'s components.
</description>
</method>
<method name="round" qualifiers="const">
diff --git a/doc/classes/Vector4i.xml b/doc/classes/Vector4i.xml
index e2de7a28dc..c2e03016bf 100644
--- a/doc/classes/Vector4i.xml
+++ b/doc/classes/Vector4i.xml
@@ -65,7 +65,8 @@
<method name="length_squared" qualifiers="const">
<return type="int" />
<description>
- Returns the squared length (squared magnitude) of this vector. This method runs faster than [method length].
+ Returns the squared length (squared magnitude) of this vector.
+ This method runs faster than [method length], so prefer it if you need to compare vectors or need the squared distance for some formula.
</description>
</method>
<method name="max_axis_index" qualifiers="const">