public float Normalize() { float length = this.Length; this /= length; return length; }
public static Plane FromPoints(Vec3 p1, Vec3 p2, Vec3 p3) { Plane result = default(Plane); Vec3 v = p2 - p1; Vec3 v2 = p2 - p3; Vec3 v3 = Vec3.Cross(v, v2); v3.Normalize(); result.normal = v3; result.dist = Vec3.Dot(v3, p1); return(result); }