Plane represents a normalized plane equation. "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing.

Static variables

@:native("PlaneXY")staticread onlyPLANE_X_Y:Plane

A godot.Plane that extends in the X and Y axes (normal vector points +Z).

Value: Equivalent to new Plane(0, 0, 1, 0).

@:native("PlaneXZ")staticread onlyPLANE_X_Z:Plane

A godot.Plane that extends in the X and Z axes (normal vector points +Y).

Value: Equivalent to new Plane(0, 1, 0, 0).

@:native("PlaneYZ")staticread onlyPLANE_Y_Z:Plane

A godot.Plane that extends in the Y and Z axes (normal vector points +X).

Value: Equivalent to new Plane(1, 0, 0, 0).

Static methods

@:op(A == B)staticinlineop_Equality(left:Plane, right:Plane):Bool

Operator overload for godot.Plane == godot.Plane.

@:op(A != B)staticinlineop_Inequality(left:Plane, right:Plane):Bool

Operator overload for godot.Plane != godot.Plane.

@:op(-A)staticinlineop_UnaryNegation(plane:Plane):Plane

Operator overload for -godot.Plane.

Constructor

@:native("new")new(a:Single, b:Single, c:Single, d:Single)

@:native("new")new(v1:Vector3, v2:Vector3, v3:Vector3)

@:native("new")new(normal:Vector3, d:Single)

Constructs a godot.Plane from four values. a, b and c become the components of the resulting plane's godot.Plane.normal vector. d becomes the plane's distance from the origin.

Parameters:

a

The X component of the plane's normal vector.

b

The Y component of the plane's normal vector.

c

The Z component of the plane's normal vector.

d

The plane's distance from the origin. This value is typically non-negative.

Variables

@:native("Center")center:Vector3

The center of the plane, the point where the normal line intersects the plane.

Value: Equivalent to godot.Plane.normal multiplied by godot.Plane.d.

@:native("D")d:Single

The distance from the origin to the plane (in the direction of godot.Plane.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 godot.Plane.normal property.

Value: The plane's distance from the origin.

@:native("Normal")normal:Vector3

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 d is the godot.Plane.d property.

Value: Equivalent to godot.Plane.x, godot.Plane.y, and godot.Plane.z.

@:native("x")x:Single

The X component of the plane's normal vector.

Value: Equivalent to godot.Plane.normal's X value.

@:native("y")y:Single

The Y component of the plane's normal vector.

Value: Equivalent to godot.Plane.normal's Y value.

@:native("z")z:Single

The Z component of the plane's normal vector.

Value: Equivalent to godot.Plane.normal's Z value.

Methods

@:native("DistanceTo")distanceTo(point:Vector3):Single

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

Parameters:

point

The position to use for the calculation.

Returns:

The shortest distance.

@:native("GetAnyPoint")getAnyPoint():Vector3

The center of the plane, the point where the normal line intersects the plane. Deprecated, use the Center property instead.

Returns:

Equivalent to godot.Plane.normal multiplied by D.

@:native("HasPoint")hasPoint(point:Vector3, ?epsilon:Single):Bool

Returns true if point is inside the plane. Comparison uses a custom minimum epsilon threshold.

Parameters:

point

The point to check.

epsilon

The tolerance threshold.

Returns:

A bool for whether or not the plane has the point.

@:native("Intersect3")intersect3(b:Plane, c:Plane):Nullable_1<Vector3>

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

Parameters:

b

One of the three planes to use in the calculation.

c

One of the three planes to use in the calculation.

Returns:

The intersection, or null if none is found.

@:native("IntersectRay")intersectRay(from:Vector3, dir:Vector3):Nullable_1<Vector3>

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.

Parameters:

from

The start of the ray.

dir

The direction of the ray, normalized.

Returns:

The intersection, or null if none is found.

@:native("IntersectSegment")intersectSegment(begin:Vector3, end:Vector3):Nullable_1<Vector3>

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

Parameters:

begin

The start of the line segment.

end

The end of the line segment.

Returns:

The intersection, or null if none is found.

@:native("IsEqualApprox")isEqualApprox(other:Plane):Bool

Returns true if this plane and other are approximately equal, by running godot.Mathf.isEqualApprox on each component.

Parameters:

other

The other plane to compare.

Returns:

Whether or not the planes are approximately equal.

@:native("IsPointOver")isPointOver(point:Vector3):Bool

Returns true if point is located above the plane.

Parameters:

point

The point to check.

Returns:

A bool for whether or not the point is above the plane.

@:native("Normalized")normalized():Plane

Returns the plane scaled to unit length.

Returns:

A normalized version of the plane.

@:native("Project")project(point:Vector3):Vector3

Returns the orthogonal projection of point into the plane.

Parameters:

point

The point to project.

Returns:

The projected point.

@:native("ToString")toString():String

@:native("ToString")ToString(format:String):String

Converts this godot.Plane to a string.

Returns:

A string representation of this plane.