public class QuadTreeNode<T>
{
public const int LT = 0;
public const int RT = 1;
public const int LB = 2;
public const int RB = 3;
public List<T> dataList;
public List<AABB> aabbList;
public AABB aabb;
public QuadTreeNode<T>[] childList;
public QuadTreeNode(AABB aabb)
{
childList = null;
dataList = new List<T>();
aabbList = new List<AABB>();
this.aabb = aabb;
}
};
public class QuadTree<T>
{
private int maxDeep;
private QuadTreeNode<T> root;
public QuadTree(int maxDeep = 31) //todo 可以改成传一个aabb
{
this.maxDeep = maxDeep;
int size = 2;//深度为2
for (int i = 2; i < this.maxDeep; i++)
size *= 2;
AABB aabb = new AABB(-size / 2,
四叉树C#源码
最新推荐文章于 2019-03-18 10:48:09 发布
本文详细介绍了如何使用C#编程语言实现四叉树数据结构,包括其核心概念、节点操作以及应用场景,帮助读者理解并掌握四叉树在计算机科学中的应用。
摘要由CSDN通过智能技术生成