Plane

    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

    Methods

    Plane ( float a, b, float c, d )
    Plane ( Vector3 v1, v2, Vector3 v3 )
    Plane ( normal, float d )
    center ( )
    distance_to ( point )
    Vector3 ( )
    bool ( Vector3 point, epsilon=1e-05 )
    Vector3 ( Plane b, c )
    Vector3 ( Vector3 from, dir )
    Vector3 ( Vector3 begin, end )
    bool ( Plane plane )
    is_point_over ( point )
    Plane ( )
    Vector3 ( Vector3 point )
    • PLANE_YZ = Plane( 1, 0, 0, 0 ) —- A plane that extends in the Y and Z axes (normal vector points +X).
    • PLANE_XY = Plane( 0, 0, 1, 0 ) —- A plane that extends in the X and Y axes (normal vector points +Z).

    Property Descriptions

    • d

    The distance from the origin to the plane, in the direction of normal. This value is typically non-negative.

    In the scalar equation of the plane ax + by + cz = d, this is d, while the (a, b, c) coordinates are represented by the property.


    DefaultVector3( 0, 0, 0 )

    The normal of the plane, which must be normalized.

    In the scalar equation of the plane ax + by + cz = d, this is the vector (a, b, c), where is the property.


    The X component of the plane’s vector.


    Default0.0

    The Y component of the plane’s vector.


    Creates a plane from the four parameters. The three components of the resulting plane’s normal are a, b and c, and the plane has a distance of d from the origin.


    Creates a plane from the three points, given in clockwise order.


    Creates a plane from the normal and the plane’s distance to the origin.


    Returns the center of the plane.


    • float distance_to ( point )

    Returns the shortest distance from the plane to the position point.


    Returns the center of the plane.

    This method is deprecated, please use instead.


    • bool has_point ( point, float epsilon=1e-05 )

    • intersect_3 ( Plane b, c )

    Returns the intersection point of the three planes , c and this plane. If no intersection is found, null is returned.


    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.


    • intersects_segment ( Vector3 begin, 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.


    • bool is_equal_approx ( plane )

    Returns true if this plane and plane are approximately equal, by running @GDScript.is_equal_approx on each component.


    Returns true if is located above the plane.


    • normalized ( )

    Returns a copy of the plane, normalized.


    Returns the orthogonal projection of point into a point in the plane.