class_physicstestmotionparameters2d.rst 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/PhysicsTestMotionParameters2D.xml.
  6. .. _class_PhysicsTestMotionParameters2D:
  7. PhysicsTestMotionParameters2D
  8. =============================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Provides parameters for :ref:`PhysicsServer2D.body_test_motion<class_PhysicsServer2D_method_body_test_motion>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. By changing various properties of this object, such as the motion, you can configure the parameters for :ref:`PhysicsServer2D.body_test_motion<class_PhysicsServer2D_method_body_test_motion>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  21. | :ref:`bool<class_bool>` | :ref:`collide_separation_ray<class_PhysicsTestMotionParameters2D_property_collide_separation_ray>` | ``false`` |
  22. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  23. | :ref:`RID[]<class_RID>` | :ref:`exclude_bodies<class_PhysicsTestMotionParameters2D_property_exclude_bodies>` | ``[]`` |
  24. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  25. | :ref:`int[]<class_int>` | :ref:`exclude_objects<class_PhysicsTestMotionParameters2D_property_exclude_objects>` | ``[]`` |
  26. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  27. | :ref:`Transform2D<class_Transform2D>` | :ref:`from<class_PhysicsTestMotionParameters2D_property_from>` | ``Transform2D(1, 0, 0, 1, 0, 0)`` |
  28. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  29. | :ref:`float<class_float>` | :ref:`margin<class_PhysicsTestMotionParameters2D_property_margin>` | ``0.08`` |
  30. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  31. | :ref:`Vector2<class_Vector2>` | :ref:`motion<class_PhysicsTestMotionParameters2D_property_motion>` | ``Vector2(0, 0)`` |
  32. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`recovery_as_collision<class_PhysicsTestMotionParameters2D_property_recovery_as_collision>` | ``false`` |
  34. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  35. .. rst-class:: classref-section-separator
  36. ----
  37. .. rst-class:: classref-descriptions-group
  38. Property Descriptions
  39. ---------------------
  40. .. _class_PhysicsTestMotionParameters2D_property_collide_separation_ray:
  41. .. rst-class:: classref-property
  42. :ref:`bool<class_bool>` **collide_separation_ray** = ``false``
  43. .. rst-class:: classref-property-setget
  44. - void **set_collide_separation_ray_enabled** **(** :ref:`bool<class_bool>` value **)**
  45. - :ref:`bool<class_bool>` **is_collide_separation_ray_enabled** **(** **)**
  46. If set to ``true``, shapes of type :ref:`PhysicsServer2D.SHAPE_SEPARATION_RAY<class_PhysicsServer2D_constant_SHAPE_SEPARATION_RAY>` are used to detect collisions and can stop the motion. Can be useful when snapping to the ground.
  47. If set to ``false``, shapes of type :ref:`PhysicsServer2D.SHAPE_SEPARATION_RAY<class_PhysicsServer2D_constant_SHAPE_SEPARATION_RAY>` are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_PhysicsTestMotionParameters2D_property_exclude_bodies:
  51. .. rst-class:: classref-property
  52. :ref:`RID[]<class_RID>` **exclude_bodies** = ``[]``
  53. .. rst-class:: classref-property-setget
  54. - void **set_exclude_bodies** **(** :ref:`RID[]<class_RID>` value **)**
  55. - :ref:`RID[]<class_RID>` **get_exclude_bodies** **(** **)**
  56. Optional array of body :ref:`RID<class_RID>` to exclude from collision. Use :ref:`CollisionObject2D.get_rid<class_CollisionObject2D_method_get_rid>` to get the :ref:`RID<class_RID>` associated with a :ref:`CollisionObject2D<class_CollisionObject2D>`-derived node.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_PhysicsTestMotionParameters2D_property_exclude_objects:
  60. .. rst-class:: classref-property
  61. :ref:`int[]<class_int>` **exclude_objects** = ``[]``
  62. .. rst-class:: classref-property-setget
  63. - void **set_exclude_objects** **(** :ref:`int[]<class_int>` value **)**
  64. - :ref:`int[]<class_int>` **get_exclude_objects** **(** **)**
  65. Optional array of object unique instance ID to exclude from collision. See :ref:`Object.get_instance_id<class_Object_method_get_instance_id>`.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_PhysicsTestMotionParameters2D_property_from:
  69. .. rst-class:: classref-property
  70. :ref:`Transform2D<class_Transform2D>` **from** = ``Transform2D(1, 0, 0, 1, 0, 0)``
  71. .. rst-class:: classref-property-setget
  72. - void **set_from** **(** :ref:`Transform2D<class_Transform2D>` value **)**
  73. - :ref:`Transform2D<class_Transform2D>` **get_from** **(** **)**
  74. Transform in global space where the motion should start. Usually set to :ref:`Node2D.global_transform<class_Node2D_property_global_transform>` for the current body's transform.
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_PhysicsTestMotionParameters2D_property_margin:
  78. .. rst-class:: classref-property
  79. :ref:`float<class_float>` **margin** = ``0.08``
  80. .. rst-class:: classref-property-setget
  81. - void **set_margin** **(** :ref:`float<class_float>` value **)**
  82. - :ref:`float<class_float>` **get_margin** **(** **)**
  83. Increases the size of the shapes involved in the collision detection.
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_PhysicsTestMotionParameters2D_property_motion:
  87. .. rst-class:: classref-property
  88. :ref:`Vector2<class_Vector2>` **motion** = ``Vector2(0, 0)``
  89. .. rst-class:: classref-property-setget
  90. - void **set_motion** **(** :ref:`Vector2<class_Vector2>` value **)**
  91. - :ref:`Vector2<class_Vector2>` **get_motion** **(** **)**
  92. Motion vector to define the length and direction of the motion to test.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_PhysicsTestMotionParameters2D_property_recovery_as_collision:
  96. .. rst-class:: classref-property
  97. :ref:`bool<class_bool>` **recovery_as_collision** = ``false``
  98. .. rst-class:: classref-property-setget
  99. - void **set_recovery_as_collision_enabled** **(** :ref:`bool<class_bool>` value **)**
  100. - :ref:`bool<class_bool>` **is_recovery_as_collision_enabled** **(** **)**
  101. If set to ``true``, any depenetration from the recovery phase is reported as a collision; this is used e.g. by :ref:`CharacterBody2D<class_CharacterBody2D>` for improving floor detection during floor snapping.
  102. If set to ``false``, only collisions resulting from the motion are reported, which is generally the desired behavior.
  103. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  104. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  105. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  106. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  107. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  108. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  109. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`