Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Plane

A plane represented by a normal vector and a distance along the normal from the origin.
Read time 1 minuteLast updated 9 days ago

Definition

public struct Plane

Remarks

A plane splits the 3D space in half. The normal vector points to the positive half and the other half is considered negative.

Fields

Value

Description

NormalAndDistanceA plane in the form Ax + By + Cz + Dw = 0.

Constructors

Constructor

Description

Plane(System.Single,System.Single,System.Single,System.Single)Constructs a Plane from arbitrary coefficients A, B, C, D of the plane equation Ax + By + Cz + Dw = 0.
Plane(Unity.Mathematics.float3,System.Single)Constructs a plane with a normal vector and distance from the origin.
Plane(Unity.Mathematics.float3,Unity.Mathematics.float3)Constructs a plane with a normal vector and a point that lies in the plane.
Plane(Unity.Mathematics.float3,Unity.Mathematics.float3,Unity.Mathematics.float3)Constructs a plane with two vectors and a point that all lie in the plane.

Properties

Property

Description

DistanceGet/set the distance of the plane from the origin. May be a negative value.
FlippedFlips the plane so the normal points in the opposite direction.
NormalGet/set the normal vector of the plane.

Methods

Method

Description

ProjectionProjects the given point onto the plane.
SignedDistanceToPointGet the signed distance from the point to the plane.

Static Methods

Method

Description

CreateFromUnitNormalAndDistanceCreates a normalized Plane directly without normalization cost.
CreateFromUnitNormalAndPointInPlaneCreates a normalized Plane without normalization cost.
NormalizeNormalizes the plane represented by the given plane coefficients.

Operators

Operator

Description

float4Implicitly converts a Plane to float4.