class_physicstestmotionparameters3d.rst 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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/PhysicsTestMotionParameters3D.xml.
  6. .. _class_PhysicsTestMotionParameters3D:
  7. PhysicsTestMotionParameters3D
  8. =============================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Provides parameters for :ref:`PhysicsServer3D.body_test_motion<class_PhysicsServer3D_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:`PhysicsServer3D.body_test_motion<class_PhysicsServer3D_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_PhysicsTestMotionParameters3D_property_collide_separation_ray>` | ``false`` |
  22. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------+
  23. | :ref:`RID[]<class_RID>` | :ref:`exclude_bodies<class_PhysicsTestMotionParameters3D_property_exclude_bodies>` | ``[]`` |
  24. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------+
  25. | :ref:`int[]<class_int>` | :ref:`exclude_objects<class_PhysicsTestMotionParameters3D_property_exclude_objects>` | ``[]`` |
  26. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------+
  27. | :ref:`Transform3D<class_Transform3D>` | :ref:`from<class_PhysicsTestMotionParameters3D_property_from>` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` |
  28. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------+
  29. | :ref:`float<class_float>` | :ref:`margin<class_PhysicsTestMotionParameters3D_property_margin>` | ``0.001`` |
  30. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------+
  31. | :ref:`int<class_int>` | :ref:`max_collisions<class_PhysicsTestMotionParameters3D_property_max_collisions>` | ``1`` |
  32. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------+
  33. | :ref:`Vector3<class_Vector3>` | :ref:`motion<class_PhysicsTestMotionParameters3D_property_motion>` | ``Vector3(0, 0, 0)`` |
  34. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`recovery_as_collision<class_PhysicsTestMotionParameters3D_property_recovery_as_collision>` | ``false`` |
  36. +---------------------------------------+----------------------------------------------------------------------------------------------------+-----------------------------------------------------+
  37. .. rst-class:: classref-section-separator
  38. ----
  39. .. rst-class:: classref-descriptions-group
  40. Property Descriptions
  41. ---------------------
  42. .. _class_PhysicsTestMotionParameters3D_property_collide_separation_ray:
  43. .. rst-class:: classref-property
  44. :ref:`bool<class_bool>` **collide_separation_ray** = ``false``
  45. .. rst-class:: classref-property-setget
  46. - void **set_collide_separation_ray_enabled** **(** :ref:`bool<class_bool>` value **)**
  47. - :ref:`bool<class_bool>` **is_collide_separation_ray_enabled** **(** **)**
  48. If set to ``true``, shapes of type :ref:`PhysicsServer3D.SHAPE_SEPARATION_RAY<class_PhysicsServer3D_constant_SHAPE_SEPARATION_RAY>` are used to detect collisions and can stop the motion. Can be useful when snapping to the ground.
  49. If set to ``false``, shapes of type :ref:`PhysicsServer3D.SHAPE_SEPARATION_RAY<class_PhysicsServer3D_constant_SHAPE_SEPARATION_RAY>` are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes.
  50. .. rst-class:: classref-item-separator
  51. ----
  52. .. _class_PhysicsTestMotionParameters3D_property_exclude_bodies:
  53. .. rst-class:: classref-property
  54. :ref:`RID[]<class_RID>` **exclude_bodies** = ``[]``
  55. .. rst-class:: classref-property-setget
  56. - void **set_exclude_bodies** **(** :ref:`RID[]<class_RID>` value **)**
  57. - :ref:`RID[]<class_RID>` **get_exclude_bodies** **(** **)**
  58. Optional array of body :ref:`RID<class_RID>` to exclude from collision. Use :ref:`CollisionObject3D.get_rid<class_CollisionObject3D_method_get_rid>` to get the :ref:`RID<class_RID>` associated with a :ref:`CollisionObject3D<class_CollisionObject3D>`-derived node.
  59. .. rst-class:: classref-item-separator
  60. ----
  61. .. _class_PhysicsTestMotionParameters3D_property_exclude_objects:
  62. .. rst-class:: classref-property
  63. :ref:`int[]<class_int>` **exclude_objects** = ``[]``
  64. .. rst-class:: classref-property-setget
  65. - void **set_exclude_objects** **(** :ref:`int[]<class_int>` value **)**
  66. - :ref:`int[]<class_int>` **get_exclude_objects** **(** **)**
  67. Optional array of object unique instance ID to exclude from collision. See :ref:`Object.get_instance_id<class_Object_method_get_instance_id>`.
  68. .. rst-class:: classref-item-separator
  69. ----
  70. .. _class_PhysicsTestMotionParameters3D_property_from:
  71. .. rst-class:: classref-property
  72. :ref:`Transform3D<class_Transform3D>` **from** = ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)``
  73. .. rst-class:: classref-property-setget
  74. - void **set_from** **(** :ref:`Transform3D<class_Transform3D>` value **)**
  75. - :ref:`Transform3D<class_Transform3D>` **get_from** **(** **)**
  76. Transform in global space where the motion should start. Usually set to :ref:`Node3D.global_transform<class_Node3D_property_global_transform>` for the current body's transform.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_PhysicsTestMotionParameters3D_property_margin:
  80. .. rst-class:: classref-property
  81. :ref:`float<class_float>` **margin** = ``0.001``
  82. .. rst-class:: classref-property-setget
  83. - void **set_margin** **(** :ref:`float<class_float>` value **)**
  84. - :ref:`float<class_float>` **get_margin** **(** **)**
  85. Increases the size of the shapes involved in the collision detection.
  86. .. rst-class:: classref-item-separator
  87. ----
  88. .. _class_PhysicsTestMotionParameters3D_property_max_collisions:
  89. .. rst-class:: classref-property
  90. :ref:`int<class_int>` **max_collisions** = ``1``
  91. .. rst-class:: classref-property-setget
  92. - void **set_max_collisions** **(** :ref:`int<class_int>` value **)**
  93. - :ref:`int<class_int>` **get_max_collisions** **(** **)**
  94. Maximum number of returned collisions, between ``1`` and ``32``. Always returns the deepest detected collisions.
  95. .. rst-class:: classref-item-separator
  96. ----
  97. .. _class_PhysicsTestMotionParameters3D_property_motion:
  98. .. rst-class:: classref-property
  99. :ref:`Vector3<class_Vector3>` **motion** = ``Vector3(0, 0, 0)``
  100. .. rst-class:: classref-property-setget
  101. - void **set_motion** **(** :ref:`Vector3<class_Vector3>` value **)**
  102. - :ref:`Vector3<class_Vector3>` **get_motion** **(** **)**
  103. Motion vector to define the length and direction of the motion to test.
  104. .. rst-class:: classref-item-separator
  105. ----
  106. .. _class_PhysicsTestMotionParameters3D_property_recovery_as_collision:
  107. .. rst-class:: classref-property
  108. :ref:`bool<class_bool>` **recovery_as_collision** = ``false``
  109. .. rst-class:: classref-property-setget
  110. - void **set_recovery_as_collision_enabled** **(** :ref:`bool<class_bool>` value **)**
  111. - :ref:`bool<class_bool>` **is_recovery_as_collision_enabled** **(** **)**
  112. If set to ``true``, any depenetration from the recovery phase is reported as a collision; this is used e.g. by :ref:`CharacterBody3D<class_CharacterBody3D>` for improving floor detection during floor snapping.
  113. If set to ``false``, only collisions resulting from the motion are reported, which is generally the desired behavior.
  114. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  115. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  116. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  117. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  118. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  119. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  120. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`