Skip to content

Commit c04d6f8

Browse files
authored
Merge pull request #10434 from godotengine/classref/sync-a7a2a12
classref: Sync with current master branch (a7a2a12)
2 parents 6d5fd9a + c1577c5 commit c04d6f8

File tree

61 files changed

+1286
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1286
-238
lines changed

classes/[email protected]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ Mark the following property as assigned when the :ref:`Node<class_Node>` is read
803803

804804
::
805805

806-
@onready var character_name: Label = $Label
806+
@onready var character_name = $Label
807807

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

classes/[email protected]

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,15 +1425,15 @@ Help key.
14251425

14261426
:ref:`Key<enum_@GlobalScope_Key>` **KEY_BACK** = ``4194376``
14271427

1428-
Media back key. Not to be confused with the Back button on an Android device.
1428+
Back key.
14291429

14301430
.. _class_@GlobalScope_constant_KEY_FORWARD:
14311431

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

14341434
:ref:`Key<enum_@GlobalScope_Key>` **KEY_FORWARD** = ``4194377``
14351435

1436-
Media forward key.
1436+
Forward key.
14371437

14381438
.. _class_@GlobalScope_constant_KEY_STOP:
14391439

@@ -1449,7 +1449,7 @@ Media stop key.
14491449

14501450
:ref:`Key<enum_@GlobalScope_Key>` **KEY_REFRESH** = ``4194379``
14511451

1452-
Media refresh key.
1452+
Refresh key.
14531453

14541454
.. _class_@GlobalScope_constant_KEY_VOLUMEDOWN:
14551455

