Ejemplo n.º 1
0
 protected override bool DoesDataFallWithinNodeAABB(Vector3 data, OctreeNode node)
 {
     return(node.AABB.ContainsPoint(data));
 }
Ejemplo 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);
        }
Ejemplo n.º 3
0
 protected abstract bool DoesDataFallWithinNodeAABB(T data, OctreeNode node);
Ejemplo 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);
                }
            }
        }
Ejemplo n.º 5
0
 protected abstract List <int> GatherIndicesOfDataWhichFallsWithinNodeAABB(List <int> dataIndices, OctreeNode node);