Planeclass

Represents a plane.

objectPlane
Namespace
Sandbox
Assembly
Sandbox.System
Declaration
public sealed struct Sandbox.Plane

Constructors3

Showing 3 constructors

Methods11

Showing 11 methods

public float GetDistance(Vector3 point)PUBLIC

Returns the distance from this plane to given point.

ParameterTypeDescription
pointVector3
Returns:float

public static System.Nullable`1<Vector3> GetIntersection(Sandbox.Plane vp1, Sandbox.Plane vp2, Sandbox.Plane vp3)PUBLICSTATIC

Gets the intersecting point of the three planes if it exists. If the planes don't all intersect will return null.

ParameterTypeDescription
vp1Plane
vp2Plane
vp3Plane
Returns:Nullable<Vector3>

public Vector3 ReflectDirection(Vector3 direction)PUBLIC

Reflects a direction across the plane.

ParameterTypeDescription
directionVector3
Returns:Vector3

public Vector3 SnapToPlane(Vector3 point)PUBLIC

Returns closest point on the plane to given point.

ParameterTypeDescription
pointVector3
Returns:Vector3

public System.Nullable`1<Vector3> Trace(Ray ray, bool twosided = False, double maxDistance = 1.7976931348623157E+308)PUBLIC

Trace a Ray against this plane

ParameterTypeDescription
rayRayThe origin and direction to trace from
twosided = FalseboolIf true we'll trace against the underside of the plane too.
maxDistance = 1.7976931348623157E+308doubleThe maximum distance from the ray origin to trace
Returns:Nullable<Vector3>The hit position on the ray. Or null if we didn't hit.

public bool TryTrace(Ray ray, Vector3 hitPoint, bool twosided = False, double maxDistance = 1.7976931348623157E+308)PUBLIC

Trace a Ray against this plane

ParameterTypeDescription
rayRay
hitPointVector3
twosided = Falsebool
maxDistance = 1.7976931348623157E+308double
Returns:bool

Properties2

Showing 2 properties

public Vector3 Sandbox.Plane.Origin { get; set; }PUBLICGETSETOBSOLETE

Origin position of the plane, basically a vector `Sandbox.Plane.Distance` away from world origin in the direction given by `Sandbox.Plane.Normal`.

Obsolete: Use Plane.Position

Returns:Vector3

public Vector3 Sandbox.Plane.Position { get; set; }PUBLICGETSET

Origin position of the plane, basically a vector `Sandbox.Plane.Distance` away from world origin in the direction given by `Sandbox.Plane.Normal`.

Returns:Vector3

On this page