docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct Plane

    A plane represented by a normal vector and a distance along the normal from the origin.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Mathematics.Geometry
    Assembly: Unity.Mathematics.dll
    Syntax
    [Serializable]
    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.

    Constructors

    Name Description
    Plane(float, float, float, float)

    Constructs a Plane from arbitrary coefficients A, B, C, D of the plane equation Ax + By + Cz + Dw = 0.

    Plane(float3, float)

    Constructs a plane with a normal vector and distance from the origin.

    Plane(float3, float3)

    Constructs a plane with a normal vector and a point that lies in the plane.

    Plane(float3, float3, float3)

    Constructs a plane with two vectors and a point that all lie in the plane.

    Fields

    Name Description
    NormalAndDistance

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

    Properties

    Name Description
    Distance

    Get/set the distance of the plane from the origin. May be a negative value.

    Flipped

    Flips the plane so the normal points in the opposite direction.

    Normal

    Get/set the normal vector of the plane.

    Methods

    Name Description
    CreateFromUnitNormalAndDistance(float3, float)

    Creates a normalized Plane directly without normalization cost.

    CreateFromUnitNormalAndPointInPlane(float3, float3)

    Creates a normalized Plane without normalization cost.

    Normalize(Plane)

    Normalizes the given Plane.

    Normalize(float4)

    Normalizes the plane represented by the given plane coefficients.

    Projection(float3)

    Projects the given point onto the plane.

    SignedDistanceToPoint(float3)

    Get the signed distance from the point to the plane.

    Operators

    Name Description
    implicit operator float4(Plane)

    Implicitly converts a Plane to float4.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)