:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the Plane.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_Plane: Plane ===== Plane in hessian form. Description ----------- 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. Tutorials --------- - :doc:`../tutorials/math/index` Properties ---------- +-------------------------------+--------------------------------------------+------------------------+ | :ref:`float` | :ref:`d` | ``0.0`` | +-------------------------------+--------------------------------------------+------------------------+ | :ref:`Vector3` | :ref:`normal` | ``Vector3( 0, 0, 0 )`` | +-------------------------------+--------------------------------------------+------------------------+ | :ref:`float` | :ref:`x` | ``0.0`` | +-------------------------------+--------------------------------------------+------------------------+ | :ref:`float` | :ref:`y` | ``0.0`` | +-------------------------------+--------------------------------------------+------------------------+ | :ref:`float` | :ref:`z` | ``0.0`` | +-------------------------------+--------------------------------------------+------------------------+ Methods ------- +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Plane` | :ref:`Plane` **(** :ref:`float` a, :ref:`float` b, :ref:`float` c, :ref:`float` d **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Plane` | :ref:`Plane` **(** :ref:`Vector3` v1, :ref:`Vector3` v2, :ref:`Vector3` v3 **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Plane` | :ref:`Plane` **(** :ref:`Vector3` normal, :ref:`float` d **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`center` **(** **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`distance_to` **(** :ref:`Vector3` point **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`get_any_point` **(** **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_point` **(** :ref:`Vector3` point, :ref:`float` epsilon=1e-05 **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`intersect_3` **(** :ref:`Plane` b, :ref:`Plane` c **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`intersects_ray` **(** :ref:`Vector3` from, :ref:`Vector3` dir **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`intersects_segment` **(** :ref:`Vector3` begin, :ref:`Vector3` end **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Plane` plane **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_point_over` **(** :ref:`Vector3` point **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Plane` | :ref:`normalized` **(** **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector3` | :ref:`project` **(** :ref:`Vector3` point **)** | +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Constants --------- .. _class_Plane_constant_PLANE_YZ: .. _class_Plane_constant_PLANE_XZ: .. _class_Plane_constant_PLANE_XY: - **PLANE_YZ** = **Plane( 1, 0, 0, 0 )** --- A plane that extends in the Y and Z axes. - **PLANE_XZ** = **Plane( 0, 1, 0, 0 )** --- A plane that extends in the X and Z axes. - **PLANE_XY** = **Plane( 0, 0, 1, 0 )** --- A plane that extends in the X and Y axes. Property Descriptions --------------------- .. _class_Plane_property_d: - :ref:`float` **d** +-----------+---------+ | *Default* | ``0.0`` | +-----------+---------+ Distance from the origin to the plane, in the direction of :ref:`normal`. ---- .. _class_Plane_property_normal: - :ref:`Vector3` **normal** +-----------+------------------------+ | *Default* | ``Vector3( 0, 0, 0 )`` | +-----------+------------------------+ The normal of the plane. "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing. ---- .. _class_Plane_property_x: - :ref:`float` **x** +-----------+---------+ | *Default* | ``0.0`` | +-----------+---------+ The :ref:`normal`'s X component. ---- .. _class_Plane_property_y: - :ref:`float` **y** +-----------+---------+ | *Default* | ``0.0`` | +-----------+---------+ The :ref:`normal`'s Y component. ---- .. _class_Plane_property_z: - :ref:`float` **z** +-----------+---------+ | *Default* | ``0.0`` | +-----------+---------+ The :ref:`normal`'s Z component. Method Descriptions ------------------- .. _class_Plane_method_Plane: - :ref:`Plane` **Plane** **(** :ref:`float` a, :ref:`float` b, :ref:`float` c, :ref:`float` d **)** Creates a plane from the four parameters. The three components of the resulting plane's :ref:`normal` are ``a``, ``b`` and ``c``, and the plane has a distance of ``d`` from the origin. ---- - :ref:`Plane` **Plane** **(** :ref:`Vector3` v1, :ref:`Vector3` v2, :ref:`Vector3` v3 **)** Creates a plane from the three points, given in clockwise order. ---- - :ref:`Plane` **Plane** **(** :ref:`Vector3` normal, :ref:`float` d **)** Creates a plane from the normal and the plane's distance to the origin. ---- .. _class_Plane_method_center: - :ref:`Vector3` **center** **(** **)** Returns the center of the plane. ---- .. _class_Plane_method_distance_to: - :ref:`float` **distance_to** **(** :ref:`Vector3` point **)** Returns the shortest distance from the plane to the position ``point``. ---- .. _class_Plane_method_get_any_point: - :ref:`Vector3` **get_any_point** **(** **)** Returns a point on the plane. ---- .. _class_Plane_method_has_point: - :ref:`bool` **has_point** **(** :ref:`Vector3` point, :ref:`float` epsilon=1e-05 **)** Returns ``true`` if ``point`` is inside the plane (by a very minimum ``epsilon`` threshold). ---- .. _class_Plane_method_intersect_3: - :ref:`Vector3` **intersect_3** **(** :ref:`Plane` b, :ref:`Plane` c **)** Returns the intersection point of the three planes ``b``, ``c`` and this plane. If no intersection is found, ``null`` is returned. ---- .. _class_Plane_method_intersects_ray: - :ref:`Vector3` **intersects_ray** **(** :ref:`Vector3` from, :ref:`Vector3` dir **)** 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. ---- .. _class_Plane_method_intersects_segment: - :ref:`Vector3` **intersects_segment** **(** :ref:`Vector3` begin, :ref:`Vector3` end **)** Returns the intersection point of a segment from position ``begin`` to position ``end`` with this plane. If no intersection is found, ``null`` is returned. ---- .. _class_Plane_method_is_equal_approx: - :ref:`bool` **is_equal_approx** **(** :ref:`Plane` plane **)** Returns ``true`` if this plane and ``plane`` are approximately equal, by running :ref:`@GDScript.is_equal_approx` on each component. ---- .. _class_Plane_method_is_point_over: - :ref:`bool` **is_point_over** **(** :ref:`Vector3` point **)** Returns ``true`` if ``point`` is located above the plane. ---- .. _class_Plane_method_normalized: - :ref:`Plane` **normalized** **(** **)** Returns a copy of the plane, normalized. ---- .. _class_Plane_method_project: - :ref:`Vector3` **project** **(** :ref:`Vector3` point **)** Returns the orthogonal projection of point ``p`` into a point in the plane.