class_physicsrayqueryparameters3d.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/PhysicsRayQueryParameters3D.xml.
  6. .. _class_PhysicsRayQueryParameters3D:
  7. PhysicsRayQueryParameters3D
  8. ===========================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Parameters to be sent to a 3D ray physics query.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. This class contains the ray position and other parameters to be used for :ref:`PhysicsDirectSpaceState3D.intersect_ray<class_PhysicsDirectSpaceState3D_method_intersect_ray>`.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +-------------------------------+--------------------------------------------------------------------------------------------+----------------------+
  21. | :ref:`bool<class_bool>` | :ref:`collide_with_areas<class_PhysicsRayQueryParameters3D_property_collide_with_areas>` | ``false`` |
  22. +-------------------------------+--------------------------------------------------------------------------------------------+----------------------+
  23. | :ref:`bool<class_bool>` | :ref:`collide_with_bodies<class_PhysicsRayQueryParameters3D_property_collide_with_bodies>` | ``true`` |
  24. +-------------------------------+--------------------------------------------------------------------------------------------+----------------------+
  25. | :ref:`int<class_int>` | :ref:`collision_mask<class_PhysicsRayQueryParameters3D_property_collision_mask>` | ``4294967295`` |
  26. +-------------------------------+--------------------------------------------------------------------------------------------+----------------------+
  27. | :ref:`RID[]<class_RID>` | :ref:`exclude<class_PhysicsRayQueryParameters3D_property_exclude>` | ``[]`` |
  28. +-------------------------------+--------------------------------------------------------------------------------------------+----------------------+
  29. | :ref:`Vector3<class_Vector3>` | :ref:`from<class_PhysicsRayQueryParameters3D_property_from>` | ``Vector3(0, 0, 0)`` |
  30. +-------------------------------+--------------------------------------------------------------------------------------------+----------------------+
  31. | :ref:`bool<class_bool>` | :ref:`hit_back_faces<class_PhysicsRayQueryParameters3D_property_hit_back_faces>` | ``true`` |
  32. +-------------------------------+--------------------------------------------------------------------------------------------+----------------------+
  33. | :ref:`bool<class_bool>` | :ref:`hit_from_inside<class_PhysicsRayQueryParameters3D_property_hit_from_inside>` | ``false`` |
  34. +-------------------------------+--------------------------------------------------------------------------------------------+----------------------+
  35. | :ref:`Vector3<class_Vector3>` | :ref:`to<class_PhysicsRayQueryParameters3D_property_to>` | ``Vector3(0, 0, 0)`` |
  36. +-------------------------------+--------------------------------------------------------------------------------------------+----------------------+
  37. .. rst-class:: classref-reftable-group
  38. Methods
  39. -------
  40. .. table::
  41. :widths: auto
  42. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`PhysicsRayQueryParameters3D<class_PhysicsRayQueryParameters3D>` | :ref:`create<class_PhysicsRayQueryParameters3D_method_create>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to, :ref:`int<class_int>` collision_mask=4294967295, :ref:`RID[]<class_RID>` exclude=[] **)** |static| |
  44. +-----------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Property Descriptions
  49. ---------------------
  50. .. _class_PhysicsRayQueryParameters3D_property_collide_with_areas:
  51. .. rst-class:: classref-property
  52. :ref:`bool<class_bool>` **collide_with_areas** = ``false``
  53. .. rst-class:: classref-property-setget
  54. - void **set_collide_with_areas** **(** :ref:`bool<class_bool>` value **)**
  55. - :ref:`bool<class_bool>` **is_collide_with_areas_enabled** **(** **)**
  56. If ``true``, the query will take :ref:`Area3D<class_Area3D>`\ s into account.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_PhysicsRayQueryParameters3D_property_collide_with_bodies:
  60. .. rst-class:: classref-property
  61. :ref:`bool<class_bool>` **collide_with_bodies** = ``true``
  62. .. rst-class:: classref-property-setget
  63. - void **set_collide_with_bodies** **(** :ref:`bool<class_bool>` value **)**
  64. - :ref:`bool<class_bool>` **is_collide_with_bodies_enabled** **(** **)**
  65. If ``true``, the query will take :ref:`PhysicsBody3D<class_PhysicsBody3D>`\ s into account.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_PhysicsRayQueryParameters3D_property_collision_mask:
  69. .. rst-class:: classref-property
  70. :ref:`int<class_int>` **collision_mask** = ``4294967295``
  71. .. rst-class:: classref-property-setget
  72. - void **set_collision_mask** **(** :ref:`int<class_int>` value **)**
  73. - :ref:`int<class_int>` **get_collision_mask** **(** **)**
  74. The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See `Collision layers and masks <../tutorials/physics/physics_introduction.html#collision-layers-and-masks>`__ in the documentation for more information.
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_PhysicsRayQueryParameters3D_property_exclude:
  78. .. rst-class:: classref-property
  79. :ref:`RID[]<class_RID>` **exclude** = ``[]``
  80. .. rst-class:: classref-property-setget
  81. - void **set_exclude** **(** :ref:`RID[]<class_RID>` value **)**
  82. - :ref:`RID[]<class_RID>` **get_exclude** **(** **)**
  83. The list of object :ref:`RID<class_RID>`\ s that will be excluded from collisions. 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.
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_PhysicsRayQueryParameters3D_property_from:
  87. .. rst-class:: classref-property
  88. :ref:`Vector3<class_Vector3>` **from** = ``Vector3(0, 0, 0)``
  89. .. rst-class:: classref-property-setget
  90. - void **set_from** **(** :ref:`Vector3<class_Vector3>` value **)**
  91. - :ref:`Vector3<class_Vector3>` **get_from** **(** **)**
  92. The starting point of the ray being queried for, in global coordinates.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_PhysicsRayQueryParameters3D_property_hit_back_faces:
  96. .. rst-class:: classref-property
  97. :ref:`bool<class_bool>` **hit_back_faces** = ``true``
  98. .. rst-class:: classref-property-setget
  99. - void **set_hit_back_faces** **(** :ref:`bool<class_bool>` value **)**
  100. - :ref:`bool<class_bool>` **is_hit_back_faces_enabled** **(** **)**
  101. If ``true``, the query will hit back faces with concave polygon shapes with back face enabled or heightmap shapes.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _class_PhysicsRayQueryParameters3D_property_hit_from_inside:
  105. .. rst-class:: classref-property
  106. :ref:`bool<class_bool>` **hit_from_inside** = ``false``
  107. .. rst-class:: classref-property-setget
  108. - void **set_hit_from_inside** **(** :ref:`bool<class_bool>` value **)**
  109. - :ref:`bool<class_bool>` **is_hit_from_inside_enabled** **(** **)**
  110. If ``true``, the query will detect a hit when starting inside shapes. In this case the collision normal will be ``Vector3(0, 0, 0)``. Does not affect concave polygon shapes or heightmap shapes.
  111. .. rst-class:: classref-item-separator
  112. ----
  113. .. _class_PhysicsRayQueryParameters3D_property_to:
  114. .. rst-class:: classref-property
  115. :ref:`Vector3<class_Vector3>` **to** = ``Vector3(0, 0, 0)``
  116. .. rst-class:: classref-property-setget
  117. - void **set_to** **(** :ref:`Vector3<class_Vector3>` value **)**
  118. - :ref:`Vector3<class_Vector3>` **get_to** **(** **)**
  119. The ending point of the ray being queried for, in global coordinates.
  120. .. rst-class:: classref-section-separator
  121. ----
  122. .. rst-class:: classref-descriptions-group
  123. Method Descriptions
  124. -------------------
  125. .. _class_PhysicsRayQueryParameters3D_method_create:
  126. .. rst-class:: classref-method
  127. :ref:`PhysicsRayQueryParameters3D<class_PhysicsRayQueryParameters3D>` **create** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` to, :ref:`int<class_int>` collision_mask=4294967295, :ref:`RID[]<class_RID>` exclude=[] **)** |static|
  128. Returns a new, pre-configured **PhysicsRayQueryParameters3D** object. Use it to quickly create query parameters using the most common options.
  129. ::
  130. var query = PhysicsRayQueryParameters3D.create(position, position + Vector3(0, -10, 0))
  131. var collision = get_world_3d().direct_space_state.intersect_ray(query)
  132. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  133. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  134. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  135. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  136. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  137. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`