Struct Plane
A plane described by a normal and a negated distance from the origin.
Inherited Members
Namespace: Unity.Physics
Syntax
public struct Plane
Constructors
Plane(float3, Single)
Constructor.
Declaration
public Plane(float3 normal, float distance)
Parameters
Type | Name | Description |
---|---|---|
float3 | normal | The normal. |
Single | 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 |
---|---|
Single | Negative distance from the origin. |
Flipped
Gets the flipped plane. Negates normal and distance.
Declaration
public readonly 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 |
---|---|
Single | Signed distance from the point to the plane. |
Operators
Implicit(float4 to Plane)
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(Plane to float4)
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. |