Skip to content

omrezkeypie/BinaryOctree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

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.

Performance

All the benchmarks shown use 1000 objects

Octree updating. image

Octree querying. image

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

API

BinaryOctreeModule.new(Size : number, MaxDepth : number?,OffsetPosition : Vector3?) : BinaryOctree

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.

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.

About

A binary octree for roblox

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages