classref: Sync with current master branch (96cdbbe)

This commit is contained in:
Godot Organization
2025-02-15 03:21:09 +00:00
parent 4f3c3fc101
commit b55955c3ce
427 changed files with 4074 additions and 3919 deletions
+33 -33
View File
@@ -253,7 +253,7 @@ enum **Axis**: :ref:`🔗<enum_Vector3_Axis>`
:ref:`Axis<enum_Vector3_Axis>` **AXIS_X** = ``0``
Enumerated value for the X axis. Returned by :ref:`max_axis_index<class_Vector3_method_max_axis_index>` and :ref:`min_axis_index<class_Vector3_method_min_axis_index>`.
Enumerated value for the X axis. Returned by :ref:`max_axis_index()<class_Vector3_method_max_axis_index>` and :ref:`min_axis_index()<class_Vector3_method_min_axis_index>`.
.. _class_Vector3_constant_AXIS_Y:
@@ -261,7 +261,7 @@ Enumerated value for the X axis. Returned by :ref:`max_axis_index<class_Vector3_
:ref:`Axis<enum_Vector3_Axis>` **AXIS_Y** = ``1``
Enumerated value for the Y axis. Returned by :ref:`max_axis_index<class_Vector3_method_max_axis_index>` and :ref:`min_axis_index<class_Vector3_method_min_axis_index>`.
Enumerated value for the Y axis. Returned by :ref:`max_axis_index()<class_Vector3_method_max_axis_index>` and :ref:`min_axis_index()<class_Vector3_method_min_axis_index>`.
.. _class_Vector3_constant_AXIS_Z:
@@ -269,7 +269,7 @@ Enumerated value for the Y axis. Returned by :ref:`max_axis_index<class_Vector3_
:ref:`Axis<enum_Vector3_Axis>` **AXIS_Z** = ``2``
Enumerated value for the Z axis. Returned by :ref:`max_axis_index<class_Vector3_method_max_axis_index>` and :ref:`min_axis_index<class_Vector3_method_min_axis_index>`.
Enumerated value for the Z axis. Returned by :ref:`max_axis_index()<class_Vector3_method_max_axis_index>` and :ref:`min_axis_index()<class_Vector3_method_min_axis_index>`.
.. rst-class:: classref-section-separator
@@ -553,7 +553,7 @@ Returns the point at the given ``t`` on the `Bézier curve <https://en.wikipedia
Returns the vector "bounced off" from a plane defined by the given normal ``n``.
\ **Note:** :ref:`bounce<class_Vector3_method_bounce>` performs the operation that most engines and frameworks call ``reflect()``.
\ **Note:** :ref:`bounce()<class_Vector3_method_bounce>` performs the operation that most engines and frameworks call ``reflect()``.
.. rst-class:: classref-item-separator
@@ -577,7 +577,7 @@ Returns a new vector with all components rounded up (towards positive infinity).
:ref:`Vector3<class_Vector3>` **clamp**\ (\ min\: :ref:`Vector3<class_Vector3>`, max\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_Vector3_method_clamp>`
Returns a new vector with all components clamped between the components of ``min`` and ``max``, by running :ref:`@GlobalScope.clamp<class_@GlobalScope_method_clamp>` on each component.
Returns a new vector with all components clamped between the components of ``min`` and ``max``, by running :ref:`@GlobalScope.clamp()<class_@GlobalScope_method_clamp>` on each component.
.. rst-class:: classref-item-separator
@@ -589,7 +589,7 @@ Returns a new vector with all components clamped between the components of ``min
:ref:`Vector3<class_Vector3>` **clampf**\ (\ min\: :ref:`float<class_float>`, max\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Vector3_method_clampf>`
Returns a new vector with all components clamped between ``min`` and ``max``, by running :ref:`@GlobalScope.clamp<class_@GlobalScope_method_clamp>` on each component.
Returns a new vector with all components clamped between ``min`` and ``max``, by running :ref:`@GlobalScope.clamp()<class_@GlobalScope_method_clamp>` on each component.
.. rst-class:: classref-item-separator
@@ -629,7 +629,7 @@ Performs a cubic interpolation between this vector and ``b`` using ``pre_a`` and
Performs a cubic interpolation between this vector and ``b`` using ``pre_a`` and ``post_b`` as handles, and returns the result at position ``weight``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation.
It can perform smoother interpolation than :ref:`cubic_interpolate<class_Vector3_method_cubic_interpolate>` by the time values.
It can perform smoother interpolation than :ref:`cubic_interpolate()<class_Vector3_method_cubic_interpolate>` by the time values.
.. rst-class:: classref-item-separator
@@ -655,7 +655,7 @@ Returns the normalized vector pointing from this vector to ``to``. This is equiv
Returns the squared distance between this vector and ``to``.
This method runs faster than :ref:`distance_to<class_Vector3_method_distance_to>`, so prefer it if you need to compare vectors or need the squared distance for some formula.
This method runs faster than :ref:`distance_to()<class_Vector3_method_distance_to>`, so prefer it if you need to compare vectors or need the squared distance for some formula.
.. rst-class:: classref-item-separator
@@ -721,7 +721,7 @@ Returns the inverse of the vector. This is the same as ``Vector3(1.0 / v.x, 1.0
:ref:`bool<class_bool>` **is_equal_approx**\ (\ to\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_Vector3_method_is_equal_approx>`
Returns ``true`` if this vector and ``to`` are approximately equal, by running :ref:`@GlobalScope.is_equal_approx<class_@GlobalScope_method_is_equal_approx>` on each component.
Returns ``true`` if this vector and ``to`` are approximately equal, by running :ref:`@GlobalScope.is_equal_approx()<class_@GlobalScope_method_is_equal_approx>` on each component.
.. rst-class:: classref-item-separator
@@ -733,7 +733,7 @@ Returns ``true`` if this vector and ``to`` are approximately equal, by running :
:ref:`bool<class_bool>` **is_finite**\ (\ ) |const| :ref:`🔗<class_Vector3_method_is_finite>`
Returns ``true`` if this vector is finite, by calling :ref:`@GlobalScope.is_finite<class_@GlobalScope_method_is_finite>` on each component.
Returns ``true`` if this vector is finite, by calling :ref:`@GlobalScope.is_finite()<class_@GlobalScope_method_is_finite>` on each component.
.. rst-class:: classref-item-separator
@@ -757,9 +757,9 @@ Returns ``true`` if the vector is normalized, i.e. its length is approximately e
:ref:`bool<class_bool>` **is_zero_approx**\ (\ ) |const| :ref:`🔗<class_Vector3_method_is_zero_approx>`
Returns ``true`` if this vector's values are approximately zero, by running :ref:`@GlobalScope.is_zero_approx<class_@GlobalScope_method_is_zero_approx>` on each component.
Returns ``true`` if this vector's values are approximately zero, by running :ref:`@GlobalScope.is_zero_approx()<class_@GlobalScope_method_is_zero_approx>` on each component.
This method is faster than using :ref:`is_equal_approx<class_Vector3_method_is_equal_approx>` with one value as a zero vector.
This method is faster than using :ref:`is_equal_approx()<class_Vector3_method_is_equal_approx>` with one value as a zero vector.
.. rst-class:: classref-item-separator
@@ -785,7 +785,7 @@ Returns the length (magnitude) of this vector.
Returns the squared length (squared magnitude) of this vector.
This method runs faster than :ref:`length<class_Vector3_method_length>`, so prefer it if you need to compare vectors or need the squared distance for some formula.
This method runs faster than :ref:`length()<class_Vector3_method_length>`, so prefer it if you need to compare vectors or need the squared distance for some formula.
.. rst-class:: classref-item-separator
@@ -905,7 +905,7 @@ Returns a new vector moved toward ``to`` by the fixed ``delta`` amount. Will not
:ref:`Vector3<class_Vector3>` **normalized**\ (\ ) |const| :ref:`🔗<class_Vector3_method_normalized>`
Returns the result of scaling the vector to unit length. Equivalent to ``v / v.length()``. Returns ``(0, 0, 0)`` if ``v.length() == 0``. See also :ref:`is_normalized<class_Vector3_method_is_normalized>`.
Returns the result of scaling the vector to unit length. Equivalent to ``v / v.length()``. Returns ``(0, 0, 0)`` if ``v.length() == 0``. See also :ref:`is_normalized()<class_Vector3_method_is_normalized>`.
\ **Note:** This function may return incorrect values if the input vector length is near zero.
@@ -919,7 +919,7 @@ Returns the result of scaling the vector to unit length. Equivalent to ``v / v.l
:ref:`Vector3<class_Vector3>` **octahedron_decode**\ (\ uv\: :ref:`Vector2<class_Vector2>`\ ) |static| :ref:`🔗<class_Vector3_method_octahedron_decode>`
Returns the **Vector3** from an octahedral-compressed form created using :ref:`octahedron_encode<class_Vector3_method_octahedron_encode>` (stored as a :ref:`Vector2<class_Vector2>`).
Returns the **Vector3** from an octahedral-compressed form created using :ref:`octahedron_encode()<class_Vector3_method_octahedron_encode>` (stored as a :ref:`Vector2<class_Vector2>`).
.. rst-class:: classref-item-separator
@@ -931,9 +931,9 @@ Returns the **Vector3** from an octahedral-compressed form created using :ref:`o
:ref:`Vector2<class_Vector2>` **octahedron_encode**\ (\ ) |const| :ref:`🔗<class_Vector3_method_octahedron_encode>`
Returns the octahedral-encoded (oct32) form of this **Vector3** as a :ref:`Vector2<class_Vector2>`. Since a :ref:`Vector2<class_Vector2>` occupies 1/3 less memory compared to **Vector3**, this form of compression can be used to pass greater amounts of :ref:`normalized<class_Vector3_method_normalized>` **Vector3**\ s without increasing storage or memory requirements. See also :ref:`octahedron_decode<class_Vector3_method_octahedron_decode>`.
Returns the octahedral-encoded (oct32) form of this **Vector3** as a :ref:`Vector2<class_Vector2>`. Since a :ref:`Vector2<class_Vector2>` occupies 1/3 less memory compared to **Vector3**, this form of compression can be used to pass greater amounts of :ref:`normalized()<class_Vector3_method_normalized>` **Vector3**\ s without increasing storage or memory requirements. See also :ref:`octahedron_decode()<class_Vector3_method_octahedron_decode>`.
\ **Note:** :ref:`octahedron_encode<class_Vector3_method_octahedron_encode>` can only be used for :ref:`normalized<class_Vector3_method_normalized>` vectors. :ref:`octahedron_encode<class_Vector3_method_octahedron_encode>` does *not* check whether this **Vector3** is normalized, and will return a value that does not decompress to the original value if the **Vector3** is not normalized.
\ **Note:** :ref:`octahedron_encode()<class_Vector3_method_octahedron_encode>` can only be used for :ref:`normalized()<class_Vector3_method_normalized>` vectors. :ref:`octahedron_encode()<class_Vector3_method_octahedron_encode>` does *not* check whether this **Vector3** is normalized, and will return a value that does not decompress to the original value if the **Vector3** is not normalized.
\ **Note:** Octahedral compression is *lossy*, although visual differences are rarely perceptible in real world scenarios.
@@ -959,7 +959,7 @@ Returns the outer product with ``with``.
:ref:`Vector3<class_Vector3>` **posmod**\ (\ mod\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Vector3_method_posmod>`
Returns a vector composed of the :ref:`@GlobalScope.fposmod<class_@GlobalScope_method_fposmod>` of this vector's components and ``mod``.
Returns a vector composed of the :ref:`@GlobalScope.fposmod()<class_@GlobalScope_method_fposmod>` of this vector's components and ``mod``.
.. rst-class:: classref-item-separator
@@ -971,7 +971,7 @@ Returns a vector composed of the :ref:`@GlobalScope.fposmod<class_@GlobalScope_m
:ref:`Vector3<class_Vector3>` **posmodv**\ (\ modv\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_Vector3_method_posmodv>`
Returns a vector composed of the :ref:`@GlobalScope.fposmod<class_@GlobalScope_method_fposmod>` of this vector's components and ``modv``'s components.
Returns a vector composed of the :ref:`@GlobalScope.fposmod()<class_@GlobalScope_method_fposmod>` of this vector's components and ``modv``'s components.
.. rst-class:: classref-item-separator
@@ -983,7 +983,7 @@ Returns a vector composed of the :ref:`@GlobalScope.fposmod<class_@GlobalScope_m
:ref:`Vector3<class_Vector3>` **project**\ (\ b\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_Vector3_method_project>`
Returns a new vector resulting from projecting this vector onto the given vector ``b``. The resulting new vector is parallel to ``b``. See also :ref:`slide<class_Vector3_method_slide>`.
Returns a new vector resulting from projecting this vector onto the given vector ``b``. The resulting new vector is parallel to ``b``. See also :ref:`slide()<class_Vector3_method_slide>`.
\ **Note:** If the vector ``b`` is a zero vector, the components of the resulting new vector will be :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>`.
@@ -999,7 +999,7 @@ Returns a new vector resulting from projecting this vector onto the given vector
Returns the result of reflecting the vector through a plane defined by the given normal vector ``n``.
\ **Note:** :ref:`reflect<class_Vector3_method_reflect>` differs from what other engines and frameworks call ``reflect()``. In other engines, ``reflect()`` returns the result of the vector reflected by the given plane. The reflection thus passes through the given normal. While in Godot the reflection passes through the plane and can be thought of as bouncing off the normal. See also :ref:`bounce<class_Vector3_method_bounce>` which does what most engines call ``reflect()``.
\ **Note:** :ref:`reflect()<class_Vector3_method_reflect>` differs from what other engines and frameworks call ``reflect()``. In other engines, ``reflect()`` returns the result of the vector reflected by the given plane. The reflection thus passes through the given normal. While in Godot the reflection passes through the plane and can be thought of as bouncing off the normal. See also :ref:`bounce()<class_Vector3_method_bounce>` which does what most engines call ``reflect()``.
.. rst-class:: classref-item-separator
@@ -1011,7 +1011,7 @@ Returns the result of reflecting the vector through a plane defined by the given
:ref:`Vector3<class_Vector3>` **rotated**\ (\ axis\: :ref:`Vector3<class_Vector3>`, angle\: :ref:`float<class_float>`\ ) |const| :ref:`🔗<class_Vector3_method_rotated>`
Returns the result of rotating this vector around a given axis by ``angle`` (in radians). The axis must be a normalized vector. See also :ref:`@GlobalScope.deg_to_rad<class_@GlobalScope_method_deg_to_rad>`.
Returns the result of rotating this vector around a given axis by ``angle`` (in radians). The axis must be a normalized vector. See also :ref:`@GlobalScope.deg_to_rad()<class_@GlobalScope_method_deg_to_rad>`.
.. rst-class:: classref-item-separator
@@ -1035,7 +1035,7 @@ Returns a new vector with all components rounded to the nearest integer, with ha
:ref:`Vector3<class_Vector3>` **sign**\ (\ ) |const| :ref:`🔗<class_Vector3_method_sign>`
Returns a new vector with each component set to ``1.0`` if it's positive, ``-1.0`` if it's negative, and ``0.0`` if it's zero. The result is identical to calling :ref:`@GlobalScope.sign<class_@GlobalScope_method_sign>` on each component.
Returns a new vector with each component set to ``1.0`` if it's positive, ``-1.0`` if it's negative, and ``0.0`` if it's zero. The result is identical to calling :ref:`@GlobalScope.sign()<class_@GlobalScope_method_sign>` on each component.
.. rst-class:: classref-item-separator
@@ -1061,7 +1061,7 @@ Returns the signed angle to the given vector, in radians. The sign of the angle
Returns the result of spherical linear interpolation between this vector and ``to``, by amount ``weight``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation.
This method also handles interpolating the lengths if the input vectors have different lengths. For the special case of one or both input vectors having zero length, this method behaves like :ref:`lerp<class_Vector3_method_lerp>`.
This method also handles interpolating the lengths if the input vectors have different lengths. For the special case of one or both input vectors having zero length, this method behaves like :ref:`lerp()<class_Vector3_method_lerp>`.
.. rst-class:: classref-item-separator
@@ -1073,9 +1073,9 @@ This method also handles interpolating the lengths if the input vectors have dif
:ref:`Vector3<class_Vector3>` **slide**\ (\ n\: :ref:`Vector3<class_Vector3>`\ ) |const| :ref:`🔗<class_Vector3_method_slide>`
Returns a new vector resulting from sliding this vector along a plane with normal ``n``. The resulting new vector is perpendicular to ``n``, and is equivalent to this vector minus its projection on ``n``. See also :ref:`project<class_Vector3_method_project>`.
Returns a new vector resulting from sliding this vector along a plane with normal ``n``. The resulting new vector is perpendicular to ``n``, and is equivalent to this vector minus its projection on ``n``. See also :ref:`project()<class_Vector3_method_project>`.
\ **Note:** The vector ``n`` must be normalized. See also :ref:`normalized<class_Vector3_method_normalized>`.
\ **Note:** The vector ``n`` must be normalized. See also :ref:`normalized()<class_Vector3_method_normalized>`.
.. rst-class:: classref-item-separator
@@ -1118,7 +1118,7 @@ Operator Descriptions
Returns ``true`` if the vectors are not equal.
\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_Vector3_method_is_equal_approx>` instead, which is more reliable.
\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()<class_Vector3_method_is_equal_approx>` instead, which is more reliable.
\ **Note:** Vectors with :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.
@@ -1134,9 +1134,9 @@ Returns ``true`` if the vectors are not equal.
Inversely transforms (multiplies) the **Vector3** by the given :ref:`Basis<class_Basis>` matrix, under the assumption that the basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
\ ``vector * basis`` is equivalent to ``basis.transposed() * vector``. See :ref:`Basis.transposed<class_Basis_method_transposed>`.
\ ``vector * basis`` is equivalent to ``basis.transposed() * vector``. See :ref:`Basis.transposed()<class_Basis_method_transposed>`.
For transforming by inverse of a non-orthonormal basis (e.g. with scaling) ``basis.inverse() * vector`` can be used instead. See :ref:`Basis.inverse<class_Basis_method_inverse>`.
For transforming by inverse of a non-orthonormal basis (e.g. with scaling) ``basis.inverse() * vector`` can be used instead. See :ref:`Basis.inverse()<class_Basis_method_inverse>`.
.. rst-class:: classref-item-separator
@@ -1150,7 +1150,7 @@ For transforming by inverse of a non-orthonormal basis (e.g. with scaling) ``bas
Inversely transforms (multiplies) the **Vector3** by the given :ref:`Quaternion<class_Quaternion>`.
\ ``vector * quaternion`` is equivalent to ``quaternion.inverse() * vector``. See :ref:`Quaternion.inverse<class_Quaternion_method_inverse>`.
\ ``vector * quaternion`` is equivalent to ``quaternion.inverse() * vector``. See :ref:`Quaternion.inverse()<class_Quaternion_method_inverse>`.
.. rst-class:: classref-item-separator
@@ -1164,9 +1164,9 @@ Inversely transforms (multiplies) the **Vector3** by the given :ref:`Quaternion<
Inversely transforms (multiplies) the **Vector3** by the given :ref:`Transform3D<class_Transform3D>` transformation matrix, under the assumption that the transformation basis is orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).
\ ``vector * transform`` is equivalent to ``transform.inverse() * vector``. See :ref:`Transform3D.inverse<class_Transform3D_method_inverse>`.
\ ``vector * transform`` is equivalent to ``transform.inverse() * vector``. See :ref:`Transform3D.inverse()<class_Transform3D_method_inverse>`.
For transforming by inverse of an affine transformation (e.g. with scaling) ``transform.affine_inverse() * vector`` can be used instead. See :ref:`Transform3D.affine_inverse<class_Transform3D_method_affine_inverse>`.
For transforming by inverse of an affine transformation (e.g. with scaling) ``transform.affine_inverse() * vector`` can be used instead. See :ref:`Transform3D.affine_inverse()<class_Transform3D_method_affine_inverse>`.
.. rst-class:: classref-item-separator
@@ -1320,7 +1320,7 @@ Compares two **Vector3** vectors by first checking if the X value of the left ve
Returns ``true`` if the vectors are exactly equal.
\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx<class_Vector3_method_is_equal_approx>` instead, which is more reliable.
\ **Note:** Due to floating-point precision errors, consider using :ref:`is_equal_approx()<class_Vector3_method_is_equal_approx>` instead, which is more reliable.
\ **Note:** Vectors with :ref:`@GDScript.NAN<class_@GDScript_constant_NAN>` elements don't behave the same as other vectors. Therefore, the results from this operator may not be accurate if NaNs are included.