class_physicstestmotionparameters2d.rst 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the PhysicsTestMotionParameters2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_PhysicsTestMotionParameters2D:
  6. PhysicsTestMotionParameters2D
  7. =============================
  8. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  9. Parameters to be sent to a 2D body motion test.
  10. Description
  11. -----------
  12. This class contains parameters used in :ref:`PhysicsServer2D.body_test_motion<class_PhysicsServer2D_method_body_test_motion>`.
  13. Properties
  14. ----------
  15. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  16. | :ref:`bool<class_bool>` | :ref:`collide_separation_ray<class_PhysicsTestMotionParameters2D_property_collide_separation_ray>` | ``false`` |
  17. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  18. | :ref:`Array<class_Array>` | :ref:`exclude_bodies<class_PhysicsTestMotionParameters2D_property_exclude_bodies>` | ``[]`` |
  19. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  20. | :ref:`Array<class_Array>` | :ref:`exclude_objects<class_PhysicsTestMotionParameters2D_property_exclude_objects>` | ``[]`` |
  21. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  22. | :ref:`Transform2D<class_Transform2D>` | :ref:`from<class_PhysicsTestMotionParameters2D_property_from>` | ``Transform2D(1, 0, 0, 1, 0, 0)`` |
  23. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  24. | :ref:`float<class_float>` | :ref:`margin<class_PhysicsTestMotionParameters2D_property_margin>` | ``0.08`` |
  25. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  26. | :ref:`Vector2<class_Vector2>` | :ref:`motion<class_PhysicsTestMotionParameters2D_property_motion>` | ``Vector2(0, 0)`` |
  27. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------+
  28. Property Descriptions
  29. ---------------------
  30. .. _class_PhysicsTestMotionParameters2D_property_collide_separation_ray:
  31. - :ref:`bool<class_bool>` **collide_separation_ray**
  32. +-----------+-------------------------------------------+
  33. | *Default* | ``false`` |
  34. +-----------+-------------------------------------------+
  35. | *Setter* | set_collide_separation_ray_enabled(value) |
  36. +-----------+-------------------------------------------+
  37. | *Getter* | is_collide_separation_ray_enabled() |
  38. +-----------+-------------------------------------------+
  39. 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.
  40. 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.
  41. ----
  42. .. _class_PhysicsTestMotionParameters2D_property_exclude_bodies:
  43. - :ref:`Array<class_Array>` **exclude_bodies**
  44. +-----------+---------------------------+
  45. | *Default* | ``[]`` |
  46. +-----------+---------------------------+
  47. | *Setter* | set_exclude_bodies(value) |
  48. +-----------+---------------------------+
  49. | *Getter* | get_exclude_bodies() |
  50. +-----------+---------------------------+
  51. Optional array of body :ref:`RID<class_RID>` to exclude from collision.
  52. ----
  53. .. _class_PhysicsTestMotionParameters2D_property_exclude_objects:
  54. - :ref:`Array<class_Array>` **exclude_objects**
  55. +-----------+----------------------------+
  56. | *Default* | ``[]`` |
  57. +-----------+----------------------------+
  58. | *Setter* | set_exclude_objects(value) |
  59. +-----------+----------------------------+
  60. | *Getter* | get_exclude_objects() |
  61. +-----------+----------------------------+
  62. Optional array of object unique instance ID to exclude from collision. See :ref:`Object.get_instance_id<class_Object_method_get_instance_id>`.
  63. ----
  64. .. _class_PhysicsTestMotionParameters2D_property_from:
  65. - :ref:`Transform2D<class_Transform2D>` **from**
  66. +-----------+-----------------------------------+
  67. | *Default* | ``Transform2D(1, 0, 0, 1, 0, 0)`` |
  68. +-----------+-----------------------------------+
  69. | *Setter* | set_from(value) |
  70. +-----------+-----------------------------------+
  71. | *Getter* | get_from() |
  72. +-----------+-----------------------------------+
  73. 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.
  74. ----
  75. .. _class_PhysicsTestMotionParameters2D_property_margin:
  76. - :ref:`float<class_float>` **margin**
  77. +-----------+-------------------+
  78. | *Default* | ``0.08`` |
  79. +-----------+-------------------+
  80. | *Setter* | set_margin(value) |
  81. +-----------+-------------------+
  82. | *Getter* | get_margin() |
  83. +-----------+-------------------+
  84. Increases the size of the shapes involved in the collision detection.
  85. ----
  86. .. _class_PhysicsTestMotionParameters2D_property_motion:
  87. - :ref:`Vector2<class_Vector2>` **motion**
  88. +-----------+-------------------+
  89. | *Default* | ``Vector2(0, 0)`` |
  90. +-----------+-------------------+
  91. | *Setter* | set_motion(value) |
  92. +-----------+-------------------+
  93. | *Getter* | get_motion() |
  94. +-----------+-------------------+
  95. Motion vector to define the length and direction of the motion to test.
  96. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  97. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  98. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  99. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  100. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  101. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`