double box_ray_intersect_t(int iBox, Ray3d ray)
        {
            Vector3d                c    = box_centers[iBox];
            Vector3d                e    = box_extents[iBox];
            AxisAlignedBox3d        box  = new AxisAlignedBox3d(c - e, c + e);
            IntrRay3AxisAlignedBox3 intr = new IntrRay3AxisAlignedBox3(ray, box);

            if (intr.Find())
            {
                return(intr.RayParam0);
            }
            else
            {
                return(double.MaxValue);
            }
        }
示例#2
0
        double box_ray_intersect_t(int iBox, Ray3d ray)
        {
            Vector3d                c    = box_centers[iBox];
            Vector3d                e    = box_extents[iBox];
            AxisAlignedBox3d        box  = new AxisAlignedBox3d(c - e, c + e);
            IntrRay3AxisAlignedBox3 intr = new IntrRay3AxisAlignedBox3(ray, box);

            if (intr.Find())
            {
                return(intr.RayParam0);
            }
            else
            {
                Debug.Assert(intr.Result != IntersectionResult.InvalidQuery);
                return(double.MaxValue);
            }
        }