Beispiel #1
0
        public static bool Intersect(SlimDX.Ray ray, ref float dist, out IADTChunk hitChunk)
        {
            hitChunk = null;
            if (VisibleChunks.Count == 0)
            {
                return(false);
            }

            bool  hasHit  = false;
            float nearHit = 9999999;

            foreach (var file in VisibleChunks)
            {
                float     curHit = 0;
                IADTChunk tmpHit;
                if (file.Intersect(ray, ref curHit, out tmpHit))
                {
                    hitChunk = tmpHit;
                    hasHit   = true;
                    if (curHit < nearHit)
                    {
                        nearHit = curHit;
                    }
                }
            }

            if (hasHit)
            {
                dist = nearHit;
            }

            return(hasHit);
        }
Beispiel #2
0
 public abstract bool Intersect(SlimDX.Ray ray, ref float dist, out IADTChunk hitChunk);
Beispiel #3
0
        public static bool Intersect(SlimDX.Ray ray, ref float dist, out IADTChunk hitChunk)
        {
            hitChunk = null;
            if (VisibleChunks.Count == 0)
                return false;

            bool hasHit = false;
            float nearHit = 9999999;
            foreach (var file in VisibleChunks)
            {
                float curHit = 0;
                IADTChunk tmpHit;
                if (file.Intersect(ray, ref curHit, out tmpHit))
                {
                    hitChunk = tmpHit;
                    hasHit = true;
                    if (curHit < nearHit)
                        nearHit = curHit;
                }
            }

            if (hasHit)
                dist = nearHit;

            return hasHit;
        }
Beispiel #4
0
 public abstract bool Intersect(SlimDX.Ray ray, ref float dist, out IADTChunk hitChunk);