2
0

class_plane.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/Plane.xml.
  6. .. _class_Plane:
  7. Plane
  8. =====
  9. Plane in hessian form.
  10. .. rst-class:: classref-introduction-group
  11. Description
  12. -----------
  13. Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.
  14. .. rst-class:: classref-introduction-group
  15. Tutorials
  16. ---------
  17. - :doc:`../tutorials/math/index`
  18. .. rst-class:: classref-reftable-group
  19. Properties
  20. ----------
  21. .. table::
  22. :widths: auto
  23. +-------------------------------+--------------------------------------------+------------------------+
  24. | :ref:`float<class_float>` | :ref:`d<class_Plane_property_d>` | ``0.0`` |
  25. +-------------------------------+--------------------------------------------+------------------------+
  26. | :ref:`Vector3<class_Vector3>` | :ref:`normal<class_Plane_property_normal>` | ``Vector3( 0, 0, 0 )`` |
  27. +-------------------------------+--------------------------------------------+------------------------+
  28. | :ref:`float<class_float>` | :ref:`x<class_Plane_property_x>` | ``0.0`` |
  29. +-------------------------------+--------------------------------------------+------------------------+
  30. | :ref:`float<class_float>` | :ref:`y<class_Plane_property_y>` | ``0.0`` |
  31. +-------------------------------+--------------------------------------------+------------------------+
  32. | :ref:`float<class_float>` | :ref:`z<class_Plane_property_z>` | ``0.0`` |
  33. +-------------------------------+--------------------------------------------+------------------------+
  34. .. rst-class:: classref-reftable-group
  35. Methods
  36. -------
  37. .. table::
  38. :widths: auto
  39. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`Plane<class_Plane>` | :ref:`Plane<class_Plane_method_Plane>` **(** :ref:`float<class_float>` a, :ref:`float<class_float>` b, :ref:`float<class_float>` c, :ref:`float<class_float>` d **)** |
  41. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`Plane<class_Plane>` | :ref:`Plane<class_Plane_method_Plane>` **(** :ref:`Vector3<class_Vector3>` v1, :ref:`Vector3<class_Vector3>` v2, :ref:`Vector3<class_Vector3>` v3 **)** |
  43. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`Plane<class_Plane>` | :ref:`Plane<class_Plane_method_Plane>` **(** :ref:`Vector3<class_Vector3>` normal, :ref:`float<class_float>` d **)** |
  45. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Vector3<class_Vector3>` | :ref:`center<class_Plane_method_center>` **(** **)** |
  47. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`float<class_float>` | :ref:`distance_to<class_Plane_method_distance_to>` **(** :ref:`Vector3<class_Vector3>` point **)** |
  49. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Vector3<class_Vector3>` | :ref:`get_any_point<class_Plane_method_get_any_point>` **(** **)** |
  51. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`bool<class_bool>` | :ref:`has_point<class_Plane_method_has_point>` **(** :ref:`Vector3<class_Vector3>` point, :ref:`float<class_float>` epsilon=1e-05 **)** |
  53. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`Vector3<class_Vector3>` | :ref:`intersect_3<class_Plane_method_intersect_3>` **(** :ref:`Plane<class_Plane>` b, :ref:`Plane<class_Plane>` c **)** |
  55. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`Vector3<class_Vector3>` | :ref:`intersects_ray<class_Plane_method_intersects_ray>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` dir **)** |
  57. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`Vector3<class_Vector3>` | :ref:`intersects_segment<class_Plane_method_intersects_segment>` **(** :ref:`Vector3<class_Vector3>` begin, :ref:`Vector3<class_Vector3>` end **)** |
  59. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`bool<class_bool>` | :ref:`is_equal_approx<class_Plane_method_is_equal_approx>` **(** :ref:`Plane<class_Plane>` plane **)** |
  61. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`bool<class_bool>` | :ref:`is_point_over<class_Plane_method_is_point_over>` **(** :ref:`Vector3<class_Vector3>` point **)** |
  63. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`Plane<class_Plane>` | :ref:`normalized<class_Plane_method_normalized>` **(** **)** |
  65. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`Vector3<class_Vector3>` | :ref:`project<class_Plane_method_project>` **(** :ref:`Vector3<class_Vector3>` point **)** |
  67. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. .. rst-class:: classref-section-separator
  69. ----
  70. .. rst-class:: classref-descriptions-group
  71. Constants
  72. ---------
  73. .. _class_Plane_constant_PLANE_YZ:
  74. .. rst-class:: classref-constant
  75. **PLANE_YZ** = ``Plane( 1, 0, 0, 0 )``
  76. A plane that extends in the Y and Z axes (normal vector points +X).
  77. .. _class_Plane_constant_PLANE_XZ:
  78. .. rst-class:: classref-constant
  79. **PLANE_XZ** = ``Plane( 0, 1, 0, 0 )``
  80. A plane that extends in the X and Z axes (normal vector points +Y).
  81. .. _class_Plane_constant_PLANE_XY:
  82. .. rst-class:: classref-constant
  83. **PLANE_XY** = ``Plane( 0, 0, 1, 0 )``
  84. A plane that extends in the X and Y axes (normal vector points +Z).
  85. .. rst-class:: classref-section-separator
  86. ----
  87. .. rst-class:: classref-descriptions-group
  88. Property Descriptions
  89. ---------------------
  90. .. _class_Plane_property_d:
  91. .. rst-class:: classref-property
  92. :ref:`float<class_float>` **d** = ``0.0``
  93. The distance from the origin to the plane, in the direction of :ref:`normal<class_Plane_property_normal>`. This value is typically non-negative.
  94. In the scalar equation of the plane ``ax + by + cz = d``, this is ``d``, while the ``(a, b, c)`` coordinates are represented by the :ref:`normal<class_Plane_property_normal>` property.
  95. .. rst-class:: classref-item-separator
  96. ----
  97. .. _class_Plane_property_normal:
  98. .. rst-class:: classref-property
  99. :ref:`Vector3<class_Vector3>` **normal** = ``Vector3( 0, 0, 0 )``
  100. The normal of the plane, which must be normalized.
  101. In the scalar equation of the plane ``ax + by + cz = d``, this is the vector ``(a, b, c)``, where ``d`` is the :ref:`d<class_Plane_property_d>` property.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _class_Plane_property_x:
  105. .. rst-class:: classref-property
  106. :ref:`float<class_float>` **x** = ``0.0``
  107. The X component of the plane's :ref:`normal<class_Plane_property_normal>` vector.
  108. .. rst-class:: classref-item-separator
  109. ----
  110. .. _class_Plane_property_y:
  111. .. rst-class:: classref-property
  112. :ref:`float<class_float>` **y** = ``0.0``
  113. The Y component of the plane's :ref:`normal<class_Plane_property_normal>` vector.
  114. .. rst-class:: classref-item-separator
  115. ----
  116. .. _class_Plane_property_z:
  117. .. rst-class:: classref-property
  118. :ref:`float<class_float>` **z** = ``0.0``
  119. The Z component of the plane's :ref:`normal<class_Plane_property_normal>` vector.
  120. .. rst-class:: classref-section-separator
  121. ----
  122. .. rst-class:: classref-descriptions-group
  123. Method Descriptions
  124. -------------------
  125. .. _class_Plane_method_Plane:
  126. .. rst-class:: classref-method
  127. :ref:`Plane<class_Plane>` **Plane** **(** :ref:`float<class_float>` a, :ref:`float<class_float>` b, :ref:`float<class_float>` c, :ref:`float<class_float>` d **)**
  128. Creates a plane from the four parameters. The three components of the resulting plane's :ref:`normal<class_Plane_property_normal>` are ``a``, ``b`` and ``c``, and the plane has a distance of ``d`` from the origin.
  129. .. rst-class:: classref-item-separator
  130. ----
  131. .. rst-class:: classref-method
  132. :ref:`Plane<class_Plane>` **Plane** **(** :ref:`Vector3<class_Vector3>` v1, :ref:`Vector3<class_Vector3>` v2, :ref:`Vector3<class_Vector3>` v3 **)**
  133. Creates a plane from the three points, given in clockwise order.
  134. .. rst-class:: classref-item-separator
  135. ----
  136. .. rst-class:: classref-method
  137. :ref:`Plane<class_Plane>` **Plane** **(** :ref:`Vector3<class_Vector3>` normal, :ref:`float<class_float>` d **)**
  138. Creates a plane from the normal and the plane's distance to the origin.
  139. .. rst-class:: classref-item-separator
  140. ----
  141. .. _class_Plane_method_center:
  142. .. rst-class:: classref-method
  143. :ref:`Vector3<class_Vector3>` **center** **(** **)**
  144. Returns the center of the plane.
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_Plane_method_distance_to:
  148. .. rst-class:: classref-method
  149. :ref:`float<class_float>` **distance_to** **(** :ref:`Vector3<class_Vector3>` point **)**
  150. Returns the shortest distance from the plane to the position ``point``.
  151. .. rst-class:: classref-item-separator
  152. ----
  153. .. _class_Plane_method_get_any_point:
  154. .. rst-class:: classref-method
  155. :ref:`Vector3<class_Vector3>` **get_any_point** **(** **)**
  156. Returns the center of the plane.
  157. This method is deprecated, please use :ref:`center<class_Plane_method_center>` instead.
  158. .. rst-class:: classref-item-separator
  159. ----
  160. .. _class_Plane_method_has_point:
  161. .. rst-class:: classref-method
  162. :ref:`bool<class_bool>` **has_point** **(** :ref:`Vector3<class_Vector3>` point, :ref:`float<class_float>` epsilon=1e-05 **)**
  163. Returns ``true`` if ``point`` is inside the plane. Comparison uses a custom minimum ``epsilon`` threshold.
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_Plane_method_intersect_3:
  167. .. rst-class:: classref-method
  168. :ref:`Vector3<class_Vector3>` **intersect_3** **(** :ref:`Plane<class_Plane>` b, :ref:`Plane<class_Plane>` c **)**
  169. Returns the intersection point of the three planes ``b``, ``c`` and this plane. If no intersection is found, ``null`` is returned.
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_Plane_method_intersects_ray:
  173. .. rst-class:: classref-method
  174. :ref:`Vector3<class_Vector3>` **intersects_ray** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` dir **)**
  175. Returns the intersection point of a ray consisting of the position ``from`` and the direction normal ``dir`` with this plane. If no intersection is found, ``null`` is returned.
  176. .. rst-class:: classref-item-separator
  177. ----
  178. .. _class_Plane_method_intersects_segment:
  179. .. rst-class:: classref-method
  180. :ref:`Vector3<class_Vector3>` **intersects_segment** **(** :ref:`Vector3<class_Vector3>` begin, :ref:`Vector3<class_Vector3>` end **)**
  181. Returns the intersection point of a segment from position ``begin`` to position ``end`` with this plane. If no intersection is found, ``null`` is returned.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_Plane_method_is_equal_approx:
  185. .. rst-class:: classref-method
  186. :ref:`bool<class_bool>` **is_equal_approx** **(** :ref:`Plane<class_Plane>` plane **)**
  187. Returns ``true`` if this plane and ``plane`` are approximately equal, by running :ref:`@GDScript.is_equal_approx<class_@GDScript_method_is_equal_approx>` on each component.
  188. .. rst-class:: classref-item-separator
  189. ----
  190. .. _class_Plane_method_is_point_over:
  191. .. rst-class:: classref-method
  192. :ref:`bool<class_bool>` **is_point_over** **(** :ref:`Vector3<class_Vector3>` point **)**
  193. Returns ``true`` if ``point`` is located above the plane.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_Plane_method_normalized:
  197. .. rst-class:: classref-method
  198. :ref:`Plane<class_Plane>` **normalized** **(** **)**
  199. Returns a copy of the plane, normalized.
  200. .. rst-class:: classref-item-separator
  201. ----
  202. .. _class_Plane_method_project:
  203. .. rst-class:: classref-method
  204. :ref:`Vector3<class_Vector3>` **project** **(** :ref:`Vector3<class_Vector3>` point **)**
  205. Returns the orthogonal projection of ``point`` into a point in the plane.
  206. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  207. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  208. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  209. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`