diff options
Diffstat (limited to 'doc/classes/Vector3.xml')
-rw-r--r-- | doc/classes/Vector3.xml | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/doc/classes/Vector3.xml b/doc/classes/Vector3.xml index a94cc0086f..62d467c505 100644 --- a/doc/classes/Vector3.xml +++ b/doc/classes/Vector3.xml @@ -9,9 +9,9 @@ [b]Note:[/b] In a boolean context, a Vector3 will evaluate to [code]false[/code] if it's equal to [code]Vector3(0, 0, 0)[/code]. Otherwise, a Vector3 will always evaluate to [code]true[/code]. </description> <tutorials> - <link title="Math documentation index">https://docs.godotengine.org/en/latest/tutorials/math/index.html</link> - <link title="Vector math">https://docs.godotengine.org/en/latest/tutorials/math/vector_math.html</link> - <link title="Advanced vector math">https://docs.godotengine.org/en/latest/tutorials/math/vectors_advanced.html</link> + <link title="Math documentation index">$DOCS_URL/tutorials/math/index.html</link> + <link title="Vector math">$DOCS_URL/tutorials/math/vector_math.html</link> + <link title="Advanced vector math">$DOCS_URL/tutorials/math/vectors_advanced.html</link> <link title="3Blue1Brown Essence of Linear Algebra">https://www.youtube.com/playlist?list=PLZHQObOWTQDPD3MizzM2xVFitgF8hE_ab</link> <link title="Matrix Transform Demo">https://godotengine.org/asset-library/asset/584</link> <link title="All 3D Demos">https://github.com/godotengine/godot-demo-projects/tree/master/3d</link> @@ -367,84 +367,111 @@ <return type="bool" /> <argument index="0" name="right" type="Vector3" /> <description> + Returns [code]true[/code] if the vectors are not equal. + [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. </description> </operator> <operator name="operator *"> <return type="Vector3" /> <argument index="0" name="right" type="Vector3" /> <description> + Multiplies each component of the [Vector3] by the components of the given [Vector3]. + [codeblock] + print(Vector3(10, 20, 30) * Vector3(3, 4, 5)) # Prints "(30, 80, 150)" + [/codeblock] </description> </operator> <operator name="operator *"> <return type="Vector3" /> <argument index="0" name="right" type="Basis" /> <description> + Inversely transforms (multiplies) the [Vector3] by the given [Basis] matrix. </description> </operator> <operator name="operator *"> <return type="Vector3" /> <argument index="0" name="right" type="Quaternion" /> <description> + Inversely transforms (multiplies) the [Vector3] by the given [Quaternion]. </description> </operator> <operator name="operator *"> <return type="Vector3" /> <argument index="0" name="right" type="Transform3D" /> <description> + Inversely transforms (multiplies) the [Vector3] by the given [Transform3D] transformation matrix. </description> </operator> <operator name="operator *"> <return type="Vector3" /> <argument index="0" name="right" type="float" /> <description> + Multiplies each component of the [Vector3] by the given [float]. </description> </operator> <operator name="operator *"> <return type="Vector3" /> <argument index="0" name="right" type="int" /> <description> + Multiplies each component of the [Vector3] by the given [int]. </description> </operator> <operator name="operator +"> <return type="Vector3" /> <argument index="0" name="right" type="Vector3" /> <description> + Adds each component of the [Vector3] by the components of the given [Vector3]. + [codeblock] + print(Vector3(10, 20, 30) + Vector3(3, 4, 5)) # Prints "(13, 24, 35)" + [/codeblock] </description> </operator> <operator name="operator -"> <return type="Vector3" /> <argument index="0" name="right" type="Vector3" /> <description> + Subtracts each component of the [Vector3] by the components of the given [Vector3]. + [codeblock] + print(Vector3(10, 20, 30) - Vector3(3, 4, 5)) # Prints "(7, 16, 25)" + [/codeblock] </description> </operator> <operator name="operator /"> <return type="Vector3" /> <argument index="0" name="right" type="Vector3" /> <description> + Divides each component of the [Vector3] by the components of the given [Vector3]. + [codeblock] + print(Vector3(10, 20, 30) / Vector3(2, 5, 3)) # Prints "(5, 4, 10)" + [/codeblock] </description> </operator> <operator name="operator /"> <return type="Vector3" /> <argument index="0" name="right" type="float" /> <description> + Divides each component of the [Vector3] by the given [float]. </description> </operator> <operator name="operator /"> <return type="Vector3" /> <argument index="0" name="right" type="int" /> <description> + Divides each component of the [Vector3] by the given [int]. </description> </operator> <operator name="operator <"> <return type="bool" /> <argument index="0" name="right" type="Vector3" /> <description> + Compares two [Vector3] vectors by first checking if the X value of the left vector is less than the X value of the [code]right[/code] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, and then with the Z values. This operator is useful for sorting vectors. </description> </operator> <operator name="operator <="> <return type="bool" /> <argument index="0" name="right" type="Vector3" /> <description> + Compares two [Vector3] vectors by first checking if the X value of the left vector is less than or equal to the X value of the [code]right[/code] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, and then with the Z values. This operator is useful for sorting vectors. </description> </operator> <operator name="operator =="> @@ -456,34 +483,41 @@ <return type="bool" /> <argument index="0" name="right" type="Vector3" /> <description> + Returns [code]true[/code] if the vectors are exactly equal. + [b]Note:[/b] Due to floating-point precision errors, consider using [method is_equal_approx] instead, which is more reliable. </description> </operator> <operator name="operator >"> <return type="bool" /> <argument index="0" name="right" type="Vector3" /> <description> + Compares two [Vector3] vectors by first checking if the X value of the left vector is greater than the X value of the [code]right[/code] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, and then with the Z values. This operator is useful for sorting vectors. </description> </operator> <operator name="operator >="> <return type="bool" /> <argument index="0" name="right" type="Vector3" /> <description> + Compares two [Vector3] vectors by first checking if the X value of the left vector is greater than or equal to the X value of the [code]right[/code] vector. If the X values are exactly equal, then it repeats this check with the Y values of the two vectors, and then with the Z values. This operator is useful for sorting vectors. </description> </operator> <operator name="operator []"> <return type="float" /> <argument index="0" name="index" type="int" /> <description> + Access vector components using their index. [code]v[0][/code] is equivalent to [code]v.x[/code], [code]v[1][/code] is equivalent to [code]v.y[/code], and [code]v[2][/code] is equivalent to [code]v.z[/code]. </description> </operator> <operator name="operator unary+"> <return type="Vector3" /> <description> + Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable. </description> </operator> <operator name="operator unary-"> <return type="Vector3" /> <description> + Returns the negative value of the [Vector3]. This is the same as writing [code]Vector3(-v.x, -v.y, -v.z)[/code]. This operation flips the direction of the vector while keeping the same magnitude. With floats, the number zero can be either positive or negative. </description> </operator> </operators> |