Exemple #1
0
 public void GetClosestIntersections(RayBundle rayBundle, int rayIndexToStartCheckingFrom, IntersectInfo[] intersectionsForBundle)
 {
     for (int i = 0; i < rayBundle.rayArray.Length; i++)
     {
         rayBundle.rayArray[i] = GetLocalSpaceRay(rayBundle.rayArray[i]);
     }
     child.GetClosestIntersections(rayBundle, rayIndexToStartCheckingFrom, intersectionsForBundle);
     for (int i = 0; i < rayBundle.rayArray.Length; i++)
     {
         intersectionsForBundle[i] = GetGlobalSpaceInfo(intersectionsForBundle[i]);
     }
 }
Exemple #2
0
        public void GetClosestIntersections(RayBundle rayBundle, int rayIndexToStartCheckingFrom, IntersectInfo[] intersectionsForBundle)
        {
            int startRayIndex = FindFirstRay(rayBundle, rayIndexToStartCheckingFrom);

            if (startRayIndex != -1)
            {
                IRayTraceable checkFirst  = nodeA;
                IRayTraceable checkSecond = nodeB;
                if (rayBundle.rayArray[startRayIndex].directionNormal[splitingPlane] < 0)
                {
                    checkFirst  = nodeB;
                    checkSecond = nodeA;
                }

                checkFirst.GetClosestIntersections(rayBundle, startRayIndex, intersectionsForBundle);
                if (checkSecond != null)
                {
                    checkSecond.GetClosestIntersections(rayBundle, startRayIndex, intersectionsForBundle);
                }
            }
        }