コード例 #1
0
ファイル: Tree.cs プロジェクト: jj-jabb/scratchpad
        unsafe void Test <TResultList>(TraversalTarget *stack, ref int count, int stackCapacity, int level,
                                       ref BoundingBoxWide query, ref Node node,
                                       ref TResultList results) where TResultList : IList <int>
        {
            Vector <int> intersectionMask;

            BoundingBoxWide.Intersects(ref node.BoundingBoxes, ref query, out intersectionMask);
            //Console.WriteLine($"Intersection mask: {intersectionMask}");
            //Console.WriteLine(node.BoundingBoxes);
            for (int i = 0; i < Vector <int> .Count; ++i)
            {
                if (intersectionMask[i] < 0)
                {
                    if (node.Children[i] >= 0)
                    {
                        Debug.Assert(count < stackCapacity);
                        stack[count++] = new TraversalTarget {
                            Level = level + 1, Node = node.Children[i]
                        };
                    }
                    else if (node.Children[i] < -1)
                    {
                        results.Add(Encode(node.Children[i]));
                    }
                }
            }
        }
コード例 #2
0
ファイル: Tree.cs プロジェクト: jj-jabb/scratchpad
 public void Initialize(TraversalTarget *stack)
 {
     this.Stack = stack;
     this.Count = 0;
 }