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

Properties

float d 0.0
Vector3 normal Vector3( 0, 0, 0 )
float x 0.0
float y 0.0
float z 0.0

Constants

  • 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

Default 0.0

Distance from the origin to the plane, in the direction of 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.


Default 0.0

The normal’s X component.


Default 0.0

The normal’s Y component.


Default 0.0

The normal’s Z component.

Method Descriptions

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.


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


Returns a point on the plane.


Returns true if point is inside the plane (by a very minimum epsilon threshold).


Returns the intersection point of the three planes b, 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.


Returns the intersection point of a segment from position begin to position end with this plane. If no intersection is found, null is returned.


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


Returns true if point is located above the plane.


Returns a copy of the plane, normalized.


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