Skip to content

Commit

Permalink
Merge pull request godotengine#10309 from godotengine/classref/sync-0…
Browse files Browse the repository at this point in the history
…c45ace

classref: Sync with current master branch (0c45ace)
  • Loading branch information
mhilbrunner authored Nov 23, 2024
2 parents e7d5ab3 + fa8c143 commit 9eb8552
Show file tree
Hide file tree
Showing 35 changed files with 553 additions and 211 deletions.
10 changes: 9 additions & 1 deletion classes/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -3867,11 +3867,19 @@ Hints that a :ref:`Callable<class_Callable>` property should be displayed as a c
\ **Note:** A :ref:`Callable<class_Callable>` cannot be properly serialized and stored in a file, so it is recommended to use :ref:`PROPERTY_USAGE_EDITOR<class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR>` instead of :ref:`PROPERTY_USAGE_DEFAULT<class_@GlobalScope_constant_PROPERTY_USAGE_DEFAULT>`.

.. _class_@GlobalScope_constant_PROPERTY_HINT_ONESHOT:

.. rst-class:: classref-enumeration-constant

:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_ONESHOT** = ``40``

Hints that a property will be changed on its own after setting, such as :ref:`AudioStreamPlayer.playing<class_AudioStreamPlayer_property_playing>` or :ref:`GPUParticles3D.emitting<class_GPUParticles3D_property_emitting>`.

.. _class_@GlobalScope_constant_PROPERTY_HINT_MAX:

.. rst-class:: classref-enumeration-constant

:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``40``
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``41``

Represents the size of the :ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` enum.

Expand Down
6 changes: 3 additions & 3 deletions classes/class_aabb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Property Descriptions

:ref:`Vector3<class_Vector3>` **end** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_AABB_property_end>`

The ending point. This is usually the corner on the top-right and forward of the bounding box, and is equivalent to ``position + size``. Setting this point affects the :ref:`size<class_AABB_property_size>`.
The ending point. This is usually the corner on the top-right and back of the bounding box, and is equivalent to ``position + size``. Setting this point affects the :ref:`size<class_AABB_property_size>`.

.. rst-class:: classref-item-separator

Expand All @@ -175,7 +175,7 @@ The ending point. This is usually the corner on the top-right and forward of the

:ref:`Vector3<class_Vector3>` **position** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_AABB_property_position>`

The origin point. This is usually the corner on the bottom-left and back of the bounding box.
The origin point. This is usually the corner on the bottom-left and forward of the bounding box.

.. rst-class:: classref-item-separator

Expand All @@ -189,7 +189,7 @@ The origin point. This is usually the corner on the bottom-left and back of the

The bounding box's width, height, and depth starting from :ref:`position<class_AABB_property_position>`. Setting this value also affects the :ref:`end<class_AABB_property_end>` point.

\ **Note:** It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the :ref:`position<class_AABB_property_position>` is the bottom-left-back corner, and the :ref:`end<class_AABB_property_end>` is the top-right-forward corner. To get an equivalent bounding box with non-negative size, use :ref:`abs<class_AABB_method_abs>`.
\ **Note:** It's recommended setting the width, height, and depth to non-negative values. This is because most methods in Godot assume that the :ref:`position<class_AABB_property_position>` is the bottom-left-forward corner, and the :ref:`end<class_AABB_property_end>` is the top-right-back corner. To get an equivalent bounding box with non-negative size, use :ref:`abs<class_AABB_method_abs>`.

.. rst-class:: classref-section-separator

Expand Down
66 changes: 52 additions & 14 deletions classes/class_animationmixer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Properties
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`reset_on_save<class_AnimationMixer_property_reset_on_save>` | ``true`` |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
| :ref:`bool<class_bool>` | :ref:`root_motion_local<class_AnimationMixer_property_root_motion_local>` | |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`root_motion_track<class_AnimationMixer_property_root_motion_track>` | ``NodePath("")`` |
+-----------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------+--------------------+
| :ref:`NodePath<class_NodePath>` | :ref:`root_node<class_AnimationMixer_property_root_node>` | ``NodePath("..")`` |
Expand Down Expand Up @@ -474,6 +476,23 @@ This makes it more convenient to preview and edit animations in the editor, as c

----

.. _class_AnimationMixer_property_root_motion_local:

.. rst-class:: classref-property

:ref:`bool<class_bool>` **root_motion_local** :ref:`🔗<class_AnimationMixer_property_root_motion_local>`

.. rst-class:: classref-property-setget

- |void| **set_root_motion_local**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_root_motion_local**\ (\ )

If ``true``, :ref:`get_root_motion_position<class_AnimationMixer_method_get_root_motion_position>` value is extracted as a local translation value before blending. In other words, it is treated like the translation is done after the rotation.

.. rst-class:: classref-item-separator

----

.. _class_AnimationMixer_property_root_motion_track:

.. rst-class:: classref-property
Expand Down Expand Up @@ -684,13 +703,13 @@ The most basic example is applying position to :ref:`CharacterBody3D<class_Chara

