Plane
La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.
public struct Plane : IFormattableNamespace NodeWorld.Flux.
A plane: the points p with Dot(normal, p) + distance == 0.
Constructors
Plane
public Plane(Vector3 inNormal, Vector3 inPoint)The plane through inPoint, facing inNormal (normalized).
public Plane(Vector3 inNormal, float d)The plane facing inNormal (normalized) at distance d: Dot(normal, p) + d == 0.
public Plane(Vector3 a, Vector3 b, Vector3 c)The plane through the points a, b and c; its normal is Cross(b - a, c - a), normalized.
Properties
normal
public Vector3 normal { get; set; }The normal of the plane, of length 1.
distance
public float distance { get; set; }The distance term: Dot(normal, p) + distance == 0 for the points p of the plane.
flipped
public Plane flipped { get; }The same plane facing the other way.
Methods
Flip
public void Flip()Turns the plane to face the other way.
SetNormalAndPosition
public void SetNormalAndPosition(Vector3 inNormal, Vector3 inPoint)Makes it the plane through inPoint, facing inNormal (normalized).
GetDistanceToPoint
public float GetDistanceToPoint(Vector3 point)Signed distance from the plane to point: positive on the side the normal faces.
GetSide
public bool GetSide(Vector3 point)point is on the side the normal faces.
SameSide
public bool SameSide(Vector3 inPt0, Vector3 inPt1)The two points are on the same side of the plane.
ClosestPointOnPlane
public Vector3 ClosestPointOnPlane(Vector3 point)The point of the plane nearest to point.
Raycast
public bool Raycast(Ray ray, out float enter)The ray meets the plane ahead of its origin: true, with enter the distance along the ray. A ray parallel to the plane gives false.
Translate
public void Translate(Vector3 translation)Moves the plane by translation.
public static Plane Translate(Plane plane, Vector3 translation)A copy of plane moved by translation.
ToString
public override string ToString()"(normal:(x, y, z), distance:d)", with 2 decimals.
public string ToString(string format)The same text with the numbers in format.
public string ToString(string format, IFormatProvider formatProvider)The same text with the numbers in format (F2 when empty) and formatProvider (the invariant culture when null).