@@ -3879,7 +3879,7 @@ Hints that a property will be changed on its own after setting, such as :ref:`Au
38793879

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

3882-
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``41``
3882+
:ref:`PropertyHint<enum_@GlobalScope_PropertyHint>` **PROPERTY_HINT_MAX** = ``42``
38833883

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

classes/class_animationnode.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AnimationNode
1212

1313
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
1414

15-
**Inherited By:** :ref:`AnimationNodeOutput<class_AnimationNodeOutput>`, :ref:`AnimationNodeSync<class_AnimationNodeSync>`, :ref:`AnimationNodeTimeScale<class_AnimationNodeTimeScale>`, :ref:`AnimationNodeTimeSeek<class_AnimationNodeTimeSeek>`, :ref:`AnimationRootNode<class_AnimationRootNode>`
15+
**Inherited By:** :ref:`AnimationNodeExtension<class_AnimationNodeExtension>`, :ref:`AnimationNodeOutput<class_AnimationNodeOutput>`, :ref:`AnimationNodeSync<class_AnimationNodeSync>`, :ref:`AnimationNodeTimeScale<class_AnimationNodeTimeScale>`, :ref:`AnimationNodeTimeSeek<class_AnimationNodeTimeSeek>`, :ref:`AnimationRootNode<class_AnimationRootNode>`
1616

1717
Base class for :ref:`AnimationTree<class_AnimationTree>` nodes. Not related to scene nodes.
1818

@@ -437,7 +437,7 @@ Gets the value of a parameter. Parameters are custom local memory used for your
437437

438438
Returns the object id of the :ref:`AnimationTree<class_AnimationTree>` that owns this node.
439439

440-
\ **Note:** This method should only be called from within the :ref:`AnimationNodeExtension._process<class_AnimationNodeExtension_private_method__process>` method, and will return an invalid id otherwise.
440+
\ **Note:** This method should only be called from within the :ref:`AnimationNodeExtension._process_animation_node<class_AnimationNodeExtension_private_method__process_animation_node>` method, and will return an invalid id otherwise.
441441

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

classes/class_animationnodeextension.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AnimationNodeExtension
1212

1313
**Experimental:** This class may be changed or removed in future versions.
1414

15-
**Inherits:** :ref:`AnimationRootNode<class_AnimationRootNode>` **<** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
15+
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
1616

1717
Base class for extending :ref:`AnimationRootNode<class_AnimationRootNode>`\ s from GDScript, C#, or C++.
1818

@@ -31,13 +31,13 @@ Methods
3131
.. table::
3232
:widths: auto
3333

34-
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
35-
| :ref:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`_process<class_AnimationNodeExtension_private_method__process>`\ (\ playback_info\: :ref:`PackedFloat64Array<class_PackedFloat64Array>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| |
36-
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
37-
| :ref:`float<class_float>` | :ref:`get_remaining_time<class_AnimationNodeExtension_method_get_remaining_time>`\ (\ node_info\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`, break_loop\: :ref:`bool<class_bool>`\ ) |static| |
38-
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
39-
| :ref:`bool<class_bool>` | :ref:`is_looping<class_AnimationNodeExtension_method_is_looping>`\ (\ node_info\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ ) |static| |
40-
+-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
34+
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
35+
| :ref:`PackedFloat32Array<class_PackedFloat32Array>` | :ref:`_process_animation_node<class_AnimationNodeExtension_private_method__process_animation_node>`\ (\ playback_info\: :ref:`PackedFloat64Array<class_PackedFloat64Array>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| |
36+
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
37+
| :ref:`float<class_float>` | :ref:`get_remaining_time<class_AnimationNodeExtension_method_get_remaining_time>`\ (\ node_info\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`, break_loop\: :ref:`bool<class_bool>`\ ) |static| |
38+
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
39+
| :ref:`bool<class_bool>` | :ref:`is_looping<class_AnimationNodeExtension_method_is_looping>`\ (\ node_info\: :ref:`PackedFloat32Array<class_PackedFloat32Array>`\ ) |static| |
40+
+-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
4141

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

@@ -48,11 +48,11 @@ Methods
4848
Method Descriptions
4949
-------------------
5050

51-
.. _class_AnimationNodeExtension_private_method__process:
51+
.. _class_AnimationNodeExtension_private_method__process_animation_node:
5252

5353
.. rst-class:: classref-method
5454

55-
:ref:`PackedFloat32Array<class_PackedFloat32Array>` **_process**\ (\ playback_info\: :ref:`PackedFloat64Array<class_PackedFloat64Array>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| :ref:`🔗<class_AnimationNodeExtension_private_method__process>`
55+
:ref:`PackedFloat32Array<class_PackedFloat32Array>` **_process_animation_node**\ (\ playback_info\: :ref:`PackedFloat64Array<class_PackedFloat64Array>`, test_only\: :ref:`bool<class_bool>`\ ) |virtual| :ref:`🔗<class_AnimationNodeExtension_private_method__process_animation_node>`
5656

5757
A version of the :ref:`AnimationNode._process<class_AnimationNode_private_method__process>` method that is meant to be overridden by custom nodes. It returns a :ref:`PackedFloat32Array<class_PackedFloat32Array>` with the processed animation data.
5858

classes/class_animationrootnode.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AnimationRootNode
1212

1313
**Inherits:** :ref:`AnimationNode<class_AnimationNode>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
1414

15-
**Inherited By:** :ref:`AnimationNodeAnimation<class_AnimationNodeAnimation>`, :ref:`AnimationNodeBlendSpace1D<class_AnimationNodeBlendSpace1D>`, :ref:`AnimationNodeBlendSpace2D<class_AnimationNodeBlendSpace2D>`, :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, :ref:`AnimationNodeExtension<class_AnimationNodeExtension>`, :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`
15+
**Inherited By:** :ref:`AnimationNodeAnimation<class_AnimationNodeAnimation>`, :ref:`AnimationNodeBlendSpace1D<class_AnimationNodeBlendSpace1D>`, :ref:`AnimationNodeBlendSpace2D<class_AnimationNodeBlendSpace2D>`, :ref:`AnimationNodeBlendTree<class_AnimationNodeBlendTree>`, :ref:`AnimationNodeStateMachine<class_AnimationNodeStateMachine>`
1616

1717
Base class for :ref:`AnimationNode<class_AnimationNode>`\ s that hold one or multiple composite animations. Usually used for :ref:`AnimationTree.tree_root<class_AnimationTree_property_tree_root>`.
1818

classes/class_arraymesh.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ Methods
134134
+---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
135135
| :ref:`PrimitiveType<enum_Mesh_PrimitiveType>` | :ref:`surface_get_primitive_type<class_ArrayMesh_method_surface_get_primitive_type>`\ (\ surf_idx\: :ref:`int<class_int>`\ ) |const| |
136136
+---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
137+
| |void| | :ref:`surface_remove<class_ArrayMesh_method_surface_remove>`\ (\ surf_idx\: :ref:`int<class_int>`\ ) |
138+
+---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
137139
| |void| | :ref:`surface_set_name<class_ArrayMesh_method_surface_set_name>`\ (\ surf_idx\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) |
138140
+---------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
139141
| |void| | :ref:`surface_update_attribute_region<class_ArrayMesh_method_surface_update_attribute_region>`\ (\ surf_idx\: :ref:`int<class_int>`, offset\: :ref:`int<class_int>`, data\: :ref:`PackedByteArray<class_PackedByteArray>`\ ) |
@@ -402,6 +404,18 @@ Returns the primitive type of the requested surface (see :ref:`add_surface_from_
402404

403405
----
404406

407+
.. _class_ArrayMesh_method_surface_remove:
408+
409+
.. rst-class:: classref-method
410+
411+
|void| **surface_remove**\ (\ surf_idx\: :ref:`int<class_int>`\ ) :ref:`🔗<class_ArrayMesh_method_surface_remove>`
412+
413+
Removes the surface at the given index from the Mesh, shifting surfaces with higher index down by one.
414+
415+
.. rst-class:: classref-item-separator
416+
417+
----
418+
405419
.. _class_ArrayMesh_method_surface_set_name:
406420

407421
.. rst-class:: classref-method

classes/class_astar3d.rst

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,48 @@ A\* (A star) is a computer algorithm used in pathfinding and graph traversal, th
2323

2424
You must add points manually with :ref:`add_point<class_AStar3D_method_add_point>` and create segments manually with :ref:`connect_points<class_AStar3D_method_connect_points>`. Once done, you can test if there is a path between two points with the :ref:`are_points_connected<class_AStar3D_method_are_points_connected>` function, get a path containing indices by :ref:`get_id_path<class_AStar3D_method_get_id_path>`, or one containing actual coordinates with :ref:`get_point_path<class_AStar3D_method_get_point_path>`.
2525

26-
It is also possible to use non-Euclidean distances. To do so, create a class that extends **AStar3D** and override methods :ref:`_compute_cost<class_AStar3D_private_method__compute_cost>` and :ref:`_estimate_cost<class_AStar3D_private_method__estimate_cost>`. Both take two indices and return a length, as is shown in the following example.
26+
It is also possible to use non-Euclidean distances. To do so, create a script that extends **AStar3D** and override the methods :ref:`_compute_cost<class_AStar3D_private_method__compute_cost>` and :ref:`_estimate_cost<class_AStar3D_private_method__estimate_cost>`. Both should take two point IDs and return the distance between the corresponding points.
27+
28+
\ **Example:** Use Manhattan distance instead of Euclidean distance:
2729

2830

2931
.. tabs::
3032

3133
.. code-tab:: gdscript
3234

33-
class MyAStar:
34-
extends AStar3D
35+
class_name MyAStar3D
36+
extends AStar3D
3537

36-
func _compute_cost(u, v):
37-
return abs(u - v)
38+
func _compute_cost(u, v):
39+
var u_pos = get_point_position(u)
40+
var v_pos = get_point_position(v)
41+
return abs(u_pos.x - v_pos.x) + abs(u_pos.y - v_pos.y) + abs(u_pos.z - v_pos.z)
3842

39-
func _estimate_cost(u, v):
40-
return min(0, abs(u - v) - 1)
43+
func _estimate_cost(u, v):
44+
var u_pos = get_point_position(u)
45+
var v_pos = get_point_position(v)
46+
return abs(u_pos.x - v_pos.x) + abs(u_pos.y - v_pos.y) + abs(u_pos.z - v_pos.z)
4147

4248
.. code-tab:: csharp
4349

44-
public partial class MyAStar : AStar3D
50+
using Godot;
51+
52+
[GlobalClass]
53+
public partial class MyAStar3D : AStar3D
4554
{
4655
public override float _ComputeCost(long fromId, long toId)
4756
{
48-
return Mathf.Abs((int)(fromId - toId));
57+
Vector3 fromPoint = GetPointPosition(fromId);
58+
Vector3 toPoint = GetPointPosition(toId);
59+
60+
return Mathf.Abs(fromPoint.X - toPoint.X) + Mathf.Abs(fromPoint.Y - toPoint.Y) + Mathf.Abs(fromPoint.Z - toPoint.Z);
4961
}
5062

5163
public override float _EstimateCost(long fromId, long toId)
5264
{
53-
return Mathf.Min(0, Mathf.Abs((int)(fromId - toId)) - 1);
65+
Vector3 fromPoint = GetPointPosition(fromId);
66+
Vector3 toPoint = GetPointPosition(toId);
67+
return Mathf.Abs(fromPoint.X - toPoint.X) + Mathf.Abs(fromPoint.Y - toPoint.Y) + Mathf.Abs(fromPoint.Z - toPoint.Z);
5468
}
5569
}
5670

classes/class_audioeffectamplify.rst

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ Properties
3636
.. table::
3737
:widths: auto
3838

39-
+---------------------------+---------------------------------------------------------------+---------+
40-
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>` | ``0.0`` |
41-
+---------------------------+---------------------------------------------------------------+---------+
39+
+---------------------------+-----------------------------------------------------------------------+---------+
40+
| :ref:`float<class_float>` | :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>` | ``0.0`` |
41+
+---------------------------+-----------------------------------------------------------------------+---------+
42+
| :ref:`float<class_float>` | :ref:`volume_linear<class_AudioEffectAmplify_property_volume_linear>` | |
43+
+---------------------------+-----------------------------------------------------------------------+---------+
4244

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

@@ -62,6 +64,25 @@ Property Descriptions
6264

6365
Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24.
6466

67+
.. rst-class:: classref-item-separator
68+
69+
----
70+
71+
.. _class_AudioEffectAmplify_property_volume_linear:
72+
73+
.. rst-class:: classref-property
74+
75+
:ref:`float<class_float>` **volume_linear** :ref:`🔗<class_AudioEffectAmplify_property_volume_linear>`
76+
77+
.. rst-class:: classref-property-setget
78+
79+
- |void| **set_volume_linear**\ (\ value\: :ref:`float<class_float>`\ )
80+
- :ref:`float<class_float>` **get_volume_linear**\ (\ )
81+
82+
Amount of amplification as a linear value.
83+
84+
\ **Note:** This member modifies :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>` for convenience. The returned value is equivalent to the result of :ref:`@GlobalScope.db_to_linear<class_@GlobalScope_method_db_to_linear>` on :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>`. Setting this member is equivalent to setting :ref:`volume_db<class_AudioEffectAmplify_property_volume_db>` to the result of :ref:`@GlobalScope.linear_to_db<class_@GlobalScope_method_linear_to_db>` on a value.
85+
6586
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
6687
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
6788
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`

0 commit comments

Comments
 (0)