.. code-tab:: gdscript

var current_rotation: Quaternion
var current_rotation

func _process(delta):
if Input.is_action_just_pressed("animate"):
current_rotation = get_quaternion()
state_machine.travel("Animate")
var velocity: Vector3 = current_rotation * animation_tree.get_root_motion_position() / delta
var velocity = current_rotation * animation_tree.get_root_motion_position() / delta
set_velocity(velocity)
move_and_slide()

Expand All @@ -707,7 +726,26 @@ By using this in combination with :ref:`get_root_motion_rotation_accumulator<cla
if Input.is_action_just_pressed("animate"):
state_machine.travel("Animate")
set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation())
var velocity: Vector3 = (animation_tree.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * animation_tree.get_root_motion_position() / delta
var velocity = (animation_tree.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * animation_tree.get_root_motion_position() / delta
set_velocity(velocity)
move_and_slide()



If :ref:`root_motion_local<class_AnimationMixer_property_root_motion_local>` is ``true``, return the pre-multiplied translation value with the inverted rotation.

In this case, the code can be written as follows:


.. tabs::

.. code-tab:: gdscript

func _process(delta):
if Input.is_action_just_pressed("animate"):
state_machine.travel("Animate")
set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation())
var velocity = get_quaternion() * animation_tree.get_root_motion_position() / delta
set_velocity(velocity)
move_and_slide()

Expand All @@ -734,13 +772,13 @@ For example, if an animation with only one key ``Vector3(0, 0, 0)`` is played in

.. code-tab:: gdscript

var prev_root_motion_position_accumulator: Vector3
var prev_root_motion_position_accumulator

func _process(delta):
if Input.is_action_just_pressed("animate"):
state_machine.travel("Animate")
var current_root_motion_position_accumulator: Vector3 = animation_tree.get_root_motion_position_accumulator()
var difference: Vector3 = current_root_motion_position_accumulator - prev_root_motion_position_accumulator
var current_root_motion_position_accumulator = animation_tree.get_root_motion_position_accumulator()
var difference = current_root_motion_position_accumulator - prev_root_motion_position_accumulator
prev_root_motion_position_accumulator = current_root_motion_position_accumulator
transform.origin += difference

Expand Down Expand Up @@ -801,13 +839,13 @@ For example, if an animation with only one key ``Quaternion(0, 0, 0, 1)`` is pla

.. code-tab:: gdscript

var prev_root_motion_rotation_accumulator: Quaternion
var prev_root_motion_rotation_accumulator

func _process(delta):
if Input.is_action_just_pressed("animate"):
state_machine.travel("Animate")
var current_root_motion_rotation_accumulator: Quaternion = animation_tree.get_root_motion_rotation_accumulator()
var difference: Quaternion = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator
var current_root_motion_rotation_accumulator = animation_tree.get_root_motion_rotation_accumulator()
var difference = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator
prev_root_motion_rotation_accumulator = current_root_motion_rotation_accumulator
transform.basis *= Basis(difference)
Expand Down Expand Up @@ -838,8 +876,8 @@ The most basic example is applying scale to :ref:`CharacterBody3D<class_Characte

