BinaryOctree 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
Note The old octree module is a previous version of BinaryOctree before any optimizations.
Link to sleitnicks octree module: https://github.com/Sleitnick/rbxts-octo-tree
BinaryOctreeModule.new(Size : number, MaxDepth : number?,OffsetPosition : Vector3?) : BinaryOctreeTakes 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.
BinaryOctreeModule.InsertObjects(BinaryOctree : BinaryOctree,Objects : {Object})Takes in a table of objects (anything with a Position value) and inserts them into the octree.
BinaryOctreeModule.RemoveObject(BinaryOctree : BinaryOctree,Object : Object)Takes in an object and removes it from the octree.
BinaryOctreeModule.InsertObject(BinaryOctree : BinaryOctree,Object : Object)Takes in an object and inserts it into the octree.
BinaryOctreeModule.QueryBox(BinaryOctree : BinaryOctree,Position : Vector3,Size : Vector3) : {Object}Takes in the box's position and size and returns all the objects in the octree inside said box.
BinaryOctreeModule.QuerySphere(BinaryOctree : BinaryOctree,Position : Vector3,Radius : number) : {Object}Takes in the sphere's position and radius and returns all the objects in the octree inside said sphere.
BinaryOctreeModule.VisualizeOctree(BinaryOctree : BinaryOctree)Takes in an octree and visualizes it.

