class_plane.rst 10 KB

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