Exemple #1
0
 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);
 }
Exemple #2
0
 public Ray(Ray source)
 {
     ri = source.ri;
     rJ = source.rJ;
 }
Exemple #3
0
 public Ray(Vec3 origin, Vec3 direction)
 {
     ri = origin;
     rJ = direction;
 }
Exemple #4
0
 public bool LineIntersection(Vec3 start, Vec3 end)
 {
     return(LineIntersection(start, end, out float num));
 }
Exemple #5
0
 /// <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));
 }
Exemple #6
0
 public bool LineIntersection(Vec3 start, Vec3 end, out float scale)
 {
     return(LineIntersection(ref start, ref end, out scale));
 }
Exemple #7
0
        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);
        }
Exemple #8
0
 public static Plane FromPointAndNormal(Vec3 point, Vec3 normal)
 {
     return(new Plane(normal, Vec3.A(ref point, ref normal)));
 }
Exemple #9
0
 public static Plane FromPoints(Vec3 point0, Vec3 point1, Vec3 point2)
 {
     FromPoints(ref point0, ref point1, ref point2, out Plane plane);
     return(plane);
 }
Exemple #10
0
 public float GetDistance(ref Vec3 v)
 {
     return((((RI * v.X) + (Ri * v.Y)) + (RJ * v.Z)) + Rj);
 }