class_physicsrayqueryparameters3d.rst 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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/PhysicsRayQueryParameters3D.xml.
  6. .. _class_PhysicsRayQueryParameters3D:
  7. PhysicsRayQueryParameters3D
  8. ===========================
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Provides parameters for :ref:`PhysicsDirectSpaceState3D.intersect_ray<class_PhysicsDirectSpaceState3D_method_intersect_ray>`.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. By changing various properties of this object, such as the ray position, you can configure the parameters 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:`Array<class_Array>`\[: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>`\ (\ from\: :ref:`Vector3<class_Vector3>`, to\: :ref:`Vector3<class_Vector3>`, collision_mask\: :ref:`int<class_int>` = 4294967295, exclude\: :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] = []\ ) |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`` :ref:`🔗<class_PhysicsRayQueryParameters3D_property_collide_with_areas>`
  53. .. rst-class:: classref-property-setget
  54. - |void| **set_collide_with_areas**\ (\ value\: :ref:`bool<class_bool>`\ )
  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`` :ref:`🔗<class_PhysicsRayQueryParameters3D_property_collide_with_bodies>`
  62. .. rst-class:: classref-property-setget
  63. - |void| **set_collide_with_bodies**\ (\ value\: :ref:`bool<class_bool>`\ )
  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`` :ref:`🔗<class_PhysicsRayQueryParameters3D_property_collision_mask>`
  71. .. rst-class:: classref-property-setget
  72. - |void| **set_collision_mask**\ (\ value\: :ref:`int<class_int>`\ )
  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:`Array<class_Array>`\[:ref:`RID<class_RID>`\] **exclude** = ``[]`` :ref:`🔗<class_PhysicsRayQueryParameters3D_property_exclude>`
  80. .. rst-class:: classref-property-setget
  81. - |void| **set_exclude**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\]\ )
  82. - :ref:`Array<class_Array>`\[: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. \ **Note:** The returned array is copied and any changes to it will not update the original property value. To update the value you need to modify the returned array, and then assign it to the property again.
  85. .. rst-class:: classref-item-separator
  86. ----
  87. .. _class_PhysicsRayQueryParameters3D_property_from:
  88. .. rst-class:: classref-property
  89. :ref:`Vector3<class_Vector3>` **from** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_PhysicsRayQueryParameters3D_property_from>`
  90. .. rst-class:: classref-property-setget
  91. - |void| **set_from**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  92. - :ref:`Vector3<class_Vector3>` **get_from**\ (\ )
  93. The starting point of the ray being queried for, in global coordinates.
  94. .. rst-class:: classref-item-separator
  95. ----
  96. .. _class_PhysicsRayQueryParameters3D_property_hit_back_faces:
  97. .. rst-class:: classref-property
  98. :ref:`bool<class_bool>` **hit_back_faces** = ``true`` :ref:`🔗<class_PhysicsRayQueryParameters3D_property_hit_back_faces>`
  99. .. rst-class:: classref-property-setget
  100. - |void| **set_hit_back_faces**\ (\ value\: :ref:`bool<class_bool>`\ )
  101. - :ref:`bool<class_bool>` **is_hit_back_faces_enabled**\ (\ )
  102. If ``true``, the query will hit back faces with concave polygon shapes with back face enabled or heightmap shapes.
  103. .. rst-class:: classref-item-separator
  104. ----
  105. .. _class_PhysicsRayQueryParameters3D_property_hit_from_inside:
  106. .. rst-class:: classref-property
  107. :ref:`bool<class_bool>` **hit_from_inside** = ``false`` :ref:`🔗<class_PhysicsRayQueryParameters3D_property_hit_from_inside>`
  108. .. rst-class:: classref-property-setget
  109. - |void| **set_hit_from_inside**\ (\ value\: :ref:`bool<class_bool>`\ )
  110. - :ref:`bool<class_bool>` **is_hit_from_inside_enabled**\ (\ )
  111. 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.
  112. .. rst-class:: classref-item-separator
  113. ----
  114. .. _class_PhysicsRayQueryParameters3D_property_to:
  115. .. rst-class:: classref-property
  116. :ref:`Vector3<class_Vector3>` **to** = ``Vector3(0, 0, 0)`` :ref:`🔗<class_PhysicsRayQueryParameters3D_property_to>`
  117. .. rst-class:: classref-property-setget
  118. - |void| **set_to**\ (\ value\: :ref:`Vector3<class_Vector3>`\ )
  119. - :ref:`Vector3<class_Vector3>` **get_to**\ (\ )
  120. The ending point of the ray being queried for, in global coordinates.
  121. .. rst-class:: classref-section-separator
  122. ----
  123. .. rst-class:: classref-descriptions-group
  124. Method Descriptions
  125. -------------------
  126. .. _class_PhysicsRayQueryParameters3D_method_create:
  127. .. rst-class:: classref-method
  128. :ref:`PhysicsRayQueryParameters3D<class_PhysicsRayQueryParameters3D>` **create**\ (\ from\: :ref:`Vector3<class_Vector3>`, to\: :ref:`Vector3<class_Vector3>`, collision_mask\: :ref:`int<class_int>` = 4294967295, exclude\: :ref:`Array<class_Array>`\[:ref:`RID<class_RID>`\] = []\ ) |static| :ref:`🔗<class_PhysicsRayQueryParameters3D_method_create>`
  129. Returns a new, pre-configured **PhysicsRayQueryParameters3D** object. Use it to quickly create query parameters using the most common options.
  130. ::
  131. var query = PhysicsRayQueryParameters3D.create(position, position + Vector3(0, -10, 0))
  132. var collision = get_world_3d().direct_space_state.intersect_ray(query)
  133. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  134. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  135. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  136. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  137. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  138. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  139. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  140. .. |void| replace:: :abbr:`void (No return value.)`