Skip to main content

Plane

Representation of a plane in 3D space.
See Unity Plane for more info.

Members

Properties

NameDescription
Plane.distanceDistance from the origin to the plane.
Plane.flippedReturns a copy of the plane that faces in the opposite direction. (Read only)
Plane.normalNormal vector of the plane.

Constructor

NameDescription
[Plane(inNormal, inPoint)](./Plane Constructor 1.md)Creates a plane.
[Plane(inNormal, d)](./Plane Constructor 2.md)Creates a plane.
[Plane(a, b, c)](./Plane Constructor 3.md)Creates a plane.

Methods

NameDescription
Plane.ClosestPointOnPlane(point)For a given point returns the closest point on the plane.
Plane.Flip()Makes the plane face in the opposite direction.
Plane.GetDistanceToPoint(point)Returns a signed distance from plane to point.
Plane.GetSide(point)Is a point on the positive side of the plane?
Plane.Raycast(ray)Intersects a ray with the plane.
Plane.SameSide(point0, point1)Are two points on the same side of the plane?
Plane.Set3Points(a, b, c)Sets a plane using three points that lie within it. The points go around clockwise as you look down on the top surface of the plane.
Plane.SetNormalAndPosition(inNormal, inPoint)Sets a plane using a point that lies within it along with a normal to orient it.
Note that the normal must be a normalised vector.
Plane.Translate(translation)Moves the plane in space by the translation vector.

Static Methods

NameDescription
Plane.Translate(plane, translation)Returns a copy of the given plane that is moved in space by the given translation.

Extra Detail

A plane is an infinitely large, flat surface that exists in 3D space and divides the space into two halves known as half-spaces. It is easy to determine which of the two half-spaces a particular point is in and also how far the point is from the plane. Walls, floors and other flat surfaces are common in games, so a plane is sometimes useful for mathematical calculations with these objects. Also, there are cases where a real surface does not exist but it is useful to imagine that one is there. For example, in sports, a goal line or out-of-bounds line is often assumed to extend into the air, effectively defining a plane.