diff options
Diffstat (limited to 'doc/classes')
30 files changed, 288 insertions, 115 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index ea49b6b634..345a769ca5 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -566,6 +566,26 @@ [b]Warning:[/b] Due to the way it is implemented, this function returns [code]0[/code] rather than [code]1[/code] for non-positive values of [code]value[/code] (in reality, 1 is the smallest integer power of 2). </description> </method> + <method name="pingpong"> + <return type="float" /> + <argument index="0" name="value" type="float" /> + <argument index="1" name="length" type="float" /> + <description> + Returns the [code]value[/code] wrapped between [code]0[/code] and the [code]length[/code]. If the limit is reached, the next value the function returned is decreased to the [code]0[/code] side or increased to the [code]length[/code] side (like a triangle wave). If [code]length[/code] is less than zero, it becomes positive. + [codeblock] + pingpong(-3.0, 3.0) # Returns 3 + pingpong(-2.0, 3.0) # Returns 2 + pingpong(-1.0, 3.0) # Returns 1 + pingpong(0.0, 3.0) # Returns 0 + pingpong(1.0, 3.0) # Returns 1 + pingpong(2.0, 3.0) # Returns 2 + pingpong(3.0, 3.0) # Returns 3 + pingpong(4.0, 3.0) # Returns 2 + pingpong(5.0, 3.0) # Returns 1 + pingpong(6.0, 3.0) # Returns 0 + [/codeblock] + </description> + </method> <method name="posmod"> <return type="int" /> <argument index="0" name="x" type="int" /> diff --git a/doc/classes/AABB.xml b/doc/classes/AABB.xml index f353cd19b8..15d146fba1 100644 --- a/doc/classes/AABB.xml +++ b/doc/classes/AABB.xml @@ -54,7 +54,22 @@ <return type="AABB" /> <argument index="0" name="to_point" type="Vector3" /> <description> - Returns this [AABB] expanded to include a given point. + Returns a copy of this [AABB] expanded to include a given point. + [b]Example:[/b] + [codeblocks] + [gdscript] + # position (-3, 2, 0), size (1, 1, 1) + var box = AABB(Vector3(-3, 2, 0), Vector3(1, 1, 1)) + # position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2) + var box2 = box.expand(Vector3(0, -1, 2)) + [/gdscript] + [csharp] + // position (-3, 2, 0), size (1, 1, 1) + var box = new AABB(new Vector3(-3, 2, 0), new Vector3(1, 1, 1)); + // position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and Vector3(0, -1, 2) + var box2 = box.Expand(new Vector3(0, -1, 2)); + [/csharp] + [/codeblocks] </description> </method> <method name="get_center" qualifiers="const"> diff --git a/doc/classes/Animation.xml b/doc/classes/Animation.xml index e3bb60f6de..dca943dec6 100644 --- a/doc/classes/Animation.xml +++ b/doc/classes/Animation.xml @@ -551,8 +551,8 @@ The total length of the animation (in seconds). [b]Note:[/b] Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping. </member> - <member name="loop" type="bool" setter="set_loop" getter="has_loop" default="false"> - A flag indicating that the animation must loop. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation. + <member name="loop_mode" type="int" setter="set_loop_mode" getter="get_loop_mode" enum="Animation.LoopMode" default="0"> + Determines the behavior of both ends of the animation timeline during animation playback. This is used for correct interpolation of animation cycles, and for hinting the player that it must restart the animation. </member> <member name="step" type="float" setter="set_step" getter="get_step" default="0.1"> The animation step value. @@ -610,5 +610,14 @@ <constant name="UPDATE_CAPTURE" value="3" enum="UpdateMode"> Same as linear interpolation, but also interpolates from the current value (i.e. dynamically at runtime) if the first key isn't at 0 seconds. </constant> + <constant name="LOOP_NONE" value="0" enum="LoopMode"> + At both ends of the animation, the animation will stop playing. + </constant> + <constant name="LOOP_LINEAR" value="1" enum="LoopMode"> + At both ends of the animation, the animation will be repeated without changing the playback direction. + </constant> + <constant name="LOOP_PINGPONG" value="2" enum="LoopMode"> + Repeats playback and reverse playback at both ends of the animation. + </constant> </constants> </class> diff --git a/doc/classes/AnimationNode.xml b/doc/classes/AnimationNode.xml index 173ff43d2a..6bc44ea0a0 100644 --- a/doc/classes/AnimationNode.xml +++ b/doc/classes/AnimationNode.xml @@ -73,6 +73,7 @@ <argument index="2" name="delta" type="float" /> <argument index="3" name="seeked" type="bool" /> <argument index="4" name="blend" type="float" /> + <argument index="5" name="pingponged" type="int" default="0" /> <description> Blend an animation by [code]blend[/code] amount (name must be valid in the linked [AnimationPlayer]). A [code]time[/code] and [code]delta[/code] may be passed, as well as whether [code]seek[/code] happened. </description> diff --git a/doc/classes/AnimationNodeAnimation.xml b/doc/classes/AnimationNodeAnimation.xml index 668a35226f..076e675007 100644 --- a/doc/classes/AnimationNodeAnimation.xml +++ b/doc/classes/AnimationNodeAnimation.xml @@ -15,5 +15,14 @@ <member name="animation" type="StringName" setter="set_animation" getter="get_animation" default="&"""> Animation to use as an output. It is one of the animations provided by [member AnimationTree.anim_player]. </member> + <member name="play_mode" type="int" setter="set_play_mode" getter="get_play_mode" enum="AnimationNodeAnimation.PlayMode" default="0"> + Determines the playback direction of the animation. + </member> </members> + <constants> + <constant name="PLAY_MODE_FORWARD" value="0" enum="PlayMode"> + </constant> + <constant name="PLAY_MODE_BACKWARD" value="1" enum="PlayMode"> + </constant> + </constants> </class> diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index c6a3f87042..8abdaac45f 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -50,6 +50,9 @@ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. See [member ProjectSettings.physics/2d/default_angular_damp] for more details about damping. </member> + <member name="angular_damp_space_override" type="int" setter="set_angular_damp_space_override_mode" getter="get_angular_damp_space_override_mode" enum="Area2D.SpaceOverride" default="0"> + Override mode for angular damping calculations within this area. See [enum SpaceOverride] for possible values. + </member> <member name="audio_bus_name" type="StringName" setter="set_audio_bus_name" getter="get_audio_bus_name" default="&"Master""> The name of the area's audio bus. </member> @@ -57,21 +60,30 @@ If [code]true[/code], the area's audio bus overrides the default audio bus. </member> <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" default="980.0"> - The area's gravity intensity (in pixels per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. + The area's gravity intensity (in pixels per second squared). This value multiplies the gravity direction. This is useful to alter the force of gravity without altering its direction. </member> - <member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale" default="0.0"> - The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. + <member name="gravity_direction" type="Vector2" setter="set_gravity_direction" getter="get_gravity_direction" default="Vector2(0, 1)"> + The area's gravity vector (not normalized). </member> <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" default="false"> - If [code]true[/code], gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override]. + If [code]true[/code], gravity is calculated from a point (set via [member gravity_point_center]). See also [member gravity_space_override]. </member> - <member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector" default="Vector2(0, 1)"> - The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction. + <member name="gravity_point_center" type="Vector2" setter="set_gravity_point_center" getter="get_gravity_point_center" default="Vector2(0, 1)"> + If gravity is a point (see [member gravity_point]), this will be the point of attraction. + </member> + <member name="gravity_point_distance_scale" type="float" setter="set_gravity_point_distance_scale" getter="get_gravity_point_distance_scale" default="0.0"> + The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. + </member> + <member name="gravity_space_override" type="int" setter="set_gravity_space_override_mode" getter="get_gravity_space_override_mode" enum="Area2D.SpaceOverride" default="0"> + Override mode for gravity calculations within this area. See [enum SpaceOverride] for possible values. </member> <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.1"> The rate at which objects stop moving in this area. Represents the linear velocity lost per second. See [member ProjectSettings.physics/2d/default_linear_damp] for more details about damping. </member> + <member name="linear_damp_space_override" type="int" setter="set_linear_damp_space_override_mode" getter="get_linear_damp_space_override_mode" enum="Area2D.SpaceOverride" default="0"> + Override mode for linear damping calculations within this area. See [enum SpaceOverride] for possible values. + </member> <member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" default="true"> If [code]true[/code], other monitoring areas can detect this area. </member> @@ -81,9 +93,6 @@ <member name="priority" type="float" setter="set_priority" getter="get_priority" default="0.0"> The area's priority. Higher priority areas are processed first. </member> - <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area2D.SpaceOverride" default="0"> - Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values. - </member> </members> <signals> <signal name="area_entered"> diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index 571fd8cad3..450ed44307 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -48,6 +48,9 @@ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. See [member ProjectSettings.physics/3d/default_angular_damp] for more details about damping. </member> + <member name="angular_damp_space_override" type="int" setter="set_angular_damp_space_override_mode" getter="get_angular_damp_space_override_mode" enum="Area3D.SpaceOverride" default="0"> + Override mode for angular damping calculations within this area. See [enum SpaceOverride] for possible values. + </member> <member name="audio_bus_name" type="StringName" setter="set_audio_bus_name" getter="get_audio_bus_name" default="&"Master""> The name of the area's audio bus. </member> @@ -55,21 +58,30 @@ If [code]true[/code], the area's audio bus overrides the default audio bus. </member> <member name="gravity" type="float" setter="set_gravity" getter="get_gravity" default="9.8"> - The area's gravity intensity (in meters per second squared). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction. + The area's gravity intensity (in meters per second squared). This value multiplies the gravity direction. This is useful to alter the force of gravity without altering its direction. </member> - <member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale" default="0.0"> - The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. + <member name="gravity_direction" type="Vector3" setter="set_gravity_direction" getter="get_gravity_direction" default="Vector3(0, -1, 0)"> + The area's gravity vector (not normalized). </member> <member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point" default="false"> - If [code]true[/code], gravity is calculated from a point (set via [member gravity_vec]). See also [member space_override]. + If [code]true[/code], gravity is calculated from a point (set via [member gravity_point_center]). See also [member gravity_space_override]. </member> - <member name="gravity_vec" type="Vector3" setter="set_gravity_vector" getter="get_gravity_vector" default="Vector3(0, -1, 0)"> - The area's gravity vector (not normalized). If gravity is a point (see [member gravity_point]), this will be the point of attraction. + <member name="gravity_point_center" type="Vector3" setter="set_gravity_point_center" getter="get_gravity_point_center" default="Vector3(0, -1, 0)"> + If gravity is a point (see [member gravity_point]), this will be the point of attraction. + </member> + <member name="gravity_point_distance_scale" type="float" setter="set_gravity_point_distance_scale" getter="get_gravity_point_distance_scale" default="0.0"> + The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance. + </member> + <member name="gravity_space_override" type="int" setter="set_gravity_space_override_mode" getter="get_gravity_space_override_mode" enum="Area3D.SpaceOverride" default="0"> + Override mode for gravity calculations within this area. See [enum SpaceOverride] for possible values. </member> <member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp" default="0.1"> The rate at which objects stop moving in this area. Represents the linear velocity lost per second. See [member ProjectSettings.physics/3d/default_linear_damp] for more details about damping. </member> + <member name="linear_damp_space_override" type="int" setter="set_linear_damp_space_override_mode" getter="get_linear_damp_space_override_mode" enum="Area3D.SpaceOverride" default="0"> + Override mode for linear damping calculations within this area. See [enum SpaceOverride] for possible values. + </member> <member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable" default="true"> If [code]true[/code], other monitoring areas can detect this area. </member> @@ -91,9 +103,6 @@ <member name="reverb_bus_uniformity" type="float" setter="set_reverb_uniformity" getter="get_reverb_uniformity" default="0.0"> The degree to which this area's reverb is a uniform effect. Ranges from [code]0[/code] to [code]1[/code] with [code]0.1[/code] precision. </member> - <member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area3D.SpaceOverride" default="0"> - Override mode for gravity and damping calculations within this area. See [enum SpaceOverride] for possible values. - </member> <member name="wind_attenuation_factor" type="float" setter="set_wind_attenuation_factor" getter="get_wind_attenuation_factor" default="0.0"> The exponential rate at which wind force decreases with distance from its origin. </member> diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml index 7e1155d89b..df7b5ff1c7 100644 --- a/doc/classes/AudioStreamSample.xml +++ b/doc/classes/AudioStreamSample.xml @@ -61,7 +61,7 @@ <constant name="LOOP_FORWARD" value="1" enum="LoopMode"> Audio loops the data between [member loop_begin] and [member loop_end], playing forward only. </constant> - <constant name="LOOP_PING_PONG" value="2" enum="LoopMode"> + <constant name="LOOP_PINGPONG" value="2" enum="LoopMode"> Audio loops the data between [member loop_begin] and [member loop_end], playing back and forth. </constant> <constant name="LOOP_BACKWARD" value="3" enum="LoopMode"> diff --git a/doc/classes/Color.xml b/doc/classes/Color.xml index 71ec225cf6..650f10a97f 100644 --- a/doc/classes/Color.xml +++ b/doc/classes/Color.xml @@ -147,6 +147,24 @@ <description> </description> </method> + <method name="from_hsv" qualifiers="static"> + <return type="Color" /> + <argument index="0" name="h" type="float" /> + <argument index="1" name="s" type="float" /> + <argument index="2" name="v" type="float" /> + <argument index="3" name="alpha" type="float" default="1.0" /> + <description> + Constructs a color from an [url=https://en.wikipedia.org/wiki/HSL_and_HSV]HSV profile[/url]. [code]h[/code] (hue), [code]s[/code] (saturation), and [code]v[/code] (value) are typically between 0 and 1. + [codeblocks] + [gdscript] + var c = Color.from_hsv(0.58, 0.5, 0.79, 0.8) + [/gdscript] + [csharp] + var c = Color.FromHsv(0.58f, 0.5f, 0.79f, 0.8f); + [/csharp] + [/codeblocks] + </description> + </method> <method name="from_rgbe9995" qualifiers="static"> <return type="Color" /> <argument index="0" name="rgbe" type="int" /> diff --git a/doc/classes/EditorInspectorPlugin.xml b/doc/classes/EditorInspectorPlugin.xml index f65e974d47..bc5df47d57 100644 --- a/doc/classes/EditorInspectorPlugin.xml +++ b/doc/classes/EditorInspectorPlugin.xml @@ -25,8 +25,9 @@ </method> <method name="_parse_begin" qualifiers="virtual"> <return type="void" /> + <argument index="0" name="object" type="Object" /> <description> - Called to allow adding controls at the beginning of the list. + Called to allow adding controls at the beginning of the property list for [code]object[/code]. </description> </method> <method name="_parse_category" qualifiers="virtual"> @@ -34,12 +35,22 @@ <argument index="0" name="object" type="Object" /> <argument index="1" name="category" type="String" /> <description> + Called to allow adding controls at the beginning of a category in the property list for [code]object[/code]. </description> </method> <method name="_parse_end" qualifiers="virtual"> <return type="void" /> + <argument index="0" name="object" type="Object" /> + <description> + Called to allow adding controls at the end of the property list for [code]object[/code]. + </description> + </method> + <method name="_parse_group" qualifiers="virtual"> + <return type="void" /> + <argument index="0" name="object" type="Object" /> + <argument index="1" name="group" type="String" /> <description> - Called to allow adding controls at the end of the list. + Called to allow adding controls at the beginning of a group or a sub-group in the property list for [code]object[/code]. </description> </method> <method name="_parse_property" qualifiers="virtual"> @@ -52,7 +63,7 @@ <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. + Called to allow adding property-specific editors to the property list for [code]object[/code]. The added editor control must extend [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> </method> <method name="add_custom_control"> diff --git a/doc/classes/NavigationPolygon.xml b/doc/classes/NavigationPolygon.xml index 5b5b7c42ef..7ecdca8793 100644 --- a/doc/classes/NavigationPolygon.xml +++ b/doc/classes/NavigationPolygon.xml @@ -28,7 +28,7 @@ var polygon = NavigationPolygon.new() var vertices = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) polygon.vertices = vertices - var indices = PackedInt32Array(0, 3, 1) + var indices = PackedInt32Array([0, 1, 2, 3]) polygon.add_polygon(indices) $NavigationRegion2D.navpoly = polygon [/gdscript] @@ -36,7 +36,7 @@ var polygon = new NavigationPolygon(); var vertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; polygon.Vertices = vertices; - var indices = new int[] { 0, 3, 1 }; + var indices = new int[] { 0, 1, 2, 3 }; polygon.AddPolygon(indices); GetNode<NavigationRegion2D>("NavigationRegion2D").Navpoly = polygon; [/csharp] diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 843db8c174..3745b394e0 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -228,11 +228,6 @@ If [code]include_internal[/code] is [code]false[/code], the returned array won't include internal children (see [code]internal[/code] parameter in [method add_child]). </description> </method> - <method name="get_editor_description" qualifiers="const"> - <return type="String" /> - <description> - </description> - </method> <method name="get_groups" qualifiers="const"> <return type="Array" /> <description> @@ -618,12 +613,6 @@ Sets the editable children state of [code]node[/code] relative to this node. This method is only intended for use with editor tooling. </description> </method> - <method name="set_editor_description"> - <return type="void" /> - <argument index="0" name="editor_description" type="String" /> - <description> - </description> - </method> <method name="set_multiplayer_authority"> <return type="void" /> <argument index="0" name="id" type="int" /> @@ -702,6 +691,9 @@ <member name="custom_multiplayer" type="MultiplayerAPI" setter="set_custom_multiplayer" getter="get_custom_multiplayer"> The override to the default [MultiplayerAPI]. Set to [code]null[/code] to use the default [SceneTree] one. </member> + <member name="editor_description" type="String" setter="set_editor_description" getter="get_editor_description" default=""""> + Add a custom description to a node. + </member> <member name="multiplayer" type="MultiplayerAPI" setter="" getter="get_multiplayer"> The [MultiplayerAPI] instance associated with this node. Either the [member custom_multiplayer], or the default SceneTree one (if inside tree). </member> diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml index e108ab6298..7775cfb2f9 100644 --- a/doc/classes/PhysicsBody2D.xml +++ b/doc/classes/PhysicsBody2D.xml @@ -30,7 +30,7 @@ <argument index="2" name="safe_margin" type="float" default="0.08" /> <description> Moves the body along the vector [code]linear_velocity[/code]. 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. - The body will stop if it collides. Returns a [KinematicCollision2D], which contains information about the collision. + The body will stop if it collides. Returns a [KinematicCollision2D], which contains information about the collision when stopped, or when touching another body along the motion. If [code]test_only[/code] is [code]true[/code], the body does not move but the would-be collision information is given. [code]safe_margin[/code] is the extra margin used for collision recovery (see [member CharacterBody2D.collision/safe_margin] for more details). </description> @@ -50,8 +50,8 @@ <argument index="3" name="safe_margin" type="float" default="0.08" /> <description> Checks for collisions without moving the body. 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. - Virtually sets the node's position, scale and rotation to that of the given [Transform2D], then tries to move the body along the vector [code]linear_velocity[/code]. Returns [code]true[/code] if a collision would occur. - [code]collision[/code] is an optional object of type [KinematicCollision2D], which contains additional information about the collision (should there be one). + Virtually sets the node's position, scale and rotation to that of the given [Transform2D], then tries to move the body along the vector [code]linear_velocity[/code]. Returns [code]true[/code] if a collision would stop the body from moving along the whole path. + [code]collision[/code] is an optional object of type [KinematicCollision2D], which contains additional information about the collision when stopped, or when touching another body along the motion. [code]safe_margin[/code] is the extra margin used for collision recovery (see [member CharacterBody2D.collision/safe_margin] for more details). </description> </method> diff --git a/doc/classes/PhysicsBody3D.xml b/doc/classes/PhysicsBody3D.xml index 8718c0caa2..9cf587f2e0 100644 --- a/doc/classes/PhysicsBody3D.xml +++ b/doc/classes/PhysicsBody3D.xml @@ -38,7 +38,7 @@ <argument index="3" name="max_collisions" type="int" default="1" /> <description> Moves the body along the vector [code]linear_velocity[/code]. 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. - The body will stop if it collides. Returns a [KinematicCollision3D], which contains information about the collision. + The body will stop if it collides. Returns a [KinematicCollision3D], which contains information about the collision when stopped, or when touching another body along the motion. If [code]test_only[/code] is [code]true[/code], the body does not move but the would-be collision information is given. [code]safe_margin[/code] is the extra margin used for collision recovery (see [member CharacterBody3D.collision/safe_margin] for more details). [code]max_collisions[/code] allows to retrieve more than one collision result. @@ -68,8 +68,8 @@ <argument index="4" name="max_collisions" type="int" default="1" /> <description> Checks for collisions without moving the body. 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. - Virtually sets the node's position, scale and rotation to that of the given [Transform3D], then tries to move the body along the vector [code]linear_velocity[/code]. Returns [code]true[/code] if a collision would occur. - [code]collision[/code] is an optional object of type [KinematicCollision3D], which contains additional information about the collision (should there be one). + Virtually sets the node's position, scale and rotation to that of the given [Transform3D], then tries to move the body along the vector [code]linear_velocity[/code]. Returns [code]true[/code] if a collision would stop the body from moving along the whole path. + [code]collision[/code] is an optional object of type [KinematicCollision3D], which contains additional information about the collision when stopped, or when touching another body along the motion. [code]safe_margin[/code] is the extra margin used for collision recovery (see [member CharacterBody3D.collision/safe_margin] for more details). [code]max_collisions[/code] allows to retrieve more than one collision result. </description> diff --git a/doc/classes/PhysicsDirectSpaceState2D.xml b/doc/classes/PhysicsDirectSpaceState2D.xml index 5892ef266f..107d276df2 100644 --- a/doc/classes/PhysicsDirectSpaceState2D.xml +++ b/doc/classes/PhysicsDirectSpaceState2D.xml @@ -64,7 +64,7 @@ Intersects a ray in a given space. Ray position and other parameters are defined through [PhysicsRayQueryParameters2D]. The returned object is a dictionary with the following fields: [code]collider[/code]: The colliding object. [code]collider_id[/code]: The colliding object's ID. - [code]normal[/code]: The object's surface normal at the intersection point. + [code]normal[/code]: The object's surface normal at the intersection point, or [code]Vector2(0, 0)[/code] if the ray starts inside the shape and [member PhysicsRayQueryParameters2D.hit_from_inside] is [code]true[/code]. [code]position[/code]: The intersection point. [code]rid[/code]: The intersecting object's [RID]. [code]shape[/code]: The shape index of the colliding shape. diff --git a/doc/classes/PhysicsDirectSpaceState3D.xml b/doc/classes/PhysicsDirectSpaceState3D.xml index 6a7fe46518..349ce31ab4 100644 --- a/doc/classes/PhysicsDirectSpaceState3D.xml +++ b/doc/classes/PhysicsDirectSpaceState3D.xml @@ -65,7 +65,7 @@ Intersects a ray in a given space. Ray position and other parameters are defined through [PhysicsRayQueryParameters3D]. The returned object is a dictionary with the following fields: [code]collider[/code]: The colliding object. [code]collider_id[/code]: The colliding object's ID. - [code]normal[/code]: The object's surface normal at the intersection point. + [code]normal[/code]: The object's surface normal at the intersection point, or [code]Vector3(0, 0, 0)[/code] if the ray starts inside the shape and [member PhysicsRayQueryParameters3D.hit_from_inside] is [code]true[/code]. [code]position[/code]: The intersection point. [code]rid[/code]: The intersecting object's [RID]. [code]shape[/code]: The shape index of the colliding shape. diff --git a/doc/classes/PhysicsRayQueryParameters2D.xml b/doc/classes/PhysicsRayQueryParameters2D.xml index 0e99e47286..b71b48f223 100644 --- a/doc/classes/PhysicsRayQueryParameters2D.xml +++ b/doc/classes/PhysicsRayQueryParameters2D.xml @@ -24,6 +24,9 @@ <member name="from" type="Vector2" setter="set_from" getter="get_from" default="Vector2(0, 0)"> The starting point of the ray being queried for, in global coordinates. </member> + <member name="hit_from_inside" type="bool" setter="set_hit_from_inside" getter="is_hit_from_inside_enabled" default="false"> + If [code]true[/code], the query will detect a hit when starting inside shapes. In this case the collision normal will be [code]Vector2(0, 0)[/code]. Does not affect concave polygon shapes. + </member> <member name="to" type="Vector2" setter="set_to" getter="get_to" default="Vector2(0, 0)"> The ending point of the ray being queried for, in global coordinates. </member> diff --git a/doc/classes/PhysicsRayQueryParameters3D.xml b/doc/classes/PhysicsRayQueryParameters3D.xml index dbd09e5128..3085ff3b35 100644 --- a/doc/classes/PhysicsRayQueryParameters3D.xml +++ b/doc/classes/PhysicsRayQueryParameters3D.xml @@ -24,6 +24,12 @@ <member name="from" type="Vector3" setter="set_from" getter="get_from" default="Vector3(0, 0, 0)"> The starting point of the ray being queried for, in global coordinates. </member> + <member name="hit_back_faces" type="bool" setter="set_hit_back_faces" getter="is_hit_back_faces_enabled" default="true"> + If [code]true[/code], the query will hit back faces with concave polygon shapes with back face enabled or heightmap shapes. + </member> + <member name="hit_from_inside" type="bool" setter="set_hit_from_inside" getter="is_hit_from_inside_enabled" default="false"> + If [code]true[/code], the query will detect a hit when starting inside shapes. In this case the collision normal will be [code]Vector3(0, 0, 0)[/code]. Does not affect concave polygon shapes or heightmap shapes. + </member> <member name="to" type="Vector3" setter="set_to" getter="get_to" default="Vector3(0, 0, 0)"> The ending point of the ray being queried for, in global coordinates. </member> diff --git a/doc/classes/PhysicsServer2D.xml b/doc/classes/PhysicsServer2D.xml index 7368fe06ab..868b58ea9f 100644 --- a/doc/classes/PhysicsServer2D.xml +++ b/doc/classes/PhysicsServer2D.xml @@ -98,13 +98,6 @@ Returns the space assigned to the area. </description> </method> - <method name="area_get_space_override_mode" qualifiers="const"> - <return type="int" enum="PhysicsServer2D.AreaSpaceOverrideMode" /> - <argument index="0" name="area" type="RID" /> - <description> - Returns the space override mode for the area. - </description> - </method> <method name="area_get_transform" qualifiers="const"> <return type="Transform2D" /> <argument index="0" name="area" type="RID" /> @@ -207,14 +200,6 @@ Assigns a space to the area. </description> </method> - <method name="area_set_space_override_mode"> - <return type="void" /> - <argument index="0" name="area" type="RID" /> - <argument index="1" name="mode" type="int" enum="PhysicsServer2D.AreaSpaceOverrideMode" /> - <description> - Sets the space override mode for the area. See [enum AreaSpaceOverrideMode] for a list of available modes. - </description> - </method> <method name="area_set_transform"> <return type="void" /> <argument index="0" name="area" type="RID" /> @@ -346,7 +331,7 @@ <return type="PhysicsDirectBodyState2D" /> <argument index="0" name="body" type="RID" /> <description> - Returns the [PhysicsDirectBodyState2D] of the body. + Returns the [PhysicsDirectBodyState2D] of the body. Returns [code]null[/code] if the body is destroyed or removed from the physics space. </description> </method> <method name="body_get_max_contacts_reported" qualifiers="const"> @@ -855,28 +840,37 @@ <constant name="SHAPE_CUSTOM" value="8" enum="ShapeType"> This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. </constant> - <constant name="AREA_PARAM_GRAVITY" value="0" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_OVERRIDE_MODE" value="0" enum="AreaParameter"> + Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. + </constant> + <constant name="AREA_PARAM_GRAVITY" value="1" enum="AreaParameter"> Constant to set/get gravity strength in an area. </constant> - <constant name="AREA_PARAM_GRAVITY_VECTOR" value="1" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_VECTOR" value="2" enum="AreaParameter"> Constant to set/get gravity vector/center in an area. </constant> - <constant name="AREA_PARAM_GRAVITY_IS_POINT" value="2" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_IS_POINT" value="3" enum="AreaParameter"> Constant to set/get whether the gravity vector of an area is a direction, or a center point. </constant> - <constant name="AREA_PARAM_GRAVITY_DISTANCE_SCALE" value="3" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_DISTANCE_SCALE" value="4" enum="AreaParameter"> Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance. </constant> - <constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="4" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="5" enum="AreaParameter"> This constant was used to set/get the falloff factor for point gravity. It has been superseded by [constant AREA_PARAM_GRAVITY_DISTANCE_SCALE]. </constant> - <constant name="AREA_PARAM_LINEAR_DAMP" value="5" enum="AreaParameter"> - Constant to set/get the linear dampening factor of an area. + <constant name="AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE" value="6" enum="AreaParameter"> + Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. + </constant> + <constant name="AREA_PARAM_LINEAR_DAMP" value="7" enum="AreaParameter"> + Constant to set/get the linear damping factor of an area. + </constant> + <constant name="AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE" value="8" enum="AreaParameter"> + Constant to set/get angular damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. </constant> - <constant name="AREA_PARAM_ANGULAR_DAMP" value="6" enum="AreaParameter"> - Constant to set/get the angular dampening factor of an area. + <constant name="AREA_PARAM_ANGULAR_DAMP" value="9" enum="AreaParameter"> + Constant to set/get the angular damping factor of an area. </constant> - <constant name="AREA_PARAM_PRIORITY" value="7" enum="AreaParameter"> + <constant name="AREA_PARAM_PRIORITY" value="10" enum="AreaParameter"> Constant to set/get the priority (order of processing) of an area. </constant> <constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0" enum="AreaSpaceOverrideMode"> diff --git a/doc/classes/PhysicsServer3D.xml b/doc/classes/PhysicsServer3D.xml index 0f02cdf92f..dd8003be1d 100644 --- a/doc/classes/PhysicsServer3D.xml +++ b/doc/classes/PhysicsServer3D.xml @@ -85,13 +85,6 @@ Returns the space assigned to the area. </description> </method> - <method name="area_get_space_override_mode" qualifiers="const"> - <return type="int" enum="PhysicsServer3D.AreaSpaceOverrideMode" /> - <argument index="0" name="area" type="RID" /> - <description> - Returns the space override mode for the area. - </description> - </method> <method name="area_get_transform" qualifiers="const"> <return type="Transform3D" /> <argument index="0" name="area" type="RID" /> @@ -201,14 +194,6 @@ Assigns a space to the area. </description> </method> - <method name="area_set_space_override_mode"> - <return type="void" /> - <argument index="0" name="area" type="RID" /> - <argument index="1" name="mode" type="int" enum="PhysicsServer3D.AreaSpaceOverrideMode" /> - <description> - Sets the space override mode for the area. The modes are described in the [enum AreaSpaceOverrideMode] constants. - </description> - </method> <method name="area_set_transform"> <return type="void" /> <argument index="0" name="area" type="RID" /> @@ -320,7 +305,7 @@ <return type="PhysicsDirectBodyState3D" /> <argument index="0" name="body" type="RID" /> <description> - Returns the [PhysicsDirectBodyState3D] of the body. + Returns the [PhysicsDirectBodyState3D] of the body. Returns [code]null[/code] if the body is destroyed or removed from the physics space. </description> </method> <method name="body_get_max_contacts_reported" qualifiers="const"> @@ -1211,40 +1196,49 @@ <constant name="SHAPE_CUSTOM" value="10" enum="ShapeType"> This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. </constant> - <constant name="AREA_PARAM_GRAVITY" value="0" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_OVERRIDE_MODE" value="0" enum="AreaParameter"> + Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. + </constant> + <constant name="AREA_PARAM_GRAVITY" value="1" enum="AreaParameter"> Constant to set/get gravity strength in an area. </constant> - <constant name="AREA_PARAM_GRAVITY_VECTOR" value="1" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_VECTOR" value="2" enum="AreaParameter"> Constant to set/get gravity vector/center in an area. </constant> - <constant name="AREA_PARAM_GRAVITY_IS_POINT" value="2" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_IS_POINT" value="3" enum="AreaParameter"> Constant to set/get whether the gravity vector of an area is a direction, or a center point. </constant> - <constant name="AREA_PARAM_GRAVITY_DISTANCE_SCALE" value="3" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_DISTANCE_SCALE" value="4" enum="AreaParameter"> Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance. </constant> - <constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="4" enum="AreaParameter"> + <constant name="AREA_PARAM_GRAVITY_POINT_ATTENUATION" value="5" enum="AreaParameter"> This constant was used to set/get the falloff factor for point gravity. It has been superseded by [constant AREA_PARAM_GRAVITY_DISTANCE_SCALE]. </constant> - <constant name="AREA_PARAM_LINEAR_DAMP" value="5" enum="AreaParameter"> - Constant to set/get the linear dampening factor of an area. + <constant name="AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE" value="6" enum="AreaParameter"> + Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. + </constant> + <constant name="AREA_PARAM_LINEAR_DAMP" value="7" enum="AreaParameter"> + Constant to set/get the linear damping factor of an area. + </constant> + <constant name="AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE" value="8" enum="AreaParameter"> + Constant to set/get angular damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. </constant> - <constant name="AREA_PARAM_ANGULAR_DAMP" value="6" enum="AreaParameter"> - Constant to set/get the angular dampening factor of an area. + <constant name="AREA_PARAM_ANGULAR_DAMP" value="9" enum="AreaParameter"> + Constant to set/get the angular damping factor of an area. </constant> - <constant name="AREA_PARAM_PRIORITY" value="7" enum="AreaParameter"> + <constant name="AREA_PARAM_PRIORITY" value="10" enum="AreaParameter"> Constant to set/get the priority (order of processing) of an area. </constant> - <constant name="AREA_PARAM_WIND_FORCE_MAGNITUDE" value="8" enum="AreaParameter"> + <constant name="AREA_PARAM_WIND_FORCE_MAGNITUDE" value="11" enum="AreaParameter"> Constant to set/get the magnitude of area-specific wind force. </constant> - <constant name="AREA_PARAM_WIND_SOURCE" value="9" enum="AreaParameter"> + <constant name="AREA_PARAM_WIND_SOURCE" value="12" enum="AreaParameter"> Constant to set/get the 3D vector that specifies the origin from which an area-specific wind blows. </constant> - <constant name="AREA_PARAM_WIND_DIRECTION" value="10" enum="AreaParameter"> + <constant name="AREA_PARAM_WIND_DIRECTION" value="13" enum="AreaParameter"> Constant to set/get the 3D vector that specifies the direction in which an area-specific wind blows. </constant> - <constant name="AREA_PARAM_WIND_ATTENUATION_FACTOR" value="11" enum="AreaParameter"> + <constant name="AREA_PARAM_WIND_ATTENUATION_FACTOR" value="14" enum="AreaParameter"> Constant to set/get the exponential rate at which wind force decreases with distance from its origin. </constant> <constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0" enum="AreaSpaceOverrideMode"> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 30409814d2..abdd8138ad 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -289,7 +289,9 @@ Safer override for [member audio/driver/mix_rate] in the Web platform. Here [code]0[/code] means "let the browser choose" (since some browsers do not like forcing the mix rate). </member> <member name="audio/driver/output_latency" type="int" setter="" getter="" default="15"> - Output latency in milliseconds for audio. Lower values will result in lower audio latency at the cost of increased CPU usage. Low values may result in audible cracking on slower hardware. + Specifies the preferred output latency in milliseconds for audio. Lower values will result in lower audio latency at the cost of increased CPU usage. Low values may result in audible cracking on slower hardware. + Audio output latency may be constrained by the host operating system and audio hardware drivers. If the host can not provide the specified audio output latency then Godot will attempt to use the nearest latency allowed by the host. As such you should always use [method AudioServer.get_output_latency] to determine the actual audio output latency. + [b]Note:[/b] This setting is ignored on all versions of Windows prior to Windows 10. </member> <member name="audio/driver/output_latency.web" type="int" setter="" getter="" default="50"> Safer override for [member audio/driver/output_latency] in the Web platform, to avoid audio issues especially on mobile devices. @@ -1315,9 +1317,9 @@ </member> <member name="mono/profiler/enabled" type="bool" setter="" getter="" default="false"> </member> - <member name="mono/project/auto_update_project" type="bool" setter="" getter="" default="true"> - </member> - <member name="mono/unhandled_exception_policy" type="int" setter="" getter="" default="0"> + <member name="mono/runtime/unhandled_exception_policy" type="int" setter="" getter="" default="0"> + The policy to use for unhandled Mono (C#) exceptions. The default "Terminate Application" exits the project as soon as an unhandled exception is thrown. "Log Error" logs an error message to the console instead, and will not interrupt the project execution when an unhandled exception is thrown. + [b]Note:[/b] The unhandled exception policy is always set to "Log Error" in the editor, which also includes C# [code]tool[/code] scripts running within the editor as well as editor plugin code. </member> <member name="navigation/2d/default_cell_size" type="int" setter="" getter="" default="10"> Default cell size for 2D navigation maps. See [method NavigationServer2D.map_set_cell_size]. diff --git a/doc/classes/RayCast2D.xml b/doc/classes/RayCast2D.xml index 592c074a77..d7540ef206 100644 --- a/doc/classes/RayCast2D.xml +++ b/doc/classes/RayCast2D.xml @@ -63,7 +63,7 @@ <method name="get_collision_normal" qualifiers="const"> <return type="Vector2" /> <description> - Returns the normal of the intersecting object's shape at the collision point. + Returns the normal of the intersecting object's shape at the collision point, or [code]Vector2(0, 0)[/code] if the ray starts inside the shape and [member hit_from_inside] is [code]true[/code]. </description> </method> <method name="get_collision_point" qualifiers="const"> @@ -118,6 +118,9 @@ <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true"> If [code]true[/code], the parent node will be excluded from collision detection. </member> + <member name="hit_from_inside" type="bool" setter="set_hit_from_inside" getter="is_hit_from_inside_enabled" default="false"> + If [code]true[/code], the ray will detect a hit when starting inside shapes. In this case the collision normal will be [code]Vector2(0, 0)[/code]. Does not affect concave polygon shapes. + </member> <member name="target_position" type="Vector2" setter="set_target_position" getter="get_target_position" default="Vector2(0, 50)"> The ray's destination point, relative to the RayCast's [code]position[/code]. </member> diff --git a/doc/classes/RayCast3D.xml b/doc/classes/RayCast3D.xml index c7253e81c4..f15643c93f 100644 --- a/doc/classes/RayCast3D.xml +++ b/doc/classes/RayCast3D.xml @@ -65,7 +65,7 @@ <method name="get_collision_normal" qualifiers="const"> <return type="Vector3" /> <description> - Returns the normal of the intersecting object's shape at the collision point. + Returns the normal of the intersecting object's shape at the collision point, or [code]Vector3(0, 0, 0)[/code] if the ray starts inside the shape and [member hit_from_inside] is [code]true[/code]. </description> </method> <method name="get_collision_point" qualifiers="const"> @@ -127,6 +127,9 @@ <member name="exclude_parent" type="bool" setter="set_exclude_parent_body" getter="get_exclude_parent_body" default="true"> If [code]true[/code], collisions will be ignored for this RayCast3D's immediate parent. </member> + <member name="hit_from_inside" type="bool" setter="set_hit_from_inside" getter="is_hit_from_inside_enabled" default="false"> + If [code]true[/code], the ray will detect a hit when starting inside shapes. In this case the collision normal will be [code]Vector3(0, 0, 0)[/code]. Does not affect shapes with no volume like concave polygon or heightmap. + </member> <member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3(0, -1, 0)"> The ray's destination point, relative to the RayCast's [code]position[/code]. </member> diff --git a/doc/classes/Rect2.xml b/doc/classes/Rect2.xml index 01bec10ed8..ad88551d9d 100644 --- a/doc/classes/Rect2.xml +++ b/doc/classes/Rect2.xml @@ -71,7 +71,22 @@ <return type="Rect2" /> <argument index="0" name="to" type="Vector2" /> <description> - Returns this [Rect2] expanded to include a given point. + Returns a copy of this [Rect2] expanded to include a given point. + [b]Example:[/b] + [codeblocks] + [gdscript] + # position (-3, 2), size (1, 1) + var rect = Rect2(Vector2(-3, 2), Vector2(1, 1)) + # position (-3, -1), size (3, 4), so we fit both rect and Vector2(0, -1) + var rect2 = rect.expand(Vector2(0, -1)) + [/gdscript] + [csharp] + # position (-3, 2), size (1, 1) + var rect = new Rect2(new Vector2(-3, 2), new Vector2(1, 1)); + # position (-3, -1), size (3, 4), so we fit both rect and Vector2(0, -1) + var rect2 = rect.Expand(new Vector2(0, -1)); + [/csharp] + [/codeblocks] </description> </method> <method name="get_area" qualifiers="const"> @@ -121,7 +136,8 @@ <return type="bool" /> <argument index="0" name="point" type="Vector2" /> <description> - Returns [code]true[/code] if the [Rect2] contains a point. + Returns [code]true[/code] if the [Rect2] contains a point. By convention, the right and bottom edges of the [Rect2] are considered exclusive, so points on these edges are [b]not[/b] included. + [b]Note:[/b] This method is not reliable for [Rect2] with a [i]negative size[/i]. Use [method abs] to get a positive sized equivalent rectangle to check for contained points. </description> </method> <method name="intersection" qualifiers="const"> diff --git a/doc/classes/Rect2i.xml b/doc/classes/Rect2i.xml index fc27c64fa5..f5ea6a6c87 100644 --- a/doc/classes/Rect2i.xml +++ b/doc/classes/Rect2i.xml @@ -69,7 +69,21 @@ <return type="Rect2i" /> <argument index="0" name="to" type="Vector2i" /> <description> - Returns this [Rect2i] expanded to include a given point. + Returns a copy of this [Rect2i] expanded to include a given point. + [codeblocks] + [gdscript] + # position (-3, 2), size (1, 1) + var rect = Rect2i(Vector2i(-3, 2), Vector2i(1, 1)) + # position (-3, -1), size (3, 4), so we fit both rect and Vector2i(0, -1) + var rect2 = rect.expand(Vector2i(0, -1)) + [/gdscript] + [csharp] + # position (-3, 2), size (1, 1) + var rect = new Rect2i(new Vector2i(-3, 2), new Vector2i(1, 1)); + # position (-3, -1), size (3, 4), so we fit both rect and Vector2i(0, -1) + var rect2 = rect.Expand(new Vector2i(0, -1)); + [/csharp] + [/codeblocks] </description> </method> <method name="get_area" qualifiers="const"> @@ -120,7 +134,8 @@ <return type="bool" /> <argument index="0" name="point" type="Vector2i" /> <description> - Returns [code]true[/code] if the [Rect2i] contains a point. + Returns [code]true[/code] if the [Rect2i] contains a point. By convention, the right and bottom edges of the [Rect2i] are considered exclusive, so points on these edges are [b]not[/b] included. + [b]Note:[/b] This method is not reliable for [Rect2i] with a [i]negative size[/i]. Use [method abs] to get a positive sized equivalent rectangle to check for contained points. </description> </method> <method name="intersection" qualifiers="const"> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 68b79ff749..ddb25788c8 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -2661,8 +2661,10 @@ <return type="RID" /> <argument index="0" name="shader" type="RID" /> <argument index="1" name="param" type="StringName" /> + <argument index="2" name="index" type="int" default="0" /> <description> Returns a default texture from a shader searched by name. + [b]Note:[/b] If the sampler array is used use [code]index[/code] to access the specified texture. </description> </method> <method name="shader_get_param_default" qualifiers="const"> @@ -2684,8 +2686,10 @@ <argument index="0" name="shader" type="RID" /> <argument index="1" name="param" type="StringName" /> <argument index="2" name="texture" type="RID" /> + <argument index="3" name="index" type="int" default="0" /> <description> Sets a shader's default texture. Overwrites the texture given by name. + [b]Note:[/b] If the sampler array is used use [code]index[/code] to access the specified texture. </description> </method> <method name="shadows_quality_set"> diff --git a/doc/classes/Shader.xml b/doc/classes/Shader.xml index 99e38e969d..751afb9b65 100644 --- a/doc/classes/Shader.xml +++ b/doc/classes/Shader.xml @@ -13,9 +13,11 @@ <method name="get_default_texture_param" qualifiers="const"> <return type="Texture2D" /> <argument index="0" name="param" type="StringName" /> + <argument index="1" name="index" type="int" default="0" /> <description> Returns the texture that is set as default for the specified parameter. [b]Note:[/b] [code]param[/code] must match the name of the uniform in the code exactly. + [b]Note:[/b] If the sampler array is used use [code]index[/code] to access the specified texture. </description> </method> <method name="get_mode" qualifiers="const"> @@ -36,9 +38,11 @@ <return type="void" /> <argument index="0" name="param" type="StringName" /> <argument index="1" name="texture" type="Texture2D" /> + <argument index="2" name="index" type="int" default="0" /> <description> Sets the default texture to be used with a texture uniform. The default is used if a texture is not set in the [ShaderMaterial]. [b]Note:[/b] [code]param[/code] must match the name of the uniform in the code exactly. + [b]Note:[/b] If the sampler array is used use [code]index[/code] to access the specified texture. </description> </method> </methods> diff --git a/doc/classes/TileSetAtlasSource.xml b/doc/classes/TileSetAtlasSource.xml index 881a1c3d07..6580c6bd4c 100644 --- a/doc/classes/TileSetAtlasSource.xml +++ b/doc/classes/TileSetAtlasSource.xml @@ -45,6 +45,21 @@ Returns the alternative ID a following call to [method create_alternative_tile] would return. </description> </method> + <method name="get_runtime_texture" qualifiers="const"> + <return type="Texture2D" /> + <description> + If [member use_texture_padding] is [code]false[/code], returns [member texture]. Otherwise, returns and internal [ImageTexture] created that includes the padding. + </description> + </method> + <method name="get_runtime_tile_texture_region" qualifiers="const"> + <return type="Rect2i" /> + <argument index="0" name="atlas_coords" type="Vector2i" /> + <argument index="1" name="frame" type="int" /> + <description> + Returns the region of the tile at coordinates [code]atlas_coords[/code] for frame [code]frame[/code] inside the texture returned by [method get_runtime_texture]. + [b]Note:[/b] If [member use_texture_padding] is [code]false[/code], returns the same as [method get_tile_texture_region]. + </description> + </method> <method name="get_tile_animation_columns" qualifiers="const"> <return type="int" /> <argument index="0" name="atlas_coords" type="Vector2i" /> @@ -232,5 +247,9 @@ <member name="texture_region_size" type="Vector2i" setter="set_texture_region_size" getter="get_texture_region_size" default="Vector2i(16, 16)"> The base tile size in the texture (in pixel). This size must be bigger than the TileSet's [code]tile_size[/code] value. </member> + <member name="use_texture_padding" type="bool" setter="set_use_texture_padding" getter="get_use_texture_padding" default="true"> + If [code]true[/code], generates an internal texture with an additional one pixel padding around each tile. Texture padding avoids a common artifact where lines appear between tiles. + Disabling this setting might lead a small performance improvement, as generating the internal texture requires both memory and processing time when the TileSetAtlasSource resource is modified. + </member> </members> </class> diff --git a/doc/classes/VisualShaderNodeCustom.xml b/doc/classes/VisualShaderNodeCustom.xml index b87b59c3e4..58f345b8f9 100644 --- a/doc/classes/VisualShaderNodeCustom.xml +++ b/doc/classes/VisualShaderNodeCustom.xml @@ -27,8 +27,8 @@ <return type="String" /> <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" /> + <argument index="2" name="mode" type="int" enum="Shader.Mode" /> + <argument index="3" name="type" type="int" enum="VisualShader.Type" /> <description> Override this method to define the actual shader code of the associated custom node. The shader code should be returned as a string, which can have multiple lines (the [code]"""[/code] multiline string construct can be used for convenience). The [code]input_vars[/code] and [code]output_vars[/code] arrays contain the string names of the various input and output variables, as defined by [code]_get_input_*[/code] and [code]_get_output_*[/code] virtual methods in this class. @@ -46,7 +46,7 @@ </method> <method name="_get_global_code" qualifiers="virtual const"> <return type="String" /> - <argument index="0" name="mode" type="int" /> + <argument index="0" name="mode" type="int" enum="Shader.Mode" /> <description> Override this method to add shader code on top of the global shader, to define your own standard library of reusable methods, varyings, constants, uniforms, etc. The shader code should be returned as a string, which can have multiple lines (the [code]"""[/code] multiline string construct can be used for convenience). Be careful with this functionality as it can cause name conflicts with other custom nodes, so be sure to give the defined entities unique names. diff --git a/doc/classes/VisualShaderNodeParticleMeshEmitter.xml b/doc/classes/VisualShaderNodeParticleMeshEmitter.xml new file mode 100644 index 0000000000..7abb330fd3 --- /dev/null +++ b/doc/classes/VisualShaderNodeParticleMeshEmitter.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="VisualShaderNodeParticleMeshEmitter" inherits="VisualShaderNodeParticleEmitter" version="4.0"> + <brief_description> + </brief_description> + <description> + </description> + <tutorials> + </tutorials> + <members> + <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh"> + </member> + <member name="surface_index" type="int" setter="set_surface_index" getter="get_surface_index" default="0"> + </member> + <member name="use_all_surfaces" type="bool" setter="set_use_all_surfaces" getter="is_use_all_surfaces" default="true"> + </member> + </members> +</class> |