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