예제 #1
0
        public List <int> CollectRay(Ray ray, float d)
        {
#if VALIDATE
            if (tested == null)
            {
                tested = new bool[Triangles.Length];
                MarkTriangles(0);
                for (int i = 0, n = tested.Length; i != n; ++i)
                {
                    Debug.Assert(tested[i]);
                }
            }
#endif
            ReturnTriangles.Clear();
            float dd = d;
#if DEBUG
            trisTested.Clear();
            nodesTested.Clear();
#endif
            if (Bounds.Intersects(ref ray, ref dd))
            {
                RayTester rt = new RayTester();
                rt.collRay  = ray;
                rt.collRayD = d;
                TraverseNode(0, ref Bounds, rt);
            }
            return(ReturnTriangles);
        }
예제 #2
0
            public bool Overlaps(ref AABB aabb, float expand)
            {
                float dd = collRayD;

                return(aabb.Intersects(ref collRay, ref dd, expand));
            }