diff options
Diffstat (limited to 'doc')
86 files changed, 1822 insertions, 395 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index d4680d1836..46b9bdd52d 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2458,6 +2458,8 @@ </constant> <constant name="METHOD_FLAG_STATIC" value="256" enum="MethodFlags"> </constant> + <constant name="METHOD_FLAG_OBJECT_CORE" value="512" enum="MethodFlags"> + </constant> <constant name="METHOD_FLAGS_DEFAULT" value="1" enum="MethodFlags"> Default method flags. </constant> diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml index 63dd250dbc..3e91184a65 100644 --- a/doc/classes/AStar.xml +++ b/doc/classes/AStar.xml @@ -38,7 +38,7 @@ <tutorials> </tutorials> <methods> - <method name="_compute_cost" qualifiers="virtual"> + <method name="_compute_cost" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> @@ -47,7 +47,7 @@ Note that this function is hidden in the default [code]AStar[/code] class. </description> </method> - <method name="_estimate_cost" qualifiers="virtual"> + <method name="_estimate_cost" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml index 31d695b051..453e8b6315 100644 --- a/doc/classes/AStar2D.xml +++ b/doc/classes/AStar2D.xml @@ -9,7 +9,7 @@ <tutorials> </tutorials> <methods> - <method name="_compute_cost" qualifiers="virtual"> + <method name="_compute_cost" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> @@ -18,7 +18,7 @@ Note that this function is hidden in the default [code]AStar2D[/code] class. </description> </method> - <method name="_estimate_cost" qualifiers="virtual"> + <method name="_estimate_cost" qualifiers="virtual const"> <return type="float" /> <argument index="0" name="from_id" type="int" /> <argument index="1" name="to_id" type="int" /> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index a9a08efcf1..173ff43d2a 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -11,46 +11,46 @@ <link title="AnimationTree">https://docs.godotengine.org/en/latest/tutorials/animation/animation_tree.html</link> </tutorials> <methods> - <method name="_get_caption" qualifiers="virtual"> + <method name="_get_caption" qualifiers="virtual const"> <return type="String" /> <description> Gets the text caption for this node (used by some editors). </description> </method> - <method name="_get_child_by_name" qualifiers="virtual"> - <return type="Object" /> - <argument index="0" name="name" type="String" /> + <method name="_get_child_by_name" qualifiers="virtual const"> + <return type="AnimationNode" /> + <argument index="0" name="name" type="StringName" /> <description> Gets a child node by index (used by editors inheriting from [AnimationRootNode]). </description> </method> - <method name="_get_child_nodes" qualifiers="virtual"> + <method name="_get_child_nodes" qualifiers="virtual const"> <return type="Dictionary" /> <description> Gets all children nodes in order as a [code]name: node[/code] dictionary. Only useful when inheriting [AnimationRootNode]. </description> </method> - <method name="_get_parameter_default_value" qualifiers="virtual"> + <method name="_get_parameter_default_value" qualifiers="virtual const"> <return type="Variant" /> - <argument index="0" name="name" type="StringName" /> + <argument index="0" name="parameter" type="StringName" /> <description> Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. </description> </method> - <method name="_get_parameter_list" qualifiers="virtual"> + <method name="_get_parameter_list" qualifiers="virtual const"> <return type="Array" /> <description> Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to [method Object.get_property_list]. </description> </method> - <method name="_has_filter" qualifiers="virtual"> + <method name="_has_filter" qualifiers="virtual const"> <return type="bool" /> <description> Returns [code]true[/code] whether you want the blend tree editor to display filter editing on this node. </description> </method> - <method name="_process" qualifiers="virtual"> - <return type="void" /> + <method name="_process" qualifiers="virtual const"> + <return type="float" /> <argument index="0" name="time" type="float" /> <argument index="1" name="seek" type="bool" /> <description> diff --git a/doc/classes/BoneAttachment3D.xml b/doc/classes/BoneAttachment3D.xml index ab1e5b17d9..b493002c70 100644 --- a/doc/classes/BoneAttachment3D.xml +++ b/doc/classes/BoneAttachment3D.xml @@ -4,13 +4,76 @@ A node that will attach to a bone. </brief_description> <description> - This node must be the child of a [Skeleton3D] node. You can then select a bone for this node to attach to. The BoneAttachment3D node will copy the transform of the selected bone. + This node will allow you to select a bone for this node to attach to. The BoneAttachment3D node can copy the transform of the select bone, or can override the transform of the selected bone. + The BoneAttachment3D node must either be a child of a [Skeleton3D] node or be given an external [Skeleton3D] to use in order to function properly. </description> <tutorials> </tutorials> <methods> + <method name="get_external_skeleton" qualifiers="const"> + <return type="NodePath" /> + <description> + Returns the [NodePath] to the external [Skeleton3D] node, if one has been set. + </description> + </method> + <method name="get_override_mode" qualifiers="const"> + <return type="int" /> + <description> + Returns the override mode for the BoneAttachment3D node. + </description> + </method> + <method name="get_override_pose" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether the BoneAttachment3D node is overriding the bone pose of the bone it's attached to. + </description> + </method> + <method name="get_use_external_skeleton" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether the BoneAttachment3D node is using an external [Skeleton3D] rather than attempting to use its parent node as the [Skeleton3D]. + </description> + </method> + <method name="on_bone_pose_update"> + <return type="void" /> + <argument index="0" name="bone_index" type="int" /> + <description> + A function that is called automatically when the [Skeleton3D] the BoneAttachment3D node is using has a bone that has changed its pose. This function is where the BoneAttachment3D node updates its position so it is correctly bound when it is [i]not[/i] set to override the bone pose. + </description> + </method> + <method name="set_external_skeleton"> + <return type="void" /> + <argument index="0" name="external_skeleton" type="NodePath" /> + <description> + Sets the [NodePath] to the external skeleton that the BoneAttachment3D node should use. The external [Skeleton3D] node is only used when [code]use_external_skeleton[/code] is set to [code]true[/code]. + </description> + </method> + <method name="set_override_mode"> + <return type="void" /> + <argument index="0" name="override_mode" type="int" /> + <description> + Sets the override mode for the BoneAttachment3D node. The override mode defines which of the bone poses the BoneAttachment3D node will override. + </description> + </method> + <method name="set_override_pose"> + <return type="void" /> + <argument index="0" name="override_pose" type="bool" /> + <description> + Sets whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to [code]true[/code], the BoneAttachment3D node can change the pose of the bone. + </description> + </method> + <method name="set_use_external_skeleton"> + <return type="void" /> + <argument index="0" name="use_external_skeleton" type="bool" /> + <description> + Sets whether the BoneAttachment3D node will use an extenral [Skeleton3D] node rather than attenpting to use its parent node as the [Skeleton3D]. When set to [code]true[/code], the BoneAttachment3D node will use the external [Skeleton3D] node set in [code]set_external_skeleton[/code]. + </description> + </method> </methods> <members> + <member name="bone_idx" type="int" setter="set_bone_idx" getter="get_bone_idx" default="-1"> + The index of the attached bone. + </member> <member name="bone_name" type="String" setter="set_bone_name" getter="get_bone_name" default=""""> The name of the attached bone. </member> diff --git a/doc/classes/CharacterBody2D.xml b/doc/classes/CharacterBody2D.xml index a20b0aeea6..e5f60541b9 100644 --- a/doc/classes/CharacterBody2D.xml +++ b/doc/classes/CharacterBody2D.xml @@ -15,12 +15,25 @@ <link title="2D Platformer Demo">https://godotengine.org/asset-library/asset/120</link> </tutorials> <methods> + <method name="get_floor_angle" qualifiers="const"> + <return type="float" /> + <argument index="0" name="up_direction" type="Vector2" default="Vector2(0, -1)" /> + <description> + Returns the floor's collision angle at the last collision point according to [code]up_direction[/code], which is [code]Vector2.UP[/code] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. + </description> + </method> <method name="get_floor_normal" qualifiers="const"> <return type="Vector2" /> <description> Returns the surface normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. </description> </method> + <method name="get_last_slide_collision"> + <return type="KinematicCollision2D" /> + <description> + Returns a [KinematicCollision2D], which contains information about the latest collision that occurred during the last call to [method move_and_slide]. + </description> + </method> <method name="get_platform_velocity" qualifiers="const"> <return type="Vector2" /> <description> @@ -31,11 +44,11 @@ <return type="KinematicCollision2D" /> <argument index="0" name="slide_idx" type="int" /> <description> - Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_count] - 1). + Returns a [KinematicCollision2D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). [b]Example usage:[/b] [codeblocks] [gdscript] - for i in get_slide_count(): + for i in get_slide_collision_count(): var collision = get_slide_collision(i) print("Collided with: ", collision.collider.name) [/gdscript] @@ -49,7 +62,7 @@ [/codeblocks] </description> </method> - <method name="get_slide_count" qualifiers="const"> + <method name="get_slide_collision_count" qualifiers="const"> <return type="int" /> <description> Returns the number of times the body collided and changed direction during the last call to [method move_and_slide]. @@ -92,12 +105,14 @@ </description> </method> <method name="move_and_slide"> - <return type="void" /> + <return type="bool" /> <description> - Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. + Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [CharacterBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. - Modifies [member linear_velocity] if a slide collision occurred. To get detailed information about collisions that occurred, use [method get_slide_collision]. + Modifies [member linear_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for detailed information about collisions that occurred, use [method get_slide_collision]. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. + The general behaviour and available properties change according to the [member motion_mode]. + Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. </description> </method> </methods> @@ -108,13 +123,13 @@ A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of character bodies. </member> - <member name="constant_speed_on_floor" type="bool" setter="set_constant_speed_on_floor_enabled" getter="is_constant_speed_on_floor_enabled" default="false"> + <member name="floor_block_on_wall" type="bool" setter="set_floor_block_on_wall_enabled" getter="is_floor_block_on_wall_enabled" default="true"> + If [code]true[/code], the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them. + </member> + <member name="floor_constant_speed" type="bool" setter="set_floor_constant_speed_enabled" getter="is_floor_constant_speed_enabled" default="false"> If [code]false[/code] (by default), the body will move faster on downward slopes and slower on upward slopes. If [code]true[/code], the body will always move at the same speed on the ground no matter the slope. Note that you need to use [member floor_snap_length] to stick along a downward slope at constant speed. </member> - <member name="exclude_body_layers" type="int" setter="set_exclude_body_layers" getter="get_exclude_body_layers" default="0"> - Collision layers that will be excluded for detecting bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all touching bodies are detected and propagate their velocity. You can add excluded layers to ignore bodies that are contained in these layers. - </member> <member name="floor_max_angle" type="float" setter="set_floor_max_angle" getter="get_floor_max_angle" default="0.785398"> Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. </member> @@ -122,25 +137,37 @@ Sets a snapping distance. When set to a value different from [code]0.0[/code], the body is kept attached to slopes when calling [method move_and_slide]. The snapping vector is determined by the given distance along the opposite direction of the [member up_direction]. As long as the snapping vector is in contact with the ground and the body moves against `up_direction`, the body will remain attached to the surface. Snapping is not applied if the body moves along `up_direction`, so it will be able to detach from the ground when jumping. </member> + <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="false"> + If [code]true[/code], the body will not slide on floor's slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. + </member> + <member name="free_mode_min_slide_angle" type="float" setter="set_free_mode_min_slide_angle" getter="get_free_mode_min_slide_angle" default="0.261799"> + Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. + </member> <member name="linear_velocity" type="Vector2" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector2(0, 0)"> Current velocity vector in pixels per second, used and modified during calls to [method move_and_slide]. </member> <member name="max_slides" type="int" setter="set_max_slides" getter="get_max_slides" default="4"> Maximum number of times the body can change direction before it stops when calling [method move_and_slide]. </member> - <member name="move_on_floor_only" type="bool" setter="set_move_on_floor_only_enabled" getter="is_move_on_floor_only_enabled" default="true"> - If [code]true[/code], the body will be able to move on the floor only, this option avoids to be able to walk on walls, it will however allow to slide down along them. + <member name="motion_mode" type="int" setter="set_motion_mode" getter="get_motion_mode" enum="CharacterBody2D.MotionMode" default="0"> + Sets the motion mode which defines the behaviour of [method move_and_slide]. See [enum MotionMode] constants for available modes. + </member> + <member name="moving_platform_ignore_layers" type="int" setter="set_moving_platform_ignore_layers" getter="get_moving_platform_ignore_layers" default="0"> + Collision layers that will be excluded for detecting bodies that will act as moving platforms to be followed by the [CharacterBody2D]. By default, all touching bodies are detected and propagate their velocity. You can add excluded layers to ignore bodies that are contained in these layers. </member> <member name="slide_on_ceiling" type="bool" setter="set_slide_on_ceiling_enabled" getter="is_slide_on_ceiling_enabled" default="true"> If [code]true[/code], during a jump against the ceiling, the body will slide, if [code]false[/code] it will be stopped and will fall vertically. </member> - <member name="stop_on_slope" type="bool" setter="set_stop_on_slope_enabled" getter="is_stop_on_slope_enabled" default="false"> - If [code]true[/code], the body will not slide on slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. - </member> <member name="up_direction" type="Vector2" setter="set_up_direction" getter="get_up_direction" default="Vector2(0, -1)"> Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector2.UP[/code]. If set to [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games. </member> </members> <constants> + <constant name="MOTION_MODE_GROUNDED" value="0" enum="MotionMode"> + Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for sided games like platformers. + </constant> + <constant name="MOTION_MODE_FREE" value="1" enum="MotionMode"> + Apply when there is no notion of floor or ceiling. All collisions will be reported as [code]on_wall[/code]. In this mode, when you slide, the speed will be always constant. This mode is suitable for top-down games. + </constant> </constants> </class> diff --git a/doc/classes/CharacterBody3D.xml b/doc/classes/CharacterBody3D.xml index 7dc4ae9be3..85135d5509 100644 --- a/doc/classes/CharacterBody3D.xml +++ b/doc/classes/CharacterBody3D.xml @@ -16,13 +16,26 @@ <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link> </tutorials> <methods> + <method name="get_floor_angle" qualifiers="const"> + <return type="float" /> + <argument index="0" name="up_direction" type="Vector3" default="Vector3(0, 1, 0)" /> + <description> + Returns the floor's collision angle at the last collision point according to [code]up_direction[/code], which is [code]Vector3.UP[/code] by default. This value is always positive and only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. + </description> + </method> <method name="get_floor_normal" qualifiers="const"> <return type="Vector3" /> <description> Returns the surface normal of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. </description> </method> - <method name="get_floor_velocity" qualifiers="const"> + <method name="get_last_slide_collision"> + <return type="KinematicCollision3D" /> + <description> + Returns a [KinematicCollision3D], which contains information about the latest collision that occurred during the last call to [method move_and_slide]. + </description> + </method> + <method name="get_platform_velocity" qualifiers="const"> <return type="Vector3" /> <description> Returns the linear velocity of the floor at the last collision point. Only valid after calling [method move_and_slide] and when [method is_on_floor] returns [code]true[/code]. @@ -32,10 +45,10 @@ <return type="KinematicCollision3D" /> <argument index="0" name="slide_idx" type="int" /> <description> - Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_count] - 1). + Returns a [KinematicCollision3D], which contains information about a collision that occurred during the last call to [method move_and_slide]. Since the body can collide several times in a single call to [method move_and_slide], you must specify the index of the collision in the range 0 to ([method get_slide_collision_count] - 1). </description> </method> - <method name="get_slide_count" qualifiers="const"> + <method name="get_slide_collision_count" qualifiers="const"> <return type="int" /> <description> Returns the number of times the body collided and changed direction during the last call to [method move_and_slide]. @@ -47,25 +60,44 @@ Returns [code]true[/code] if the body collided with the ceiling on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. </description> </method> + <method name="is_on_ceiling_only" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the body collided only with the ceiling on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. + </description> + </method> <method name="is_on_floor" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided with the floor on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. </description> </method> + <method name="is_on_floor_only" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the body collided only with the floor on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. + </description> + </method> <method name="is_on_wall" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the body collided with a wall on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. </description> </method> + <method name="is_on_wall_only" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the body collided only with a wall on the last call of [method move_and_slide]. Otherwise, returns [code]false[/code]. + </description> + </method> <method name="move_and_slide"> - <return type="void" /> + <return type="bool" /> <description> Moves the body based on [member linear_velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [CharacterBody3D] or [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. This method should be used in [method Node._physics_process] (or in a method called by [method Node._physics_process]), as it uses the physics step's [code]delta[/code] value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. - Modifies [member linear_velocity] if a slide collision occurred. To get detailed information about collisions that occurred, use [method get_slide_collision]. + Modifies [member linear_velocity] if a slide collision occurred. To get the latest collision call [method get_last_slide_collision], for more detailed information about collisions that occurred, use [method get_slide_collision]. When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. + Returns [code]true[/code] if the body collided, otherwise, returns [code]false[/code]. </description> </method> </methods> @@ -79,6 +111,9 @@ <member name="floor_max_angle" type="float" setter="set_floor_max_angle" getter="get_floor_max_angle" default="0.785398"> Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. The default value equals 45 degrees. </member> + <member name="floor_stop_on_slope" type="bool" setter="set_floor_stop_on_slope_enabled" getter="is_floor_stop_on_slope_enabled" default="false"> + If [code]true[/code], the body will not slide on slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. + </member> <member name="linear_velocity" type="Vector3" setter="set_linear_velocity" getter="get_linear_velocity" default="Vector3(0, 0, 0)"> Current velocity vector (typically meters per second), used and modified during calls to [method move_and_slide]. </member> @@ -89,9 +124,6 @@ When set to a value different from [code]Vector3(0, 0, 0)[/code], the body is kept attached to slopes when calling [method move_and_slide]. As long as the [code]snap[/code] vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting [code]snap[/code] to [code]Vector3(0, 0, 0)[/code]. </member> - <member name="stop_on_slope" type="bool" setter="set_stop_on_slope_enabled" getter="is_stop_on_slope_enabled" default="false"> - If [code]true[/code], the body will not slide on slopes when you include gravity in [code]linear_velocity[/code] when calling [method move_and_slide] and the body is standing still. - </member> <member name="up_direction" type="Vector3" setter="set_up_direction" getter="get_up_direction" default="Vector3(0, 1, 0)"> Direction vector used to determine what is a wall and what is a floor (or a ceiling), rather than a wall, when calling [method move_and_slide]. Defaults to [code]Vector3.UP[/code]. If set to [code]Vector3(0, 0, 0)[/code], everything is considered a wall. This is useful for topdown games. </member> diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 47078330f3..93f72d45ae 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -17,9 +17,9 @@ Override this method to define how the selected entry should be inserted. If [code]replace[/code] is true, any existing text should be replaced. </description> </method> - <method name="_filter_code_completion_candidates" qualifiers="virtual"> + <method name="_filter_code_completion_candidates" qualifiers="virtual const"> <return type="Array" /> - <argument index="0" name="candidates" type="Array" /> + <argument index="0" name="candidates" type="Dictionary[]" /> <description> Override this method to define what items in [code]candidates[/code] should be displayed. Both [code]candidates[/code] and the return is a [Array] of [Dictionary], see [method get_code_completion_option] for [Dictionary] content. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 0834521c91..5392189f6a 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -22,9 +22,9 @@ <link title="All GUI Demos">https://github.com/godotengine/godot-demo-projects/tree/master/gui</link> </tutorials> <methods> - <method name="_can_drop_data" qualifiers="virtual"> + <method name="_can_drop_data" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="position" type="Vector2" /> + <argument index="0" name="at_position" type="Vector2" /> <argument index="1" name="data" type="Variant" /> <description> Godot calls this method to test if [code]data[/code] from a control's [method _get_drag_data] can be dropped at [code]position[/code]. [code]position[/code] is local to this control. @@ -49,7 +49,7 @@ </method> <method name="_drop_data" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="position" type="Vector2" /> + <argument index="0" name="at_position" type="Vector2" /> <argument index="1" name="data" type="Variant" /> <description> Godot calls this method to pass you the [code]data[/code] from a control's [method _get_drag_data] result. Godot first calls [method _can_drop_data] to test if [code]data[/code] is allowed to drop at [code]position[/code] where [code]position[/code] is local to this control. @@ -73,9 +73,9 @@ [/codeblocks] </description> </method> - <method name="_get_drag_data" qualifiers="virtual"> + <method name="_get_drag_data" qualifiers="virtual const"> <return type="Variant" /> - <argument index="0" name="position" type="Vector2" /> + <argument index="0" name="at_position" type="Vector2" /> <description> Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns [code]null[/code] if there is no data to drag. Controls that want to receive drop data should implement [method _can_drop_data] and [method _drop_data]. [code]position[/code] is local to this control. Drag may be forced with [method force_drag]. A preview that will follow the mouse that should represent the data can be set with [method set_drag_preview]. A good time to set the preview is in this method. @@ -97,7 +97,7 @@ [/codeblocks] </description> </method> - <method name="_get_minimum_size" qualifiers="virtual"> + <method name="_get_minimum_size" qualifiers="virtual const"> <return type="Vector2" /> <description> Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [member rect_min_size] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). @@ -141,15 +141,15 @@ </method> <method name="_has_point" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="" type="Vector2" /> + <argument index="0" name="position" type="Vector2" /> <description> Virtual method to be implemented by the user. Returns whether the given [code]point[/code] is inside this control. If not overridden, default behavior is checking if the point is within control's Rect. [b]Note:[/b] If you want to check if a point is inside the control, you can use [code]get_rect().has_point(point)[/code]. </description> </method> - <method name="_make_custom_tooltip" qualifiers="virtual"> - <return type="Control" /> + <method name="_make_custom_tooltip" qualifiers="virtual const"> + <return type="Object" /> <argument index="0" name="for_text" type="String" /> <description> Virtual method to be implemented by the user. Returns a [Control] node that should be used as a tooltip instead of the default one. The [code]for_text[/code] includes the contents of the [member hint_tooltip] property. @@ -193,8 +193,8 @@ [/codeblocks] </description> </method> - <method name="_structured_text_parser" qualifiers="virtual"> - <return type="void" /> + <method name="_structured_text_parser" qualifiers="virtual const"> + <return type="Array" /> <argument index="0" name="args" type="Array" /> <argument index="1" name="text" type="String" /> <description> diff --git a/doc/classes/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml index 0060368207..e3badea0f4 100644 --- a/doc/classes/DirectionalLight3D.xml +++ b/doc/classes/DirectionalLight3D.xml @@ -36,7 +36,7 @@ <member name="directional_shadow_split_3" type="float" setter="set_param" getter="get_param" default="0.5"> The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [code]SHADOW_PARALLEL_4_SPLITS[/code]. </member> - <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" override="true" default="1.0" /> + <member name="shadow_bias" type="float" setter="set_param" getter="get_param" override="true" default="0.1" /> <member name="use_in_sky_only" type="bool" setter="set_sky_only" getter="is_sky_only" default="false"> If [code]true[/code], this [DirectionalLight3D] will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon. </member> diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index 919960cc9f..e8e5a286b4 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -187,7 +187,7 @@ <argument index="0" name="from" type="String" /> <argument index="1" name="to" type="String" /> <description> - Renames (move) the [code]from[/code] file to the [code]to[/code] destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten. + Renames (move) the [code]from[/code] file or directory to the [code]to[/code] destination. Both arguments should be paths to files or directories, either relative or absolute. If the destination file or directory exists and is not access-protected, it will be overwritten. Returns one of the [enum Error] code constants ([code]OK[/code] on success). </description> </method> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index abb715b34e..4f495eaec9 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -649,6 +649,8 @@ <argument index="0" name="min_size" type="Vector2i" /> <argument index="1" name="window_id" type="int" default="0" /> <description> + Sets the minimum size for the given window to [code]min_size[/code] (in pixels). + [b]Note:[/b] By default, the main window has a minimum size of [code]Vector2i(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size. </description> </method> <method name="window_set_mode"> diff --git a/doc/classes/EditorImportPlugin.xml b/doc/classes/EditorImportPlugin.xml index b379ccc8c6..da6738d6b7 100644 --- a/doc/classes/EditorImportPlugin.xml +++ b/doc/classes/EditorImportPlugin.xml @@ -113,28 +113,28 @@ <link title="Import plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/import_plugins.html</link> </tutorials> <methods> - <method name="_get_import_options" qualifiers="virtual"> + <method name="_get_import_options" qualifiers="virtual const"> <return type="Array" /> - <argument index="0" name="preset" type="int" /> + <argument index="0" name="preset_index" type="int" /> <description> Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: [code]name[/code], [code]default_value[/code], [code]property_hint[/code] (optional), [code]hint_string[/code] (optional), [code]usage[/code] (optional). </description> </method> - <method name="_get_import_order" qualifiers="virtual"> + <method name="_get_import_order" qualifiers="virtual const"> <return type="int" /> <description> Gets the order of this importer to be run when importing resources. Importers with [i]lower[/i] import orders will be called first, and higher values will be called later. Use this to ensure the importer runs after the dependencies are already imported. The default import order is [code]0[/code] unless overridden by a specific importer. See [enum ResourceImporter.ImportOrder] for some predefined values. </description> </method> - <method name="_get_importer_name" qualifiers="virtual"> + <method name="_get_importer_name" qualifiers="virtual const"> <return type="String" /> <description> Gets the unique name of the importer. </description> </method> - <method name="_get_option_visibility" qualifiers="virtual"> + <method name="_get_option_visibility" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="option" type="String" /> + <argument index="0" name="option_name" type="StringName" /> <argument index="1" name="options" type="Dictionary" /> <description> This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example: @@ -163,50 +163,50 @@ Return [code]true[/code] to make all options always visible. </description> </method> - <method name="_get_preset_count" qualifiers="virtual"> + <method name="_get_preset_count" qualifiers="virtual const"> <return type="int" /> <description> Gets the number of initial presets defined by the plugin. Use [method _get_import_options] to get the default options for the preset and [method _get_preset_name] to get the name of the preset. </description> </method> - <method name="_get_preset_name" qualifiers="virtual"> + <method name="_get_preset_name" qualifiers="virtual const"> <return type="String" /> - <argument index="0" name="preset" type="int" /> + <argument index="0" name="preset_index" type="int" /> <description> Gets the name of the options preset at this index. </description> </method> - <method name="_get_priority" qualifiers="virtual"> + <method name="_get_priority" qualifiers="virtual const"> <return type="float" /> <description> Gets the priority of this plugin for the recognized extension. Higher priority plugins will be preferred. The default priority is [code]1.0[/code]. </description> </method> - <method name="_get_recognized_extensions" qualifiers="virtual"> - <return type="Array" /> + <method name="_get_recognized_extensions" qualifiers="virtual const"> + <return type="PackedStringArray" /> <description> Gets the list of file extensions to associate with this loader (case-insensitive). e.g. [code]["obj"][/code]. </description> </method> - <method name="_get_resource_type" qualifiers="virtual"> + <method name="_get_resource_type" qualifiers="virtual const"> <return type="String" /> <description> Gets the Godot resource type associated with this loader. e.g. [code]"Mesh"[/code] or [code]"Animation"[/code]. </description> </method> - <method name="_get_save_extension" qualifiers="virtual"> + <method name="_get_save_extension" qualifiers="virtual const"> <return type="String" /> <description> Gets the extension used to save this resource in the [code].godot/imported[/code] directory. </description> </method> - <method name="_get_visible_name" qualifiers="virtual"> + <method name="_get_visible_name" qualifiers="virtual const"> <return type="String" /> <description> Gets the name to display in the import window. You should choose this name as a continuation to "Import as", e.g. "Import as Special Mesh". </description> </method> - <method name="_import" qualifiers="virtual"> + <method name="_import" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="source_file" type="String" /> <argument index="1" name="save_path" type="String" /> diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index 62fd7a1d6e..ee93379210 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -16,9 +16,9 @@ <link title="Inspector plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/inspector_plugins.html</link> </tutorials> <methods> - <method name="_can_handle" qualifiers="virtual"> + <method name="_can_handle" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="object" type="Object" /> + <argument index="0" name="object" type="Variant" /> <description> Returns [code]true[/code] if this object can be handled by this plugin. </description> @@ -31,9 +31,9 @@ </method> <method name="_parse_category" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="category" type="String" /> + <argument index="0" name="object" type="Object" /> + <argument index="1" name="category" type="String" /> <description> - Called to allow adding controls at the beginning of the category. </description> </method> <method name="_parse_end" qualifiers="virtual"> @@ -44,11 +44,13 @@ </method> <method name="_parse_property" qualifiers="virtual"> <return type="bool" /> - <argument index="0" name="type" type="int" /> - <argument index="1" name="path" type="String" /> - <argument index="2" name="hint" type="int" /> - <argument index="3" name="hint_text" type="String" /> - <argument index="4" name="usage" type="int" /> + <argument index="0" name="object" type="Object" /> + <argument index="1" name="type" type="int" /> + <argument index="2" name="name" type="String" /> + <argument index="3" name="hint_type" type="int" /> + <argument index="4" name="hint_string" type="String" /> + <argument index="5" name="usage_flags" type="int" /> + <argument index="6" name="wide" type="bool" /> <description> Called to allow adding property specific editors to the inspector. Usually these inherit [EditorProperty]. Returning [code]true[/code] removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one. </description> diff --git a/doc/classes/EditorNode3DGizmo.xml b/doc/classes/EditorNode3DGizmo.xml index 39f6805254..91e024cc1c 100644 --- a/doc/classes/EditorNode3DGizmo.xml +++ b/doc/classes/EditorNode3DGizmo.xml @@ -13,7 +13,7 @@ <return type="void" /> <argument index="0" name="id" type="int" /> <argument index="1" name="restore" type="Variant" /> - <argument index="2" name="cancel" type="bool" default="false" /> + <argument index="2" name="cancel" type="bool" /> <description> Override this method to commit a handle being edited (handles must have been previously added by [method add_handles]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo". If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action. @@ -22,14 +22,14 @@ <method name="_commit_subgizmos" qualifiers="virtual"> <return type="void" /> <argument index="0" name="ids" type="PackedInt32Array" /> - <argument index="1" name="restore" type="Array" /> - <argument index="2" name="cancel" type="bool" default="false" /> + <argument index="1" name="restores" type="Transform3D[]" /> + <argument index="2" name="cancel" type="bool" /> <description> Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [code]restore[/code] transforms as "undo". If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] transforms should be directly set, without any [UndoRedo] action. </description> </method> - <method name="_get_handle_name" qualifiers="virtual"> + <method name="_get_handle_name" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="id" type="int" /> <description> @@ -37,21 +37,21 @@ Handles can be named for reference to the user when editing. </description> </method> - <method name="_get_handle_value" qualifiers="virtual"> + <method name="_get_handle_value" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="id" type="int" /> <description> Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle]. </description> </method> - <method name="_get_subgizmo_transform" qualifiers="virtual"> + <method name="_get_subgizmo_transform" qualifiers="virtual const"> <return type="Transform3D" /> <argument index="0" name="id" type="int" /> <description> Override this method to return the current transform of a subgizmo. This transform will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_subgizmos]. </description> </method> - <method name="_is_handle_highlighted" qualifiers="virtual"> + <method name="_is_handle_highlighted" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="id" type="int" /> <description> @@ -81,15 +81,15 @@ Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [code]transform[/code] is given in the Node3D's local coordinate system. </description> </method> - <method name="_subgizmos_intersect_frustum" qualifiers="virtual"> + <method name="_subgizmos_intersect_frustum" qualifiers="virtual const"> <return type="PackedInt32Array" /> <argument index="0" name="camera" type="Camera3D" /> - <argument index="1" name="frustum" type="Array" /> + <argument index="1" name="frustum" type="Plane[]" /> <description> Override this method to allow selecting subgizmos using mouse drag box selection. Given a [code]camera[/code] and a [code]frustum[/code], this method should return which subgizmos are contained within the frustum. The [code]frustum[/code] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. </description> </method> - <method name="_subgizmos_intersect_ray" qualifiers="virtual"> + <method name="_subgizmos_intersect_ray" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="camera" type="Camera3D" /> <argument index="1" name="point" type="Vector2" /> diff --git a/doc/classes/EditorNode3DGizmoPlugin.xml b/doc/classes/EditorNode3DGizmoPlugin.xml index fb72427a7a..4ba455a336 100644 --- a/doc/classes/EditorNode3DGizmoPlugin.xml +++ b/doc/classes/EditorNode3DGizmoPlugin.xml @@ -10,7 +10,7 @@ <link title="Spatial gizmo plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/spatial_gizmos.html</link> </tutorials> <methods> - <method name="_can_be_hidden" qualifiers="virtual"> + <method name="_can_be_hidden" qualifiers="virtual const"> <return type="bool" /> <description> Override this method to define whether the gizmos handled by this plugin can be hidden or not. Returns [code]true[/code] if not overridden. @@ -19,9 +19,9 @@ <method name="_commit_handle" qualifiers="virtual"> <return type="void" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <argument index="2" name="restore" type="Variant" /> - <argument index="3" name="cancel" type="bool" default="false" /> + <argument index="3" name="cancel" type="bool" /> <description> Override this method to commit a handle being edited (handles must have been previously added by [method EditorNode3DGizmo.add_handles] during [method _redraw]). This usually means creating an [UndoRedo] action for the change, using the current handle value as "do" and the [code]restore[/code] argument as "undo". If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] value should be directly set, without any [UndoRedo] action. Called for this plugin's active gizmos. @@ -31,73 +31,73 @@ <return type="void" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> <argument index="1" name="ids" type="PackedInt32Array" /> - <argument index="2" name="restore" type="Array" /> - <argument index="3" name="cancel" type="bool" default="false" /> + <argument index="2" name="restores" type="Transform3D[]" /> + <argument index="3" name="cancel" type="bool" /> <description> Override this method to commit a group of subgizmos being edited (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). This usually means creating an [UndoRedo] action for the change, using the current transforms as "do" and the [code]restore[/code] transforms as "undo". If the [code]cancel[/code] argument is [code]true[/code], the [code]restore[/code] transforms should be directly set, without any [UndoRedo] action. As with all subgizmo methods, transforms are given in local space respect to the gizmo's Node3D. Called for this plugin's active gizmos. </description> </method> - <method name="_create_gizmo" qualifiers="virtual"> + <method name="_create_gizmo" qualifiers="virtual const"> <return type="EditorNode3DGizmo" /> - <argument index="0" name="spatial" type="Node3D" /> + <argument index="0" name="for_node_3d" type="Node3D" /> <description> Override this method to return a custom [EditorNode3DGizmo] for the spatial nodes of your choice, return [code]null[/code] for the rest of nodes. See also [method _has_gizmo]. </description> </method> - <method name="_get_gizmo_name" qualifiers="virtual"> + <method name="_get_gizmo_name" qualifiers="virtual const"> <return type="String" /> <description> Override this method to provide the name that will appear in the gizmo visibility menu. </description> </method> - <method name="_get_handle_name" qualifiers="virtual"> + <method name="_get_handle_name" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <description> Override this method to provide gizmo's handle names. Called for this plugin's active gizmos. </description> </method> - <method name="_get_handle_value" qualifiers="virtual"> + <method name="_get_handle_value" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <description> Override this method to return the current value of a handle. This value will be requested at the start of an edit and used as the [code]restore[/code] argument in [method _commit_handle]. Called for this plugin's active gizmos. </description> </method> - <method name="_get_priority" qualifiers="virtual"> + <method name="_get_priority" qualifiers="virtual const"> <return type="int" /> <description> Override this method to set the gizmo's priority. Gizmos with higher priority will have precedence when processing inputs like handles or subgizmos selection. All built-in editor gizmos return a priority of [code]-1[/code]. If not overridden, this method will return [code]0[/code], which means custom gizmos will automatically get higher priority than built-in gizmos. </description> </method> - <method name="_get_subgizmo_transform" qualifiers="virtual"> + <method name="_get_subgizmo_transform" qualifiers="virtual const"> <return type="Transform3D" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="subgizmo_id" type="int" /> <description> Override this method to return the current transform of a subgizmo. As with all subgizmo methods, the transform should be in local space respect to the gizmo's Node3D. This transform will be requested at the start of an edit and used in the [code]restore[/code] argument in [method _commit_subgizmos]. Called for this plugin's active gizmos. </description> </method> - <method name="_has_gizmo" qualifiers="virtual"> + <method name="_has_gizmo" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="spatial" type="Node3D" /> + <argument index="0" name="for_node_3d" type="Node3D" /> <description> Override this method to define which Node3D nodes have a gizmo from this plugin. Whenever a [Node3D] node is added to a scene this method is called, if it returns [code]true[/code] the node gets a generic [EditorNode3DGizmo] assigned and is added to this plugin's list of active gizmos. </description> </method> - <method name="_is_handle_highlighted" qualifiers="virtual"> + <method name="_is_handle_highlighted" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <description> Override this method to return [code]true[/code] whenever to given handle should be highlighted in the editor. Called for this plugin's active gizmos. </description> </method> - <method name="_is_selectable_when_hidden" qualifiers="virtual"> + <method name="_is_selectable_when_hidden" qualifiers="virtual const"> <return type="bool" /> <description> Override this method to define whether Node3D with this gizmo should be selectable even when the gizmo is hidden. @@ -113,9 +113,9 @@ <method name="_set_handle" qualifiers="virtual"> <return type="void" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="handle_id" type="int" /> <argument index="2" name="camera" type="Camera3D" /> - <argument index="3" name="point" type="Vector2" /> + <argument index="3" name="screen_pos" type="Vector2" /> <description> Override this method to update the node's properties when the user drags a gizmo handle (previously added with [method EditorNode3DGizmo.add_handles]). The provided [code]point[/code] is the mouse position in screen coordinates and the [code]camera[/code] can be used to convert it to raycasts. Called for this plugin's active gizmos. </description> @@ -123,26 +123,26 @@ <method name="_set_subgizmo_transform" qualifiers="virtual"> <return type="void" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> - <argument index="1" name="id" type="int" /> + <argument index="1" name="subgizmo_id" type="int" /> <argument index="2" name="transform" type="Transform3D" /> <description> Override this method to update the node properties during subgizmo editing (see [method _subgizmos_intersect_ray] and [method _subgizmos_intersect_frustum]). The [code]transform[/code] is given in the Node3D's local coordinate system. Called for this plugin's active gizmos. </description> </method> - <method name="_subgizmos_intersect_frustum" qualifiers="virtual"> + <method name="_subgizmos_intersect_frustum" qualifiers="virtual const"> <return type="PackedInt32Array" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> <argument index="1" name="camera" type="Camera3D" /> - <argument index="2" name="frustum" type="Array" /> + <argument index="2" name="frustum_planes" type="Plane[]" /> <description> Override this method to allow selecting subgizmos using mouse drag box selection. Given a [code]camera[/code] and a [code]frustum[/code], this method should return which subgizmos are contained within the frustum. The [code]frustum[/code] argument consists of an [code]Array[/code] with all the [code]Plane[/code]s that make up the selection frustum. The returned value should contain a list of unique subgizmo identifiers, these identifiers can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos. </description> </method> - <method name="_subgizmos_intersect_ray" qualifiers="virtual"> + <method name="_subgizmos_intersect_ray" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="gizmo" type="EditorNode3DGizmo" /> <argument index="1" name="camera" type="Camera3D" /> - <argument index="2" name="point" type="Vector2" /> + <argument index="2" name="screen_pos" type="Vector2" /> <description> Override this method to allow selecting subgizmos using mouse clicks. Given a [code]camera[/code] and a [code]point[/code] in screen coordinates, this method should return which subgizmo should be selected. The returned value should be a unique subgizmo identifier, which can have any non-negative value and will be used in other virtual methods like [method _get_subgizmo_transform] or [method _commit_subgizmos]. Called for this plugin's active gizmos. </description> diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml index 37efca7f48..e564e8045c 100644 --- a/doc/classes/EditorPlugin.xml +++ b/doc/classes/EditorPlugin.xml @@ -38,7 +38,7 @@ </method> <method name="_edit" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="object" type="Object" /> + <argument index="0" name="object" type="Variant" /> <description> This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. </description> @@ -49,18 +49,18 @@ Called by the engine when the user enables the [EditorPlugin] in the Plugin tab of the project settings window. </description> </method> - <method name="_forward_canvas_draw_over_viewport" qualifiers="virtual"> + <method name="_forward_3d_draw_over_viewport" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="overlay" type="Control" /> + <argument index="0" name="viewport_control" type="Control" /> <description> - Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. + Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. [codeblocks] [gdscript] - func _forward_canvas_draw_over_viewport(overlay): + func _forward_spatial_3d_over_viewport(overlay): # Draw a circle at cursor position. - overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white) + overlay.draw_circle(overlay.get_local_mouse_position(), 64) - func _forward_canvas_gui_input(event): + func _forward_spatial_gui_input(camera, event): if event is InputEventMouseMotion: # Redraw viewport when cursor is moved. update_overlays() @@ -68,13 +68,13 @@ return false [/gdscript] [csharp] - public override void ForwardCanvasDrawOverViewport(Godot.Control overlay) + public override void ForwardSpatialDrawOverViewport(Godot.Control overlay) { // Draw a circle at cursor position. overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White); } - public override bool ForwardCanvasGuiInput(InputEvent @event) + public override bool ForwardSpatialGuiInput(Godot.Camera3D camera, InputEvent @event) { if (@event is InputEventMouseMotion) { @@ -87,28 +87,29 @@ [/codeblocks] </description> </method> - <method name="_forward_canvas_force_draw_over_viewport" qualifiers="virtual"> + <method name="_forward_3d_force_draw_over_viewport" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="overlay" type="Control" /> + <argument index="0" name="viewport_control" type="Control" /> <description> - This method is the same as [method _forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + This method is the same as [method _forward_3d_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. </description> </method> - <method name="_forward_canvas_gui_input" qualifiers="virtual"> + <method name="_forward_3d_gui_input" qualifiers="virtual"> <return type="bool" /> - <argument index="0" name="event" type="InputEvent" /> + <argument index="0" name="viewport_camera" type="Camera3D" /> + <argument index="1" name="event" type="InputEvent" /> <description> - Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: + Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: [codeblocks] [gdscript] - # Prevents the InputEvent to reach other Editor classes - func _forward_canvas_gui_input(event): + # Prevents the InputEvent to reach other Editor classes. + func _forward_spatial_gui_input(camera, event): return true [/gdscript] [csharp] - // Prevents the InputEvent to reach other Editor classes - public override bool ForwardCanvasGuiInput(InputEvent @event) + // Prevents the InputEvent to reach other Editor classes. + public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) { return true; } @@ -118,12 +119,12 @@ [codeblocks] [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. - func _forward_canvas_gui_input(event): + func _forward_spatial_gui_input(camera, event): return event is InputEventMouseMotion [/gdscript] [csharp] // Consumes InputEventMouseMotion and forwards other InputEvent types. - public override bool ForwardCanvasGuiInput(InputEvent @event) + public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) { return @event is InputEventMouseMotion; } @@ -131,18 +132,18 @@ [/codeblocks] </description> </method> - <method name="_forward_spatial_draw_over_viewport" qualifiers="virtual"> + <method name="_forward_canvas_draw_over_viewport" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="overlay" type="Control" /> + <argument index="0" name="viewport_control" type="Control" /> <description> - Called by the engine when the 3D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. + Called by the engine when the 2D editor's viewport is updated. Use the [code]overlay[/code] [Control] for drawing. You can update the viewport manually by calling [method update_overlays]. [codeblocks] [gdscript] - func _forward_spatial_draw_over_viewport(overlay): + func _forward_canvas_draw_over_viewport(overlay): # Draw a circle at cursor position. - overlay.draw_circle(overlay.get_local_mouse_position(), 64) + overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white) - func _forward_spatial_gui_input(camera, event): + func _forward_canvas_gui_input(event): if event is InputEventMouseMotion: # Redraw viewport when cursor is moved. update_overlays() @@ -150,13 +151,13 @@ return false [/gdscript] [csharp] - public override void ForwardSpatialDrawOverViewport(Godot.Control overlay) + public override void ForwardCanvasDrawOverViewport(Godot.Control overlay) { // Draw a circle at cursor position. overlay.DrawCircle(overlay.GetLocalMousePosition(), 64, Colors.White); } - public override bool ForwardSpatialGuiInput(Godot.Camera3D camera, InputEvent @event) + public override bool ForwardCanvasGuiInput(InputEvent @event) { if (@event is InputEventMouseMotion) { @@ -169,29 +170,28 @@ [/codeblocks] </description> </method> - <method name="_forward_spatial_force_draw_over_viewport" qualifiers="virtual"> + <method name="_forward_canvas_force_draw_over_viewport" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="overlay" type="Control" /> + <argument index="0" name="viewport_control" type="Control" /> <description> - This method is the same as [method _forward_spatial_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + This method is the same as [method _forward_canvas_draw_over_viewport], except it draws on top of everything. Useful when you need an extra layer that shows over anything else. You need to enable calling of this method by using [method set_force_draw_over_forwarding_enabled]. </description> </method> - <method name="_forward_spatial_gui_input" qualifiers="virtual"> + <method name="_forward_canvas_gui_input" qualifiers="virtual"> <return type="bool" /> - <argument index="0" name="camera" type="Camera3D" /> - <argument index="1" name="event" type="InputEvent" /> + <argument index="0" name="event" type="InputEvent" /> <description> - Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 3D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: + Called when there is a root node in the current edited scene, [method _handles] is implemented and an [InputEvent] happens in the 2D viewport. Intercepts the [InputEvent], if [code]return true[/code] [EditorPlugin] consumes the [code]event[/code], otherwise forwards [code]event[/code] to other Editor classes. Example: [codeblocks] [gdscript] - # Prevents the InputEvent to reach other Editor classes. - func _forward_spatial_gui_input(camera, event): + # Prevents the InputEvent to reach other Editor classes + func _forward_canvas_gui_input(event): return true [/gdscript] [csharp] - // Prevents the InputEvent to reach other Editor classes. - public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) + // Prevents the InputEvent to reach other Editor classes + public override bool ForwardCanvasGuiInput(InputEvent @event) { return true; } @@ -201,12 +201,12 @@ [codeblocks] [gdscript] # Consumes InputEventMouseMotion and forwards other InputEvent types. - func _forward_spatial_gui_input(camera, event): + func _forward_canvas_gui_input(event): return event is InputEventMouseMotion [/gdscript] [csharp] // Consumes InputEventMouseMotion and forwards other InputEvent types. - public override bool ForwardSpatialGuiInput(Camera3D camera, InputEvent @event) + public override bool ForwardCanvasGuiInput(InputEvent @event) { return @event is InputEventMouseMotion; } @@ -214,13 +214,13 @@ [/codeblocks] </description> </method> - <method name="_get_breakpoints" qualifiers="virtual"> + <method name="_get_breakpoints" qualifiers="virtual const"> <return type="PackedStringArray" /> <description> This is for editors that edit script-based objects. You can return a list of breakpoints in the format ([code]script:line[/code]), for example: [code]res://path_to_script.gd:25[/code]. </description> </method> - <method name="_get_plugin_icon" qualifiers="virtual"> + <method name="_get_plugin_icon" qualifiers="virtual const"> <return type="Texture2D" /> <description> Override this method in your plugin to return a [Texture2D] in order to give it an icon. @@ -246,14 +246,14 @@ [/codeblocks] </description> </method> - <method name="_get_plugin_name" qualifiers="virtual"> + <method name="_get_plugin_name" qualifiers="virtual const"> <return type="String" /> <description> Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor. For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. </description> </method> - <method name="_get_state" qualifiers="virtual"> + <method name="_get_state" qualifiers="virtual const"> <return type="Dictionary" /> <description> Gets the state of your plugin editor. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). @@ -261,19 +261,19 @@ </method> <method name="_get_window_layout" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="layout" type="ConfigFile" /> + <argument index="0" name="configuration" type="ConfigFile" /> <description> Gets the GUI layout of the plugin. This is used to save the project's editor layout when [method queue_save_layout] is called or the editor layout was changed(For example changing the position of a dock). </description> </method> - <method name="_handles" qualifiers="virtual"> + <method name="_handles" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="object" type="Object" /> + <argument index="0" name="object" type="Variant" /> <description> - Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_spatial_gui_input] these will be called too. + Implement this function if your plugin edits a specific type of object (Resource or Node). If you return [code]true[/code], then you will get the functions [method _edit] and [method _make_visible] called when the editor requests them. If you have declared the methods [method _forward_canvas_gui_input] and [method _forward_3d_gui_input] these will be called too. </description> </method> - <method name="_has_main_screen" qualifiers="virtual"> + <method name="_has_main_screen" qualifiers="virtual const"> <return type="bool" /> <description> Returns [code]true[/code] if this is a main screen editor plugin (it goes in the workspace selector together with [b]2D[/b], [b]3D[/b], [b]Script[/b] and [b]AssetLib[/b]). @@ -302,7 +302,7 @@ </method> <method name="_set_window_layout" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="layout" type="ConfigFile" /> + <argument index="0" name="configuration" type="ConfigFile" /> <description> Restore the plugin GUI layout saved by [method _get_window_layout]. </description> @@ -586,19 +586,19 @@ <method name="set_force_draw_over_forwarding_enabled"> <return type="void" /> <description> - Enables calling of [method _forward_canvas_force_draw_over_viewport] for the 2D editor and [method _forward_spatial_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. + Enables calling of [method _forward_canvas_force_draw_over_viewport] for the 2D editor and [method _forward_3d_force_draw_over_viewport] for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. </description> </method> <method name="set_input_event_forwarding_always_enabled"> <return type="void" /> <description> - Use this method if you always want to receive inputs from 3D view screen inside [method _forward_spatial_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene. + Use this method if you always want to receive inputs from 3D view screen inside [method _forward_3d_gui_input]. It might be especially usable if your plugin will want to use raycast in the scene. </description> </method> <method name="update_overlays" qualifiers="const"> <return type="int" /> <description> - Updates the overlays of the 2D and 3D editor viewport. Causes methods [method _forward_canvas_draw_over_viewport], [method _forward_canvas_force_draw_over_viewport], [method _forward_spatial_draw_over_viewport] and [method _forward_spatial_force_draw_over_viewport] to be called. + Updates the overlays of the 2D and 3D editor viewport. Causes methods [method _forward_canvas_draw_over_viewport], [method _forward_canvas_force_draw_over_viewport], [method _forward_3d_draw_over_viewport] and [method _forward_3d_force_draw_over_viewport] to be called. </description> </method> </methods> diff --git a/doc/classes/EditorProperty.xml b/doc/classes/EditorProperty.xml index 725b0ba8ff..822bcfd255 100644 --- a/doc/classes/EditorProperty.xml +++ b/doc/classes/EditorProperty.xml @@ -57,6 +57,11 @@ Puts the [code]editor[/code] control below the property label. The control must be previously added using [method Node.add_child]. </description> </method> + <method name="update_property"> + <return type="void" /> + <description> + </description> + </method> </methods> <members> <member name="checkable" type="bool" setter="set_checkable" getter="is_checkable" default="false"> diff --git a/doc/classes/EditorResourceConversionPlugin.xml b/doc/classes/EditorResourceConversionPlugin.xml index 3de508c88d..8543afa4ae 100644 --- a/doc/classes/EditorResourceConversionPlugin.xml +++ b/doc/classes/EditorResourceConversionPlugin.xml @@ -7,17 +7,23 @@ <tutorials> </tutorials> <methods> - <method name="_convert" qualifiers="virtual"> + <method name="_convert" qualifiers="virtual const"> <return type="Resource" /> <argument index="0" name="resource" type="Resource" /> <description> </description> </method> - <method name="_converts_to" qualifiers="virtual"> + <method name="_converts_to" qualifiers="virtual const"> <return type="String" /> <description> </description> </method> + <method name="_handles" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="resource" type="Resource" /> + <description> + </description> + </method> </methods> <constants> </constants> diff --git a/doc/classes/EditorResourcePreviewGenerator.xml b/doc/classes/EditorResourcePreviewGenerator.xml index 7054b1f4d0..033e03c5b5 100644 --- a/doc/classes/EditorResourcePreviewGenerator.xml +++ b/doc/classes/EditorResourcePreviewGenerator.xml @@ -9,41 +9,41 @@ <tutorials> </tutorials> <methods> - <method name="_can_generate_small_preview" qualifiers="virtual"> + <method name="_can_generate_small_preview" qualifiers="virtual const"> <return type="bool" /> <description> If this function returns [code]true[/code], the generator will call [method _generate] or [method _generate_from_path] for small previews as well. By default, it returns [code]false[/code]. </description> </method> - <method name="_generate" qualifiers="virtual"> + <method name="_generate" qualifiers="virtual const"> <return type="Texture2D" /> - <argument index="0" name="from" type="Resource" /> - <argument index="1" name="size" type="Vector2" /> + <argument index="0" name="resource" type="Resource" /> + <argument index="1" name="size" type="Vector2i" /> <description> Generate a preview from a given resource with the specified size. This must always be implemented. Returning an empty texture is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread). </description> </method> - <method name="_generate_from_path" qualifiers="virtual"> + <method name="_generate_from_path" qualifiers="virtual const"> <return type="Texture2D" /> <argument index="0" name="path" type="String" /> - <argument index="1" name="size" type="Vector2" /> + <argument index="1" name="size" type="Vector2i" /> <description> Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call [method _generate]. Returning an empty texture is an OK way to fail and let another generator take care. Care must be taken because this function is always called from a thread (not the main thread). </description> </method> - <method name="_generate_small_preview_automatically" qualifiers="virtual"> + <method name="_generate_small_preview_automatically" qualifiers="virtual const"> <return type="bool" /> <description> If this function returns [code]true[/code], the generator will automatically generate the small previews from the normal preview texture generated by the methods [method _generate] or [method _generate_from_path]. By default, it returns [code]false[/code]. </description> </method> - <method name="_handles" qualifiers="virtual"> + <method name="_handles" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="type" type="String" /> <description> diff --git a/doc/classes/EditorSceneImporter.xml b/doc/classes/EditorSceneImporter.xml index 2e9d6a43d8..a400db551f 100644 --- a/doc/classes/EditorSceneImporter.xml +++ b/doc/classes/EditorSceneImporter.xml @@ -8,12 +8,12 @@ <tutorials> </tutorials> <methods> - <method name="_get_extensions" qualifiers="virtual"> - <return type="Array" /> + <method name="_get_extensions" qualifiers="virtual const"> + <return type="PackedStringArray" /> <description> </description> </method> - <method name="_get_import_flags" qualifiers="virtual"> + <method name="_get_import_flags" qualifiers="virtual const"> <return type="int" /> <description> </description> @@ -27,7 +27,7 @@ </description> </method> <method name="_import_scene" qualifiers="virtual"> - <return type="Node" /> + <return type="Object" /> <argument index="0" name="path" type="String" /> <argument index="1" name="flags" type="int" /> <argument index="2" name="bake_fps" type="int" /> diff --git a/doc/classes/EditorScenePostImport.xml b/doc/classes/EditorScenePostImport.xml index 95b0b42d9f..43ca3db5fa 100644 --- a/doc/classes/EditorScenePostImport.xml +++ b/doc/classes/EditorScenePostImport.xml @@ -57,7 +57,7 @@ <methods> <method name="_post_import" qualifiers="virtual"> <return type="Object" /> - <argument index="0" name="scene" type="Object" /> + <argument index="0" name="scene" type="Node" /> <description> Called after the scene was imported. This method must return the modified version of the scene. </description> diff --git a/doc/classes/EditorSyntaxHighlighter.xml b/doc/classes/EditorSyntaxHighlighter.xml index 37644a8595..394a4ada46 100644 --- a/doc/classes/EditorSyntaxHighlighter.xml +++ b/doc/classes/EditorSyntaxHighlighter.xml @@ -5,24 +5,18 @@ </brief_description> <description> Base syntax highlighter resource all editor syntax highlighters extend from, it is used in the [ScriptEditor]. - Add a syntax highlighter to an individual script by calling [method ScriptEditorBase._add_syntax_highlighter]. To apply to all scripts on open, call [method ScriptEditor.register_syntax_highlighter] + Add a syntax highlighter to an individual script by calling ScriptEditorBase._add_syntax_highlighter (currently not working). To apply to all scripts on open, call [method ScriptEditor.register_syntax_highlighter] </description> <tutorials> </tutorials> <methods> - <method name="_get_name" qualifiers="virtual"> + <method name="_get_name" qualifiers="virtual const"> <return type="String" /> <description> Virtual method which can be overridden to return the syntax highlighter name. </description> </method> - <method name="_get_supported_extentions" qualifiers="virtual"> - <return type="Array" /> - <description> - Virtual method which can be overridden to return the supported file extensions. - </description> - </method> - <method name="_get_supported_languages" qualifiers="virtual"> + <method name="_get_supported_languages" qualifiers="virtual const"> <return type="Array" /> <description> Virtual method which can be overridden to return the supported language names. diff --git a/doc/classes/EditorTranslationParserPlugin.xml b/doc/classes/EditorTranslationParserPlugin.xml index 47da8ec37b..94e96e985f 100644 --- a/doc/classes/EditorTranslationParserPlugin.xml +++ b/doc/classes/EditorTranslationParserPlugin.xml @@ -102,8 +102,8 @@ <tutorials> </tutorials> <methods> - <method name="_get_recognized_extensions" qualifiers="virtual"> - <return type="Array" /> + <method name="_get_recognized_extensions" qualifiers="virtual const"> + <return type="PackedStringArray" /> <description> Gets the list of file extensions to associate with this parser, e.g. [code]["csv"][/code]. </description> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 907cf8587d..a3759a51dd 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -10,6 +10,14 @@ <tutorials> </tutorials> <methods> + <method name="_get_connection_line" qualifiers="virtual"> + <return type="PackedVector2Array" /> + <argument index="0" name="from" type="Vector2" /> + <argument index="1" name="to" type="Vector2" /> + <description> + Virtual method which can be overridden to customize how connections are drawn. + </description> + </method> <method name="add_valid_connection_type"> <return type="void" /> <argument index="0" name="from_type" type="int" /> @@ -64,6 +72,14 @@ Removes the connection between the [code]from_port[/code] slot of the [code]from[/code] GraphNode and the [code]to_port[/code] slot of the [code]to[/code] GraphNode. If the connection does not exist, no connection is removed. </description> </method> + <method name="get_connection_line"> + <return type="PackedVector2Array" /> + <argument index="0" name="from" type="Vector2" /> + <argument index="1" name="to" type="Vector2" /> + <description> + Returns the points which would make up a connection between [code]from[/code] and [code]to[/code]. + </description> + </method> <method name="get_connection_list" qualifiers="const"> <return type="Array" /> <description> diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml index d7999f1aa0..721b840e99 100644 --- a/doc/classes/KinematicCollision2D.xml +++ b/doc/classes/KinematicCollision2D.xml @@ -10,6 +10,13 @@ <tutorials> </tutorials> <methods> + <method name="get_angle" qualifiers="const"> + <return type="float" /> + <argument index="0" name="up_direction" type="Vector2" default="Vector2(0, -1)" /> + <description> + The collision angle according to [code]up_direction[/code], which is [code]Vector2.UP[/code] by default. This value is always positive. + </description> + </method> </methods> <members> <member name="collider" type="Object" setter="" getter="get_collider"> diff --git a/doc/classes/KinematicCollision3D.xml b/doc/classes/KinematicCollision3D.xml index abdb5b4f4e..5477736c25 100644 --- a/doc/classes/KinematicCollision3D.xml +++ b/doc/classes/KinematicCollision3D.xml @@ -10,6 +10,13 @@ <tutorials> </tutorials> <methods> + <method name="get_angle" qualifiers="const"> + <return type="float" /> + <argument index="0" name="up_direction" type="Vector3" default="Vector3(0, 1, 0)" /> + <description> + The collision angle according to [code]up_direction[/code], which is [code]Vector3.UP[/code] by default. This value is always positive. + </description> + </method> </methods> <members> <member name="collider" type="Object" setter="" getter="get_collider"> diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 380e9314d4..cd2f4eca18 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -61,7 +61,7 @@ <member name="light_specular" type="float" setter="set_param" getter="get_param" default="0.5"> The intensity of the specular blob in objects affected by the light. At [code]0[/code], the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. </member> - <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.1"> + <member name="shadow_bias" type="float" setter="set_param" getter="get_param" default="0.2"> Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. </member> <member name="shadow_blur" type="float" setter="set_param" getter="get_param" default="1.0"> @@ -75,7 +75,7 @@ </member> <member name="shadow_fog_fade" type="float" setter="set_param" getter="get_param" default="0.1"> </member> - <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="2.0"> + <member name="shadow_normal_bias" type="float" setter="set_param" getter="get_param" default="1.0"> Offsets the lookup into the shadow map by the object's normal. This can be used to reduce self-shadowing artifacts without using [member shadow_bias]. In practice, this value should be tweaked along with [member shadow_bias] to reduce artifacts as much as possible. </member> <member name="shadow_reverse_cull_face" type="bool" setter="set_shadow_reverse_cull_face" getter="get_shadow_reverse_cull_face" default="false"> diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml index b9f50ad02a..610b00efe9 100644 --- a/doc/classes/MultiplayerAPI.xml +++ b/doc/classes/MultiplayerAPI.xml @@ -66,34 +66,6 @@ Sends the given raw [code]bytes[/code] to a specific peer identified by [code]id[/code] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers. </description> </method> - <method name="send_despawn"> - <return type="int" enum="Error" /> - <argument index="0" name="peer_id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="path" type="NodePath" /> - <argument index="3" name="data" type="PackedByteArray" default="PackedByteArray()" /> - <description> - Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant SPAWN_MODE_SERVER] (see [method spawnable_config]) and the request is sent by the server (see [method is_network_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal network_despawn]. In all other cases no deletion happens, and the signal [signal network_despawn_request] is emitted instead. - </description> - </method> - <method name="send_spawn"> - <return type="int" enum="Error" /> - <argument index="0" name="peer_id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="path" type="NodePath" /> - <argument index="3" name="data" type="PackedByteArray" default="PackedByteArray()" /> - <description> - Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant SPAWN_MODE_SERVER] (see [method spawnable_config]) and the request is sent by the server (see [method is_network_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal network_spawn]. In all other cases no instantiation happens, and the signal [signal network_spawn_request] is emitted instead. - </description> - </method> - <method name="spawnable_config"> - <return type="int" enum="Error" /> - <argument index="0" name="scene_id" type="int" /> - <argument index="1" name="spawn_mode" type="int" enum="MultiplayerAPI.SpawnMode" /> - <description> - Configures the MultiplayerAPI to track instances of the [PackedScene] idenfied by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication. See [enum SpawnMode] for the possible configurations. - </description> - </method> </methods> <members> <member name="allow_object_decoding" type="bool" setter="set_allow_object_decoding" getter="is_object_decoding_allowed" default="false"> @@ -106,6 +78,8 @@ <member name="refuse_new_network_connections" type="bool" setter="set_refuse_new_network_connections" getter="is_refusing_new_network_connections" default="false"> If [code]true[/code], the MultiplayerAPI's [member network_peer] refuses new incoming connections. </member> + <member name="replicator" type="MultiplayerReplicator" setter="" getter="get_replicator"> + </member> <member name="root_node" type="Node" setter="set_root_node" getter="get_root_node"> The root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed. This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene. @@ -122,25 +96,6 @@ Emitted when this MultiplayerAPI's [member network_peer] fails to establish a connection to a server. Only emitted on clients. </description> </signal> - <signal name="network_despawn"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="node" type="Node" /> - <argument index="3" name="data" type="PackedByteArray" /> - <description> - Emitted on a client before deleting a local Node upon receiving a despawn request from the server. - </description> - </signal> - <signal name="network_despawn_request"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="parent" type="Node" /> - <argument index="3" name="name" type="String" /> - <argument index="4" name="data" type="PackedByteArray" /> - <description> - Emitted when a network despawn request has been received from a client, or for a [PackedScene] that has been configured as [constant SPAWN_MODE_CUSTOM]. - </description> - </signal> <signal name="network_peer_connected"> <argument index="0" name="id" type="int" /> <description> @@ -160,39 +115,6 @@ Emitted when this MultiplayerAPI's [member network_peer] receive a [code]packet[/code] with custom data (see [method send_bytes]). ID is the peer ID of the peer that sent the packet. </description> </signal> - <signal name="network_spawn"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="node" type="Node" /> - <argument index="3" name="data" type="PackedByteArray" /> - <description> - Emitted on a client after a new Node is instantiated locally and added to the SceneTree upon receiving a spawn request from the server. - </description> - </signal> - <signal name="network_spawn_request"> - <argument index="0" name="id" type="int" /> - <argument index="1" name="scene_id" type="int" /> - <argument index="2" name="parent" type="Node" /> - <argument index="3" name="name" type="String" /> - <argument index="4" name="data" type="PackedByteArray" /> - <description> - Emitted when a network spawn request has been received from a client, or for a [PackedScene] that has been configured as [constant SPAWN_MODE_CUSTOM]. - </description> - </signal> - <signal name="network_spawnable_added"> - <argument index="0" name="scene_id" type="int" /> - <argument index="1" name="node" type="Node" /> - <description> - Emitted when an instance of a [PackedScene] that has been configured for networking enters the [SceneTree]. See [method spawnable_config]. - </description> - </signal> - <signal name="network_spawnable_removed"> - <argument index="0" name="scene_id" type="int" /> - <argument index="1" name="node" type="Node" /> - <description> - Emitted when an instance of a [PackedScene] that has been configured for networking leaves the [SceneTree]. See [method spawnable_config]. - </description> - </signal> <signal name="server_disconnected"> <description> Emitted when this MultiplayerAPI's [member network_peer] disconnects from server. Only emitted on clients. @@ -212,14 +134,5 @@ <constant name="RPC_MODE_PUPPET" value="3" enum="RPCMode"> Used with [method Node.rpc_config] to set a method to be called or a property to be changed only on puppets for this node. Analogous to the [code]puppet[/code] keyword. Only accepts calls or property changes from the node's network master, see [method Node.set_network_master]. </constant> - <constant name="SPAWN_MODE_NONE" value="0" enum="SpawnMode"> - Used with [method spawnable_config] to identify a [PackedScene] that should not be replicated. - </constant> - <constant name="SPAWN_MODE_SERVER" value="1" enum="SpawnMode"> - Used with [method spawnable_config] to identify a [PackedScene] that should be automatically replicated from server to clients. - </constant> - <constant name="SPAWN_MODE_CUSTOM" value="2" enum="SpawnMode"> - Used with [method spawnable_config] to identify a [PackedScene] that can be manually replicated among peers. - </constant> </constants> </class> diff --git a/doc/classes/MultiplayerReplicator.xml b/doc/classes/MultiplayerReplicator.xml new file mode 100644 index 0000000000..15029e181f --- /dev/null +++ b/doc/classes/MultiplayerReplicator.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="MultiplayerReplicator" inherits="Object" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <methods> + <method name="decode_state"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <argument index="2" name="data" type="PackedByteArray" /> + <description> + Decode the given [code]data[/code] representing a spawnable state into [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when a client receives a server spawn for a scene with [constant REPLICATION_MODE_SERVER]. See [method spawn_config]. + Tip: You may find this function useful in servers when parsing spawn requests from clients, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM]. + </description> + </method> + <method name="despawn"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <argument index="2" name="peer_id" type="int" default="0" /> + <description> + </description> + </method> + <method name="encode_state"> + <return type="PackedByteArray" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <description> + Encode the given [code]object[/code] using the configuration associated with the provided [code]scene_id[/code]. This function is called automatically when the server spawns scenes with [constant REPLICATION_MODE_SERVER]. See [method spawn_config]. + Tip: You may find this function useful when requesting spawns from clients to server, or when implementing your own logic with [constant REPLICATION_MODE_CUSTOM]. + </description> + </method> + <method name="send_despawn"> + <return type="int" enum="Error" /> + <argument index="0" name="peer_id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="data" type="Variant" default="null" /> + <argument index="3" name="path" type="NodePath" default="NodePath("")" /> + <description> + Sends a despawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically queue for deletion the node at [code]path[/code] and emit the signal [signal despawned]. In all other cases no deletion happens, and the signal [signal despawn_requested] is emitted instead. + </description> + </method> + <method name="send_spawn"> + <return type="int" enum="Error" /> + <argument index="0" name="peer_id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="data" type="Variant" default="null" /> + <argument index="3" name="path" type="NodePath" default="NodePath("")" /> + <description> + Sends a spawn request for the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). If the scene is configured as [constant REPLICATION_MODE_SERVER] (see [method spawn_config]) and the request is sent by the server (see [method MultiplayerAPI.is_network_server]), the receiving peer(s) will automatically instantiate that scene, add it to the [SceneTree] at the given [code]path[/code] and emit the signal [signal spawned]. In all other cases no instantiation happens, and the signal [signal spawn_requested] is emitted instead. + </description> + </method> + <method name="spawn"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="object" type="Object" /> + <argument index="2" name="peer_id" type="int" default="0" /> + <description> + </description> + </method> + <method name="spawn_config"> + <return type="int" enum="Error" /> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="spawn_mode" type="int" enum="MultiplayerReplicator.ReplicationMode" /> + <argument index="2" name="properties" type="StringName[]" default="[]" /> + <argument index="3" name="custom_send" type="Callable" /> + <argument index="4" name="custom_receive" type="Callable" /> + <description> + Configures the MultiplayerAPI to track instances of the [PackedScene] identified by [code]scene_id[/code] (see [method ResourceLoader.get_resource_uid]) for the purpose of network replication. When [code]mode[/code] is [constant REPLICATION_MODE_SERVER], the specified [code]properties[/code] will also be replicated to clients during the initial spawn. + Tip: You can use a custom property in the scene main script to return a customly optimized state representation. + </description> + </method> + </methods> + <signals> + <signal name="despawn_requested"> + <argument index="0" name="id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="parent" type="Node" /> + <argument index="3" name="name" type="String" /> + <argument index="4" name="data" type="PackedByteArray" /> + <description> + Emitted when a network despawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM]. + </description> + </signal> + <signal name="despawned"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted on a client before deleting a local Node upon receiving a despawn request from the server. + </description> + </signal> + <signal name="replicated_instance_added"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted when an instance of a [PackedScene] that has been configured for networking enters the [SceneTree]. See [method spawn_config]. + </description> + </signal> + <signal name="replicated_instance_removed"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted when an instance of a [PackedScene] that has been configured for networking leaves the [SceneTree]. See [method spawn_config]. + </description> + </signal> + <signal name="spawn_requested"> + <argument index="0" name="id" type="int" /> + <argument index="1" name="scene_id" type="int" /> + <argument index="2" name="parent" type="Node" /> + <argument index="3" name="name" type="String" /> + <argument index="4" name="data" type="PackedByteArray" /> + <description> + Emitted when a network spawn request has been received from a client, or for a [PackedScene] that has been configured as [constant REPLICATION_MODE_CUSTOM]. + </description> + </signal> + <signal name="spawned"> + <argument index="0" name="scene_id" type="int" /> + <argument index="1" name="node" type="Node" /> + <description> + Emitted on a client after a new Node is instantiated locally and added to the SceneTree upon receiving a spawn request from the server. + </description> + </signal> + </signals> + <constants> + <constant name="REPLICATION_MODE_NONE" value="0" enum="ReplicationMode"> + Used with [method spawn_config] to identify a [PackedScene] that should not be replicated. + </constant> + <constant name="REPLICATION_MODE_SERVER" value="1" enum="ReplicationMode"> + Used with [method spawn_config] to identify a [PackedScene] that should be automatically replicated from server to clients. + </constant> + <constant name="REPLICATION_MODE_CUSTOM" value="2" enum="ReplicationMode"> + Used with [method spawn_config] to identify a [PackedScene] that can be manually replicated among peers. + </constant> + </constants> +</class> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 096fbbf2c0..97e6c71ef9 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -35,6 +35,14 @@ Corresponds to the [constant NOTIFICATION_EXIT_TREE] notification in [method Object._notification] and signal [signal tree_exiting]. To get notified when the node has already left the active tree, connect to the [signal tree_exited]. </description> </method> + <method name="_get_configuration_warnings" qualifiers="virtual const"> + <return type="PackedStringArray" /> + <description> + The elements in the array returned from this method are displayed as warnings in the Scene Dock if the script that overrides it is a [code]tool[/code] script. + Returning an empty array produces no warnings. + Call [method update_configuration_warnings] when the warnings need to be updated for this node. + </description> + </method> <method name="_get_configuration_warnings" qualifiers="virtual"> <return type="String[]" /> <description> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index e5d45189c7..757730f6c8 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -197,12 +197,6 @@ Returns the path to the current engine executable. </description> </method> - <method name="get_external_data_dir" qualifiers="const"> - <return type="String" /> - <description> - On Android, returns the absolute directory path where user data can be written to external storage if available. On all other platforms, this will return the same location as [method get_user_data_dir]. - </description> - </method> <method name="get_granted_permissions" qualifiers="const"> <return type="PackedStringArray" /> <description> @@ -270,9 +264,11 @@ <method name="get_system_dir" qualifiers="const"> <return type="String" /> <argument index="0" name="dir" type="int" enum="OS.SystemDir" /> + <argument index="1" name="shared_storage" type="bool" default="true" /> <description> Returns the actual path to commonly used folders across different platforms. Available locations are specified in [enum SystemDir]. [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. + [b]Note:[/b] Shared storage is implemented on Android and allows to differentiate between app specific and shared directories. Shared directories have additional restrictions on Android. </description> </method> <method name="get_thread_caller_id" qualifiers="const"> diff --git a/doc/classes/PhysicsTestMotionResult2D.xml b/doc/classes/PhysicsTestMotionResult2D.xml index bf3497386e..9c5d525f85 100644 --- a/doc/classes/PhysicsTestMotionResult2D.xml +++ b/doc/classes/PhysicsTestMotionResult2D.xml @@ -29,9 +29,9 @@ </member> <member name="collision_unsafe_fraction" type="float" setter="" getter="get_collision_unsafe_fraction" default="0.0"> </member> - <member name="motion" type="Vector2" setter="" getter="get_motion" default="Vector2(0, 0)"> + <member name="remainder" type="Vector2" setter="" getter="get_remainder" default="Vector2(0, 0)"> </member> - <member name="motion_remainder" type="Vector2" setter="" getter="get_motion_remainder" default="Vector2(0, 0)"> + <member name="travel" type="Vector2" setter="" getter="get_travel" default="Vector2(0, 0)"> </member> </members> <constants> diff --git a/doc/classes/PhysicsTestMotionResult3D.xml b/doc/classes/PhysicsTestMotionResult3D.xml index 08c72ba965..6c18a097a1 100644 --- a/doc/classes/PhysicsTestMotionResult3D.xml +++ b/doc/classes/PhysicsTestMotionResult3D.xml @@ -29,9 +29,9 @@ </member> <member name="collision_unsafe_fraction" type="float" setter="" getter="get_collision_unsafe_fraction" default="0.0"> </member> - <member name="motion" type="Vector3" setter="" getter="get_motion" default="Vector3(0, 0, 0)"> + <member name="remainder" type="Vector3" setter="" getter="get_remainder" default="Vector3(0, 0, 0)"> </member> - <member name="motion_remainder" type="Vector3" setter="" getter="get_motion_remainder" default="Vector3(0, 0, 0)"> + <member name="travel" type="Vector3" setter="" getter="get_travel" default="Vector3(0, 0, 0)"> </member> </members> <constants> diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index c329821646..24f7f4274e 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -448,6 +448,7 @@ <method name="shader_compile_binary_from_spirv"> <return type="PackedByteArray" /> <argument index="0" name="spirv_data" type="RDShaderSPIRV" /> + <argument index="1" name="name" type="String" default="""" /> <description> </description> </method> @@ -465,8 +466,9 @@ </description> </method> <method name="shader_create_from_spirv"> - <return type="PackedByteArray" /> + <return type="RID" /> <argument index="0" name="spirv_data" type="RDShaderSPIRV" /> + <argument index="1" name="name" type="String" default="""" /> <description> </description> </method> diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index 701ecf815c..65dedf5280 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -12,12 +12,6 @@ <link title="When and how to avoid using nodes for everything">https://docs.godotengine.org/en/latest/getting_started/workflow/best_practices/node_alternatives.html</link> </tutorials> <methods> - <method name="_setup_local_to_scene" qualifiers="virtual"> - <return type="void" /> - <description> - Virtual function which can be overridden to customize the behavior value of [method setup_local_to_scene]. - </description> - </method> <method name="duplicate" qualifiers="const"> <return type="Resource" /> <argument index="0" name="subresources" type="bool" default="false" /> @@ -54,7 +48,7 @@ <method name="setup_local_to_scene"> <return type="void" /> <description> - This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a [PackedScene] instantiation. Its behavior can be customized by overriding [method _setup_local_to_scene] from script. + This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a [PackedScene] instantiation. Its behavior can be customized by connecting [signal setup_local_to_scene_requested] from script. For most resources, this method performs no base logic. [ViewportTexture] performs custom logic to properly set the proxy texture and flags in the local viewport. </description> </method> @@ -84,6 +78,10 @@ [b]Note:[/b] This signal is not emitted automatically for custom resources, which means that you need to create a setter and emit the signal yourself. </description> </signal> + <signal name="setup_local_to_scene_requested"> + <description> + </description> + </signal> </signals> <constants> </constants> diff --git a/doc/classes/ResourceFormatLoader.xml b/doc/classes/ResourceFormatLoader.xml index bce5785cc1..0c2bb26c02 100644 --- a/doc/classes/ResourceFormatLoader.xml +++ b/doc/classes/ResourceFormatLoader.xml @@ -11,22 +11,28 @@ <tutorials> </tutorials> <methods> - <method name="_get_dependencies" qualifiers="virtual"> - <return type="void" /> + <method name="_exists" qualifiers="virtual const"> + <return type="bool" /> + <argument index="0" name="path" type="String" /> + <description> + </description> + </method> + <method name="_get_dependencies" qualifiers="virtual const"> + <return type="PackedStringArray" /> <argument index="0" name="path" type="String" /> - <argument index="1" name="add_types" type="String" /> + <argument index="1" name="add_types" type="bool" /> <description> If implemented, gets the dependencies of a given resource. If [code]add_types[/code] is [code]true[/code], paths should be appended [code]::TypeName[/code], where [code]TypeName[/code] is the class name of the dependency. [b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return [code]"Resource"[/code] for them. </description> </method> - <method name="_get_recognized_extensions" qualifiers="virtual"> + <method name="_get_recognized_extensions" qualifiers="virtual const"> <return type="PackedStringArray" /> <description> Gets the list of extensions for files this loader is able to read. </description> </method> - <method name="_get_resource_type" qualifiers="virtual"> + <method name="_get_resource_type" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="path" type="String" /> <description> @@ -34,15 +40,21 @@ [b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just return [code]"Resource"[/code] for them. </description> </method> - <method name="_handles_type" qualifiers="virtual"> + <method name="_get_resource_uid" qualifiers="virtual const"> + <return type="int" /> + <argument index="0" name="path" type="String" /> + <description> + </description> + </method> + <method name="_handles_type" qualifiers="virtual const"> <return type="bool" /> - <argument index="0" name="typename" type="StringName" /> + <argument index="0" name="type" type="StringName" /> <description> Tells which resource class this loader can load. [b]Note:[/b] Custom resource types defined by scripts aren't known by the [ClassDB], so you might just handle [code]"Resource"[/code] for them. </description> </method> - <method name="_load" qualifiers="virtual"> + <method name="_load" qualifiers="virtual const"> <return type="Variant" /> <argument index="0" name="path" type="String" /> <argument index="1" name="original_path" type="String" /> @@ -53,10 +65,10 @@ The [code]cache_mode[/code] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. </description> </method> - <method name="_rename_dependencies" qualifiers="virtual"> + <method name="_rename_dependencies" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="path" type="String" /> - <argument index="1" name="renames" type="String" /> + <argument index="1" name="renames" type="Dictionary" /> <description> If implemented, renames dependencies within the given resource and saves it. [code]renames[/code] is a dictionary [code]{ String => String }[/code] mapping old dependency paths to new paths. Returns [constant OK] on success, or an [enum Error] constant in case of failure. diff --git a/doc/classes/ResourceFormatSaver.xml b/doc/classes/ResourceFormatSaver.xml index ef9eebc953..7ee8875321 100644 --- a/doc/classes/ResourceFormatSaver.xml +++ b/doc/classes/ResourceFormatSaver.xml @@ -10,14 +10,14 @@ <tutorials> </tutorials> <methods> - <method name="_get_recognized_extensions" qualifiers="virtual"> + <method name="_get_recognized_extensions" qualifiers="virtual const"> <return type="PackedStringArray" /> <argument index="0" name="resource" type="Resource" /> <description> Returns the list of extensions available for saving the resource object, provided it is recognized (see [method _recognize]). </description> </method> - <method name="_recognize" qualifiers="virtual"> + <method name="_recognize" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="resource" type="Resource" /> <description> diff --git a/doc/classes/RichTextEffect.xml b/doc/classes/RichTextEffect.xml index 142afbb860..fd93f6be56 100644 --- a/doc/classes/RichTextEffect.xml +++ b/doc/classes/RichTextEffect.xml @@ -23,7 +23,7 @@ <link title="RichTextEffect test project (third-party)">https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project</link> </tutorials> <methods> - <method name="_process_custom_fx" qualifiers="virtual"> + <method name="_process_custom_fx" qualifiers="virtual const"> <return type="bool" /> <argument index="0" name="char_fx" type="CharFXTransform" /> <description> diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 7bbcc5e0b5..e77232a613 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -555,7 +555,7 @@ <theme_item name="italics_font_size" data_type="font_size" type="int"> The font size used for italics text. </theme_item> - <theme_item name="line_separation" data_type="constant" type="int" default="1"> + <theme_item name="line_separation" data_type="constant" type="int" default="0"> The vertical space between lines. </theme_item> <theme_item name="mono_font" data_type="font" type="Font"> diff --git a/doc/classes/ScriptEditorBase.xml b/doc/classes/ScriptEditorBase.xml index 0efcde5638..08baa705e8 100644 --- a/doc/classes/ScriptEditorBase.xml +++ b/doc/classes/ScriptEditorBase.xml @@ -9,13 +9,6 @@ <tutorials> </tutorials> <methods> - <method name="_add_syntax_highlighter" qualifiers="virtual"> - <return type="void" /> - <argument index="0" name="highlighter" type="Object" /> - <description> - Adds a [EditorSyntaxHighlighter] to the open script. - </description> - </method> <method name="get_base_editor" qualifiers="const"> <return type="Control" /> <description> diff --git a/doc/classes/Skeleton3D.xml b/doc/classes/Skeleton3D.xml index 0ec2f6b7ca..2f340adb9f 100644 --- a/doc/classes/Skeleton3D.xml +++ b/doc/classes/Skeleton3D.xml @@ -20,9 +20,10 @@ Adds a bone, with name [code]name[/code]. [method get_bone_count] will become the bone index. </description> </method> - <method name="bone_transform_to_world_transform"> - <return type="Transform3D" /> - <argument index="0" name="bone_transform" type="Transform3D" /> + <method name="add_bone_child"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="child_bone_idx" type="int" /> <description> Takes the given bone pose/transform and converts it to a world transform, relative to the [Skeleton3D] node. This is useful for using the bone transform in calculations with transforms from [Node3D]-based nodes. @@ -40,6 +41,20 @@ Removes the global pose override on all bones in the skeleton. </description> </method> + <method name="clear_bones_local_pose_override"> + <return type="void" /> + <description> + Removes the local pose override on all bones in the skeleton. + </description> + </method> + <method name="execute_modifications"> + <return type="void" /> + <argument index="0" name="delta" type="float" /> + <argument index="1" name="execution_mode" type="int" /> + <description> + Executes all the modifications on the [SkeletonModificationStack3D], if the Skeleton3D has one assigned. + </description> + </method> <method name="find_bone" qualifiers="const"> <return type="int" /> <argument index="0" name="name" type="String" /> @@ -47,6 +62,26 @@ Returns the bone index that matches [code]name[/code] as its name. </description> </method> + <method name="force_update_all_bone_transforms"> + <return type="void" /> + <description> + Force updates the bone transforms/poses for all bones in the skeleton. + </description> + </method> + <method name="force_update_bone_child_transform"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Force updates the bone transform for the bone at [code]bone_idx[/code] and all of its children. + </description> + </method> + <method name="get_bone_children"> + <return type="PackedInt32Array" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns an array containing the bone indexes of all the children node of the passed in bone, [code]bone_idx[/code]. + </description> + </method> <method name="get_bone_count" qualifiers="const"> <return type="int" /> <description> @@ -74,6 +109,19 @@ 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. </description> </method> + <method name="get_bone_global_pose_override" qualifiers="const"> + <return type="Transform3D" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + </description> + </method> + <method name="get_bone_local_pose_override" qualifiers="const"> + <return type="Transform3D" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the local pose override transform for [code]bone_idx[/code]. + </description> + </method> <method name="get_bone_name" qualifiers="const"> <return type="String" /> <argument index="0" name="bone_idx" type="int" /> @@ -96,16 +144,49 @@ Returns the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose. </description> </method> - <method name="get_bone_process_orders"> + <method name="get_bone_rest" qualifiers="const"> + <return type="Transform3D" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Returns the rest transform for a bone [code]bone_idx[/code]. + </description> + </method> + <method name="get_modification_stack"> + <return type="SkeletonModificationStack3D" /> + <description> + Returns the modification stack attached to this skeleton, if one exists. + </description> + </method> + <method name="get_parentless_bones"> <return type="PackedInt32Array" /> <description> + Returns an array with all of the bones that are parentless. Another way to look at this is that it returns the indexes of all the bones that are not dependent or modified by other bones in the Skeleton. </description> </method> - <method name="get_bone_rest" qualifiers="const"> + <method name="global_pose_to_local_pose"> <return type="Transform3D" /> <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="global_pose" type="Transform3D" /> <description> - Returns the rest transform for a bone [code]bone_idx[/code]. + Takes the passed-in global pose and converts it to local pose transform. + This can be used to easily convert a global pose from [method get_bone_global_pose] to a global transform in [method set_bone_local_pose_override]. + </description> + </method> + <method name="global_pose_to_world_transform"> + <return type="Transform3D" /> + <argument index="0" name="global_pose" type="Transform3D" /> + <description> + Takes the passed-in global pose and converts it to a world transform. + This can be used to easily convert a global pose from [method get_bone_global_pose] to a global transform usable with a node's transform, like [member Node3D.global_transform] for example. + </description> + </method> + <method name="global_pose_z_forward_to_bone_forward"> + <return type="Basis" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="basis" type="Basis" /> + <description> + Rotates the given [Basis] so that the forward axis of the Basis is facing in the forward direction of the bone at [code]bone_idx[/code]. + This is helper function to make using [method Transform3D.looking_at] easier with bone poses. </description> </method> <method name="is_bone_rest_disabled" qualifiers="const"> @@ -115,6 +196,15 @@ Returns whether the bone rest for the bone at [code]bone_idx[/code] is disabled. </description> </method> + <method name="local_pose_to_global_pose"> + <return type="Transform3D" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="local_pose" type="Transform3D" /> + <description> + Converts the passed-in local pose to a global pose relative to the inputted bone, [code]bone_idx[/code]. + This could be used to convert [method get_bone_pose] for use with the [method set_bone_global_pose_override] function. + </description> + </method> <method name="localize_rests"> <return type="void" /> <description> @@ -158,13 +248,30 @@ Binds the given Skin to the Skeleton. </description> </method> + <method name="remove_bone_child"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="child_bone_idx" type="int" /> + <description> + Removes the passed in child bone index, [code]child_bone_idx[/code], from the passed-in bone, [code]bone_idx[/code], if it exists. + [b]Note:[/b] This does not remove the child bone, but instead it removes the connection it has to the parent bone. + </description> + </method> + <method name="set_bone_children"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="bone_children" type="PackedInt32Array" /> + <description> + Sets the children for the passed in bone, [code]bone_idx[/code], to the passed-in array of bone indexes, [code]bone_children[/code]. + </description> + </method> <method name="set_bone_custom_pose"> <return type="void" /> <argument index="0" name="bone_idx" type="int" /> <argument index="1" name="custom_pose" type="Transform3D" /> <description> Sets the custom pose transform, [code]custom_pose[/code], for the bone at [code]bone_idx[/code]. This pose is an addition to the bone rest pose. - [b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space. + [b]Note:[/b] The pose transform needs to be in bone space. Use [method world_transform_to_global_pose] to convert a world transform, like one you can get from a [Node3D], to bone space. </description> </method> <method name="set_bone_disable_rest"> @@ -183,8 +290,20 @@ <argument index="3" name="persistent" type="bool" default="false" /> <description> Sets the global pose transform, [code]pose[/code], for the bone at [code]bone_idx[/code]. - [code]amount[/code] is the interpolation strength that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain. - [b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space. + [code]amount[/code] is the interpolation strengh that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain. + [b]Note:[/b] The pose transform needs to be a global pose! Use [method world_transform_to_global_pose] to convert a world transform, like one you can get from a [Node3D], to a global pose. + </description> + </method> + <method name="set_bone_local_pose_override"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <argument index="1" name="pose" type="Transform3D" /> + <argument index="2" name="amount" type="float" /> + <argument index="3" name="persistent" type="bool" default="false" /> + <description> + Sets the local pose transform, [code]pose[/code], for the bone at [code]bone_idx[/code]. + [code]amount[/code] is the interpolation strengh that will be used when applying the pose, and [code]persistent[/code] determines if the applied pose will remain. + [b]Note:[/b] The pose transform needs to be a local pose! Use [method global_pose_to_local_pose] to convert a global pose to a local pose. </description> </method> <method name="set_bone_name"> @@ -209,7 +328,7 @@ <argument index="1" name="pose" type="Transform3D" /> <description> Sets the pose transform for bone [code]bone_idx[/code]. - [b]Note[/b]: The pose transform needs to be in bone space. Use [method world_transform_to_bone_transform] to convert a world transform, like one you can get from a [Node3D], to bone space. + [b]Note:[/b] The pose transform needs to be in bone space. Use [method world_transform_to_global_pose] to convert a world transform, like one you can get from a [Node3D], to bone space. </description> </method> <method name="set_bone_rest"> @@ -220,6 +339,13 @@ Sets the rest transform for bone [code]bone_idx[/code]. </description> </method> + <method name="set_modification_stack"> + <return type="void" /> + <argument index="0" name="modification_stack" type="SkeletonModificationStack3D" /> + <description> + Sets the modification stack for this skeleton to the passed-in modification stack, [code]modification_stack[/code]. + </description> + </method> <method name="unparent_bone_and_rest"> <return type="void" /> <argument index="0" name="bone_idx" type="int" /> @@ -227,12 +353,12 @@ Unparents the bone at [code]bone_idx[/code] and sets its rest position to that of its parent prior to being reset. </description> </method> - <method name="world_transform_to_bone_transform"> + <method name="world_transform_to_global_pose"> <return type="Transform3D" /> <argument index="0" name="world_transform" type="Transform3D" /> <description> - Takes the given world transform, relative to the [Skeleton3D], and converts it to a bone pose/transform. - This is useful for using setting bone poses using transforms from [Node3D]-based nodes. + Takes the passed-in global transform and converts it to a global pose. + This can be used to easily convert a global transform from [member Node3D.global_transform] to a global pose usable with [method set_bone_global_pose_override], for example. </description> </method> </methods> @@ -241,6 +367,12 @@ </member> </members> <signals> + <signal name="bone_pose_changed"> + <argument index="0" name="bone_idx" type="int" /> + <description> + This signal is emitted when one of the bones in the Skeleton3D node have changed their pose. This is used to inform nodes that rely on bone positions that one of the bones in the Skeleton3D have changed their transform/pose. + </description> + </signal> <signal name="pose_updated"> <description> </description> diff --git a/doc/classes/SkeletonModification3D.xml b/doc/classes/SkeletonModification3D.xml new file mode 100644 index 0000000000..48b8a905b9 --- /dev/null +++ b/doc/classes/SkeletonModification3D.xml @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonModification3D" inherits="Resource" version="4.0"> + <brief_description> + A resource that operates on bones in a [Skeleton3D]. + </brief_description> + <description> + This resource provides an interface that can be expanded so code that operates on bones in a [Skeleton3D] can be mixed and matched together to create complex interactions. + This is used to provide Godot with a flexible and powerful Inverse Kinematics solution that can be adapted for many different uses. + </description> + <tutorials> + </tutorials> + <methods> + <method name="_execute" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="delta" type="float" /> + <description> + Executes the given modification. This is where the modification performs whatever function it is designed to do. + </description> + </method> + <method name="_setup_modification" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="modification_stack" type="SkeletonModificationStack3D" /> + <description> + Sets up the modification so it can be executed. This function should be called automatically by the [SkeletonModificationStack3D] containing this modification. + If you need to initialize a modification before use, this is the place to do it! + </description> + </method> + <method name="clamp_angle"> + <return type="float" /> + <argument index="0" name="angle" type="float" /> + <argument index="1" name="min" type="float" /> + <argument index="2" name="max" type="float" /> + <argument index="3" name="invert" type="bool" /> + <description> + Takes a angle and clamps it so it is within the passed-in [code]min[/code] and [code]max[/code] range. [code]invert[/code] will inversely clamp the angle, clamping it to the range outside of the given bounds. + </description> + </method> + <method name="get_is_setup" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether this modification has been successfully setup or not. + </description> + </method> + <method name="get_modification_stack"> + <return type="SkeletonModificationStack3D" /> + <description> + Returns the [SkeletonModificationStack3D] that this modification is bound to. Through the modification stack, you can access the Skeleton3D the modification is operating on. + </description> + </method> + <method name="set_is_setup"> + <return type="void" /> + <argument index="0" name="is_setup" type="bool" /> + <description> + Manually allows you to set the setup state of the modification. This function should only rarely be used, as the [SkeletonModificationStack3D] the modification is bound to should handle setting the modification up. + </description> + </method> + </methods> + <members> + <member name="enabled" type="bool" setter="set_enabled" getter="get_enabled" default="true"> + When true, the modification's [method _execute] function will be called by the [SkeletonModificationStack3D]. + </member> + <member name="execution_mode" type="int" setter="set_execution_mode" getter="get_execution_mode" default="0"> + The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only availible in certain execution modes. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/SkeletonModification3DCCDIK.xml b/doc/classes/SkeletonModification3DCCDIK.xml new file mode 100644 index 0000000000..aa7ddad56e --- /dev/null +++ b/doc/classes/SkeletonModification3DCCDIK.xml @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonModification3DCCDIK" inherits="SkeletonModification3D" version="4.0"> + <brief_description> + A modification that uses CCDIK to manipulate a series of bones to reach a target. + </brief_description> + <description> + This [SkeletonModification3D] uses an algorithm called [b]C[/b]yclic [b]C[/b]oordinate [b]D[/b]escent [b]I[/b]nverse [b]K[/b]inematics, or CCDIK, to maniuplate a chain of bones in a Skeleton so it reaches a defined target. + CCDIK works by rotating a set of bones, typically called a "bone chain", on a single axis. Each bone is rotated to face the target from the tip (by default), which over a chain of bones allow it to rotate properly to reach the target. Because the bones only rotate on a single axis, CCDIK [i]can[/i] look more robotic than other IK solvers. + [b]Note:[/b] The CCDIK modifier has [code]ccdik_joints[/code], which are the data objects that hold the data for each joint in the CCDIK chain. This is different from a bone! CCDIK joints hold the data needed for each bone in the bone chain used by CCDIK. + CCDIK also fully supports angle constraints, allowing for more control over how a solution is met. + </description> + <tutorials> + </tutorials> + <methods> + <method name="get_ccdik_joint_bone_index" qualifiers="const"> + <return type="int" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the bone index of the bone assigned to the CCDIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_ccdik_joint_bone_name" qualifiers="const"> + <return type="String" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the name of the bone that is assigned to the CCDIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_ccdik_joint_ccdik_axis" qualifiers="const"> + <return type="int" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the integer representing the joint axis of the CCDIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_ccdik_joint_constraint_angle_max" qualifiers="const"> + <return type="float" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the maximum angle constraint for the joint at [code]joint_idx[/code]. [b]Note:[/b] This angle is in degrees! + </description> + </method> + <method name="get_ccdik_joint_constraint_angle_min" qualifiers="const"> + <return type="float" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the minimum angle constraint for the joint at [code]joint_idx[/code]. [b]Note:[/b] This angle is in degrees! + </description> + </method> + <method name="get_ccdik_joint_constraint_invert" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns whether the CCDIK joint at [code]joint_idx[/code] uses an inverted joint constraint. See [method set_ccdik_joint_constraint_invert] for details. + </description> + </method> + <method name="get_ccdik_joint_enable_joint_constraint" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Enables angle constraints to the CCDIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="set_ccdik_joint_bone_index"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="bone_index" type="int" /> + <description> + Sets the bone index, [code]bone_index[/code], of the CCDIK joint at [code]joint_idx[/code]. When possible, this will also update the [code]bone_name[/code] of the CCDIK joint based on data provided by the linked skeleton. + </description> + </method> + <method name="set_ccdik_joint_bone_name"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="bone_name" type="String" /> + <description> + Sets the bone name, [code]bone_name[/code], of the CCDIK joint at [code]joint_idx[/code]. When possible, this will also update the [code]bone_index[/code] of the CCDIK joint based on data provided by the linked skeleton. + </description> + </method> + <method name="set_ccdik_joint_ccdik_axis"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="axis" type="int" /> + <description> + Sets the joint axis of the CCDIK joint at [code]joint_idx[/code] to the passed-in joint axis, [code]axis[/code]. + </description> + </method> + <method name="set_ccdik_joint_constraint_angle_max"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="max_angle" type="float" /> + <description> + Sets the maximum angle constraint for the joint at [code]joint_idx[/code]. [b]Note:[/b] This angle must be in radians! + </description> + </method> + <method name="set_ccdik_joint_constraint_angle_min"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="min_angle" type="float" /> + <description> + Sets the minimum angle constraint for the joint at [code]joint_idx[/code]. [b]Note:[/b] This angle must be in radians! + </description> + </method> + <method name="set_ccdik_joint_constraint_invert"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="invert" type="bool" /> + <description> + Sets whether the CCDIK joint at [code]joint_idx[/code] uses an inverted joint constraint. + An inverted joint constraint only constraints the CCDIK joint to the angles [i]outside of[/i] the inputted minimum and maximum angles. For this reason, it is referred to as an inverted joint constraint, as it constraints the joint to the outside of the inputted values. + </description> + </method> + <method name="set_ccdik_joint_enable_joint_constraint"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="enable" type="bool" /> + <description> + Sets whether joint constraints are enabled for the CCDIK joint at [code]joint_idx[/code]. + </description> + </method> + </methods> + <members> + <member name="ccdik_data_chain_length" type="int" setter="set_ccdik_data_chain_length" getter="get_ccdik_data_chain_length" default="0"> + The amount of CCDIK joints in the CCDIK modification. + </member> + <member name="high_quality_solve" type="bool" setter="set_use_high_quality_solve" getter="get_use_high_quality_solve" default="true"> + When true, the CCDIK algorithm will perform a higher quality solve that returns more natural results. A high quality solve requires more computation power to solve though, and therefore can be disabled to save performance. + </member> + <member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")"> + The NodePath to the node that is the target for the CCDIK modification. This node is what the CCDIK chain will attempt to rotate the bone chain to. + </member> + <member name="tip_nodepath" type="NodePath" setter="set_tip_node" getter="get_tip_node" default="NodePath("")"> + The end position of the CCDIK chain. Typically, this should be a child of a [BoneAttachment3D] node attached to the final bone in the CCDIK chain, where the child node is offset so it is at the end of the final bone. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/SkeletonModification3DFABRIK.xml b/doc/classes/SkeletonModification3DFABRIK.xml new file mode 100644 index 0000000000..7058e37e94 --- /dev/null +++ b/doc/classes/SkeletonModification3DFABRIK.xml @@ -0,0 +1,163 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonModification3DFABRIK" inherits="SkeletonModification3D" version="4.0"> + <brief_description> + A modification that uses FABRIK to manipulate a series of bones to reach a target. + </brief_description> + <description> + This [SkeletonModification3D] uses an algorithm called [b]F[/b]orward [b]A[/b]nd [b]B[/b]ackward [b]R[/b]eaching [b]I[/b]nverse [b]K[/b]inematics, or FABRIK, to rotate a bone chain so that it reaches a target. + FABRIK works by knowing the positions and lengths of a series of bones, typically called a "bone chain". It first starts by running a forward pass, which places the final bone at the target's position. Then all other bones are moved towards the tip bone, so they stay at the defined bone length away. Then a backwards pass is performed, where the root/first bone in the FABRIK chain is placed back at the origin. then all other bones are moved so they stay at the defined bone length away. This positions the bone chain so that it reaches the target when possible, but all of the bones stay the correct length away from each other. + Because of how FABRIK works, it often gives more natural results than those seen in [SkeletonModification3DCCDIK], though FABRIK currently does not support joint constraints. + [b]Note:[/b] The FABRIK modifier has [code]fabrik_joints[/code], which are the data objects that hold the data for each joint in the FABRIK chain. This is different from a bone! FABRIK joints hold the data needed for each bone in the bone chain used by FABRIK. + To help control how the FABRIK joints move, a magnet vector can be passed, which can nudge the bones in a certain direction prior to solving, giving a level of control over the final result. + </description> + <tutorials> + </tutorials> + <methods> + <method name="fabrik_joint_auto_calculate_length"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Will attempt to automatically calculate the length of the bone assigned to the FABRIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_fabrik_joint_auto_calculate_length" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns a boolean that indiciates whether this modification will attempt to autocalculate the length of the bone assigned to the FABRIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_fabrik_joint_bone_index" qualifiers="const"> + <return type="int" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the bone index of the bone assigned to the FABRIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_fabrik_joint_bone_name" qualifiers="const"> + <return type="String" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the name of the bone that is assigned to the FABRIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_fabrik_joint_length" qualifiers="const"> + <return type="float" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the length of the FABRIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_fabrik_joint_magnet" qualifiers="const"> + <return type="Vector3" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the magnet vector of the FABRIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_fabrik_joint_tip_node" qualifiers="const"> + <return type="NodePath" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the [Node3D]-based node placed at the tip of the FABRIK joint at [code]joint_idx[/code], if one has been set. + </description> + </method> + <method name="get_fabrik_joint_use_target_basis" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns a boolean indiciating whether the FABRIK joint uses the target's [Basis] for its rotation. + [b]Note:[/b] this option is only available for the final bone in the FABRIK chain, with this setting being ignored for all other bones. + </description> + </method> + <method name="get_fabrik_joint_use_tip_node" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Sets the [Node3D]-based node that will be used as the tip of the FABRIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="set_fabrik_joint_auto_calculate_length"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="auto_calculate_length" type="bool" /> + <description> + When [code]true[/code], this modification will attempt to automatically calculate the length of the bone for the FABRIK joint at [code]joint_idx[/code]. It does this by either using the tip node assigned, if there is one assigned, or the distance the of the bone's children, if the bone has any. If the bone has no children and no tip node is assigned, then the modification [b]cannot[/b] autocalculate the joint's length. In this case, the joint length should be entered manually or a tip node assigned. + </description> + </method> + <method name="set_fabrik_joint_bone_index"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="bone_index" type="int" /> + <description> + Sets the bone index, [code]bone_index[/code], of the FABRIK joint at [code]joint_idx[/code]. When possible, this will also update the [code]bone_name[/code] of the FABRIK joint based on data provided by the [Skeleton3D]. + </description> + </method> + <method name="set_fabrik_joint_bone_name"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="bone_name" type="String" /> + <description> + Sets the bone name, [code]bone_name[/code], of the FABRIK joint at [code]joint_idx[/code]. When possible, this will also update the [code]bone_index[/code] of the FABRIK joint based on data provided by the [Skeleton3D]. + </description> + </method> + <method name="set_fabrik_joint_length"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="length" type="float" /> + <description> + Sets the joint length, [code]length[/code], of the FABRIK joint at [code]joint_idx[/code]. + </description> + </method> + <method name="set_fabrik_joint_magnet"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="magnet_position" type="Vector3" /> + <description> + Sets the magenet position to [code]magnet_position[/code] for the joint at [code]joint_idx[/code]. The magnet position is used to nudge the joint in that direction when solving, which gives some control over how that joint will bend when being solved. + </description> + </method> + <method name="set_fabrik_joint_tip_node"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="tip_node" type="NodePath" /> + <description> + Sets the nodepath of the FARIK joint at [code]joint_idx[/code] to [code]tip_node[/code]. The tip node is used to calculate the length of the FABRIK joint when set to automatically calculate joint length. + [b]Note:[/b] The tip node should generally be a child node of a [BoneAttachment3D] node attached to the bone that this FABRIK joint operates on, with the child node being offset so it is at the end of the bone. + </description> + </method> + <method name="set_fabrik_joint_use_target_basis"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="use_target_basis" type="bool" /> + <description> + Sets whether the FABRIK joint at [code]joint_idx[/code] uses the target's [Basis] for its rotation. + [b]Note:[/b] this option is only available for the final bone in the FABRIK chain, with this setting being ignored for all other bones. + </description> + </method> + <method name="set_fabrik_joint_use_tip_node"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="use_tip_node" type="bool" /> + <description> + Sets whether the tip node should be used when autocalculating the joint length for the FABRIK joint at [code]joint_idx[/code]. This will only work if there is a node assigned to the tip nodepath for this joint. + </description> + </method> + </methods> + <members> + <member name="chain_max_iterations" type="int" setter="set_chain_max_iterations" getter="get_chain_max_iterations" default="10"> + The number of times FABRIK will try to solve each time the [code]execute[/code] function is called. Setting this value to a lower number will be result in better performance, but this can also result in harsher movements and slower solves. + </member> + <member name="chain_tolerance" type="float" setter="set_chain_tolerance" getter="get_chain_tolerance" default="0.01"> + The minimum distance the target has to be from the tip of the final bone in the bone chain. Setting this value to a higher number allows for greater performance, but less accurate solves. + </member> + <member name="fabrik_data_chain_length" type="int" setter="set_fabrik_data_chain_length" getter="get_fabrik_data_chain_length" default="0"> + The amount of FABRIK joints in the FABRIK modification. + </member> + <member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")"> + The NodePath to the node that is the target for the FABRIK modification. This node is what the FABRIK chain will attempt to rotate the bone chain to. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/SkeletonModification3DJiggle.xml b/doc/classes/SkeletonModification3DJiggle.xml new file mode 100644 index 0000000000..e48e382cd4 --- /dev/null +++ b/doc/classes/SkeletonModification3DJiggle.xml @@ -0,0 +1,201 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonModification3DJiggle" inherits="SkeletonModification3D" version="4.0"> + <brief_description> + A modification that jiggles bones as they move towards a target. + </brief_description> + <description> + This modification moves a series of bones, typically called a bone chain, towards a target. What makes this modification special is that it calculates the velocity and acceleration for each bone in the bone chain, and runs a very light physics-like calculation using the inputted values. This allows the bones to overshoot the target and "jiggle" around. It can be configured to act more like a spring, or sway around like cloth might. + This modification is useful for adding additional motion to things like hair, the edges of clothing, and more. It has several settings to that allow control over how the joint moves when the target moves. + [b]Note:[/b] The Jiggle modifier has [code]jiggle_joints[/code], which are the data objects that hold the data for each joint in the Jiggle chain. This is different from a bone! Jiggle joints hold the data needed for each bone in the bone chain used by the Jiggle modification. + </description> + <tutorials> + </tutorials> + <methods> + <method name="get_collision_mask" qualifiers="const"> + <return type="int" /> + <description> + Returns the collision mask that the Jiggle modifier will take into account when performing physics calculations. + </description> + </method> + <method name="get_jiggle_joint_bone_index" qualifiers="const"> + <return type="int" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the bone index of the bone assigned to the Jiggle joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_jiggle_joint_bone_name" qualifiers="const"> + <return type="String" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the name of the bone that is assigned to the Jiggle joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_jiggle_joint_damping" qualifiers="const"> + <return type="float" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the amount of dampening of the Jiggle joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_jiggle_joint_gravity" qualifiers="const"> + <return type="Vector3" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns a [Vector3] representign the amount of gravity the Jiggle joint at [code]joint_idx[/code] is influenced by. + </description> + </method> + <method name="get_jiggle_joint_mass" qualifiers="const"> + <return type="float" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the amount of mass of the Jiggle joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_jiggle_joint_override" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns a boolean that indiciates whether the joint at [code]joint_idx[/code] is overriding the default jiggle joint data defined in the modification. + </description> + </method> + <method name="get_jiggle_joint_roll" qualifiers="const"> + <return type="float" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the amount of roll/twist applied to the bone that the Jiggle joint is applied to. + </description> + </method> + <method name="get_jiggle_joint_stiffness" qualifiers="const"> + <return type="float" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns the stiffness of the Jiggle joint at [code]joint_idx[/code]. + </description> + </method> + <method name="get_jiggle_joint_use_gravity" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="joint_idx" type="int" /> + <description> + Returns a boolean that indiciates whether the joint at [code]joint_idx[/code] is using gravity or not. + </description> + </method> + <method name="get_use_colliders" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether the Jiggle modifier is taking physics colliders into account when solving. + </description> + </method> + <method name="set_collision_mask"> + <return type="void" /> + <argument index="0" name="mask" type="int" /> + <description> + Sets the collision mask that the Jiggle modifier takes into account when performing physics calculations. + </description> + </method> + <method name="set_jiggle_joint_bone_index"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="bone_idx" type="int" /> + <description> + Sets the bone index, [code]bone_index[/code], of the Jiggle joint at [code]joint_idx[/code]. When possible, this will also update the [code]bone_name[/code] of the Jiggle joint based on data provided by the [Skeleton3D]. + </description> + </method> + <method name="set_jiggle_joint_bone_name"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="name" type="String" /> + <description> + Sets the bone name, [code]bone_name[/code], of the Jiggle joint at [code]joint_idx[/code]. When possible, this will also update the [code]bone_index[/code] of the Jiggle joint based on data provided by the [Skeleton3D]. + </description> + </method> + <method name="set_jiggle_joint_damping"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="damping" type="float" /> + <description> + Sets the amount of dampening of the Jiggle joint at [code]joint_idx[/code]. + </description> + </method> + <method name="set_jiggle_joint_gravity"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="gravity" type="Vector3" /> + <description> + Sets the gravity vector of the Jiggle joint at [code]joint_idx[/code]. + </description> + </method> + <method name="set_jiggle_joint_mass"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="mass" type="float" /> + <description> + Sets the of mass of the Jiggle joint at [code]joint_idx[/code]. + </description> + </method> + <method name="set_jiggle_joint_override"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="override" type="bool" /> + <description> + Sets whether the Jiggle joint at [code]joint_idx[/code] should override the default Jiggle joint settings. Setting this to true will make the joint use its own settings rather than the default ones attached to the modification. + </description> + </method> + <method name="set_jiggle_joint_roll"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="roll" type="float" /> + <description> + Sets the amount of roll/twist on the bone the Jiggle joint is attached to. + </description> + </method> + <method name="set_jiggle_joint_stiffness"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="stiffness" type="float" /> + <description> + Sets the of stiffness of the Jiggle joint at [code]joint_idx[/code]. + </description> + </method> + <method name="set_jiggle_joint_use_gravity"> + <return type="void" /> + <argument index="0" name="joint_idx" type="int" /> + <argument index="1" name="use_gravity" type="bool" /> + <description> + Sets whether the Jiggle joint at [code]joint_idx[/code] should use gravity. + </description> + </method> + <method name="set_use_colliders"> + <return type="void" /> + <argument index="0" name="use_colliders" type="bool" /> + <description> + When [code]true[/code], the Jiggle modifier will use raycasting to prevent the Jiggle joints from rotating themselves into collision objects when solving. + </description> + </method> + </methods> + <members> + <member name="damping" type="float" setter="set_damping" getter="get_damping" default="0.75"> + The default amount of dampening applied to the Jiggle joints, if they are not overriden. Higher values lead to more of the calculated velocity being applied. + </member> + <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" default="Vector3(0, -6, 0)"> + The default amount of gravity applied to the Jiggle joints, if they are not overriden. + </member> + <member name="jiggle_data_chain_length" type="int" setter="set_jiggle_data_chain_length" getter="get_jiggle_data_chain_length" default="0"> + The amount of Jiggle joints in the Jiggle modification. + </member> + <member name="mass" type="float" setter="set_mass" getter="get_mass" default="0.75"> + The default amount of mass assigned to the Jiggle joints, if they are not overriden. Higher values lead to faster movements and more overshooting. + </member> + <member name="stiffness" type="float" setter="set_stiffness" getter="get_stiffness" default="3.0"> + The default amount of stiffness assigned to the Jiggle joints, if they are not overriden. Higher values act more like springs, quickly moving into the correct position. + </member> + <member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")"> + The NodePath to the node that is the target for the Jiggle modification. This node is what the Jiggle chain will attempt to rotate the bone chain to. + </member> + <member name="use_gravity" type="bool" setter="set_use_gravity" getter="get_use_gravity" default="false"> + Whether the gravity vector, [member gravity], should be applied to the Jiggle joints, assuming they are not overriding the default settings. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/SkeletonModification3DLookAt.xml b/doc/classes/SkeletonModification3DLookAt.xml new file mode 100644 index 0000000000..c01d764cff --- /dev/null +++ b/doc/classes/SkeletonModification3DLookAt.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonModification3DLookAt" inherits="SkeletonModification3D" version="4.0"> + <brief_description> + A modification that rotates a bone to look at a target. + </brief_description> + <description> + This [SkeletonModification3D] rotates a bone to look a target. This is extremely helpful for moving character's heads to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily. + </description> + <tutorials> + </tutorials> + <methods> + <method name="get_additional_rotation" qualifiers="const"> + <return type="Vector3" /> + <description> + Returns the amount of extra rotation that is applied to the bone after the LookAt modification executes. + </description> + </method> + <method name="get_lock_rotation_plane" qualifiers="const"> + <return type="int" /> + <description> + Returns the plane that the LookAt modification is limiting rotation to. + </description> + </method> + <method name="get_lock_rotation_to_plane" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether the LookAt modification is limiting rotation to a single plane in 3D space. + </description> + </method> + <method name="set_additional_rotation"> + <return type="void" /> + <argument index="0" name="additional_rotation" type="Vector3" /> + <description> + Sets the amount of extra rotation to be applied after the LookAt modification executes. This allows you to adjust the finished result. + </description> + </method> + <method name="set_lock_rotation_plane"> + <return type="void" /> + <argument index="0" name="plane" type="int" /> + <description> + </description> + </method> + <method name="set_lock_rotation_to_plane"> + <return type="void" /> + <argument index="0" name="lock_to_plane" type="bool" /> + <description> + When [code]true[/code], the LookAt modification will limit its rotation to a single plane in 3D space. The plane used can be configured using the [code]set_lock_rotation_plane[/code] function. + </description> + </method> + </methods> + <members> + <member name="bone_index" type="int" setter="set_bone_index" getter="get_bone_index" default="-2"> + The bone index of the bone that should be operated on by this modification. + When possible, this will also update the [member bone_name] based on data provided by the [Skeleton3D]. + </member> + <member name="bone_name" type="String" setter="set_bone_name" getter="get_bone_name" default=""""> + The name of the bone that should be operated on by this modification. + When possible, this will also update the [member bone_index] based on data provided by the [Skeleton3D]. + </member> + <member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")"> + The NodePath to the node that is the target for the modification. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/SkeletonModification3DStackHolder.xml b/doc/classes/SkeletonModification3DStackHolder.xml new file mode 100644 index 0000000000..bb923b680d --- /dev/null +++ b/doc/classes/SkeletonModification3DStackHolder.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonModification3DStackHolder" inherits="SkeletonModification3D" version="4.0"> + <brief_description> + A modification that holds and executes a [SkeletonModificationStack3D]. + </brief_description> + <description> + This [SkeletonModification3D] holds a reference to a [SkeletonModificationStack3D], allowing you to use multiple modification stacks on a single [Skeleton3D]. + [b]Note[/b]: The modifications in the held [SkeletonModificationStack3D] will only be executed if their execution mode matches the execution mode of the SkeletonModification3DStackHolder. + </description> + <tutorials> + </tutorials> + <methods> + <method name="get_held_modification_stack" qualifiers="const"> + <return type="SkeletonModificationStack3D" /> + <description> + Returns the [SkeletonModificationStack3D] that this modification is holding. + </description> + </method> + <method name="set_held_modification_stack"> + <return type="void" /> + <argument index="0" name="held_modification_stack" type="SkeletonModificationStack3D" /> + <description> + Sets the [SkeletonModificationStack3D] that this modification is holding. This modification stack will then be executed when this modification is executed. + </description> + </method> + </methods> + <constants> + </constants> +</class> diff --git a/doc/classes/SkeletonModification3DTwoBoneIK.xml b/doc/classes/SkeletonModification3DTwoBoneIK.xml new file mode 100644 index 0000000000..5c863367df --- /dev/null +++ b/doc/classes/SkeletonModification3DTwoBoneIK.xml @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonModification3DTwoBoneIK" inherits="SkeletonModification3D" version="4.0"> + <brief_description> + A modification that moves two bones to reach the target. + </brief_description> + <description> + This [SkeletonModification3D] uses an algorithm typically called TwoBoneIK. This algorithm works by leveraging the law of cosigns and the lengths of the bones to figure out what rotation the bones currently have, and what rotation they need to make a complete triangle, where the first bone, the second bone, and the target form the three verticies of the triangle. Because the algorithm works by making a triangle, it can only opperate on two bones. + TwoBoneIK is great for arms, legs, and really any joints that can be represented by just two bones that bend to reach a target. This solver is more lightweight than [SkeletonModification3DFABRIK], but gives similar, natural looking results. + A [Node3D]-based node can be used to define the pole, or bend direction, allowing control over which direction the joint takes when bending to reach the target when the target is within reach. + </description> + <tutorials> + </tutorials> + <methods> + <method name="get_auto_calculate_joint_length" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether the TwoBoneIK modification will attempt to autocalculate the lengths of the two bones. + </description> + </method> + <method name="get_joint_one_bone_idx" qualifiers="const"> + <return type="int" /> + <description> + Returns the bone index of the first bone in the TwoBoneIK modification. + </description> + </method> + <method name="get_joint_one_bone_name" qualifiers="const"> + <return type="String" /> + <description> + Returns the name of the first bone in the TwoBoneIK modification. + </description> + </method> + <method name="get_joint_one_length" qualifiers="const"> + <return type="float" /> + <description> + Returns the length of the first bone in the TwoBoneIK modification. + </description> + </method> + <method name="get_joint_one_roll" qualifiers="const"> + <return type="float" /> + <description> + Returns the amount of roll/twist applied to the first bone in the TwoBoneIK modification. + </description> + </method> + <method name="get_joint_two_bone_idx" qualifiers="const"> + <return type="int" /> + <description> + Returns the bone index of the second bone in the TwoBoneIK modification. + </description> + </method> + <method name="get_joint_two_bone_name" qualifiers="const"> + <return type="String" /> + <description> + Returns the name of the second bone in the TwoBoneIK modification. + </description> + </method> + <method name="get_joint_two_length" qualifiers="const"> + <return type="float" /> + <description> + Returns the length of the second bone in the TwoBoneIK modification. + </description> + </method> + <method name="get_joint_two_roll" qualifiers="const"> + <return type="float" /> + <description> + Returns the amount of roll/twist applied to the second bone in the TwoBoneIK modification. + </description> + </method> + <method name="get_pole_node" qualifiers="const"> + <return type="NodePath" /> + <description> + Returns the node that is being used as the pole node for the TwoBoneIK modification, if a pole node has been set. + </description> + </method> + <method name="get_tip_node" qualifiers="const"> + <return type="NodePath" /> + <description> + Returns the node that is being used to calculate the tip position of the second bone in the TwoBoneIK modification, if a tip node has been set. + </description> + </method> + <method name="get_use_pole_node" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether the TwoBoneIK modification will attempt to use the pole node to figure out which direction to bend, if a pole node has been set. + </description> + </method> + <method name="get_use_tip_node" qualifiers="const"> + <return type="bool" /> + <description> + Returns whether the TwoBoneIK modification will attempt to use the tip node to figure out the length and position of the tip of the second bone. + </description> + </method> + <method name="set_auto_calculate_joint_length"> + <return type="void" /> + <argument index="0" name="auto_calculate_joint_length" type="bool" /> + <description> + If true, the TwoBoneIK modification will attempt to autocalculate the lengths of the bones being used. The first bone will be calculated by using the distance from the origin of the first bone to the origin of the second bone. + The second bone will be calculated either using the tip node if that setting is enabled, or by using the distances of the second bone's children. If the tip node is not enabled and the bone has no children, then the length cannot be autocalculated. In this case, the length will either have to be manually inputted or a tip node used to calculate the length. + </description> + </method> + <method name="set_joint_one_bone_idx"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Sets the bone index, [code]bone_index[/code], of the first bone. When possible, this will also update the [code]bone_name[/code] of the first bone based on data provided by the [Skeleton3D]. + </description> + </method> + <method name="set_joint_one_bone_name"> + <return type="void" /> + <argument index="0" name="bone_name" type="String" /> + <description> + Sets the bone name, [code]bone_name[/code], of the first bone. When possible, this will also update the [code]bone_index[/code] of the first bone based on data provided by the [Skeleton3D]. + </description> + </method> + <method name="set_joint_one_length"> + <return type="void" /> + <argument index="0" name="bone_length" type="float" /> + <description> + Sets the length of the first bone in the TwoBoneIK modification. + </description> + </method> + <method name="set_joint_one_roll"> + <return type="void" /> + <argument index="0" name="roll" type="float" /> + <description> + Sets the amount of roll/twist applied to the first bone in the TwoBoneIK modification. + </description> + </method> + <method name="set_joint_two_bone_idx"> + <return type="void" /> + <argument index="0" name="bone_idx" type="int" /> + <description> + Sets the bone index, [code]bone_index[/code], of the second bone. When possible, this will also update the [code]bone_name[/code] of the second bone based on data provided by the [Skeleton3D]. + </description> + </method> + <method name="set_joint_two_bone_name"> + <return type="void" /> + <argument index="0" name="bone_name" type="String" /> + <description> + Sets the bone name, [code]bone_name[/code], of the second bone. When possible, this will also update the [code]bone_index[/code] of the second bone based on data provided by the [Skeleton3D]. + </description> + </method> + <method name="set_joint_two_length"> + <return type="void" /> + <argument index="0" name="bone_length" type="float" /> + <description> + Sets the length of the second bone in the TwoBoneIK modification. + </description> + </method> + <method name="set_joint_two_roll"> + <return type="void" /> + <argument index="0" name="roll" type="float" /> + <description> + Sets the amount of roll/twist applied to the second bone in the TwoBoneIK modification. + </description> + </method> + <method name="set_pole_node"> + <return type="void" /> + <argument index="0" name="pole_nodepath" type="NodePath" /> + <description> + Sets the node to be used as the for the pole of the TwoBoneIK. When a node is set and the modification is set to use the pole node, the TwoBoneIK modification will bend the nodes in the direction towards this node when the bones need to bend. + </description> + </method> + <method name="set_tip_node"> + <return type="void" /> + <argument index="0" name="tip_nodepath" type="NodePath" /> + <description> + Sets the node to be used as the tip for the second bone. This is used to calculate the length and position of the end of the second bone in the TwoBoneIK modification. + [b]Note:[/b] The tip node should generally be a child node of a [BoneAttachment3D] node attached to the second bone, with the child node being offset so it is at the end of the bone. + </description> + </method> + <method name="set_use_pole_node"> + <return type="void" /> + <argument index="0" name="use_pole_node" type="bool" /> + <description> + When [code]true[/code], the TwoBoneIK modification will bend the bones towards the pole node, if one has been set. This gives control over the direction the TwoBoneIK solver will bend, which is helpful for joints like elbows that only bend in certain directions. + </description> + </method> + <method name="set_use_tip_node"> + <return type="void" /> + <argument index="0" name="use_tip_node" type="bool" /> + <description> + When [code]true[/code], the TwoBoneIK modification will use the tip node to calculate the distance and position of the end/tip of the second bone. This is the most stable solution for knowing the tip position and length of the second bone. + </description> + </method> + </methods> + <members> + <member name="target_nodepath" type="NodePath" setter="set_target_node" getter="get_target_node" default="NodePath("")"> + The NodePath to the node that is the target for the TwoBoneIK modification. This node is what the modification will attempt to rotate the bones to reach. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/SkeletonModificationStack3D.xml b/doc/classes/SkeletonModificationStack3D.xml new file mode 100644 index 0000000000..4e5e9d72d8 --- /dev/null +++ b/doc/classes/SkeletonModificationStack3D.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="SkeletonModificationStack3D" inherits="Resource" version="4.0"> + <brief_description> + A resource that holds a stack of [SkeletonModification3D]s. + </brief_description> + <description> + This resource is used by the Skeleton and holds a stack of [SkeletonModification3D]s. The SkeletonModificationStack3D controls the order of the modifications, which controls how they are applied. Modification order is especially important for full-body IK setups, as you need to execute the modifications in the correct order to get the desired results. For example, you want to execute a modification on the spine [i]before[/i] the arms on a humanoid skeleton. + Additionally, the SkeletonModificationStack3D also controls how strongly the modifications are applied to the [Skeleton3D] node. + </description> + <tutorials> + </tutorials> + <methods> + <method name="add_modification"> + <return type="void" /> + <argument index="0" name="modification" type="SkeletonModification3D" /> + <description> + Adds the passed-in [SkeletonModification3D] to the stack. + </description> + </method> + <method name="delete_modification"> + <return type="void" /> + <argument index="0" name="mod_idx" type="int" /> + <description> + Deletes the [SkeletonModification3D] at the index position [code]mod_idx[/code], if it exists. + </description> + </method> + <method name="enable_all_modifications"> + <return type="void" /> + <argument index="0" name="enabled" type="bool" /> + <description> + Enables all [SkeletonModification3D]s in the stack. + </description> + </method> + <method name="execute"> + <return type="void" /> + <argument index="0" name="delta" type="float" /> + <argument index="1" name="execution_mode" type="int" /> + <description> + Executes all of the [SkeletonModification3D]s in the stack that use the same execution mode as the passed-in [code]execution_mode[/code], starting from index [code]0[/code] to [member modification_count]. + [b]Note:[/b] The order of the modifications can matter depending on the modifications. For example, modifications on a spine should operate before modifications on the arms in order to get proper results. + </description> + </method> + <method name="get_is_setup" qualifiers="const"> + <return type="bool" /> + <description> + Returns a boolean that indiciates whether the modification stack is setup and can execute. + </description> + </method> + <method name="get_modification" qualifiers="const"> + <return type="SkeletonModification3D" /> + <argument index="0" name="mod_idx" type="int" /> + <description> + Returns the [SkeletonModification3D] at the passed-in index, [code]mod_idx[/code]. + </description> + </method> + <method name="get_skeleton" qualifiers="const"> + <return type="Skeleton3D" /> + <description> + Returns the [Skeleton3D] node that the SkeletonModificationStack3D is bound to. + </description> + </method> + <method name="set_modification"> + <return type="void" /> + <argument index="0" name="mod_idx" type="int" /> + <argument index="1" name="modification" type="SkeletonModification3D" /> + <description> + Sets the modification at [code]mod_idx[/code] to the passed-in modification, [code]modification[/code]. + </description> + </method> + <method name="setup"> + <return type="void" /> + <description> + Sets up the modification stack so it can execute. This function should be called by [Skeleton3D] and shouldn't be called unless you know what you are doing. + </description> + </method> + </methods> + <members> + <member name="enabled" type="bool" setter="set_enabled" getter="get_enabled" default="false"> + When true, the modification's in the stack will be called. This is handled automatically through the [Skeleton3D] node. + </member> + <member name="modification_count" type="int" setter="set_modification_count" getter="get_modification_count" default="0"> + The amount of modifications in the stack. + </member> + <member name="strength" type="float" setter="set_strength" getter="get_strength" default="1.0"> + The interpolation strength of the modifications in stack. A value of [code]0[/code] will make it where the modifications are not applied, a strength of [code]0.5[/code] will be half applied, and a strength of [code]1[/code] will allow the modifications to be fully applied and override the skeleton bone poses. + </member> + </members> + <constants> + </constants> +</class> diff --git a/doc/classes/String.xml b/doc/classes/String.xml index 0376a3f96e..97efc24bd1 100644 --- a/doc/classes/String.xml +++ b/doc/classes/String.xml @@ -181,7 +181,17 @@ <method name="get_extension" qualifiers="const"> <return type="String" /> <description> - If the string is a valid file path, returns the extension. + Returns the extension without the leading period character ([code].[/code]) if the string is a valid file name or path. If the string does not contain an extension, returns an empty string instead. + [codeblock] + print("/path/to/file.txt".get_extension()) # "txt" + print("file.txt".get_extension()) # "txt" + print("file.sample.txt".get_extension()) # "txt" + print(".txt".get_extension()) # "txt" + print("file.txt.".get_extension()) # "" (empty string) + print("file.txt..".get_extension()) # "" (empty string) + print("txt".get_extension()) # "" (empty string) + print("".get_extension()) # "" (empty string) + [/codeblock] </description> </method> <method name="get_file" qualifiers="const"> @@ -410,6 +420,21 @@ <argument index="0" name="number" type="float" /> <argument index="1" name="decimals" type="int" default="-1" /> <description> + Converts a [float] to a string representation of a decimal number. + The number of decimal places can be specified with [code]decimals[/code]. If [code]decimals[/code] is [code]-1[/code] (default), decimal places will be automatically adjusted so that the string representation has 14 significant digits (counting both digits to the left and the right of the decimal point). + Trailing zeros are not included in the string. The last digit will be rounded and not truncated. + Some examples: + [codeblock] + String.num(3.141593) # "3.141593" + String.num(3.141593, 3) # "3.142" + String.num(3.14159300) # "3.141593", no trailing zeros. + # Last digit will be rounded up here, which reduces total digit count since + # trailing zeros are removed: + String.num(42.129999, 5) # "42.13" + # If `decimals` is not specified, the total amount of significant digits is 14: + String.num(-0.0000012345432123454321) # "-0.00000123454321" + String.num(-10000.0000012345432123454321) # "-10000.0000012345" + [/codeblock] </description> </method> <method name="num_scientific" qualifiers="static"> diff --git a/doc/classes/SyntaxHighlighter.xml b/doc/classes/SyntaxHighlighter.xml index ea0d1c27a3..c478cb0eb6 100644 --- a/doc/classes/SyntaxHighlighter.xml +++ b/doc/classes/SyntaxHighlighter.xml @@ -17,7 +17,7 @@ Virtual method which can be overridden to clear any local caches. </description> </method> - <method name="_get_line_syntax_highlighting" qualifiers="virtual"> + <method name="_get_line_syntax_highlighting" qualifiers="virtual const"> <return type="Dictionary" /> <argument index="0" name="line" type="int" /> <description> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 68d20e41d0..abb4119584 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -30,7 +30,7 @@ </method> <method name="_handle_unicode_input" qualifiers="virtual"> <return type="void" /> - <argument index="0" name="unicode" type="int" /> + <argument index="0" name="unicode_char" type="int" /> <description> Override this method to define what happens when the types in the provided key [code]unicode[/code]. </description> @@ -464,12 +464,24 @@ Returns if the user has IME text. </description> </method> + <method name="has_redo" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if a "redo" action is available. + </description> + </method> <method name="has_selection" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if the user has selected text. </description> </method> + <method name="has_undo" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if an "undo" action is available. + </description> + </method> <method name="insert_line_at"> <return type="void" /> <argument index="0" name="line" type="int" /> diff --git a/doc/classes/TextFile.xml b/doc/classes/TextFile.xml deleted file mode 100644 index 1c2c2ff25c..0000000000 --- a/doc/classes/TextFile.xml +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> -<class name="TextFile" inherits="Resource" version="4.0"> - <brief_description> - </brief_description> - <description> - </description> - <tutorials> - </tutorials> - <methods> - </methods> - <constants> - </constants> -</class> diff --git a/doc/classes/Theme.xml b/doc/classes/Theme.xml index 1124fb8084..edf5874432 100644 --- a/doc/classes/Theme.xml +++ b/doc/classes/Theme.xml @@ -81,19 +81,6 @@ Unmarks [code]theme_type[/code] as being a variation of any other type. </description> </method> - <method name="copy_default_theme"> - <return type="void" /> - <description> - Sets the theme's values to a copy of the default theme values. - </description> - </method> - <method name="copy_theme"> - <return type="void" /> - <argument index="0" name="other" type="Theme" /> - <description> - Sets the theme's values to a copy of a given theme. - </description> - </method> <method name="get_color" qualifiers="const"> <return type="Color" /> <argument index="0" name="name" type="StringName" /> @@ -340,6 +327,14 @@ Returns [code]true[/code] if [code]theme_type[/code] is marked as a variation of [code]base_type[/code] in this theme. </description> </method> + <method name="merge_with"> + <return type="void" /> + <argument index="0" name="other" type="Theme" /> + <description> + Adds missing and overrides existing definitions with values from the [code]other[/code] [Theme]. + [b]Note:[/b] This modifies the current theme. If you want to merge two themes together without modifying either one, create a new empty theme and merge the other two into it one after another. + </description> + </method> <method name="rename_color"> <return type="void" /> <argument index="0" name="old_name" type="StringName" /> diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 50a573d30f..ed24905254 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -552,6 +552,9 @@ <theme_item name="hseparation" data_type="constant" type="int" default="4"> The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled. </theme_item> + <theme_item name="indeterminate" data_type="icon" type="Texture2D"> + The check icon to display when the [constant TreeItem.CELL_MODE_CHECK] mode cell is indeterminate. + </theme_item> <theme_item name="item_margin" data_type="constant" type="int" default="12"> The horizontal margin at the start of an item. This is used when folding is enabled for the item. </theme_item> diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index 944b9fdc06..406c074758 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -340,6 +340,13 @@ Returns [code]true[/code] if column [code]column[/code] is editable. </description> </method> + <method name="is_indeterminate" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="column" type="int" /> + <description> + Returns [code]true[/code] if the given column is indeterminate. + </description> + </method> <method name="is_selectable" qualifiers="const"> <return type="bool" /> <argument index="0" name="column" type="int" /> @@ -415,7 +422,7 @@ <argument index="0" name="column" type="int" /> <argument index="1" name="checked" type="bool" /> <description> - If [code]true[/code], the column [code]column[/code] is checked. + If [code]true[/code], the column [code]column[/code] is checked. Clears column's indeterminate status. </description> </method> <method name="set_custom_as_button"> @@ -507,6 +514,15 @@ Sets the given column's icon's texture region. </description> </method> + <method name="set_indeterminate"> + <return type="void" /> + <argument index="0" name="column" type="int" /> + <argument index="1" name="indeterminate" type="bool" /> + <description> + If [code]true[/code], the column [code]column[/code] is marked indeterminate. + [b]Note:[/b] If set [code]true[/code] from [code]false[/code], then column is cleared of checked status. + </description> + </method> <method name="set_language"> <return type="void" /> <argument index="0" name="column" type="int" /> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index 4417447891..def6fe5d1f 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -166,13 +166,13 @@ This is useful mostly to check if something changed from a saved version. </description> </method> - <method name="has_redo"> + <method name="has_redo" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if a "redo" action is available. </description> </method> - <method name="has_undo"> + <method name="has_undo" qualifiers="const"> <return type="bool" /> <description> Returns [code]true[/code] if an "undo" action is available. diff --git a/doc/classes/VisualShaderNodeColorFunc.xml b/doc/classes/VisualShaderNodeColorFunc.xml index b9abf85802..8d410104b8 100644 --- a/doc/classes/VisualShaderNodeColorFunc.xml +++ b/doc/classes/VisualShaderNodeColorFunc.xml @@ -36,5 +36,8 @@ return vec3(r, g, b); [/codeblock] </constant> + <constant name="FUNC_MAX" value="2" enum="Function"> + Represents the size of the [enum Function] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeColorOp.xml b/doc/classes/VisualShaderNodeColorOp.xml index 629e84d47b..55b006b098 100644 --- a/doc/classes/VisualShaderNodeColorOp.xml +++ b/doc/classes/VisualShaderNodeColorOp.xml @@ -94,5 +94,8 @@ } [/codeblock] </constant> + <constant name="OP_MAX" value="9" enum="Operator"> + Represents the size of the [enum Operator] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeCompare.xml b/doc/classes/VisualShaderNodeCompare.xml index 9c2331edea..96bb3df494 100644 --- a/doc/classes/VisualShaderNodeCompare.xml +++ b/doc/classes/VisualShaderNodeCompare.xml @@ -37,6 +37,9 @@ <constant name="CTYPE_TRANSFORM" value="4" enum="ComparisonType"> A transform ([code]mat4[/code]) type. </constant> + <constant name="CTYPE_MAX" value="5" enum="ComparisonType"> + Represents the size of the [enum ComparisonType] enum. + </constant> <constant name="FUNC_EQUAL" value="0" enum="Function"> Comparison for equality ([code]a == b[/code]). </constant> @@ -55,11 +58,17 @@ <constant name="FUNC_LESS_THAN_EQUAL" value="5" enum="Function"> Comparison for less than or equal ([code]a <= b[/code]). Cannot be used if [member type] set to [constant CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM]. </constant> + <constant name="FUNC_MAX" value="6" enum="Function"> + Represents the size of the [enum Function] enum. + </constant> <constant name="COND_ALL" value="0" enum="Condition"> The result will be true if all of component in vector satisfy the comparison condition. </constant> <constant name="COND_ANY" value="1" enum="Condition"> The result will be true if any of component in vector satisfy the comparison condition. </constant> + <constant name="COND_MAX" value="2" enum="Condition"> + Represents the size of the [enum Condition] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeCubemap.xml b/doc/classes/VisualShaderNodeCubemap.xml index 13b367e8f2..4a5f58261d 100644 --- a/doc/classes/VisualShaderNodeCubemap.xml +++ b/doc/classes/VisualShaderNodeCubemap.xml @@ -28,6 +28,9 @@ <constant name="SOURCE_PORT" value="1" enum="Source"> Use the [Cubemap] sampler reference passed via the [code]samplerCube[/code] port. If this is set to [member source], the [member cube_map] texture is ignored. </constant> + <constant name="SOURCE_MAX" value="2" enum="Source"> + Represents the size of the [enum Source] enum. + </constant> <constant name="TYPE_DATA" value="0" enum="TextureType"> No hints are added to the uniform declaration. </constant> @@ -37,5 +40,8 @@ <constant name="TYPE_NORMAL_MAP" value="2" enum="TextureType"> Adds [code]hint_normal[/code] as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. </constant> + <constant name="TYPE_MAX" value="3" enum="TextureType"> + Represents the size of the [enum TextureType] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index f6dbd2ad43..3a489419c1 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -16,17 +16,17 @@ <link title="Visual Shader plugins">https://docs.godotengine.org/en/latest/tutorials/plugins/editor/visual_shader_plugins.html</link> </tutorials> <methods> - <method name="_get_category" qualifiers="virtual"> + <method name="_get_category" qualifiers="virtual const"> <return type="String" /> <description> Override this method to define the path to the associated custom node in the Visual Shader Editor's members dialog. The path may look like [code]"MyGame/MyFunctions/Noise"[/code]. Defining this method is [b]optional[/b]. If not overridden, the node will be filed under the "Addons" category. </description> </method> - <method name="_get_code" qualifiers="virtual"> + <method name="_get_code" qualifiers="virtual const"> <return type="String" /> - <argument index="0" name="input_vars" type="Array" /> - <argument index="1" name="output_vars" type="Array" /> + <argument index="0" name="input_vars" type="PackedStringArray" /> + <argument index="1" name="output_vars" type="String[]" /> <argument index="2" name="mode" type="int" /> <argument index="3" name="type" type="int" /> <description> @@ -37,14 +37,14 @@ Defining this method is [b]required[/b]. </description> </method> - <method name="_get_description" qualifiers="virtual"> + <method name="_get_description" qualifiers="virtual const"> <return type="String" /> <description> Override this method to define the description of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is [b]optional[/b]. </description> </method> - <method name="_get_global_code" qualifiers="virtual"> + <method name="_get_global_code" qualifiers="virtual const"> <return type="String" /> <argument index="0" name="mode" type="int" /> <description> @@ -54,22 +54,22 @@ Defining this method is [b]optional[/b]. </description> </method> - <method name="_get_input_port_count" qualifiers="virtual"> + <method name="_get_input_port_count" qualifiers="virtual const"> <return type="int" /> <description> Override this method to define the amount of input ports of the associated custom node. Defining this method is [b]required[/b]. If not overridden, the node has no input ports. </description> </method> - <method name="_get_input_port_name" qualifiers="virtual"> - <return type="StringName" /> + <method name="_get_input_port_name" qualifiers="virtual const"> + <return type="String" /> <argument index="0" name="port" type="int" /> <description> Override this method to define the names of input ports of the associated custom node. The names are used both for the input slots in the editor and as identifiers in the shader code, and are passed in the [code]input_vars[/code] array in [method _get_code]. Defining this method is [b]optional[/b], but recommended. If not overridden, input ports are named as [code]"in" + str(port)[/code]. </description> </method> - <method name="_get_input_port_type" qualifiers="virtual"> + <method name="_get_input_port_type" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="port" type="int" /> <description> @@ -77,29 +77,29 @@ Defining this method is [b]optional[/b], but recommended. If not overridden, input ports will return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type. </description> </method> - <method name="_get_name" qualifiers="virtual"> + <method name="_get_name" qualifiers="virtual const"> <return type="String" /> <description> Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. Defining this method is [b]optional[/b], but recommended. If not overridden, the node will be named as "Unnamed". </description> </method> - <method name="_get_output_port_count" qualifiers="virtual"> + <method name="_get_output_port_count" qualifiers="virtual const"> <return type="int" /> <description> Override this method to define the amount of output ports of the associated custom node. Defining this method is [b]required[/b]. If not overridden, the node has no output ports. </description> </method> - <method name="_get_output_port_name" qualifiers="virtual"> - <return type="StringName" /> + <method name="_get_output_port_name" qualifiers="virtual const"> + <return type="String" /> <argument index="0" name="port" type="int" /> <description> Override this method to define the names of output ports of the associated custom node. The names are used both for the output slots in the editor and as identifiers in the shader code, and are passed in the [code]output_vars[/code] array in [method _get_code]. Defining this method is [b]optional[/b], but recommended. If not overridden, output ports are named as [code]"out" + str(port)[/code]. </description> </method> - <method name="_get_output_port_type" qualifiers="virtual"> + <method name="_get_output_port_type" qualifiers="virtual const"> <return type="int" /> <argument index="0" name="port" type="int" /> <description> @@ -107,14 +107,14 @@ Defining this method is [b]optional[/b], but recommended. If not overridden, output ports will return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type. </description> </method> - <method name="_get_return_icon_type" qualifiers="virtual"> + <method name="_get_return_icon_type" qualifiers="virtual const"> <return type="int" /> <description> Override this method to define the return icon of the associated custom node in the Visual Shader Editor's members dialog. Defining this method is [b]optional[/b]. If not overridden, no return icon is shown. </description> </method> - <method name="_is_highend" qualifiers="virtual"> + <method name="_is_highend" qualifiers="virtual const"> <return type="bool" /> <description> Override this method to enable high-end mark in the Visual Shader Editor's members dialog. diff --git a/doc/classes/VisualShaderNodeFloatFunc.xml b/doc/classes/VisualShaderNodeFloatFunc.xml index bb7486e8cf..ff499d25a6 100644 --- a/doc/classes/VisualShaderNodeFloatFunc.xml +++ b/doc/classes/VisualShaderNodeFloatFunc.xml @@ -112,5 +112,8 @@ <constant name="FUNC_ONEMINUS" value="31" enum="Function"> Subtracts scalar [code]x[/code] from 1 (i.e. [code]1 - x[/code]). </constant> + <constant name="FUNC_MAX" value="32" enum="Function"> + Represents the size of the [enum Function] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeFloatOp.xml b/doc/classes/VisualShaderNodeFloatOp.xml index 2c9ebabb89..ba000f258b 100644 --- a/doc/classes/VisualShaderNodeFloatOp.xml +++ b/doc/classes/VisualShaderNodeFloatOp.xml @@ -46,5 +46,8 @@ <constant name="OP_STEP" value="9" enum="Operator"> Generates a step function by comparing [code]b[/code](x) to [code]a[/code](edge). Returns 0.0 if [code]x[/code] is smaller than [code]edge[/code] and otherwise 1.0. Translates to [code]step(a, b)[/code] in the Godot Shader Language. </constant> + <constant name="OP_ENUM_SIZE" value="10" enum="Operator"> + Represents the size of the [enum Operator] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeFloatUniform.xml b/doc/classes/VisualShaderNodeFloatUniform.xml index 705d5e8796..fcfd78dbea 100644 --- a/doc/classes/VisualShaderNodeFloatUniform.xml +++ b/doc/classes/VisualShaderNodeFloatUniform.xml @@ -40,5 +40,8 @@ <constant name="HINT_RANGE_STEP" value="2" enum="Hint"> A range hint for scalar value with step, which limits possible input values between [member min] and [member max], with a step (increment) of [member step]). Translated to [code]hint_range(min, max, step)[/code] in shader code. </constant> + <constant name="HINT_MAX" value="3" enum="Hint"> + Represents the size of the [enum Hint] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeIntFunc.xml b/doc/classes/VisualShaderNodeIntFunc.xml index a9f4144a01..358a3f3512 100644 --- a/doc/classes/VisualShaderNodeIntFunc.xml +++ b/doc/classes/VisualShaderNodeIntFunc.xml @@ -25,5 +25,8 @@ <constant name="FUNC_SIGN" value="2" enum="Function"> Extracts the sign of the parameter. Translates to [code]sign(x)[/code] in the Godot Shader Language. </constant> + <constant name="FUNC_MAX" value="3" enum="Function"> + Represents the size of the [enum Function] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeIntOp.xml b/doc/classes/VisualShaderNodeIntOp.xml index fc9a0a9a0a..2d55cdaf78 100644 --- a/doc/classes/VisualShaderNodeIntOp.xml +++ b/doc/classes/VisualShaderNodeIntOp.xml @@ -37,5 +37,8 @@ <constant name="OP_MIN" value="6" enum="Operator"> Returns the lesser of two numbers. Translates to [code]max(a, b)[/code] in the Godot Shader Language. </constant> + <constant name="OP_ENUM_SIZE" value="7" enum="Operator"> + Represents the size of the [enum Operator] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeIntUniform.xml b/doc/classes/VisualShaderNodeIntUniform.xml index e39eba865b..4070553884 100644 --- a/doc/classes/VisualShaderNodeIntUniform.xml +++ b/doc/classes/VisualShaderNodeIntUniform.xml @@ -40,5 +40,8 @@ <constant name="HINT_RANGE_STEP" value="2" enum="Hint"> A range hint for scalar value with step, which limits possible input values between [member min] and [member max], with a step (increment) of [member step]). Translated to [code]hint_range(min, max, step)[/code] in shader code. </constant> + <constant name="HINT_MAX" value="3" enum="Hint"> + Represents the size of the [enum Hint] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeIs.xml b/doc/classes/VisualShaderNodeIs.xml index b767a9638e..f46267677e 100644 --- a/doc/classes/VisualShaderNodeIs.xml +++ b/doc/classes/VisualShaderNodeIs.xml @@ -22,5 +22,8 @@ <constant name="FUNC_IS_NAN" value="1" enum="Function"> Comparison with [code]NaN[/code] (Not a Number; denotes invalid numeric results, e.g. division by zero). </constant> + <constant name="FUNC_MAX" value="2" enum="Function"> + Represents the size of the [enum Function] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeParticleAccelerator.xml b/doc/classes/VisualShaderNodeParticleAccelerator.xml index 82aae1df63..2f3f58c0cf 100644 --- a/doc/classes/VisualShaderNodeParticleAccelerator.xml +++ b/doc/classes/VisualShaderNodeParticleAccelerator.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VisualShaderNodeParticleAccelerator" inherits="VisualShaderNodeOutput" version="4.0"> +<class name="VisualShaderNodeParticleAccelerator" inherits="VisualShaderNode" version="4.0"> <brief_description> </brief_description> <description> @@ -20,6 +20,7 @@ <constant name="MODE_TANGENTIAL" value="2" enum="Mode"> </constant> <constant name="MODE_MAX" value="3" enum="Mode"> + Represents the size of the [enum Mode] enum. </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeParticleRandomness.xml b/doc/classes/VisualShaderNodeParticleRandomness.xml index f19723a663..75736992ee 100644 --- a/doc/classes/VisualShaderNodeParticleRandomness.xml +++ b/doc/classes/VisualShaderNodeParticleRandomness.xml @@ -18,6 +18,7 @@ <constant name="OP_TYPE_VECTOR" value="1" enum="OpType"> </constant> <constant name="OP_TYPE_MAX" value="2" enum="OpType"> + Represents the size of the [enum OpType] enum. </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeSample3D.xml b/doc/classes/VisualShaderNodeSample3D.xml index cf6933ab55..82bcac5f69 100644 --- a/doc/classes/VisualShaderNodeSample3D.xml +++ b/doc/classes/VisualShaderNodeSample3D.xml @@ -22,5 +22,8 @@ <constant name="SOURCE_PORT" value="1" enum="Source"> Use the uniform texture from sampler port. </constant> + <constant name="SOURCE_MAX" value="2" enum="Source"> + Represents the size of the [enum Source] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml b/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml index 33777c1e49..305586ac49 100644 --- a/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml +++ b/doc/classes/VisualShaderNodeScalarDerivativeFunc.xml @@ -25,5 +25,8 @@ <constant name="FUNC_Y" value="2" enum="Function"> Derivative in [code]y[/code] using local differencing. </constant> + <constant name="FUNC_MAX" value="3" enum="Function"> + Represents the size of the [enum Function] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeTexture.xml b/doc/classes/VisualShaderNodeTexture.xml index 8fa71b490d..17c079f385 100644 --- a/doc/classes/VisualShaderNodeTexture.xml +++ b/doc/classes/VisualShaderNodeTexture.xml @@ -40,6 +40,9 @@ <constant name="SOURCE_PORT" value="5" enum="Source"> Use the texture provided in the input port for this function. </constant> + <constant name="SOURCE_MAX" value="6" enum="Source"> + Represents the size of the [enum Source] enum. + </constant> <constant name="TYPE_DATA" value="0" enum="TextureType"> No hints are added to the uniform declaration. </constant> @@ -49,5 +52,8 @@ <constant name="TYPE_NORMAL_MAP" value="2" enum="TextureType"> Adds [code]hint_normal[/code] as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. </constant> + <constant name="TYPE_MAX" value="3" enum="TextureType"> + Represents the size of the [enum TextureType] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeTextureUniform.xml b/doc/classes/VisualShaderNodeTextureUniform.xml index 5a7474cca1..492c6010df 100644 --- a/doc/classes/VisualShaderNodeTextureUniform.xml +++ b/doc/classes/VisualShaderNodeTextureUniform.xml @@ -31,11 +31,17 @@ <constant name="TYPE_ANISO" value="3" enum="TextureType"> Adds [code]hint_aniso[/code] as hint to the uniform declaration to use for a flowmap. </constant> + <constant name="TYPE_MAX" value="4" enum="TextureType"> + Represents the size of the [enum TextureType] enum. + </constant> <constant name="COLOR_DEFAULT_WHITE" value="0" enum="ColorDefault"> Defaults to white color. </constant> <constant name="COLOR_DEFAULT_BLACK" value="1" enum="ColorDefault"> Defaults to black color. </constant> + <constant name="COLOR_DEFAULT_MAX" value="2" enum="ColorDefault"> + Represents the size of the [enum ColorDefault] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeTransformFunc.xml b/doc/classes/VisualShaderNodeTransformFunc.xml index 41a58e1458..51b1100e22 100644 --- a/doc/classes/VisualShaderNodeTransformFunc.xml +++ b/doc/classes/VisualShaderNodeTransformFunc.xml @@ -22,5 +22,8 @@ <constant name="FUNC_TRANSPOSE" value="1" enum="Function"> Perform the transpose operation on the [Transform3D] matrix. </constant> + <constant name="FUNC_MAX" value="2" enum="Function"> + Represents the size of the [enum Function] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeTransformOp.xml b/doc/classes/VisualShaderNodeTransformOp.xml index a628fa3e8d..02debd890f 100644 --- a/doc/classes/VisualShaderNodeTransformOp.xml +++ b/doc/classes/VisualShaderNodeTransformOp.xml @@ -43,7 +43,7 @@ <constant name="OP_B_DIV_A" value="8" enum="Operator"> Divides the transform [code]b[/code] by the transform [code]a[/code]. </constant> - <constant name="OP_LIMITER" value="9" enum="Operator"> + <constant name="OP_MAX" value="9" enum="Operator"> Represents the size of the [enum Operator] enum. </constant> </constants> diff --git a/doc/classes/VisualShaderNodeTransformVecMult.xml b/doc/classes/VisualShaderNodeTransformVecMult.xml index 2c9c115d9c..d8f7ebbd55 100644 --- a/doc/classes/VisualShaderNodeTransformVecMult.xml +++ b/doc/classes/VisualShaderNodeTransformVecMult.xml @@ -28,5 +28,8 @@ <constant name="OP_3x3_BxA" value="3" enum="Operator"> Multiplies vector [code]b[/code] by the transform [code]a[/code], skipping the last row and column of the transform. </constant> + <constant name="OP_MAX" value="4" enum="Operator"> + Represents the size of the [enum Operator] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeUniform.xml b/doc/classes/VisualShaderNodeUniform.xml index 83261344bd..561d87af45 100644 --- a/doc/classes/VisualShaderNodeUniform.xml +++ b/doc/classes/VisualShaderNodeUniform.xml @@ -24,5 +24,8 @@ </constant> <constant name="QUAL_INSTANCE" value="2" enum="Qualifier"> </constant> + <constant name="QUAL_MAX" value="3" enum="Qualifier"> + Represents the size of the [enum Qualifier] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorDerivativeFunc.xml b/doc/classes/VisualShaderNodeVectorDerivativeFunc.xml index 859c47bc33..9fd8ba2806 100644 --- a/doc/classes/VisualShaderNodeVectorDerivativeFunc.xml +++ b/doc/classes/VisualShaderNodeVectorDerivativeFunc.xml @@ -25,5 +25,8 @@ <constant name="FUNC_Y" value="2" enum="Function"> Derivative in [code]y[/code] using local differencing. </constant> + <constant name="FUNC_MAX" value="3" enum="Function"> + Represents the size of the [enum Function] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorFunc.xml b/doc/classes/VisualShaderNodeVectorFunc.xml index cbda3dfb46..79bf3f6a07 100644 --- a/doc/classes/VisualShaderNodeVectorFunc.xml +++ b/doc/classes/VisualShaderNodeVectorFunc.xml @@ -121,5 +121,8 @@ <constant name="FUNC_ONEMINUS" value="34" enum="Function"> Returns [code]1.0 - vector[/code]. </constant> + <constant name="FUNC_MAX" value="35" enum="Function"> + Represents the size of the [enum Function] enum. + </constant> </constants> </class> diff --git a/doc/classes/VisualShaderNodeVectorOp.xml b/doc/classes/VisualShaderNodeVectorOp.xml index d56c012f8f..263485d38e 100644 --- a/doc/classes/VisualShaderNodeVectorOp.xml +++ b/doc/classes/VisualShaderNodeVectorOp.xml @@ -52,5 +52,8 @@ <constant name="OP_STEP" value="11" enum="Operator"> Vector step operator. Returns [code]0.0[/code] if [code]a[/code] is smaller than [code]b[/code] and [code]1.0[/code] otherwise. </constant> + <constant name="OP_ENUM_SIZE" value="12" enum="Operator"> + Represents the size of the [enum Operator] enum. + </constant> </constants> </class> diff --git a/doc/classes/float.xml b/doc/classes/float.xml index 60878eb0bd..4bf04fe25f 100644 --- a/doc/classes/float.xml +++ b/doc/classes/float.xml @@ -4,9 +4,13 @@ Float built-in type. </brief_description> <description> - Float built-in type. + The [float] built-in type is a 64-bit double-precision floating-point number, equivalent to [code]double[/code] in C++. This type has 14 reliable decimal digits of precision. The [float] type can be stored in [Variant], which is the generic type used by the engine. The maximum value of [float] is approximately [code]1.79769e308[/code], and the minimum is approximately [code]-1.79769e308[/code]. + Many methods and properties in the engine use 32-bit single-precision floating-point numbers instead, equivalent to [code]float[/code] in C++, which have 6 reliable decimal digits of precision. For data structures such as [Vector2] and [Vector3], Godot uses 32-bit floating-point numbers by default, but it can be changed to use 64-bit doubles if Godot is compiled with the [code]float=64[/code] option. + Math done using the [float] type is not guaranteed to be exact or deterministic, and will often result in small errors. You should usually use the [method @GlobalScope.is_equal_approx] and [method @GlobalScope.is_zero_approx] methods instead of [code]==[/code] to compare [float] values for equality. </description> <tutorials> + <link title="Wikipedia: Double-precision floating-point format">https://en.wikipedia.org/wiki/Double-precision_floating-point_format</link> + <link title="Wikipedia: Single-precision floating-point format">https://en.wikipedia.org/wiki/Single-precision_floating-point_format</link> </tutorials> <methods> <method name="float" qualifiers="constructor"> @@ -231,11 +235,13 @@ <method name="operator unary+" qualifiers="operator"> <return type="float" /> <description> + Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable. </description> </method> <method name="operator unary-" qualifiers="operator"> <return type="float" /> <description> + Returns the negative value of the [float]. If positive, turns the number negative. If negative, turns the number positive. With floats, the number zero can be either positive or negative. </description> </method> </methods> diff --git a/doc/classes/int.xml b/doc/classes/int.xml index 84a01aa0d0..32b5fe1012 100644 --- a/doc/classes/int.xml +++ b/doc/classes/int.xml @@ -327,11 +327,13 @@ <method name="operator unary+" qualifiers="operator"> <return type="int" /> <description> + Returns the same value as if the [code]+[/code] was not there. Unary [code]+[/code] does nothing, but sometimes it can make your code more readable. </description> </method> <method name="operator unary-" qualifiers="operator"> <return type="int" /> <description> + Returns the negated value of the [int]. If positive, turns the number negative. If negative, turns the number positive. If zero, does nothing. </description> </method> <method name="operator |" qualifiers="operator"> diff --git a/doc/tools/makerst.py b/doc/tools/makerst.py index 6f9a07af1f..4691b61e1b 100755 --- a/doc/tools/makerst.py +++ b/doc/tools/makerst.py @@ -1031,9 +1031,6 @@ def make_enum(t, state): # type: (str, State) -> str if c in state.classes and e not in state.classes[c].enums: c = "@GlobalScope" - if not c in state.classes and c.startswith("_"): - c = c[1:] # Remove the underscore prefix - if c in state.classes and e in state.classes[c].enums: return ":ref:`{0}<enum_{1}_{0}>`".format(e, c) |