Struct Plane4
Mathematical abstraction of a plane that split spaces in 4D
public struct Plane4
Constructors
Plane4(Vector4, Vector4)
Create a new plane with given normal at given point
public Plane4(Vector4 norm, Vector4 point)
Plane4(Vector4, Vector4, Vector4, Vector4)
Create a new plane from known vertices
public Plane4(Vector4 a, Vector4 b, Vector4 c, Vector4 d)
Plane4(Vector4, Single)
Create a new plane with given normal and distance
public Plane4(Vector4 norm, float dist)
Fields
distance
The distance of the plane
public float distance
normal
The normal of the plane
public Vector4 normal
Properties
origin
Get origin of a plane
public Vector4 origin { get; set; }
Methods
Distance(Vector4)
Get distance between a point and the nearest point on a plane.
public float Distance(Vector4 point)
Remarks
The method can return a negative value, which mean the point is behind the plae
GetSide(Vector4)
Is the point is above or behind the plane?
public bool GetSide(Vector4 point)
Intersect(Vector4, Vector4)
Given an edge represented as two points, return an interpolation where the point intersects
public float Intersect(Vector4 a, Vector4 b)
Remarks
The resulting interpolation is unclamped, can go beyond 0..1
Project(Vector4)
Project the point to the nearest point on the plane.
public Vector4 Project(Vector4 point)
SameSide(Vector4, Vector4)
Is the two point is in the same side of the plane?
public bool SameSide(Vector4 a, Vector4 b)