class_plane.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the Plane.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Plane:
  6. Plane
  7. =====
  8. **Category:** Built-In Types
  9. Brief Description
  10. -----------------
  11. Plane in hessian form.
  12. Properties
  13. ----------
  14. +-------------------------------+--------------------------------------------+
  15. | :ref:`float<class_float>` | :ref:`d<class_Plane_property_d>` |
  16. +-------------------------------+--------------------------------------------+
  17. | :ref:`Vector3<class_Vector3>` | :ref:`normal<class_Plane_property_normal>` |
  18. +-------------------------------+--------------------------------------------+
  19. | :ref:`float<class_float>` | :ref:`x<class_Plane_property_x>` |
  20. +-------------------------------+--------------------------------------------+
  21. | :ref:`float<class_float>` | :ref:`y<class_Plane_property_y>` |
  22. +-------------------------------+--------------------------------------------+
  23. | :ref:`float<class_float>` | :ref:`z<class_Plane_property_z>` |
  24. +-------------------------------+--------------------------------------------+
  25. Methods
  26. -------
  27. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :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 **)** |
  29. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :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 **)** |
  31. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`Plane<class_Plane>` | :ref:`Plane<class_Plane_method_Plane>` **(** :ref:`Vector3<class_Vector3>` normal, :ref:`float<class_float>` d **)** |
  33. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | :ref:`Vector3<class_Vector3>` | :ref:`center<class_Plane_method_center>` **(** **)** |
  35. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`distance_to<class_Plane_method_distance_to>` **(** :ref:`Vector3<class_Vector3>` point **)** |
  37. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Vector3<class_Vector3>` | :ref:`get_any_point<class_Plane_method_get_any_point>` **(** **)** |
  39. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`bool<class_bool>` | :ref:`has_point<class_Plane_method_has_point>` **(** :ref:`Vector3<class_Vector3>` point, :ref:`float<class_float>` epsilon=0.00001 **)** |
  41. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`Vector3<class_Vector3>` | :ref:`intersect_3<class_Plane_method_intersect_3>` **(** :ref:`Plane<class_Plane>` b, :ref:`Plane<class_Plane>` c **)** |
  43. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | :ref:`Vector3<class_Vector3>` | :ref:`intersects_ray<class_Plane_method_intersects_ray>` **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` dir **)** |
  45. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Vector3<class_Vector3>` | :ref:`intersects_segment<class_Plane_method_intersects_segment>` **(** :ref:`Vector3<class_Vector3>` begin, :ref:`Vector3<class_Vector3>` end **)** |
  47. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`bool<class_bool>` | :ref:`is_point_over<class_Plane_method_is_point_over>` **(** :ref:`Vector3<class_Vector3>` point **)** |
  49. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`Plane<class_Plane>` | :ref:`normalized<class_Plane_method_normalized>` **(** **)** |
  51. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`Vector3<class_Vector3>` | :ref:`project<class_Plane_method_project>` **(** :ref:`Vector3<class_Vector3>` point **)** |
  53. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. Constants
  55. ---------
  56. .. _class_Plane_constant_PLANE_YZ:
  57. .. _class_Plane_constant_PLANE_XZ:
  58. .. _class_Plane_constant_PLANE_XY:
  59. - **PLANE_YZ** = **Plane( 1, 0, 0, 0 )**
  60. - **PLANE_XZ** = **Plane( 0, 1, 0, 0 )**
  61. - **PLANE_XY** = **Plane( 0, 0, 1, 0 )**
  62. Description
  63. -----------
  64. 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.
  65. Tutorials
  66. ---------
  67. - :doc:`../tutorials/math/index`
  68. Property Descriptions
  69. ---------------------
  70. .. _class_Plane_property_d:
  71. - :ref:`float<class_float>` **d**
  72. ----
  73. .. _class_Plane_property_normal:
  74. - :ref:`Vector3<class_Vector3>` **normal**
  75. ----
  76. .. _class_Plane_property_x:
  77. - :ref:`float<class_float>` **x**
  78. ----
  79. .. _class_Plane_property_y:
  80. - :ref:`float<class_float>` **y**
  81. ----
  82. .. _class_Plane_property_z:
  83. - :ref:`float<class_float>` **z**
  84. Method Descriptions
  85. -------------------
  86. .. _class_Plane_method_Plane:
  87. - :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 **)**
  88. Creates a plane from the four parameters "a", "b", "c" and "d".
  89. ----
  90. - :ref:`Plane<class_Plane>` **Plane** **(** :ref:`Vector3<class_Vector3>` v1, :ref:`Vector3<class_Vector3>` v2, :ref:`Vector3<class_Vector3>` v3 **)**
  91. Creates a plane from three points.
  92. ----
  93. - :ref:`Plane<class_Plane>` **Plane** **(** :ref:`Vector3<class_Vector3>` normal, :ref:`float<class_float>` d **)**
  94. Creates a plane from the normal and the plane's distance to the origin.
  95. ----
  96. .. _class_Plane_method_center:
  97. - :ref:`Vector3<class_Vector3>` **center** **(** **)**
  98. Returns the center of the plane.
  99. ----
  100. .. _class_Plane_method_distance_to:
  101. - :ref:`float<class_float>` **distance_to** **(** :ref:`Vector3<class_Vector3>` point **)**
  102. Returns the shortest distance from the plane to the position "point".
  103. ----
  104. .. _class_Plane_method_get_any_point:
  105. - :ref:`Vector3<class_Vector3>` **get_any_point** **(** **)**
  106. Returns a point on the plane.
  107. ----
  108. .. _class_Plane_method_has_point:
  109. - :ref:`bool<class_bool>` **has_point** **(** :ref:`Vector3<class_Vector3>` point, :ref:`float<class_float>` epsilon=0.00001 **)**
  110. Returns ``true`` if "point" is inside the plane (by a very minimum threshold).
  111. ----
  112. .. _class_Plane_method_intersect_3:
  113. - :ref:`Vector3<class_Vector3>` **intersect_3** **(** :ref:`Plane<class_Plane>` b, :ref:`Plane<class_Plane>` c **)**
  114. Returns the intersection point of the three planes "b", "c" and this plane. If no intersection is found null is returned.
  115. ----
  116. .. _class_Plane_method_intersects_ray:
  117. - :ref:`Vector3<class_Vector3>` **intersects_ray** **(** :ref:`Vector3<class_Vector3>` from, :ref:`Vector3<class_Vector3>` dir **)**
  118. 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.
  119. ----
  120. .. _class_Plane_method_intersects_segment:
  121. - :ref:`Vector3<class_Vector3>` **intersects_segment** **(** :ref:`Vector3<class_Vector3>` begin, :ref:`Vector3<class_Vector3>` end **)**
  122. Returns the intersection point of a segment from position "begin" to position "end" with this plane. If no intersection is found null is returned.
  123. ----
  124. .. _class_Plane_method_is_point_over:
  125. - :ref:`bool<class_bool>` **is_point_over** **(** :ref:`Vector3<class_Vector3>` point **)**
  126. Returns ``true`` if "point" is located above the plane.
  127. ----
  128. .. _class_Plane_method_normalized:
  129. - :ref:`Plane<class_Plane>` **normalized** **(** **)**
  130. Returns a copy of the plane, normalized.
  131. ----
  132. .. _class_Plane_method_project:
  133. - :ref:`Vector3<class_Vector3>` **project** **(** :ref:`Vector3<class_Vector3>` point **)**
  134. Returns the orthogonal projection of point "p" into a point in the plane.