public void GetPointOnRay(float t, out Vec3 result) { result.x = ri.x + (rJ.x * t); result.y = ri.y + (rJ.y * t); result.z = ri.z + (rJ.z * t); }
public Ray(Ray source) { ri = source.ri; rJ = source.rJ; }
public Ray(Vec3 origin, Vec3 direction) { ri = origin; rJ = direction; }
public bool LineIntersection(Vec3 start, Vec3 end) { return(LineIntersection(start, end, out float num)); }
/// <summary> /// Returns which side of the plane that the given box lies on. /// The box is defined as centre/half-size pairs for effectively. /// </summary> /// <param name="boundsCenter"></param> /// <param name="boundsHalfSize"></param> /// <returns></returns> public Side GetSide(Vec3 boundsCenter, Vec3 boundsHalfSize) { return(GetSide(ref boundsCenter, ref boundsHalfSize)); }
public bool LineIntersection(Vec3 start, Vec3 end, out float scale) { return(LineIntersection(ref start, ref end, out scale)); }
public static void FromPointAndNormal(ref Vec3 point, ref Vec3 normal, out Plane plane) { float distance = Vec3.A(ref point, ref normal); plane = new Plane(normal, distance); }
public static Plane FromPointAndNormal(Vec3 point, Vec3 normal) { return(new Plane(normal, Vec3.A(ref point, ref normal))); }
public static Plane FromPoints(Vec3 point0, Vec3 point1, Vec3 point2) { FromPoints(ref point0, ref point1, ref point2, out Plane plane); return(plane); }
public float GetDistance(ref Vec3 v) { return((((RI * v.X) + (Ri * v.Y)) + (RJ * v.Z)) + Rj); }