docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct Plane

    A plane described by a normal and a negated distance from the origin.

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Physics
    Assembly: Unity.Physics.dll
    Syntax
    public struct Plane

    Constructors

    Plane(float3, float)

    Constructor.

    Declaration
    public Plane(float3 normal, float distance)
    Parameters
    Type Name Description
    float3 normal

    The normal.

    float distance

    The distance.

    Properties

    Distance

    Gets or sets the distance. Distance is negative distance from the origin.

    Declaration
    public float Distance { get; set; }
    Property Value
    Type Description
    float

    Negative distance from the origin.

    Flipped

    Gets the flipped plane. Negates normal and distance.

    Declaration
    public Plane Flipped { get; }
    Property Value
    Type Description
    Plane

    The flipped plane.

    Normal

    Gets or sets the normal.

    Declaration
    public float3 Normal { get; set; }
    Property Value
    Type Description
    float3

    The normal.

    Methods

    Projection(float3)

    Returns the closest point on the plane to the input point.

    Declaration
    public float3 Projection(float3 point)
    Parameters
    Type Name Description
    float3 point

    The point.

    Returns
    Type Description
    float3

    The closest point.

    SignedDistanceToPoint(float3)

    Returns the distance from the point to the plane, positive if the point is on the side of the plane on which the plane normal points, zero if the point is on the plane, negative otherwise.

    Declaration
    public float SignedDistanceToPoint(float3 point)
    Parameters
    Type Name Description
    float3 point

    The point.

    Returns
    Type Description
    float

    Signed distance from the point to the plane.

    Operators

    implicit operator Plane(float4)

    Implicit cast that converts the given float4 to a Plane.

    Declaration
    public static implicit operator Plane(float4 plane)
    Parameters
    Type Name Description
    float4 plane

    The plane.

    Returns
    Type Description
    Plane

    The result of the operation.

    implicit operator float4(Plane)

    Implicit cast that converts the given Plane to a float4.

    Declaration
    public static implicit operator float4(Plane plane)
    Parameters
    Type Name Description
    Plane plane

    The plane.

    Returns
    Type Description
    float4

    The result of the operation.

    In This Article
    Back to top
    Copyright © 2024 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)