class_physicstestmotionparameters2d.rst 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/PhysicsTestMotionParameters2D.xml.
  6. .. _class_PhysicsTestMotionParameters2D:
  7. PhysicsTestMotionParameters2D
  8. =============================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Parameters to be sent to a 2D body motion test.
  11. Description
  12. -----------
  13. This class contains parameters used in :ref:`PhysicsServer2D.body_test_motion<class_PhysicsServer2D_method_body_test_motion>`.
  14. Properties
  15. ----------
  16. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  17. | :ref:`bool<class_bool>` | :ref:`collide_separation_ray<class_PhysicsTestMotionParameters2D_property_collide_separation_ray>` | ``false`` |
  18. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  19. | :ref:`RID[]<class_RID>` | :ref:`exclude_bodies<class_PhysicsTestMotionParameters2D_property_exclude_bodies>` | ``[]`` |
  20. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  21. | :ref:`Array<class_Array>` | :ref:`exclude_objects<class_PhysicsTestMotionParameters2D_property_exclude_objects>` | ``[]`` |
  22. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  23. | :ref:`Transform2D<class_Transform2D>` | :ref:`from<class_PhysicsTestMotionParameters2D_property_from>` | ``Transform2D(1, 0, 0, 1, 0, 0)`` |
  24. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  25. | :ref:`float<class_float>` | :ref:`margin<class_PhysicsTestMotionParameters2D_property_margin>` | ``0.08`` |
  26. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  27. | :ref:`Vector2<class_Vector2>` | :ref:`motion<class_PhysicsTestMotionParameters2D_property_motion>` | ``Vector2(0, 0)`` |
  28. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  29. | :ref:`bool<class_bool>` | :ref:`recovery_as_collision<class_PhysicsTestMotionParameters2D_property_recovery_as_collision>` | ``false`` |
  30. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  31. Property Descriptions
  32. ---------------------
  33. .. _class_PhysicsTestMotionParameters2D_property_collide_separation_ray:
  34. - :ref:`bool<class_bool>` **collide_separation_ray**
  35. +-----------+-------------------------------------------+
  36. | *Default* | ``false`` |
  37. +-----------+-------------------------------------------+
  38. | *Setter* | set_collide_separation_ray_enabled(value) |
  39. +-----------+-------------------------------------------+
  40. | *Getter* | is_collide_separation_ray_enabled() |
  41. +-----------+-------------------------------------------+
  42. 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.
  43. 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.
  44. ----
  45. .. _class_PhysicsTestMotionParameters2D_property_exclude_bodies:
  46. - :ref:`RID[]<class_RID>` **exclude_bodies**
  47. +-----------+---------------------------+
  48. | *Default* | ``[]`` |
  49. +-----------+---------------------------+
  50. | *Setter* | set_exclude_bodies(value) |
  51. +-----------+---------------------------+
  52. | *Getter* | get_exclude_bodies() |
  53. +-----------+---------------------------+
  54. Optional array of body :ref:`RID<class_RID>` to exclude from collision.
  55. ----
  56. .. _class_PhysicsTestMotionParameters2D_property_exclude_objects:
  57. - :ref:`Array<class_Array>` **exclude_objects**
  58. +-----------+----------------------------+
  59. | *Default* | ``[]`` |
  60. +-----------+----------------------------+
  61. | *Setter* | set_exclude_objects(value) |
  62. +-----------+----------------------------+
  63. | *Getter* | get_exclude_objects() |
  64. +-----------+----------------------------+
  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. ----
  67. .. _class_PhysicsTestMotionParameters2D_property_from:
  68. - :ref:`Transform2D<class_Transform2D>` **from**
  69. +-----------+-----------------------------------+
  70. | *Default* | ``Transform2D(1, 0, 0, 1, 0, 0)`` |
  71. +-----------+-----------------------------------+
  72. | *Setter* | set_from(value) |
  73. +-----------+-----------------------------------+
  74. | *Getter* | get_from() |
  75. +-----------+-----------------------------------+
  76. 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.
  77. ----
  78. .. _class_PhysicsTestMotionParameters2D_property_margin:
  79. - :ref:`float<class_float>` **margin**
  80. +-----------+-------------------+
  81. | *Default* | ``0.08`` |
  82. +-----------+-------------------+
  83. | *Setter* | set_margin(value) |
  84. +-----------+-------------------+
  85. | *Getter* | get_margin() |
  86. +-----------+-------------------+
  87. Increases the size of the shapes involved in the collision detection.
  88. ----
  89. .. _class_PhysicsTestMotionParameters2D_property_motion:
  90. - :ref:`Vector2<class_Vector2>` **motion**
  91. +-----------+-------------------+
  92. | *Default* | ``Vector2(0, 0)`` |
  93. +-----------+-------------------+
  94. | *Setter* | set_motion(value) |
  95. +-----------+-------------------+
  96. | *Getter* | get_motion() |
  97. +-----------+-------------------+
  98. Motion vector to define the length and direction of the motion to test.
  99. ----
  100. .. _class_PhysicsTestMotionParameters2D_property_recovery_as_collision:
  101. - :ref:`bool<class_bool>` **recovery_as_collision**
  102. +-----------+------------------------------------------+
  103. | *Default* | ``false`` |
  104. +-----------+------------------------------------------+
  105. | *Setter* | set_recovery_as_collision_enabled(value) |
  106. +-----------+------------------------------------------+
  107. | *Getter* | is_recovery_as_collision_enabled() |
  108. +-----------+------------------------------------------+
  109. If set to ``true``, any depenetration from the recovery phase is reported as a collision; this is used e.g. by :ref:`CharacterBody2D.move_and_slide<class_CharacterBody2D_method_move_and_slide>` for improving floor detection when floor snapping is disabled.
  110. If set to ``false``, only collisions resulting from the motion are reported; this is used e.g. by :ref:`PhysicsBody2D.move_and_collide<class_PhysicsBody2D_method_move_and_collide>`.
  111. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  112. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  113. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  114. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  115. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  116. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`