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