class_physics2ddirectspacestate.rst 7.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_Physics2DDirectSpaceState:
  4. Physics2DDirectSpaceState
  5. =========================
  6. **Inherits:** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Direct access object to a space in the :ref:`Physics2DServer<class_physics2dserver>`.
  11. Member Functions
  12. ----------------
  13. +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`Array<class_array>` | :ref:`intersect_point<class_Physics2DDirectSpaceState_intersect_point>` **(** :ref:`Vector2<class_vector2>` point, :ref:`int<class_int>` max_results=32, :ref:`Array<class_array>` exclude=Array(), :ref:`int<class_int>` layer_mask=2147483647, :ref:`int<class_int>` type_mask=15 **)** |
  15. +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`Dictionary<class_dictionary>` | :ref:`intersect_ray<class_Physics2DDirectSpaceState_intersect_ray>` **(** :ref:`Vector2<class_vector2>` from, :ref:`Vector2<class_vector2>` to, :ref:`Array<class_array>` exclude=Array(), :ref:`int<class_int>` layer_mask=2147483647, :ref:`int<class_int>` type_mask=15 **)** |
  17. +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`Array<class_array>` | :ref:`intersect_shape<class_Physics2DDirectSpaceState_intersect_shape>` **(** :ref:`Physics2DShapeQueryParameters<class_physics2dshapequeryparameters>` shape, :ref:`int<class_int>` max_results=32 **)** |
  19. +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`Array<class_array>` | :ref:`cast_motion<class_Physics2DDirectSpaceState_cast_motion>` **(** :ref:`Physics2DShapeQueryParameters<class_physics2dshapequeryparameters>` shape **)** |
  21. +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`Array<class_array>` | :ref:`collide_shape<class_Physics2DDirectSpaceState_collide_shape>` **(** :ref:`Physics2DShapeQueryParameters<class_physics2dshapequeryparameters>` shape, :ref:`int<class_int>` max_results=32 **)** |
  23. +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Dictionary<class_dictionary>` | :ref:`get_rest_info<class_Physics2DDirectSpaceState_get_rest_info>` **(** :ref:`Physics2DShapeQueryParameters<class_physics2dshapequeryparameters>` shape **)** |
  25. +--------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. Numeric Constants
  27. -----------------
  28. - **TYPE_MASK_STATIC_BODY** = **1**
  29. - **TYPE_MASK_KINEMATIC_BODY** = **2**
  30. - **TYPE_MASK_RIGID_BODY** = **4**
  31. - **TYPE_MASK_CHARACTER_BODY** = **8**
  32. - **TYPE_MASK_AREA** = **16**
  33. - **TYPE_MASK_COLLISION** = **15**
  34. Description
  35. -----------
  36. Direct access object to a space in the :ref:`Physics2DServer<class_physics2dserver>`. It's used mainly to do queries against objects and areas residing in a given space.
  37. Member Function Description
  38. ---------------------------
  39. .. _class_Physics2DDirectSpaceState_intersect_point:
  40. - :ref:`Array<class_array>` **intersect_point** **(** :ref:`Vector2<class_vector2>` point, :ref:`int<class_int>` max_results=32, :ref:`Array<class_array>` exclude=Array(), :ref:`int<class_int>` layer_mask=2147483647, :ref:`int<class_int>` type_mask=15 **)**
  41. .. _class_Physics2DDirectSpaceState_intersect_ray:
  42. - :ref:`Dictionary<class_dictionary>` **intersect_ray** **(** :ref:`Vector2<class_vector2>` from, :ref:`Vector2<class_vector2>` to, :ref:`Array<class_array>` exclude=Array(), :ref:`int<class_int>` layer_mask=2147483647, :ref:`int<class_int>` type_mask=15 **)**
  43. Intersect a ray in a given space, the returned object is a dictionary with the following fields:
  44. position: place where ray is stopped.
  45. normal: normal of the object at the point where the ray was stopped.
  46. shape: shape index of the object against which the ray was stopped.
  47. collider\_: collider against which the ray was stopped.
  48. collider_id: collider id of the object against which the ray was stopped.
  49. collider: collider object against which the ray was stopped.
  50. rid: :ref:`RID<class_rid>` of the object against which the ray was stopped.
  51. If the ray did not intersect anything, then an empty dictionary (dir.empty()==true) is returned instead.
  52. .. _class_Physics2DDirectSpaceState_intersect_shape:
  53. - :ref:`Array<class_array>` **intersect_shape** **(** :ref:`Physics2DShapeQueryParameters<class_physics2dshapequeryparameters>` shape, :ref:`int<class_int>` max_results=32 **)**
  54. Intersect a given shape (RID or :ref:`Shape2D<class_shape2d>`) against the space, the intersected shapes are returned in a special result object.
  55. .. _class_Physics2DDirectSpaceState_cast_motion:
  56. - :ref:`Array<class_array>` **cast_motion** **(** :ref:`Physics2DShapeQueryParameters<class_physics2dshapequeryparameters>` shape **)**
  57. .. _class_Physics2DDirectSpaceState_collide_shape:
  58. - :ref:`Array<class_array>` **collide_shape** **(** :ref:`Physics2DShapeQueryParameters<class_physics2dshapequeryparameters>` shape, :ref:`int<class_int>` max_results=32 **)**
  59. .. _class_Physics2DDirectSpaceState_get_rest_info:
  60. - :ref:`Dictionary<class_dictionary>` **get_rest_info** **(** :ref:`Physics2DShapeQueryParameters<class_physics2dshapequeryparameters>` shape **)**