HashOctree is an optimized octree that is both memory effiecent and cpu effiecent.
Note The module has no update function for dynamic objects as the updating was slower than just recreating a new octree per frame.
All the benchmarks shown use 1000 objects
HashOctreeModule.new(Size : number, MaxDepth : number?,OffsetPosition : Vector3?) : HashOctree
Takes in a number for the size of the octree and an optional max subdivision depth (The top limit is 10 depth) and an optional OffsetPosition and returns the octree.
HashOctreeModule.InsertObjects(HashOctree : HashOctree,Objects : {Object})
Takes in a table of objects (anything with a Position value) and inserts them into the octree.
HashOctreeModule.RemoveObject(HashOctree : HashOctree,Object : Object)
Takes in an object and removes it from the octree.
HashOctreeModule.InsertObject(HashOctree : HashOctree,Object : Object)
Takes in an object and inserts it into the octree.
HashOctreeModule.QueryBox(HashOctree : HashOctree,Position : Vector3,Size : Vector3) : {Object}
Takes in the box's position and size and returns all the objects in the octree inside said box.
HashOctreeModule.QuerySphere(HashOctree : HashOctree,Position : Vector3,Radius : number) : {Object}
Takes in the sphere's position and radius and returns all the objects in the octree inside said sphere.
HashOctreeModule.VisualizeOctree(HashOctree : HashOctree)
Takes in an octree and visualizes it.