diff --git a/classes/class_audiostreamplayer.rst b/classes/class_audiostreamplayer.rst index 6c3769536..7f13bff57 100644 --- a/classes/class_audiostreamplayer.rst +++ b/classes/class_audiostreamplayer.rst @@ -18,6 +18,8 @@ Description Plays an audio stream non-positionally. +To play audio positionally, use :ref:`AudioStreamPlayer2D` or :ref:`AudioStreamPlayer3D` instead of ``AudioStreamPlayer``. + Tutorials --------- diff --git a/classes/class_audiostreamplayer2d.rst b/classes/class_audiostreamplayer2d.rst index 05846038e..cd946f797 100644 --- a/classes/class_audiostreamplayer2d.rst +++ b/classes/class_audiostreamplayer2d.rst @@ -11,13 +11,17 @@ AudioStreamPlayer2D **Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` -Plays audio in 2D. +Plays positional sound in 2D space. Description ----------- Plays audio that dampens with distance from screen center. +See also :ref:`AudioStreamPlayer` to play a sound non-positionally. + +**Note:** Hiding an ``AudioStreamPlayer2D`` node does not disable its audio output. To temporarily disable an ``AudioStreamPlayer2D``'s audio output, set :ref:`volume_db` to a very low value like ``-100`` (which isn't audible to human hearing). + Tutorials --------- diff --git a/classes/class_audiostreamplayer3d.rst b/classes/class_audiostreamplayer3d.rst index d35de4ace..b9ab29737 100644 --- a/classes/class_audiostreamplayer3d.rst +++ b/classes/class_audiostreamplayer3d.rst @@ -11,7 +11,7 @@ AudioStreamPlayer3D **Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` -Plays 3D sound in 3D space. +Plays positional sound in 3D space. Description ----------- @@ -20,6 +20,10 @@ Plays a sound effect with directed sound effects, dampens with distance if neede By default, audio is heard from the camera position. This can be changed by adding a :ref:`Listener` node to the scene and enabling it by calling :ref:`Listener.make_current` on it. +See also :ref:`AudioStreamPlayer` to play a sound non-positionally. + +**Note:** Hiding an ``AudioStreamPlayer3D`` node does not disable its audio output. To temporarily disable an ``AudioStreamPlayer3D``'s audio output, set :ref:`unit_db` to a very low value like ``-100`` (which isn't audible to human hearing). + Tutorials --------- diff --git a/classes/class_basis.rst b/classes/class_basis.rst index a44143aaf..a1e2cfa4d 100644 --- a/classes/class_basis.rst +++ b/classes/class_basis.rst @@ -82,7 +82,7 @@ Methods +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Basis` | :ref:`scaled` **(** :ref:`Vector3` scale **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Basis` | :ref:`slerp` **(** :ref:`Basis` b, :ref:`float` t **)** | +| :ref:`Basis` | :ref:`slerp` **(** :ref:`Basis` to, :ref:`float` weight **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`tdotx` **(** :ref:`Vector3` with **)** | +-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -274,7 +274,7 @@ Introduce an additional scaling specified by the given 3D scaling factor. .. _class_Basis_method_slerp: -- :ref:`Basis` **slerp** **(** :ref:`Basis` b, :ref:`float` t **)** +- :ref:`Basis` **slerp** **(** :ref:`Basis` to, :ref:`float` weight **)** Assuming that the matrix is a proper rotation matrix, slerp performs a spherical-linear interpolation with another rotation matrix. diff --git a/classes/class_color.rst b/classes/class_color.rst index 1862a23ca..65259d077 100644 --- a/classes/class_color.rst +++ b/classes/class_color.rst @@ -88,7 +88,7 @@ Methods +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Color` | :ref:`lightened` **(** :ref:`float` amount **)** | +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Color` | :ref:`linear_interpolate` **(** :ref:`Color` b, :ref:`float` t **)** | +| :ref:`Color` | :ref:`linear_interpolate` **(** :ref:`Color` to, :ref:`float` weight **)** | +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`to_abgr32` **(** **)** | +-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -977,9 +977,9 @@ Returns a new color resulting from making this color lighter by the specified pe .. _class_Color_method_linear_interpolate: -- :ref:`Color` **linear_interpolate** **(** :ref:`Color` b, :ref:`float` t **)** +- :ref:`Color` **linear_interpolate** **(** :ref:`Color` to, :ref:`float` weight **)** -Returns the linear interpolation with another color. The interpolation factor ``t`` is between 0 and 1. +Returns the linear interpolation with another color. The interpolation factor ``weight`` is between 0 and 1. :: diff --git a/classes/class_file.rst b/classes/class_file.rst index 4f2bb629b..c953bcb72 100644 --- a/classes/class_file.rst +++ b/classes/class_file.rst @@ -457,6 +457,8 @@ Opens the file for writing or reading, depending on the flags. Opens a compressed file for reading or writing. +**Note:** :ref:`open_compressed` can only read files that were saved by Godot, not third-party compression formats. See `GitHub issue #28999 `_ for a workaround. + ---- .. _class_File_method_open_encrypted: diff --git a/classes/class_kinematicbody.rst b/classes/class_kinematicbody.rst index 3c0159103..d5ce3ec34 100644 --- a/classes/class_kinematicbody.rst +++ b/classes/class_kinematicbody.rst @@ -197,7 +197,7 @@ Returns the number of times the body collided and changed direction during the l - :ref:`bool` **is_on_ceiling** **(** **)** |const| -Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. +Returns ``true`` if the body collided with the ceiling on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. ---- @@ -205,7 +205,7 @@ Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:` - :ref:`bool` **is_on_floor** **(** **)** |const| -Returns ``true`` if the body is on the floor. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. +Returns ``true`` if the body collided with the floor on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. ---- @@ -213,7 +213,7 @@ Returns ``true`` if the body is on the floor. Only updates when calling :ref:`mo - :ref:`bool` **is_on_wall** **(** **)** |const| -Returns ``true`` if the body is on a wall. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. +Returns ``true`` if the body collided with a wall on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. ---- diff --git a/classes/class_kinematicbody2d.rst b/classes/class_kinematicbody2d.rst index 739bd11f9..7d998587c 100644 --- a/classes/class_kinematicbody2d.rst +++ b/classes/class_kinematicbody2d.rst @@ -155,7 +155,7 @@ Returns the number of times the body collided and changed direction during the l - :ref:`bool` **is_on_ceiling** **(** **)** |const| -Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. +Returns ``true`` if the body collided with the ceiling on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. ---- @@ -163,7 +163,7 @@ Returns ``true`` if the body is on the ceiling. Only updates when calling :ref:` - :ref:`bool` **is_on_floor** **(** **)** |const| -Returns ``true`` if the body is on the floor. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. +Returns ``true`` if the body collided with the floor on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. ---- @@ -171,7 +171,7 @@ Returns ``true`` if the body is on the floor. Only updates when calling :ref:`mo - :ref:`bool` **is_on_wall** **(** **)** |const| -Returns ``true`` if the body is on a wall. Only updates when calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. +Returns ``true`` if the body collided with a wall on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. ---- diff --git a/classes/class_largetexture.rst b/classes/class_largetexture.rst index 172a6dff5..bba608da1 100644 --- a/classes/class_largetexture.rst +++ b/classes/class_largetexture.rst @@ -11,12 +11,12 @@ LargeTexture **Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` -A :ref:`Texture` capable of storing many smaller textures with offsets. +*Deprecated.* A :ref:`Texture` capable of storing many smaller textures with offsets. Description ----------- -A :ref:`Texture` capable of storing many smaller textures with offsets. +*Deprecated (will be removed in Godot 4.0).* A :ref:`Texture` capable of storing many smaller textures with offsets. You can dynamically add pieces (:ref:`Texture`\ s) to this ``LargeTexture`` using different offsets. diff --git a/classes/class_os.rst b/classes/class_os.rst index 014de9b00..cf266861f 100644 --- a/classes/class_os.rst +++ b/classes/class_os.rst @@ -1464,6 +1464,8 @@ Returns the current time zone as a dictionary with the keys: bias and name. Returns a string that is unique to the device. +**Note:** This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved prior to an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by :ref:`get_unique_id` for security purposes. + **Note:** Returns an empty string on HTML5 and UWP, as this method isn't implemented on those platforms yet. ---- diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst index 3bd9dd5a7..8ce9fd702 100644 --- a/classes/class_projectsettings.rst +++ b/classes/class_projectsettings.rst @@ -20,6 +20,8 @@ Contains global variables accessible from everywhere. Use :ref:`get_setting`_. + **Overriding:** Any project setting can be overridden by creating a file named ``override.cfg`` in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. Overriding will still take the base project settings' `feature tags `_ in account. Therefore, make sure to *also* override the setting with the desired feature tags if you want them to override base project settings on all platforms and configurations. Tutorials diff --git a/classes/class_quat.rst b/classes/class_quat.rst index 3f1b4585d..0949113b4 100644 --- a/classes/class_quat.rst +++ b/classes/class_quat.rst @@ -43,43 +43,43 @@ Properties Methods ------- -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quat` | :ref:`Quat` **(** :ref:`Basis` from **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quat` | :ref:`Quat` **(** :ref:`Vector3` euler **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quat` | :ref:`Quat` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quat` | :ref:`Quat` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quat` | :ref:`cubic_slerp` **(** :ref:`Quat` b, :ref:`Quat` pre_a, :ref:`Quat` post_b, :ref:`float` t **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`dot` **(** :ref:`Quat` b **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`get_euler` **(** **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quat` | :ref:`inverse` **(** **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Quat` quat **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_normalized` **(** **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`length` **(** **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`length_squared` **(** **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quat` | :ref:`normalized` **(** **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_axis_angle` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| void | :ref:`set_euler` **(** :ref:`Vector3` euler **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quat` | :ref:`slerp` **(** :ref:`Quat` b, :ref:`float` t **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Quat` | :ref:`slerpni` **(** :ref:`Quat` b, :ref:`float` t **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`xform` **(** :ref:`Vector3` v **)** | -+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`Quat` **(** :ref:`Basis` from **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`Quat` **(** :ref:`Vector3` euler **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`Quat` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`Quat` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`cubic_slerp` **(** :ref:`Quat` b, :ref:`Quat` pre_a, :ref:`Quat` post_b, :ref:`float` weight **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`dot` **(** :ref:`Quat` b **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_euler` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`inverse` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Quat` quat **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_normalized` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length_squared` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`normalized` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_axis_angle` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_euler` **(** :ref:`Vector3` euler **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`slerp` **(** :ref:`Quat` to, :ref:`float` weight **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`slerpni` **(** :ref:`Quat` to, :ref:`float` weight **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`xform` **(** :ref:`Vector3` v **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Constants --------- @@ -176,9 +176,9 @@ Constructs a quaternion defined by the given values. .. _class_Quat_method_cubic_slerp: -- :ref:`Quat` **cubic_slerp** **(** :ref:`Quat` b, :ref:`Quat` pre_a, :ref:`Quat` post_b, :ref:`float` t **)** +- :ref:`Quat` **cubic_slerp** **(** :ref:`Quat` b, :ref:`Quat` pre_a, :ref:`Quat` post_b, :ref:`float` weight **)** -Performs a cubic spherical interpolation between quaternions ``preA``, this vector, ``b``, and ``postB``, by the given amount ``t``. +Performs a cubic spherical interpolation between quaternions ``pre_a``, this vector, ``b``, and ``post_b``, by the given amount ``weight``. ---- @@ -264,7 +264,7 @@ Sets the quaternion to a rotation specified by Euler angles (in the YXZ conventi .. _class_Quat_method_slerp: -- :ref:`Quat` **slerp** **(** :ref:`Quat` b, :ref:`float` t **)** +- :ref:`Quat` **slerp** **(** :ref:`Quat` to, :ref:`float` weight **)** Returns the result of the spherical linear interpolation between this quaternion and ``to`` by amount ``weight``. @@ -274,7 +274,7 @@ Returns the result of the spherical linear interpolation between this quaternion .. _class_Quat_method_slerpni: -- :ref:`Quat` **slerpni** **(** :ref:`Quat` b, :ref:`float` t **)** +- :ref:`Quat` **slerpni** **(** :ref:`Quat` to, :ref:`float` weight **)** Returns the result of the spherical linear interpolation between this quaternion and ``to`` by amount ``weight``, but without checking if the rotation path is not bigger than 90 degrees. diff --git a/classes/class_scenetree.rst b/classes/class_scenetree.rst index f4c57033d..6f66a44b6 100644 --- a/classes/class_scenetree.rst +++ b/classes/class_scenetree.rst @@ -483,6 +483,8 @@ Calls ``method`` on each member of the given group. You can pass arguments to `` **Note:** ``method`` may only have 5 arguments at most (7 arguments passed to this method in total). +**Note:** :ref:`call_group` will always call methods with an one-frame delay, in a way similar to :ref:`Object.call_deferred`. To call methods immediately, use :ref:`call_group_flags` with the :ref:`GROUP_CALL_REALTIME` flag. + ---- .. _class_SceneTree_method_call_group_flags: @@ -493,6 +495,8 @@ Calls ``method`` on each member of the given group, respecting the given :ref:`G **Note:** ``method`` may only have 5 arguments at most (8 arguments passed to this method in total). +**Note:** Group call flags are used to control the method calling behavior. If the :ref:`GROUP_CALL_REALTIME` flag is present in the ``flags`` argument, methods will be called immediately. If this flag isn't present in ``flags``, methods will be called with a one-frame delay in a way similar to :ref:`call_group`. + ---- .. _class_SceneTree_method_change_scene: diff --git a/classes/class_shape.rst b/classes/class_shape.rst index f776ab177..012331a23 100644 --- a/classes/class_shape.rst +++ b/classes/class_shape.rst @@ -32,6 +32,13 @@ Properties | :ref:`float` | :ref:`margin` | ``0.04`` | +---------------------------+--------------------------------------------+----------+ +Methods +------- + ++-----------------------------------+----------------------------------------------------------------------+ +| :ref:`ArrayMesh` | :ref:`get_debug_mesh` **(** **)** | ++-----------------------------------+----------------------------------------------------------------------+ + Property Descriptions --------------------- @@ -51,6 +58,15 @@ The collision margin for the shape. Used in Bullet Physics only. Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp. +Method Descriptions +------------------- + +.. _class_Shape_method_get_debug_mesh: + +- :ref:`ArrayMesh` **get_debug_mesh** **(** **)** + +Returns the :ref:`ArrayMesh` used to draw the debug collision for this ``Shape``. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_skeleton.rst b/classes/class_skeleton.rst index 70704fade..3ec109b63 100644 --- a/classes/class_skeleton.rst +++ b/classes/class_skeleton.rst @@ -49,6 +49,8 @@ Methods +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Transform` | :ref:`get_bone_global_pose` **(** :ref:`int` bone_idx **)** |const| | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_bone_global_pose_no_override` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_bone_name` **(** :ref:`int` bone_idx **)** |const| | +-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_bone_parent` **(** :ref:`int` bone_idx **)** |const| | @@ -169,6 +171,14 @@ Returns the overall transform of the specified bone, with respect to the skeleto ---- +.. _class_Skeleton_method_get_bone_global_pose_no_override: + +- :ref:`Transform` **get_bone_global_pose_no_override** **(** :ref:`int` bone_idx **)** |const| + +Returns the overall transform of the specified bone, with respect to the skeleton, but without any global pose overrides. Being relative to the skeleton frame, this is not the actual "global" transform of the bone. + +---- + .. _class_Skeleton_method_get_bone_name: - :ref:`String` **get_bone_name** **(** :ref:`int` bone_idx **)** |const| diff --git a/classes/class_skeletonik.rst b/classes/class_skeletonik.rst index 2ea096dc2..92b19b200 100644 --- a/classes/class_skeletonik.rst +++ b/classes/class_skeletonik.rst @@ -11,7 +11,32 @@ SkeletonIK **Inherits:** :ref:`Node` **<** :ref:`Object` +SkeletonIK is used to place the end bone of a :ref:`Skeleton` bone chain at a certain point in 3D by rotating all bones in the chain accordingly. +Description +----------- + +SkeletonIK is used to place the end bone of a :ref:`Skeleton` bone chain at a certain point in 3D by rotating all bones in the chain accordingly. A typical scenario for IK in games is to place a characters feet on the ground or a characters hands on a currently hold object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the :ref:`Skeleton` ``bones_global_pose_override`` property for all affected bones in the chain. If fully applied this overwrites any bone transform from :ref:`Animation`\ s or bone custom poses set by users. The applied amount can be controlled with the ``interpolation`` property. + +:: + + # Apply IK effect automatically on every new frame (not the current) + skeleton_ik_node.start() + + # Apply IK effect only on the current frame + skeleton_ik_node.start(true) + + # Stop IK effect and reset bones_global_pose_override on Skeleton + skeleton_ik_node.stop() + + # Apply full IK effect + skeleton_ik_node.set_interpolation(1.0) + + # Apply half IK effect + skeleton_ik_node.set_interpolation(0.5) + + # Apply zero IK effect (a value at or below 0.01 also removes bones_global_pose_override on Skeleton) + skeleton_ik_node.set_interpolation(0.0) Tutorials --------- @@ -71,6 +96,8 @@ Property Descriptions | *Getter* | get_interpolation() | +-----------+--------------------------+ +Interpolation value for how much the IK results are applied to the current skeleton bone chain. A value of ``1.0`` will overwrite all skeleton bone transforms completely while a value of ``0.0`` will visually disable the SkeletonIK. A value at or below ``0.01`` also calls :ref:`Skeleton.clear_bones_global_pose_override`. + ---- .. _class_SkeletonIK_property_magnet: @@ -85,6 +112,8 @@ Property Descriptions | *Getter* | get_magnet_position() | +-----------+----------------------------+ +Secondary target position (first is :ref:`target` property or :ref:`target_node`) for the IK chain. Use magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain has more than 2 bones. The middle chain bone position will be linearly interpolated with the magnet position. + ---- .. _class_SkeletonIK_property_max_iterations: @@ -99,6 +128,8 @@ Property Descriptions | *Getter* | get_max_iterations() | +-----------+---------------------------+ +Number of iteration loops used by the IK solver to produce more accurate (and elegant) bone chain results. + ---- .. _class_SkeletonIK_property_min_distance: @@ -113,6 +144,8 @@ Property Descriptions | *Getter* | get_min_distance() | +-----------+-------------------------+ +The minimum distance between bone and goal target. If the distance is below this value, the IK solver stops further iterations. + ---- .. _class_SkeletonIK_property_override_tip_basis: @@ -127,6 +160,8 @@ Property Descriptions | *Getter* | is_override_tip_basis() | +-----------+-------------------------------+ +If ``true`` overwrites the rotation of the tip bone with the rotation of the :ref:`target` (or :ref:`target_node` if defined). + ---- .. _class_SkeletonIK_property_root_bone: @@ -141,6 +176,8 @@ Property Descriptions | *Getter* | get_root_bone() | +-----------+----------------------+ +The name of the current root bone, the first bone in the IK chain. + ---- .. _class_SkeletonIK_property_target: @@ -155,6 +192,8 @@ Property Descriptions | *Getter* | get_target_transform() | +-----------+-----------------------------------------------------+ +First target of the IK chain where the tip bone is placed and, if :ref:`override_tip_basis` is ``true``, how the tip bone is rotated. If a :ref:`target_node` path is available the nodes transform is used instead and this property is ignored. + ---- .. _class_SkeletonIK_property_target_node: @@ -169,6 +208,8 @@ Property Descriptions | *Getter* | get_target_node() | +-----------+------------------------+ +Target node :ref:`NodePath` for the IK chain. If available, the node's current :ref:`Transform` is used instead of the :ref:`target` property. + ---- .. _class_SkeletonIK_property_tip_bone: @@ -183,6 +224,8 @@ Property Descriptions | *Getter* | get_tip_bone() | +-----------+---------------------+ +The name of the current tip bone, the last bone in the IK chain placed at the :ref:`target` transform (or :ref:`target_node` if defined). + ---- .. _class_SkeletonIK_property_use_magnet: @@ -197,6 +240,8 @@ Property Descriptions | *Getter* | is_using_magnet() | +-----------+-----------------------+ +If ``true``, instructs the IK solver to consider the secondary magnet target (pole target) when calculating the bone chain. Use the magnet position (pole target) to control the bending of the IK chain. + Method Descriptions ------------------- @@ -204,24 +249,32 @@ Method Descriptions - :ref:`Skeleton` **get_parent_skeleton** **(** **)** |const| +Returns the parent :ref:`Skeleton` Node that was present when SkeletonIK entered the :ref:`SceneTree`. Returns null if the parent node was not a :ref:`Skeleton` Node when SkeletonIK entered the :ref:`SceneTree`. + ---- .. _class_SkeletonIK_method_is_running: - :ref:`bool` **is_running** **(** **)** +Returns ``true`` if SkeletonIK is applying IK effects on continues frames to the :ref:`Skeleton` bones. Returns ``false`` if SkeletonIK is stopped or :ref:`start` was used with the ``one_time`` parameter set to ``true``. + ---- .. _class_SkeletonIK_method_start: - void **start** **(** :ref:`bool` one_time=false **)** +Starts applying IK effects on each frame to the :ref:`Skeleton` bones but will only take effect starting on the next frame. If ``one_time`` is ``true``, this will take effect immediately but also reset on the next frame. + ---- .. _class_SkeletonIK_method_stop: - void **stop** **(** **)** +Stops applying IK effects on each frame to the :ref:`Skeleton` bones and also calls :ref:`Skeleton.clear_bones_global_pose_override` to remove existing overrides on all bones. + .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_spatialmaterial.rst b/classes/class_spatialmaterial.rst index c0bf77eb7..9a95ba806 100644 --- a/classes/class_spatialmaterial.rst +++ b/classes/class_spatialmaterial.rst @@ -857,6 +857,8 @@ Sets the strength of the clearcoat effect. Setting to ``0`` looks the same as di If ``true``, clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough. +**Note:** Clearcoat rendering is not visible if the material has :ref:`flags_unshaded` set to ``true``. + ---- .. _class_SpatialMaterial_property_clearcoat_gloss: @@ -1895,6 +1897,8 @@ Sets the strength of the rim lighting effect. If ``true``, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object. +**Note:** Rim lighting is not visible if the material has :ref:`flags_unshaded` set to ``true``. + ---- .. _class_SpatialMaterial_property_rim_texture: diff --git a/classes/class_spriteframes.rst b/classes/class_spriteframes.rst index 132f96140..5deb8c0a7 100644 --- a/classes/class_spriteframes.rst +++ b/classes/class_spriteframes.rst @@ -112,7 +112,7 @@ Removes all animations. A "default" animation will be created. - :ref:`bool` **get_animation_loop** **(** :ref:`String` anim **)** |const| -If ``true``, the given animation will loop. +Returns ``true`` if the given animation is configured to loop when it finishes playing. Otherwise, returns ``false``. ---- diff --git a/classes/class_transform2d.rst b/classes/class_transform2d.rst index 36b72e2b8..03a423fb7 100644 --- a/classes/class_transform2d.rst +++ b/classes/class_transform2d.rst @@ -212,7 +212,7 @@ Returns the scale. - :ref:`Transform2D` **interpolate_with** **(** :ref:`Transform2D` transform, :ref:`float` weight **)** -Returns a transform interpolated between this transform and another by a given weight (on the range of 0.0 to 1.0). +Returns a transform interpolated between this transform and another by a given ``weight`` (on the range of 0.0 to 1.0). ---- diff --git a/classes/class_vector2.rst b/classes/class_vector2.rst index 0f960049c..bbcf6434d 100644 --- a/classes/class_vector2.rst +++ b/classes/class_vector2.rst @@ -45,75 +45,75 @@ Properties Methods ------- -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`Vector2` **(** :ref:`float` x, :ref:`float` y **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`abs` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`angle` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`angle_to` **(** :ref:`Vector2` to **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`angle_to_point` **(** :ref:`Vector2` to **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`aspect` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`bounce` **(** :ref:`Vector2` n **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`ceil` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`clamped` **(** :ref:`float` length **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`cross` **(** :ref:`Vector2` with **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`cubic_interpolate` **(** :ref:`Vector2` b, :ref:`Vector2` pre_a, :ref:`Vector2` post_b, :ref:`float` t **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`direction_to` **(** :ref:`Vector2` b **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`distance_squared_to` **(** :ref:`Vector2` to **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`distance_to` **(** :ref:`Vector2` to **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`dot` **(** :ref:`Vector2` with **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`floor` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Vector2` v **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_normalized` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`length` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`length_squared` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`linear_interpolate` **(** :ref:`Vector2` b, :ref:`float` t **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`move_toward` **(** :ref:`Vector2` to, :ref:`float` delta **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`normalized` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`posmod` **(** :ref:`float` mod **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`posmodv` **(** :ref:`Vector2` modv **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`project` **(** :ref:`Vector2` b **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`reflect` **(** :ref:`Vector2` n **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`rotated` **(** :ref:`float` phi **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`round` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`sign` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`slerp` **(** :ref:`Vector2` b, :ref:`float` t **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`slide` **(** :ref:`Vector2` n **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`snapped` **(** :ref:`Vector2` by **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector2` | :ref:`tangent` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`Vector2` **(** :ref:`float` x, :ref:`float` y **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`abs` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angle` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angle_to` **(** :ref:`Vector2` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angle_to_point` **(** :ref:`Vector2` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`aspect` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`bounce` **(** :ref:`Vector2` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`ceil` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`clamped` **(** :ref:`float` length **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`cross` **(** :ref:`Vector2` with **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`cubic_interpolate` **(** :ref:`Vector2` b, :ref:`Vector2` pre_a, :ref:`Vector2` post_b, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`direction_to` **(** :ref:`Vector2` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`distance_squared_to` **(** :ref:`Vector2` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`distance_to` **(** :ref:`Vector2` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`dot` **(** :ref:`Vector2` with **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`floor` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Vector2` v **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_normalized` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length_squared` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`linear_interpolate` **(** :ref:`Vector2` to, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`move_toward` **(** :ref:`Vector2` to, :ref:`float` delta **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`normalized` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`posmod` **(** :ref:`float` mod **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`posmodv` **(** :ref:`Vector2` modv **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`project` **(** :ref:`Vector2` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`reflect` **(** :ref:`Vector2` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`rotated` **(** :ref:`float` phi **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`round` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`sign` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`slerp` **(** :ref:`Vector2` to, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`slide` **(** :ref:`Vector2` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`snapped` **(** :ref:`Vector2` by **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`tangent` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Constants --------- @@ -268,9 +268,9 @@ Returns the cross product of this vector and ``with``. .. _class_Vector2_method_cubic_interpolate: -- :ref:`Vector2` **cubic_interpolate** **(** :ref:`Vector2` b, :ref:`Vector2` pre_a, :ref:`Vector2` post_b, :ref:`float` t **)** +- :ref:`Vector2` **cubic_interpolate** **(** :ref:`Vector2` b, :ref:`Vector2` pre_a, :ref:`Vector2` post_b, :ref:`float` weight **)** -Cubically interpolates between this vector and ``b`` using ``pre_a`` and ``post_b`` as handles, and returns the result at position ``t``. ``t`` is on the range of 0.0 to 1.0, representing the amount of interpolation. +Cubically interpolates 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. ---- @@ -358,9 +358,9 @@ This method runs faster than :ref:`length`, so pref .. _class_Vector2_method_linear_interpolate: -- :ref:`Vector2` **linear_interpolate** **(** :ref:`Vector2` b, :ref:`float` t **)** +- :ref:`Vector2` **linear_interpolate** **(** :ref:`Vector2` to, :ref:`float` weight **)** -Returns the result of the linear interpolation between this vector and ``b`` by amount ``t``. ``t`` is on the range of 0.0 to 1.0, representing the amount of interpolation. +Returns the result of the 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. ---- @@ -438,9 +438,9 @@ Returns the vector with each component set to one or negative one, depending on .. _class_Vector2_method_slerp: -- :ref:`Vector2` **slerp** **(** :ref:`Vector2` b, :ref:`float` t **)** +- :ref:`Vector2` **slerp** **(** :ref:`Vector2` to, :ref:`float` weight **)** -Returns the result of spherical linear interpolation between this vector and ``b``, by amount ``t``. ``t`` is on the range of 0.0 to 1.0, representing the amount of interpolation. +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. **Note:** Both vectors must be normalized. diff --git a/classes/class_vector3.rst b/classes/class_vector3.rst index 641b36af1..bdc0121ca 100644 --- a/classes/class_vector3.rst +++ b/classes/class_vector3.rst @@ -47,75 +47,75 @@ Properties Methods ------- -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`Vector3` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`abs` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`angle_to` **(** :ref:`Vector3` to **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`bounce` **(** :ref:`Vector3` n **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`ceil` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`cross` **(** :ref:`Vector3` b **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`cubic_interpolate` **(** :ref:`Vector3` b, :ref:`Vector3` pre_a, :ref:`Vector3` post_b, :ref:`float` t **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`direction_to` **(** :ref:`Vector3` b **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`distance_squared_to` **(** :ref:`Vector3` b **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`distance_to` **(** :ref:`Vector3` b **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`dot` **(** :ref:`Vector3` b **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`floor` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`inverse` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Vector3` v **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`bool` | :ref:`is_normalized` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`length` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`float` | :ref:`length_squared` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`linear_interpolate` **(** :ref:`Vector3` b, :ref:`float` t **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`max_axis` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`int` | :ref:`min_axis` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`move_toward` **(** :ref:`Vector3` to, :ref:`float` delta **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`normalized` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Basis` | :ref:`outer` **(** :ref:`Vector3` b **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`posmod` **(** :ref:`float` mod **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`posmodv` **(** :ref:`Vector3` modv **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`project` **(** :ref:`Vector3` b **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`reflect` **(** :ref:`Vector3` n **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`round` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`sign` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`slerp` **(** :ref:`Vector3` b, :ref:`float` t **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`slide` **(** :ref:`Vector3` n **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Vector3` | :ref:`snapped` **(** :ref:`Vector3` by **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ -| :ref:`Basis` | :ref:`to_diagonal_matrix` **(** **)** | -+-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`Vector3` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`abs` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angle_to` **(** :ref:`Vector3` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`bounce` **(** :ref:`Vector3` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`ceil` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`cross` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`cubic_interpolate` **(** :ref:`Vector3` b, :ref:`Vector3` pre_a, :ref:`Vector3` post_b, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`direction_to` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`distance_squared_to` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`distance_to` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`dot` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`floor` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`inverse` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Vector3` v **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_normalized` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length_squared` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`linear_interpolate` **(** :ref:`Vector3` to, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`max_axis` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`min_axis` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`move_toward` **(** :ref:`Vector3` to, :ref:`float` delta **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`normalized` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`outer` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`posmod` **(** :ref:`float` mod **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`posmodv` **(** :ref:`Vector3` modv **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`project` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`reflect` **(** :ref:`Vector3` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`round` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`sign` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`slerp` **(** :ref:`Vector3` to, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`slide` **(** :ref:`Vector3` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`snapped` **(** :ref:`Vector3` by **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`to_diagonal_matrix` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Constants --------- @@ -258,9 +258,9 @@ Returns the cross product of this vector and ``b``. .. _class_Vector3_method_cubic_interpolate: -- :ref:`Vector3` **cubic_interpolate** **(** :ref:`Vector3` b, :ref:`Vector3` pre_a, :ref:`Vector3` post_b, :ref:`float` t **)** +- :ref:`Vector3` **cubic_interpolate** **(** :ref:`Vector3` b, :ref:`Vector3` pre_a, :ref:`Vector3` post_b, :ref:`float` weight **)** -Performs a cubic interpolation between vectors ``pre_a``, ``a``, ``b``, ``post_b`` (``a`` is current), by the given amount ``t``. ``t`` is on the range of 0.0 to 1.0, representing the amount of interpolation. +Performs a cubic interpolation between vectors ``pre_a``, ``a``, ``b``, ``post_b`` (``a`` is current), by the given amount ``weight``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation. ---- @@ -356,9 +356,9 @@ This method runs faster than :ref:`length`, so pref .. _class_Vector3_method_linear_interpolate: -- :ref:`Vector3` **linear_interpolate** **(** :ref:`Vector3` b, :ref:`float` t **)** +- :ref:`Vector3` **linear_interpolate** **(** :ref:`Vector3` to, :ref:`float` weight **)** -Returns the result of the linear interpolation between this vector and ``b`` by amount ``t``. ``t`` is on the range of 0.0 to 1.0, representing the amount of interpolation. +Returns the result of the linear interpolation between this vector and ``to`` by amount ``t``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation. ---- @@ -460,9 +460,9 @@ Returns a vector with each component set to one or negative one, depending on th .. _class_Vector3_method_slerp: -- :ref:`Vector3` **slerp** **(** :ref:`Vector3` b, :ref:`float` t **)** +- :ref:`Vector3` **slerp** **(** :ref:`Vector3` to, :ref:`float` weight **)** -Returns the result of spherical linear interpolation between this vector and ``b``, by amount ``t``. ``t`` is on the range of 0.0 to 1.0, representing the amount of interpolation. +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. **Note:** Both vectors must be normalized.