.. code-tab:: gdscript

var current_scale: Vector3 = Vector3(1, 1, 1)
var scale_accum: Vector3 = Vector3(1, 1, 1)
var current_scale = Vector3(1, 1, 1)
var scale_accum = Vector3(1, 1, 1)

func _process(delta):
if Input.is_action_just_pressed("animate"):
Expand Down Expand Up @@ -870,13 +908,13 @@ For example, if an animation with only one key ``Vector3(1, 1, 1)`` is played in

.. code-tab:: gdscript

var prev_root_motion_scale_accumulator: Vector3
var prev_root_motion_scale_accumulator

func _process(delta):
if Input.is_action_just_pressed("animate"):
state_machine.travel("Animate")
var current_root_motion_scale_accumulator: Vector3 = animation_tree.get_root_motion_scale_accumulator()
var difference: Vector3 = current_root_motion_scale_accumulator - prev_root_motion_scale_accumulator
var current_root_motion_scale_accumulator = animation_tree.get_root_motion_scale_accumulator()
var difference = current_root_motion_scale_accumulator - prev_root_motion_scale_accumulator
prev_root_motion_scale_accumulator = current_root_motion_scale_accumulator
transform.basis = transform.basis.scaled(difference)

Expand Down
34 changes: 34 additions & 0 deletions classes/class_animationnodetimeseek.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,40 @@ Tutorials

- :doc:`Using AnimationTree <../tutorials/animation/animation_tree>`

.. rst-class:: classref-reftable-group

Properties
----------

.. table::
:widths: auto

+-------------------------+------------------------------------------------------------------------------+----------+
| :ref:`bool<class_bool>` | :ref:`explicit_elapse<class_AnimationNodeTimeSeek_property_explicit_elapse>` | ``true`` |
+-------------------------+------------------------------------------------------------------------------+----------+

.. rst-class:: classref-section-separator

----

.. rst-class:: classref-descriptions-group

Property Descriptions
---------------------

.. _class_AnimationNodeTimeSeek_property_explicit_elapse:

.. rst-class:: classref-property

:ref:`bool<class_bool>` **explicit_elapse** = ``true`` :ref:`🔗<class_AnimationNodeTimeSeek_property_explicit_elapse>`

.. rst-class:: classref-property-setget

- |void| **set_explicit_elapse**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_explicit_elapse**\ (\ )

If ``true``, some processes are executed to handle keys between seeks, such as calculating root motion and finding the nearest discrete key.

.. |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.)`
Expand Down
2 changes: 1 addition & 1 deletion classes/class_audiostream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Override this method to customize the name assigned to this audio stream. Unused

:ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **_instantiate_playback**\ (\ ) |virtual| |const| :ref:`🔗<class_AudioStream_private_method__instantiate_playback>`

Override this method to customize the returned value of :ref:`instantiate_playback<class_AudioStream_method_instantiate_playback>`. Should returned a new :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` created when the stream is played (such as by an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`)..
Override this method to customize the returned value of :ref:`instantiate_playback<class_AudioStream_method_instantiate_playback>`. Should return a new :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` created when the stream is played (such as by an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`).

.. rst-class:: classref-item-separator

Expand Down
2 changes: 2 additions & 0 deletions classes/class_audiostreamplayer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ Returns the position in the :ref:`AudioStream<class_AudioStream>` of the latest

\ **Note:** The position is not always accurate, as the :ref:`AudioServer<class_AudioServer>` does not mix audio every processed frame. To get more accurate results, add :ref:`AudioServer.get_time_since_last_mix<class_AudioServer_method_get_time_since_last_mix>` to the returned position.

\ **Note:** This method always returns ``0.0`` if the :ref:`stream<class_AudioStreamPlayer_property_stream>` is an :ref:`AudioStreamInteractive<class_AudioStreamInteractive>`, since it can have multiple clips playing at once.

.. rst-class:: classref-item-separator

----
Expand Down
Loading

0 comments on commit 9eb8552

Please sign in to comment.