稀疏八度一种基于指针的稀疏八叉树数据结构。
有关线性实现,请参见。
··安装该库需求对等依赖关系。
npminstallmath-dssparse-octree用法点数import{Vector3}from"math-ds";import{PointOctree}from"sparse-octree";constmin=newVector3(-1,-1,-1);constmax=newVector3(1,1,1);constoctree=newPointOctree(min,max);constmyData={};constp1=newVector3(0,0,0);constp2=newVector3(0,0,0.5);octree.insert(p1,myData);octree.move(p1,p2);octree.get(p2);//
1