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
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)
.
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)
.
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
staticinlineop_Equality(left:Plane, right:Plane):Bool
Operator overload for godot.Plane
== godot.Plane
.
staticinlineop_Inequality(left:Plane, right:Plane):Bool
Operator overload for godot.Plane
!= godot.Plane
.
Constructor
new(a:Single, b:Single, c:Single, d:Single)
new(v1:Vector3, v2:Vector3, v3:Vector3)
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
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
.
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.
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
.
x:Single
The X component of the plane's normal vector.
Value: Equivalent to godot.Plane.normal
's X value.
y:Single
The Y component of the plane's normal vector.
Value: Equivalent to godot.Plane.normal
's Y value.
z:Single
The Z component of the plane's normal vector.
Value: Equivalent to godot.Plane.normal
's Z value.
Methods
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.
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
.
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.
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.
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.
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.
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.
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.
normalized():Plane
Returns the plane scaled to unit length.
Returns:
A normalized version of the plane.
project(point:Vector3):Vector3
Returns the orthogonal projection of point
into the plane.
Parameters:
point | The point to project. |
---|
Returns:
The projected point.