summaryrefslogtreecommitdiff
path: root/doc/base
diff options
context:
space:
mode:
authorOvnuniarchos <pujalte.jorge@gmail.com>2016-06-12 20:03:24 +0200
committerOvnuniarchos <pujalte.jorge@gmail.com>2016-06-12 20:24:19 +0200
commit471ab4e6ff1b94e09835b7e3a2a82ea9e65f9214 (patch)
treeb4df3be22e8b9e96184c9793b53ddcde4cbd3e57 /doc/base
parent4bb93c976c6b67b4538c8a012ea549ec24e3ac1a (diff)
Documented many Physics2D* classes
Diffstat (limited to 'doc/base')
-rw-r--r--doc/base/classes.xml303
1 files changed, 273 insertions, 30 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index b72f082afa..8a75ba5c87 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -8751,7 +8751,7 @@
Concave polygon 2D shape resource for physics.
</brief_description>
<description>
- Concave polygon 2D shape resource for physics. It is made out of segments and is very optimal for complex polygonal concave collisions. It is really not advised to use for RigidBody nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions.
+ Concave polygon 2D shape resource for physics. It is made out of segments and is very optimal for complex polygonal concave collisions. It is really not advised to use for [RigidBody2D] nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions.
The main difference between a [ConvexPolygonShape2D] and a [ConcavePolygonShape2D] is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection.
</description>
<methods>
@@ -24970,12 +24970,14 @@ This method controls whether the position between two cached points is interpola
<return type="float">
</return>
<description>
+ Return the rate at which the body stops moving, if there are not any other forces moving it.
</description>
</method>
<method name="get_total_angular_damp" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the rate at which the body stops rotating, if there are not any other forces moving it.
</description>
</method>
<method name="get_inverse_mass" qualifiers="const">
@@ -25070,6 +25072,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="contact_idx" type="int">
</argument>
<description>
+ Return the local normal (of this body) of the contact point.
</description>
</method>
<method name="get_contact_local_shape" qualifiers="const">
@@ -25087,7 +25090,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="contact_idx" type="int">
</argument>
<description>
- Return the RID of the collider.
+ Return the [RID] of the collider.
</description>
</method>
<method name="get_contact_collider_pos" qualifiers="const">
@@ -25132,6 +25135,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="contact_idx" type="int">
</argument>
<description>
+ Return the metadata of the collided shape. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
</description>
</method>
<method name="get_contact_collider_velocity_at_pos" qualifiers="const">
@@ -25168,8 +25172,10 @@ This method controls whether the position between two cached points is interpola
</class>
<class name="Physics2DDirectBodyStateSW" inherits="Physics2DDirectBodyState" category="Core">
<brief_description>
+ Software implementation of [Physics2DDirectBodyState].
</brief_description>
<description>
+ Software implementation of [Physics2DDirectBodyState]. This object exposes no new methods or properties and should not be used, as [Physics2DDirectBodyState] selects the best implementation available.
</description>
<methods>
</methods>
@@ -25198,6 +25204,13 @@ This method controls whether the position between two cached points is interpola
<argument index="4" name="type_mask" type="int" default="15">
</argument>
<description>
+ Check whether a point is inside any shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields:
+ shape: Shape index within the object the point is in.
+ metadata: Metadata of the shape the point is in. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
+ collider_id: Id of the object the point is in.
+ collider: Object the point is inside of.
+ rid: [RID] of the object the point is in.
+ Additionally, the method can take an array of objects or [RID]s that are to be excluded from collisions, a bitmask representing the physics layers to check in, and another bitmask for the types of objects to check (see TYPE_MASK_* constants).
</description>
</method>
<method name="intersect_ray">
@@ -25214,15 +25227,16 @@ This method controls whether the position between two cached points is interpola
<argument index="4" name="type_mask" type="int" default="15">
</argument>
<description>
- Intersect a ray in a given space, the returned object is a dictionary with the following fields:
- position: place where ray is stopped.
- normal: normal of the object at the point where the ray was stopped.
- shape: shape index of the object against which the ray was stopped.
- collider_: collider against which the ray was stopped.
- collider_id: collider id of the object against which the ray was stopped.
- collider: collider object against which the ray was stopped.
+ Intersect a ray in a given space. The returned object is a dictionary with the following fields:
+ position: Place where ray is stopped.
+ normal: Normal of the object at the point where the ray was stopped.
+ shape: Shape index within the object against which the ray was stopped.
+ metadata: Metadata of the shape against which the ray was stopped. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
+ collider_id: Id of the object against which the ray was stopped.
+ collider: Object against which the ray was stopped.
rid: [RID] of the object against which the ray was stopped.
If the ray did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead.
+ Additionally, the method can take an array of objects or [RID]s that are to be excluded from collisions, a bitmask representing the physics layers to check in, and another bitmask for the types of objects to check (see TYPE_MASK_* constants).
</description>
</method>
<method name="intersect_shape">
@@ -25233,7 +25247,13 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="max_results" type="int" default="32">
</argument>
<description>
- Intersect a given shape (RID or [Shape2D]) against the space, the intersected shapes are returned in a special result object.
+ Check the intersections of a shape, given through a [Physics2DShapeQueryParameters] object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields:
+ shape: Shape index within the object the shape intersected.
+ metadata: Metadata of the shape intersected by the shape given through the [Physics2DShapeQueryParameters]. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
+ collider_id: Id of the object the shape intersected.
+ collider: Object the shape intersected.
+ rid: [RID] of the object the shape intersected.
+ The number of intersections can be limited with the second paramater, to reduce the processing time.
</description>
</method>
<method name="cast_motion">
@@ -25242,6 +25262,8 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="shape" type="Physics2DShapeQueryParameters">
</argument>
<description>
+ Check whether the shape can travel to a point. If it can, the method will return an array with two floats: The first is the distance the shape can move in that direction without colliding, and the second is the distance at which it will collide.
+ If the shape can not move, the array will be empty.
</description>
</method>
<method name="collide_shape">
@@ -25252,6 +25274,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="max_results" type="int" default="32">
</argument>
<description>
+ Check the intersections of a shape, given through a [Physics2DShapeQueryParameters] object, against the space. The resulting array contains a list of points where the shape intersects another. Like with [method intersect_shape], the number of returned results can be limited to save processing time.
</description>
</method>
<method name="get_rest_info">
@@ -25260,21 +25283,37 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="shape" type="Physics2DShapeQueryParameters">
</argument>
<description>
+ Check the intersections of a shape, given through a [Physics2DShapeQueryParameters] object, against the space. If it collides with more than a shape, the nearest one is selected. The returned object is a dictionary containing the following fields:
+ pointo: Place where the shapes intersect.
+ normal: Normal of the object at the point where the shapes intersect.
+ shape: Shape index within the object against which the shape intersected.
+ metadata: Metadata of the shape against which the shape intersected. This metadata is different from [method Object.get_meta], and is set with [method Physics2DServer.shape_set_data].
+ collider_id: Id of the object against which the shape intersected.
+ collider: Object against which the shape intersected.
+ rid: [RID] of the object against which the shape intersected.
+ linear_velocity: The movement vector of the object the shape intersected, if it was a body. If it was an area, it is (0,0).
+ If the shape did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead.
</description>
</method>
</methods>
<constants>
<constant name="TYPE_MASK_STATIC_BODY" value="1">
+ Check for collisions with static bodies.
</constant>
<constant name="TYPE_MASK_KINEMATIC_BODY" value="2">
+ Check for collisions with kinematic bodies.
</constant>
<constant name="TYPE_MASK_RIGID_BODY" value="4">
+ Check for collisions with rigid bodies.
</constant>
<constant name="TYPE_MASK_CHARACTER_BODY" value="8">
+ Check for collisions with rigid bodies in character mode.
</constant>
<constant name="TYPE_MASK_AREA" value="16">
+ Check for collisions with areas.
</constant>
<constant name="TYPE_MASK_COLLISION" value="15">
+ Check for collisions with any kind of bodies (but not areas).
</constant>
</constants>
</class>
@@ -25283,7 +25322,7 @@ This method controls whether the position between two cached points is interpola
Physics 2D Server.
</brief_description>
<description>
- Physics 2D Server is the server responsible for all 2D physics.
+ Physics 2D Server is the server responsible for all 2D physics. It can create many kinds of physics objects, but does not insert them on the node tree.
</description>
<methods>
<method name="shape_create">
@@ -25292,6 +25331,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="type" type="int">
</argument>
<description>
+ Create a shape of type SHAPE_*. Does not assign it to a body or an area. To do so, you must use [method area_set_shape] or [method body_set_shape].
</description>
</method>
<method name="shape_set_data">
@@ -25300,6 +25340,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="data" type="Variant">
</argument>
<description>
+ Set the shape data that defines its shape and size. The data to be passed depends on the kind of shape created [method shape_get_type].
</description>
</method>
<method name="shape_get_type" qualifiers="const">
@@ -25308,18 +25349,23 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="shape" type="RID">
</argument>
<description>
+ Return the type of shape (see SHAPE_* constants).
</description>
</method>
<method name="shape_get_data" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="shape" type="RID">
</argument>
<description>
+ Return the shape data.
</description>
</method>
<method name="space_create">
<return type="RID">
</return>
<description>
+ Create a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with [method area_set_space], or to a body with [method body_set_space].
</description>
</method>
<method name="space_set_active">
@@ -25328,6 +25374,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="active" type="bool">
</argument>
<description>
+ Mark a space as active. It will not have an effect, unless it is assigned to an area or body.
</description>
</method>
<method name="space_is_active" qualifiers="const">
@@ -25336,6 +25383,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="space" type="RID">
</argument>
<description>
+ Return whether the space is active.
</description>
</method>
<method name="space_set_param">
@@ -25346,6 +25394,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="float">
</argument>
<description>
+ Set the value for a space parameter. A list of available parameters is on the SPACE_PARAM_* constants.
</description>
</method>
<method name="space_get_param" qualifiers="const">
@@ -25356,6 +25405,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return the value of a space parameter.
</description>
</method>
<method name="space_get_direct_state">
@@ -25364,12 +25414,14 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="space" type="RID">
</argument>
<description>
+ Return the state of a space, a [Physics2DDirectSpaceState]. This object can be used to make collision/intersection queries.
</description>
</method>
<method name="area_create">
<return type="RID">
</return>
<description>
+ Create an [Area2D].
</description>
</method>
<method name="area_set_space">
@@ -25378,6 +25430,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="space" type="RID">
</argument>
<description>
+ Assign a space to the area.
</description>
</method>
<method name="area_get_space" qualifiers="const">
@@ -25386,6 +25439,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Return the space assigned to the area.
</description>
</method>
<method name="area_set_space_override_mode">
@@ -25394,6 +25448,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mode" type="int">
</argument>
<description>
+ Set the space override mode for the area. The modes are described in the constants AREA_SPACE_OVERRIDE_*.
</description>
</method>
<method name="area_get_space_override_mode" qualifiers="const">
@@ -25402,6 +25457,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Return the space override mode for the area.
</description>
</method>
<method name="area_add_shape">
@@ -25412,6 +25468,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="transform" type="Matrix32" default="1,0, 0,1, 0,0">
</argument>
<description>
+ Add a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
</description>
</method>
<method name="area_set_shape">
@@ -25422,6 +25479,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="shape" type="RID">
</argument>
<description>
+ Substitute a given area shape by another. The old shape is selected by its index, the new one by its [RID].
</description>
</method>
<method name="area_set_shape_transform">
@@ -25432,6 +25490,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="transform" type="Matrix32">
</argument>
<description>
+ Set the transform matrix for an area shape.
</description>
</method>
<method name="area_get_shape_count" qualifiers="const">
@@ -25440,6 +25499,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Return the number of shapes assigned to an area.
</description>
</method>
<method name="area_get_shape" qualifiers="const">
@@ -25450,6 +25510,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the [RID] of the nth shape of an area.
</description>
</method>
<method name="area_get_shape_transform" qualifiers="const">
@@ -25460,6 +25521,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the transform matrix of a shape within an area.
</description>
</method>
<method name="area_remove_shape">
@@ -25468,12 +25530,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Remove a shape from an area. It does not delete the shape, so it can be reassigned later.
</description>
</method>
<method name="area_clear_shapes">
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Remove all shapes from an area. It does not delete the shapes, so they can be reassigned later.
</description>
</method>
<method name="area_set_layer_mask">
@@ -25482,6 +25546,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mask" type="int">
</argument>
<description>
+ Assign the area to one or many physics layers.
</description>
</method>
<method name="area_set_collision_mask">
@@ -25490,6 +25555,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mask" type="int">
</argument>
<description>
+ Set which physics layers the area will monitor.
</description>
</method>
<method name="area_set_param">
@@ -25500,6 +25566,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="Variant">
</argument>
<description>
+ Set the value for an area parameter. A list of available parameters is on the AREA_PARAM_* constants.
</description>
</method>
<method name="area_set_transform">
@@ -25508,14 +25575,18 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="transform" type="Matrix32">
</argument>
<description>
+ Set the transform matrix for an area.
</description>
</method>
<method name="area_get_param" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="area" type="RID">
</argument>
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return an area parameter value.
</description>
</method>
<method name="area_get_transform" qualifiers="const">
@@ -25524,6 +25595,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Return the transform matrix for an area.
</description>
</method>
<method name="area_attach_object_instance_ID">
@@ -25532,6 +25604,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="id" type="int">
</argument>
<description>
+ Assign the area to a descendant of [Object], so it can exist in the node tree.
</description>
</method>
<method name="area_get_object_instance_ID" qualifiers="const">
@@ -25540,6 +25613,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="area" type="RID">
</argument>
<description>
+ Get the instance ID of the object the area is assigned to.
</description>
</method>
<method name="area_set_monitor_callback">
@@ -25550,6 +25624,12 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="method" type="String">
</argument>
<description>
+ Set the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters:
+ 1: AREA_BODY_ADDED or AREA_BODY_REMOVED, depending on whether the object entered or exited the area.
+ 2: [RID] of the object that entered/exited the area.
+ 3: Instance ID of the object that entered/exited the area.
+ 4: The shape index of the object that entered/exited the area.
+ 5: The shape index of the area where the object entered/exited.
</description>
</method>
<method name="body_create">
@@ -25560,6 +25640,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="init_sleeping" type="bool" default="false">
</argument>
<description>
+ Create a physics body. The first parameter can be any value from constants BODY_MODE*, for the type of body created. Additionally, the body can be created in sleeping state to save processing time.
</description>
</method>
<method name="body_set_space">
@@ -25568,6 +25649,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="space" type="RID">
</argument>
<description>
+ Assign a space to the body (see [method create_space]).
</description>
</method>
<method name="body_get_space" qualifiers="const">
@@ -25576,6 +25658,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the [RID] of the space assigned to a body.
</description>
</method>
<method name="body_set_mode">
@@ -25584,6 +25667,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mode" type="int">
</argument>
<description>
+ Set the body mode, from one of the constants BODY_MODE*.
</description>
</method>
<method name="body_get_mode" qualifiers="const">
@@ -25592,6 +25676,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the body mode.
</description>
</method>
<method name="body_add_shape">
@@ -25602,6 +25687,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="transform" type="Matrix32" default="1,0, 0,1, 0,0">
</argument>
<description>
+ Add a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index.
</description>
</method>
<method name="body_set_shape">
@@ -25612,6 +25698,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="shape" type="RID">
</argument>
<description>
+ Substitute a given body shape by another. The old shape is selected by its index, the new one by its [RID].
</description>
</method>
<method name="body_set_shape_transform">
@@ -25622,6 +25709,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="transform" type="Matrix32">
</argument>
<description>
+ Set the transform matrix for a body shape.
</description>
</method>
<method name="body_set_shape_metadata">
@@ -25632,6 +25720,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="metadata" type="Variant">
</argument>
<description>
+ Set metadata of a shape within a body. This metadata is different from [method Object.set_meta], and can be retrieved on shape queries.
</description>
</method>
<method name="body_get_shape_count" qualifiers="const">
@@ -25640,6 +25729,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the number of shapes assigned to a body.
</description>
</method>
<method name="body_get_shape" qualifiers="const">
@@ -25650,6 +25740,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the [RID] of the nth shape of a body.
</description>
</method>
<method name="body_get_shape_transform" qualifiers="const">
@@ -25660,14 +25751,18 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the transform matrix of a body shape.
</description>
</method>
<method name="body_get_shape_metadata" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="body" type="RID">
</argument>
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return the metadata of a shape of a body.
</description>
</method>
<method name="body_remove_shape">
@@ -25676,12 +25771,14 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Remove a shape from a body. The shape is not deleted, so it can be reused afterwards.
</description>
</method>
<method name="body_clear_shapes">
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Remove all shapes from a body.
</description>
</method>
<method name="body_set_shape_as_trigger">
@@ -25692,6 +25789,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="enable" type="bool">
</argument>
<description>
+ Mark a body's shape as a trigger. A trigger shape cannot affect other bodies, but detects other shapes entering and exiting it.
</description>
</method>
<method name="body_is_shape_set_as_trigger" qualifiers="const">
@@ -25702,6 +25800,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="shape_idx" type="int">
</argument>
<description>
+ Return whether a body's shape is marked as a trigger.
</description>
</method>
<method name="body_attach_object_instance_ID">
@@ -25710,6 +25809,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="id" type="int">
</argument>
<description>
+ Assign the area to a descendant of [Object], so it can exist in the node tree.
</description>
</method>
<method name="body_get_object_instance_ID" qualifiers="const">
@@ -25718,6 +25818,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Get the instance ID of the object the area is assigned to.
</description>
</method>
<method name="body_set_continuous_collision_detection_mode">
@@ -25726,6 +25827,8 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mode" type="int">
</argument>
<description>
+ Set the continuous collision detection mode from any of the CCD_MODE_* constants.
+ Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided.
</description>
</method>
<method name="body_get_continuous_collision_detection_mode" qualifiers="const">
@@ -25734,6 +25837,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the continuous collision detection mode.
</description>
</method>
<method name="body_set_layer_mask">
@@ -25742,6 +25846,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mask" type="int">
</argument>
<description>
+ Set the physics layer or layers a body belongs to.
</description>
</method>
<method name="body_get_layer_mask" qualifiers="const">
@@ -25750,6 +25855,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the physics layer or layers a body belongs to.
</description>
</method>
<method name="body_set_collision_mask">
@@ -25758,6 +25864,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="mask" type="int">
</argument>
<description>
+ Set the physics layer or layers a body can collide with.
</description>
</method>
<method name="body_get_collision_mask" qualifiers="const">
@@ -25766,6 +25873,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the physics layer or layers a body can collide with.
</description>
</method>
<method name="body_set_param">
@@ -25776,6 +25884,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="float">
</argument>
<description>
+ Set a body parameter (see BODY_PARAM* constants).
</description>
</method>
<method name="body_get_param" qualifiers="const">
@@ -25786,6 +25895,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return the value of a body parameter.
</description>
</method>
<method name="body_set_state">
@@ -25796,14 +25906,18 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="Variant">
</argument>
<description>
+ Set a body state (see BODY_STATE* constants).
</description>
</method>
<method name="body_get_state" qualifiers="const">
+ <return type="Variant">
+ </return>
<argument index="0" name="body" type="RID">
</argument>
<argument index="1" name="state" type="int">
</argument>
<description>
+ Return a body state.
</description>
</method>
<method name="body_apply_impulse">
@@ -25814,6 +25928,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="impulse" type="Vector2">
</argument>
<description>
+ Add a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates.
</description>
</method>
<method name="body_add_force">
@@ -25824,7 +25939,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="force" type="Vector2">
</argument>
<description>
- Add a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates.
+ Add a positioned force to the applied force and torque. As with [method body_apply_impulse], both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied.
</description>
</method>
<method name="body_set_axis_velocity">
@@ -25833,6 +25948,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="axis_velocity" type="Vector2">
</argument>
<description>
+ Set an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior.
</description>
</method>
<method name="body_add_collision_exception">
@@ -25841,6 +25957,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="excepted_body" type="RID">
</argument>
<description>
+ Add a body to the list of bodies exempt from collisions.
</description>
</method>
<method name="body_remove_collision_exception">
@@ -25849,6 +25966,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="excepted_body" type="RID">
</argument>
<description>
+ Remove a body from the list of bodies exempt from collisions.
</description>
</method>
<method name="body_set_max_contacts_reported">
@@ -25857,6 +25975,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="amount" type="int">
</argument>
<description>
+ Set the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0.
</description>
</method>
<method name="body_get_max_contacts_reported" qualifiers="const">
@@ -25865,6 +25984,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the maximum contacts that can be reported. See [method body_set_max_contacts_reported].
</description>
</method>
<method name="body_set_one_way_collision_direction">
@@ -25873,6 +25993,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="normal" type="Vector2">
</argument>
<description>
+ Set a direction in which bodies can go through the given one. If this value is different from (0,0), any movement within 90 degrees of this vector is considered a valid movement. Set this direction to (0,0) to disable one-way collisions.
</description>
</method>
<method name="body_get_one_way_collision_direction" qualifiers="const">
@@ -25881,6 +26002,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return the direction used for one-way collision detection.
</description>
</method>
<method name="body_set_one_way_collision_max_depth">
@@ -25889,6 +26011,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="depth" type="float">
</argument>
<description>
+ Set how far a body can go through the given one, if it allows one-way collisions (see [method body_set_one_way_collision_direction]).
</description>
</method>
<method name="body_get_one_way_collision_max_depth" qualifiers="const">
@@ -25897,6 +26020,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return how far a body can go through the given one, when it allows one-way collisions.
</description>
</method>
<method name="body_set_omit_force_integration">
@@ -25905,6 +26029,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="enable" type="bool">
</argument>
<description>
+ Set whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
</description>
</method>
<method name="body_is_omitting_force_integration" qualifiers="const">
@@ -25913,6 +26038,7 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="body" type="RID">
</argument>
<description>
+ Return whether a body uses a callback function to calculate its own physics (see [method body_set_force_integration_callback]).
</description>
</method>
<method name="body_set_force_integration_callback">
@@ -25925,6 +26051,7 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="userdata" type="Variant" default="NULL">
</argument>
<description>
+ Set the function used to calculate physics for an object, if that object allows it (see [method body_set_omit_force integration]).
</description>
</method>
<method name="body_test_motion">
@@ -25939,6 +26066,7 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="result" type="Physics2DTestMotionResult" default="NULL">
</argument>
<description>
+ Return whether a body can move in a given direction. Apart from the boolean return value, a [Physics2DTestMotionResult] can be passed to return additional information in.
</description>
</method>
<method name="joint_set_param">
@@ -25949,6 +26077,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="float">
</argument>
<description>
+ Set a joint parameter. Parameters are explained in the JOINT_PARAM* constants.
</description>
</method>
<method name="joint_get_param" qualifiers="const">
@@ -25959,6 +26088,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return the value of a joint parameter.
</description>
</method>
<method name="pin_joint_create">
@@ -25971,6 +26101,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="body_b" type="RID" default="RID()">
</argument>
<description>
+ Create a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself.
</description>
</method>
<method name="groove_joint_create">
@@ -25987,6 +26118,7 @@ This method controls whether the position between two cached points is interpola
<argument index="4" name="body_b" type="RID" default="RID()">
</argument>
<description>
+ Create a groove joint between two bodies. If not specified, the bodyies are assumed to be the joint itself.
</description>
</method>
<method name="damped_spring_joint_create">
@@ -26001,6 +26133,7 @@ This method controls whether the position between two cached points is interpola
<argument index="3" name="body_b" type="RID" default="RID()">
</argument>
<description>
+ Create a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself.
</description>
</method>
<method name="damped_string_joint_set_param">
@@ -26011,6 +26144,7 @@ This method controls whether the position between two cached points is interpola
<argument index="2" name="value" type="float">
</argument>
<description>
+ Set a damped spring joint parameter. Parameters are explained in the DAMPED_STRING* constants.
</description>
</method>
<method name="damped_string_joint_get_param" qualifiers="const">
@@ -26021,6 +26155,7 @@ This method controls whether the position between two cached points is interpola
<argument index="1" name="param" type="int">
</argument>
<description>
+ Return the value of a damped spring joint parameter.
</description>
</method>
<method name="joint_get_type" qualifiers="const">
@@ -26029,18 +26164,21 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="joint" type="RID">
</argument>
<description>
+ Return the type of a joint (see JOINT_* constants).
</description>
</method>
<method name="free_rid">
<argument index="0" name="rid" type="RID">
</argument>
<description>
+ Destroy any of the objects created by Physics2DServer. If the [RID] passed is not one of the objects that can be created by Physics2DServer, an error will be sent to the console.
</description>
</method>
<method name="set_active">
<argument index="0" name="active" type="bool">
</argument>
<description>
+ Activate or deactivate the 2D physics engine.
</description>
</method>
<method name="get_process_info">
@@ -26049,41 +26187,79 @@ This method controls whether the position between two cached points is interpola
<argument index="0" name="process_info" type="int">
</argument>
<description>
+ Return information about the current state of the 2D physics engine. The states are listed under the INFO_* constants.
</description>
</method>
</methods>
<constants>
+ <constant name="SPACE_PARAM_CONTACT_RECYCLE_RADIUS" value="0">
+ Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated.
+ </constant>
+ <constant name="SPACE_PARAM_CONTACT_MAX_SEPARATION" value="1">
+ Constant to set/get the maximum distance a shape can be from another before they are considered separated.
+ </constant>
+ <constant name="SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION" value="2">
+ Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision.
+ </constant>
+ <constant name="SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_TRESHOLD" value="3">
+ Constant to set/get the linear velocity threshold. Bodies slower than this will be marked as potentially inactive.
+ </constant>
+ <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_TRESHOLD" value="4">
+ Constant to set/get the angular velocity threshold. Bodies slower than this will be marked as potentially inactive.
+ </constant>
+ <constant name="SPACE_PARAM_BODY_TIME_TO_SLEEP" value="5">
+ Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time.
+ </constant>
+ <constant name="SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS" value="6">
+ Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision.
+ </constant>
<constant name="SHAPE_LINE" value="0">
+ This is the constant for creating line shapes. A line shape is an infinite line with an origin point, and a normal. Thus, it can be used for front/behind checks.
</constant>
<constant name="SHAPE_SEGMENT" value="2">
+ This is the constant for creating segment shapes. A segment shape is a line from a point A to a point B. It can be checked for intersections.
</constant>
<constant name="SHAPE_CIRCLE" value="3">
+ This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks.
</constant>
<constant name="SHAPE_RECTANGLE" value="4">
+ This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks.
</constant>
<constant name="SHAPE_CAPSULE" value="5">
+ This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks.
</constant>
<constant name="SHAPE_CONVEX_POLYGON" value="6">
+ This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the method [method CollisionPolygon2D.set_polygon], polygons modified with [method shape_set_data] do not verify that the points supplied form, in fact, a convex polygon.
</constant>
<constant name="SHAPE_CONCAVE_POLYGON" value="7">
+ This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks.
</constant>
<constant name="SHAPE_CUSTOM" value="8">
+ 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">
+ Constant to set/get gravity strength in an area.
</constant>
<constant name="AREA_PARAM_GRAVITY_VECTOR" value="1">
+ Constant to set/get gravity vector/center in an area.
</constant>
<constant name="AREA_PARAM_GRAVITY_IS_POINT" value="2">
+ 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">
+ 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">
+ This constant was used to set/get the falloff factor for point gravity. It has been superseded by AREA_PARAM_GRAVITY_DISTANCE_SCALE.
</constant>
<constant name="AREA_PARAM_LINEAR_DAMP" value="5">
+ Constant to set/get the linear dampening factor of an area.
</constant>
<constant name="AREA_PARAM_ANGULAR_DAMP" value="6">
+ Constant to set/get the angular dampening factor of an area.
</constant>
<constant name="AREA_PARAM_PRIORITY" value="7">
+ Constant to set/get the priority (order of processing) of an area.
</constant>
<constant name="AREA_SPACE_OVERRIDE_DISABLED" value="0">
This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them.
@@ -26101,73 +26277,115 @@ This method controls whether the position between two cached points is interpola
This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
</constant>
<constant name="BODY_MODE_STATIC" value="0">
+ Constant for static bodies.
</constant>
<constant name="BODY_MODE_KINEMATIC" value="1">
+ Constant for kinematic bodies.
</constant>
<constant name="BODY_MODE_RIGID" value="2">
+ Constant for rigid bodies.
</constant>
<constant name="BODY_MODE_CHARACTER" value="3">
+ Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics.
</constant>
<constant name="BODY_PARAM_BOUNCE" value="0">
+ Constant to set/get a body's bounce factor.
</constant>
<constant name="BODY_PARAM_FRICTION" value="1">
+ Constant to set/get a body's friction.
</constant>
<constant name="BODY_PARAM_MASS" value="2">
+ Constant to set/get a body's mass.
</constant>
<constant name="BODY_PARAM_INERTIA" value="3">
+ Constant to set/get a body's inertia.
</constant>
<constant name="BODY_PARAM_GRAVITY_SCALE" value="4">
+ Constant to set/get a body's gravity multiplier.
</constant>
<constant name="BODY_PARAM_LINEAR_DAMP" value="5">
+ Constant to set/get a body's linear dampening factor.
</constant>
<constant name="BODY_PARAM_ANGULAR_DAMP" value="6">
+ Constant to set/get a body's angular dampening factor.
</constant>
<constant name="BODY_PARAM_MAX" value="7">
+ This is the last ID for body parameters. Any attempt to set this property is ignored. Any attempt to get it returns 0.
</constant>
<constant name="BODY_STATE_TRANSFORM" value="0">
+ Constant to set/get the current transform matrix of the body.
</constant>
<constant name="BODY_STATE_LINEAR_VELOCITY" value="1">
+ Constant to set/get the current linear velocity of the body.
</constant>
<constant name="BODY_STATE_ANGULAR_VELOCITY" value="2">
+ Constant to set/get the current angular velocity of the body.
</constant>
<constant name="BODY_STATE_SLEEPING" value="3">
+ Constant to sleep/wake up a body, or to get whether it is sleeping.
</constant>
<constant name="BODY_STATE_CAN_SLEEP" value="4">
+ Constant to set/get whether the body can sleep.
</constant>
<constant name="JOINT_PIN" value="0">
+ Constant to create pin joints.
</constant>
<constant name="JOINT_GROOVE" value="1">
+ Constant to create groove joints.
</constant>
<constant name="JOINT_DAMPED_SPRING" value="2">
+ Constant to create damped spring joints.
+ </constant>
+ <constant name="JOINT_PARAM_BIAS" value="0">
+ Constant to set/get the solver bias for a joint.
+ </constant>
+ <constant name="JOINT_PARAM_MAX_BIAS" value="1">
+ Constant to set/get the maximum speed at which a joint can correct its bodies.
+ </constant>
+ <constant name="JOINT_PARAM_MAX_FORCE" value="2">
+ Constant to set the maximum force a joint can exert on its bodies.
</constant>
<constant name="DAMPED_STRING_REST_LENGTH" value="0">
+ Set the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
</constant>
<constant name="DAMPED_STRING_STIFFNESS" value="1">
+ Set the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
</constant>
<constant name="DAMPED_STRING_DAMPING" value="2">
+ Set the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping).
</constant>
<constant name="CCD_MODE_DISABLED" value="0">
+ Disables continuous collision detection. This is the fastest way to detect body collisions, but can miss small, fast-moving objects.
</constant>
<constant name="CCD_MODE_CAST_RAY" value="1">
+ Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise.
</constant>
<constant name="CCD_MODE_CAST_SHAPE" value="2">
+ Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise.
</constant>
<constant name="AREA_BODY_ADDED" value="0">
+ The value of the first parameter and area callback function receives, when an object enters one of its shapes.
</constant>
<constant name="AREA_BODY_REMOVED" value="1">
+ The value of the first parameter and area callback function receives, when an object exits one of its shapes.
</constant>
<constant name="INFO_ACTIVE_OBJECTS" value="0">
+ Constant to get the number of objects that are not sleeping.
</constant>
<constant name="INFO_COLLISION_PAIRS" value="1">
+ Constant to get the number of possible collisions.
</constant>
<constant name="INFO_ISLAND_COUNT" value="2">
+ Constant to get the number of space regions where a collision could occur.
</constant>
</constants>
</class>
<class name="Physics2DServerSW" inherits="Physics2DServer" category="Core">
<brief_description>
+ Software implementation of [Physics2DServer].
</brief_description>
<description>
+ Software implementation of [Physics2DServer]. This class exposes no new methods or properties and should not be used, as [Physics2DServer] automatically selects the best implementation available.
</description>
<methods>
</methods>
@@ -26176,98 +26394,115 @@ This method controls whether the position between two cached points is interpola
</class>
<class name="Physics2DShapeQueryParameters" inherits="Reference" category="Core">
<brief_description>
+ Parameters to be sent to a 2D shape physics query.
</brief_description>
<description>
+ This class contains the shape and other parameters for intersection/collision queries.
</description>
<methods>
<method name="set_shape">
<argument index="0" name="shape" type="Shape2D">
</argument>
<description>
+ Set the [Shape2D] that will be used for collision/intersection queries.
</description>
</method>
<method name="set_shape_rid">
<argument index="0" name="shape" type="RID">
</argument>
<description>
+ Set the [RID] of the shape to be used in queries.
</description>
</method>
<method name="get_shape_rid" qualifiers="const">
<return type="RID">
</return>
<description>
+ Return the [RID] of the shape queried.
</description>
</method>
<method name="set_transform">
<argument index="0" name="transform" type="Matrix32">
</argument>
<description>
+ Set the transormation matrix of the shape. This is necessary to set its position/rotation/scale.
</description>
</method>
<method name="get_transform" qualifiers="const">
<return type="Matrix32">
</return>
<description>
+ Return the transform matrix of the shape queried.
</description>
</method>
<method name="set_motion">
<argument index="0" name="motion" type="Vector2">
</argument>
<description>
+ Set the current movement speed of the shape.
</description>
</method>
<method name="get_motion" qualifiers="const">
<return type="Vector2">
</return>
<description>
+ Return the current movement speed of the shape.
</description>
</method>
<method name="set_margin">
<argument index="0" name="margin" type="float">
</argument>
<description>
+ Set the collision margin for the shape. A collision margin is an amount (in pixels) that the shape will grow when computing collisions, to account for numerical imprecision.
</description>
</method>
<method name="get_margin" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the collision margin for the shape.
</description>
</method>
<method name="set_layer_mask">
<argument index="0" name="layer_mask" type="int">
</argument>
<description>
+ Set the physics layer(s) the shape belongs to.
</description>
</method>
<method name="get_layer_mask" qualifiers="const">
<return type="int">
</return>
<description>
+ Return the physics layer(s) the shape belongs to.
</description>
</method>
<method name="set_object_type_mask">
<argument index="0" name="object_type_mask" type="int">
</argument>
<description>
+ Set the type of object the shape belongs to (see Physics2DDirectSpaceState.TYPE_MASK_*).
</description>
</method>
<method name="get_object_type_mask" qualifiers="const">
<return type="int">
</return>
<description>
+ Return the type of object the shape belongs to.
</description>
</method>
<method name="set_exclude">
<argument index="0" name="exclude" type="Array">
</argument>
<description>
+ Set the list of objects, or object [RID]s, that will be excluded from collisions.
</description>
</method>
<method name="get_exclude" qualifiers="const">
<return type="Array">
</return>
<description>
+ Return the list of objects, or object [RID]s, that will be excluded from collisions.
</description>
</method>
</methods>
@@ -28388,155 +28623,162 @@ This method controls whether the position between two cached points is interpola
2D polygon representation
</brief_description>
<description>
- A Polygon2D is defined by a set of n points connected together by line segments, meaning that the point 1 will be connected with point 2, point 2 with point 3 ..., point n-1 with point n and point n with point 1 in order to close the loop and define a plane.
+ A Polygon2D is defined by a set of n vertices connected together by line segments, meaning that the vertex 1 will be connected with vertex 2, vertex 2 with vertex 3 ..., vertex n-1 with vertex n and vertex n with vertex 1 in order to close the loop and define a polygon.
</description>
<methods>
<method name="set_polygon">
<argument index="0" name="polygon" type="Vector2Array">
</argument>
<description>
- Defines the set of points that will represent the polygon.
+ Define the set of vertices that will represent the polygon.
</description>
</method>
<method name="get_polygon" qualifiers="const">
<return type="Vector2Array">
</return>
<description>
- Returns the set of points that defines this polygon
+ Return the set of vertices that defines this polygon.
</description>
</method>
<method name="set_uv">
<argument index="0" name="uv" type="Vector2Array">
</argument>
<description>
- Sets the uv value for every point of the polygon
+ Set the texture coordinates for every vertex of the polygon. There should be one uv vertex for every vertex in the polygon. If there are less, the undefined ones will be assumed to be (0,0). Extra uv vertices are ignored.
</description>
</method>
<method name="get_uv" qualifiers="const">
<return type="Vector2Array">
</return>
<description>
- Returns the uv value associated with every point of the polygon
+ Return the texture coordinates associated with every vertex of the polygon.
</description>
</method>
<method name="set_color">
<argument index="0" name="color" type="Color">
</argument>
<description>
- Sets the polygon fill color, if the polygon has a texture defined, the defined texture will be tinted to the polygon fill color.
+ Set the polygon fill color. If the polygon has a texture defined, the defined texture will be multiplied by the polygon fill color. This, also, is the default color for those vertices that are not defined by [method get_vertex_colors].
</description>
</method>
<method name="get_color" qualifiers="const">
<return type="Color">
</return>
<description>
- Returns the polygon fill color
+ Return the polygon fill color.
</description>
</method>
<method name="set_vertex_colors">
<argument index="0" name="vertex_colors" type="ColorArray">
</argument>
<description>
+ Set the color for each vertex of the polygon. There should be one color for every vertex in the polygon. If there are less, the undefined ones will be assumed to be [method get_color]. Extra color entries are ignored.
+ Colors are interpolated between vertices, resulting in smooth gradients when they differ.
</description>
</method>
<method name="get_vertex_colors" qualifiers="const">
<return type="ColorArray">
</return>
<description>
+ Return the list of vertex colors.
</description>
</method>
<method name="set_texture">
<argument index="0" name="texture" type="Object">
</argument>
<description>
- Sets the polygon texture.
+ Set the polygon texture.
</description>
</method>
<method name="get_texture" qualifiers="const">
<return type="Object">
</return>
<description>
- Returns the polygon texture
+ Return the polygon texture
</description>
</method>
<method name="set_texture_offset">
<argument index="0" name="texture_offset" type="Vector2">
</argument>
<description>
- Sets the offset of the polygon texture. Initially the texture will appear anchored to the polygon position, the offset is used to move the texture location away from that point (notice that the texture origin is set to its top left corner, so when offset is 0,0 the top left corner of the texture is at the polygon position), for example setting the offset to 10, 10 will move the texture 10 units to the left and 10 units to the top.
+ Set the offset of the polygon texture. Initially the texture will appear anchored to the polygon position, the offset is used to move the texture location away from that point (notice that the texture origin is set to its top left corner, so when offset is 0,0 the top left corner of the texture is at the polygon position), for example setting the offset to 10, 10 will move the texture 10 units to the left and 10 units to the top.
</description>
</method>
<method name="get_texture_offset" qualifiers="const">
<return type="Vector2">
</return>
<description>
- Returns the polygon texture offset.
+ Return the polygon texture offset.
</description>
</method>
<method name="set_texture_rotation">
<argument index="0" name="texture_rotation" type="float">
</argument>
<description>
- Sets the amount of rotation of the polygon texture, [code]texture_rotation[/code] is specified in radians and clockwise rotation.
+ Set the amount of rotation of the polygon texture, [code]texture_rotation[/code] is specified in radians and clockwise rotation.
</description>
</method>
<method name="get_texture_rotation" qualifiers="const">
<return type="float">
</return>
<description>
- Returns the rotation in radians of the texture polygon.
+ Return the rotation in radians of the texture polygon.
</description>
</method>
<method name="set_texture_scale">
<argument index="0" name="texture_scale" type="Vector2">
</argument>
<description>
+ Set the value that will multiply the uv coordinates ([method get_uv]) when applying the texture. Larger values make the texture smaller, and vice versa.
</description>
</method>
<method name="get_texture_scale" qualifiers="const">
<return type="Vector2">
</return>
<description>
+ Return the uv coordinate multiplier.
</description>
</method>
<method name="set_invert">
<argument index="0" name="invert" type="bool">
</argument>
<description>
- Sets the polygon as the defined polygon bounding box minus the defined polygon (the defined polygon will appear as a hole on square that contains the defined polygon).
+ Set the polygon as the defined polygon bounding box minus the defined polygon (the defined polygon will appear as a hole on the square that contains the defined polygon).
</description>
</method>
<method name="get_invert" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns whether this polygon is inverted or not
+ Return whether this polygon is inverted or not.
</description>
</method>
<method name="set_invert_border">
<argument index="0" name="invert_border" type="float">
</argument>
<description>
+ Add extra padding around the bounding box, making it bigger. Too small a value can make the polygon triangulate strangely, due to numerical imprecision.
</description>
</method>
<method name="get_invert_border" qualifiers="const">
<return type="float">
</return>
<description>
+ Return the added padding around the bounding box.
</description>
</method>
<method name="set_offset">
<argument index="0" name="offset" type="Vector2">
</argument>
<description>
- Sets the amount of distance from the polygon points from the polygon position, for example if the offset is set to 10,10 then all the polygon points will move 10 units to the right and 10 units to the bottom.
+ Set the an offset that will be added to the vertices' position. E.g. if the offset is set to (10,10) then all the polygon points will move 10 units to the right and 10 units to the bottom.
</description>
</method>
<method name="get_offset" qualifiers="const">
<return type="Vector2">
</return>
<description>
- Returns the polygon points offset to the polygon position.
+ Return the offset for the polygon vertices.
</description>
</method>
</methods>
@@ -31415,6 +31657,7 @@ This method controls whether the position between two cached points is interpola
Rigid body. This is the "natural" state of a rigid body. It is affected by forces, and can move, rotate, and be affected by user code.
</constant>
<constant name="MODE_CHARACTER" value="2">
+ Character body. This behaves like a rigid body, but can not rotate.
</constant>
</constants>
</class>
@@ -31467,7 +31710,7 @@ This method controls whether the position between two cached points is interpola
<return type="float">
</return>
<description>
- Return the body's moment of inertia. This is usually automatically computed from the mass and the shapes. Note that this doesn't seem to work in a [code]_ready[/code] function: it apparently has not been auto-computed yet.
+ Return the body's moment of inertia. This is usually automatically computed from the mass and the shapes. Note that this doesn't seem to work in a [code]_ready[/code] function: it apparently has not been auto-computed yet.
</description>
</method>
<method name="set_inertia">