Exemplo n.º 1
0
 protected override bool DoesDataFallWithinNodeAABB(Vector3 data, OctreeNode node)
 {
     return(node.AABB.ContainsPoint(data));
 }
Exemplo n.º 2
0
        protected override List <int> GatherIndicesOfDataWhichFallsWithinNodeAABB(List <int> dataIndices, OctreeNode node)
        {
            if (dataIndices.Count == 0)
            {
                return(new List <int>());
            }

            var indicesOfPointsInsideAABB = new List <int>(dataIndices.Count);

            foreach (int index in dataIndices)
            {
                Vector3 point = _data[index];
                if (DoesDataFallWithinNodeAABB(point, node))
                {
                    indicesOfPointsInsideAABB.Add(index);
                }
            }

            return(indicesOfPointsInsideAABB);
        }
Exemplo n.º 3
0
 protected abstract bool DoesDataFallWithinNodeAABB(T data, OctreeNode node);
Exemplo n.º 4
0
        private void CollectDataIndicesInLeavesAABBrecurse(Box aabb, List <int> dataIndices, OctreeNode root)
        {
            if (!root.AABB.IntersectsBox(aabb))
            {
                return;
            }

            if (root.IsLeaf)
            {
                dataIndices.AddRange(root.DataIndices);
            }
            else
            {
                List <OctreeNode> children = root.Children;
                foreach (var child in children)
                {
                    CollectDataIndicesInLeavesAABBrecurse(aabb, dataIndices, child);
                }
            }
        }
Exemplo n.º 5
0
 protected abstract List <int> GatherIndicesOfDataWhichFallsWithinNodeAABB(List <int> dataIndices, OctreeNode node);