classref: Sync with current master branch (2e7fc81)

This commit is contained in:
Godot Organization
2024-02-24 03:20:02 +00:00
parent 4f21f44632
commit 8978497bb6
938 changed files with 42729 additions and 36889 deletions
+71 -70
View File
@@ -63,41 +63,41 @@ Methods
.. table::
:widths: auto
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_exception<class_ShapeCast2D_method_add_exception>` **(** :ref:`CollisionObject2D<class_CollisionObject2D>` node **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`add_exception_rid<class_ShapeCast2D_method_add_exception_rid>` **(** :ref:`RID<class_RID>` rid **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`clear_exceptions<class_ShapeCast2D_method_clear_exceptions>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`force_shapecast_update<class_ShapeCast2D_method_force_shapecast_update>` **(** **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_closest_collision_safe_fraction<class_ShapeCast2D_method_get_closest_collision_safe_fraction>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_closest_collision_unsafe_fraction<class_ShapeCast2D_method_get_closest_collision_unsafe_fraction>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Object<class_Object>` | :ref:`get_collider<class_ShapeCast2D_method_get_collider>` **(** :ref:`int<class_int>` index **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`RID<class_RID>` | :ref:`get_collider_rid<class_ShapeCast2D_method_get_collider_rid>` **(** :ref:`int<class_int>` index **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_collider_shape<class_ShapeCast2D_method_get_collider_shape>` **(** :ref:`int<class_int>` index **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_collision_count<class_ShapeCast2D_method_get_collision_count>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_collision_mask_value<class_ShapeCast2D_method_get_collision_mask_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_collision_normal<class_ShapeCast2D_method_get_collision_normal>` **(** :ref:`int<class_int>` index **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_collision_point<class_ShapeCast2D_method_get_collision_point>` **(** :ref:`int<class_int>` index **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_colliding<class_ShapeCast2D_method_is_colliding>` **(** **)** |const| |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_exception<class_ShapeCast2D_method_remove_exception>` **(** :ref:`CollisionObject2D<class_CollisionObject2D>` node **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`remove_exception_rid<class_ShapeCast2D_method_remove_exception_rid>` **(** :ref:`RID<class_RID>` rid **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_collision_mask_value<class_ShapeCast2D_method_set_collision_mask_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
+-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_exception<class_ShapeCast2D_method_add_exception>`\ (\ node\: :ref:`CollisionObject2D<class_CollisionObject2D>`\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_exception_rid<class_ShapeCast2D_method_add_exception_rid>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`clear_exceptions<class_ShapeCast2D_method_clear_exceptions>`\ (\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`force_shapecast_update<class_ShapeCast2D_method_force_shapecast_update>`\ (\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_closest_collision_safe_fraction<class_ShapeCast2D_method_get_closest_collision_safe_fraction>`\ (\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`float<class_float>` | :ref:`get_closest_collision_unsafe_fraction<class_ShapeCast2D_method_get_closest_collision_unsafe_fraction>`\ (\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Object<class_Object>` | :ref:`get_collider<class_ShapeCast2D_method_get_collider>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`RID<class_RID>` | :ref:`get_collider_rid<class_ShapeCast2D_method_get_collider_rid>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_collider_shape<class_ShapeCast2D_method_get_collider_shape>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_collision_count<class_ShapeCast2D_method_get_collision_count>`\ (\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`get_collision_mask_value<class_ShapeCast2D_method_get_collision_mask_value>`\ (\ layer_number\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_collision_normal<class_ShapeCast2D_method_get_collision_normal>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Vector2<class_Vector2>` | :ref:`get_collision_point<class_ShapeCast2D_method_get_collision_point>`\ (\ index\: :ref:`int<class_int>`\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_colliding<class_ShapeCast2D_method_is_colliding>`\ (\ ) |const| |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_exception<class_ShapeCast2D_method_remove_exception>`\ (\ node\: :ref:`CollisionObject2D<class_CollisionObject2D>`\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_exception_rid<class_ShapeCast2D_method_remove_exception_rid>`\ (\ rid\: :ref:`RID<class_RID>`\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_collision_mask_value<class_ShapeCast2D_method_set_collision_mask_value>`\ (\ layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ ) |
+-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
@@ -116,8 +116,8 @@ Property Descriptions
.. rst-class:: classref-property-setget
- void **set_collide_with_areas** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_collide_with_areas_enabled** **(** **)**
- |void| **set_collide_with_areas**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_collide_with_areas_enabled**\ (\ )
If ``true``, collisions with :ref:`Area2D<class_Area2D>`\ s will be reported.
@@ -133,8 +133,8 @@ If ``true``, collisions with :ref:`Area2D<class_Area2D>`\ s will be reported.
.. rst-class:: classref-property-setget
- void **set_collide_with_bodies** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_collide_with_bodies_enabled** **(** **)**
- |void| **set_collide_with_bodies**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_collide_with_bodies_enabled**\ (\ )
If ``true``, collisions with :ref:`PhysicsBody2D<class_PhysicsBody2D>`\ s will be reported.
@@ -150,8 +150,8 @@ If ``true``, collisions with :ref:`PhysicsBody2D<class_PhysicsBody2D>`\ s will b
.. rst-class:: classref-property-setget
- void **set_collision_mask** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_collision_mask** **(** **)**
- |void| **set_collision_mask**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_collision_mask**\ (\ )
The shape's collision mask. Only objects in at least one collision layer enabled in the mask will be detected.
@@ -179,8 +179,8 @@ Returns the complete collision information from the collision sweep. The data re
.. rst-class:: classref-property-setget
- void **set_enabled** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_enabled** **(** **)**
- |void| **set_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_enabled**\ (\ )
If ``true``, collisions will be reported.
@@ -196,8 +196,8 @@ If ``true``, collisions will be reported.
.. rst-class:: classref-property-setget
- void **set_exclude_parent_body** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **get_exclude_parent_body** **(** **)**
- |void| **set_exclude_parent_body**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **get_exclude_parent_body**\ (\ )
If ``true``, the parent node will be excluded from collision detection.
@@ -213,8 +213,8 @@ If ``true``, the parent node will be excluded from collision detection.
.. rst-class:: classref-property-setget
- void **set_margin** **(** :ref:`float<class_float>` value **)**
- :ref:`float<class_float>` **get_margin** **(** **)**
- |void| **set_margin**\ (\ value\: :ref:`float<class_float>`\ )
- :ref:`float<class_float>` **get_margin**\ (\ )
The collision margin for the shape. A larger margin helps detecting collisions more consistently, at the cost of precision.
@@ -230,8 +230,8 @@ The collision margin for the shape. A larger margin helps detecting collisions m
.. rst-class:: classref-property-setget
- void **set_max_results** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_max_results** **(** **)**
- |void| **set_max_results**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_max_results**\ (\ )
The number of intersections can be limited with this parameter, to reduce the processing time.
@@ -247,8 +247,8 @@ The number of intersections can be limited with this parameter, to reduce the pr
.. rst-class:: classref-property-setget
- void **set_shape** **(** :ref:`Shape2D<class_Shape2D>` value **)**
- :ref:`Shape2D<class_Shape2D>` **get_shape** **(** **)**
- |void| **set_shape**\ (\ value\: :ref:`Shape2D<class_Shape2D>`\ )
- :ref:`Shape2D<class_Shape2D>` **get_shape**\ (\ )
The :ref:`Shape2D<class_Shape2D>`-derived shape to be used for collision queries.
@@ -264,8 +264,8 @@ The :ref:`Shape2D<class_Shape2D>`-derived shape to be used for collision queries
.. rst-class:: classref-property-setget
- void **set_target_position** **(** :ref:`Vector2<class_Vector2>` value **)**
- :ref:`Vector2<class_Vector2>` **get_target_position** **(** **)**
- |void| **set_target_position**\ (\ value\: :ref:`Vector2<class_Vector2>`\ )
- :ref:`Vector2<class_Vector2>` **get_target_position**\ (\ )
The shape's destination point, relative to this node's ``position``.
@@ -282,7 +282,7 @@ Method Descriptions
.. rst-class:: classref-method
void **add_exception** **(** :ref:`CollisionObject2D<class_CollisionObject2D>` node **)**
|void| **add_exception**\ (\ node\: :ref:`CollisionObject2D<class_CollisionObject2D>`\ )
Adds a collision exception so the shape does not report collisions with the specified :ref:`CollisionObject2D<class_CollisionObject2D>` node.
@@ -294,7 +294,7 @@ Adds a collision exception so the shape does not report collisions with the spec
.. rst-class:: classref-method
void **add_exception_rid** **(** :ref:`RID<class_RID>` rid **)**
|void| **add_exception_rid**\ (\ rid\: :ref:`RID<class_RID>`\ )
Adds a collision exception so the shape does not report collisions with the specified :ref:`RID<class_RID>`.
@@ -306,7 +306,7 @@ Adds a collision exception so the shape does not report collisions with the spec
.. rst-class:: classref-method
void **clear_exceptions** **(** **)**
|void| **clear_exceptions**\ (\ )
Removes all collision exceptions for this shape.
@@ -318,7 +318,7 @@ Removes all collision exceptions for this shape.
.. rst-class:: classref-method
void **force_shapecast_update** **(** **)**
|void| **force_shapecast_update**\ (\ )
Updates the collision information for the shape immediately, without waiting for the next ``_physics_process`` call. Use this method, for example, when the shape or its parent has changed state.
@@ -332,7 +332,7 @@ Updates the collision information for the shape immediately, without waiting for
.. rst-class:: classref-method
:ref:`float<class_float>` **get_closest_collision_safe_fraction** **(** **)** |const|
:ref:`float<class_float>` **get_closest_collision_safe_fraction**\ (\ ) |const|
The fraction from the **ShapeCast2D**'s origin to its :ref:`target_position<class_ShapeCast2D_property_target_position>` (between 0 and 1) of how far the shape can move without triggering a collision.
@@ -344,7 +344,7 @@ The fraction from the **ShapeCast2D**'s origin to its :ref:`target_position<clas
.. rst-class:: classref-method
:ref:`float<class_float>` **get_closest_collision_unsafe_fraction** **(** **)** |const|
:ref:`float<class_float>` **get_closest_collision_unsafe_fraction**\ (\ ) |const|
The fraction from the **ShapeCast2D**'s origin to its :ref:`target_position<class_ShapeCast2D_property_target_position>` (between 0 and 1) of how far the shape must move to trigger a collision.
@@ -356,7 +356,7 @@ The fraction from the **ShapeCast2D**'s origin to its :ref:`target_position<clas
.. rst-class:: classref-method
:ref:`Object<class_Object>` **get_collider** **(** :ref:`int<class_int>` index **)** |const|
:ref:`Object<class_Object>` **get_collider**\ (\ index\: :ref:`int<class_int>`\ ) |const|
Returns the collided :ref:`Object<class_Object>` of one of the multiple collisions at ``index``, or ``null`` if no object is intersecting the shape (i.e. :ref:`is_colliding<class_ShapeCast2D_method_is_colliding>` returns ``false``).
@@ -368,7 +368,7 @@ Returns the collided :ref:`Object<class_Object>` of one of the multiple collisio
.. rst-class:: classref-method
:ref:`RID<class_RID>` **get_collider_rid** **(** :ref:`int<class_int>` index **)** |const|
:ref:`RID<class_RID>` **get_collider_rid**\ (\ index\: :ref:`int<class_int>`\ ) |const|
Returns the :ref:`RID<class_RID>` of the collided object of one of the multiple collisions at ``index``.
@@ -380,7 +380,7 @@ Returns the :ref:`RID<class_RID>` of the collided object of one of the multiple
.. rst-class:: classref-method
:ref:`int<class_int>` **get_collider_shape** **(** :ref:`int<class_int>` index **)** |const|
:ref:`int<class_int>` **get_collider_shape**\ (\ index\: :ref:`int<class_int>`\ ) |const|
Returns the shape ID of the colliding shape of one of the multiple collisions at ``index``, or ``0`` if no object is intersecting the shape (i.e. :ref:`is_colliding<class_ShapeCast2D_method_is_colliding>` returns ``false``).
@@ -392,7 +392,7 @@ Returns the shape ID of the colliding shape of one of the multiple collisions at
.. rst-class:: classref-method
:ref:`int<class_int>` **get_collision_count** **(** **)** |const|
:ref:`int<class_int>` **get_collision_count**\ (\ ) |const|
The number of collisions detected at the point of impact. Use this to iterate over multiple collisions as provided by :ref:`get_collider<class_ShapeCast2D_method_get_collider>`, :ref:`get_collider_shape<class_ShapeCast2D_method_get_collider_shape>`, :ref:`get_collision_point<class_ShapeCast2D_method_get_collision_point>`, and :ref:`get_collision_normal<class_ShapeCast2D_method_get_collision_normal>` methods.
@@ -404,7 +404,7 @@ The number of collisions detected at the point of impact. Use this to iterate ov
.. rst-class:: classref-method
:ref:`bool<class_bool>` **get_collision_mask_value** **(** :ref:`int<class_int>` layer_number **)** |const|
:ref:`bool<class_bool>` **get_collision_mask_value**\ (\ layer_number\: :ref:`int<class_int>`\ ) |const|
Returns whether or not the specified layer of the :ref:`collision_mask<class_ShapeCast2D_property_collision_mask>` is enabled, given a ``layer_number`` between 1 and 32.
@@ -416,7 +416,7 @@ Returns whether or not the specified layer of the :ref:`collision_mask<class_Sha
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_collision_normal** **(** :ref:`int<class_int>` index **)** |const|
:ref:`Vector2<class_Vector2>` **get_collision_normal**\ (\ index\: :ref:`int<class_int>`\ ) |const|
Returns the normal of one of the multiple collisions at ``index`` of the intersecting object.
@@ -428,7 +428,7 @@ Returns the normal of one of the multiple collisions at ``index`` of the interse
.. rst-class:: classref-method
:ref:`Vector2<class_Vector2>` **get_collision_point** **(** :ref:`int<class_int>` index **)** |const|
:ref:`Vector2<class_Vector2>` **get_collision_point**\ (\ index\: :ref:`int<class_int>`\ ) |const|
Returns the collision point of one of the multiple collisions at ``index`` where the shape intersects the colliding object.
@@ -442,7 +442,7 @@ Returns the collision point of one of the multiple collisions at ``index`` where
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_colliding** **(** **)** |const|
:ref:`bool<class_bool>` **is_colliding**\ (\ ) |const|
Returns whether any object is intersecting with the shape's vector (considering the vector length).
@@ -454,7 +454,7 @@ Returns whether any object is intersecting with the shape's vector (considering
.. rst-class:: classref-method
void **remove_exception** **(** :ref:`CollisionObject2D<class_CollisionObject2D>` node **)**
|void| **remove_exception**\ (\ node\: :ref:`CollisionObject2D<class_CollisionObject2D>`\ )
Removes a collision exception so the shape does report collisions with the specified :ref:`CollisionObject2D<class_CollisionObject2D>` node.
@@ -466,7 +466,7 @@ Removes a collision exception so the shape does report collisions with the speci
.. rst-class:: classref-method
void **remove_exception_rid** **(** :ref:`RID<class_RID>` rid **)**
|void| **remove_exception_rid**\ (\ rid\: :ref:`RID<class_RID>`\ )
Removes a collision exception so the shape does report collisions with the specified :ref:`RID<class_RID>`.
@@ -478,7 +478,7 @@ Removes a collision exception so the shape does report collisions with the speci
.. rst-class:: classref-method
void **set_collision_mask_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
|void| **set_collision_mask_value**\ (\ layer_number\: :ref:`int<class_int>`, value\: :ref:`bool<class_bool>`\ )
Based on ``value``, enables or disables the specified layer in the :ref:`collision_mask<class_ShapeCast2D_property_collision_mask>`, given a ``layer_number`` between 1 and 32.
@@ -489,3 +489,4 @@ Based on ``value``, enables or disables the specified layer in the :ref:`collisi
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
.. |void| replace:: :abbr:`void (No return value.)`