Skip to content

Implementation of a quadtree in Unity 2019.3

Notifications You must be signed in to change notification settings

AdamSai/Quadtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quadtree implementation in Unity 2019.3

There's still a few quirks to work out but it works fine as a demonstration. Used https://en.wikipedia.org/wiki/Quadtree for reference.

Git lfs must be installed before cloning in order to download all the assets. It can be downloaded here.

How to:

  1. Open the Quadtree.scene
  2. Press play and use left click to place a point in the Quadtree. The nodes will subdivide when it has 4 points inside and you try to place a 5th.
  3. Press right click to display the current points on the Quadtree.
    The root object is the root of the Quadtree. It uses a prefab to instantiate child cubes. For now whenever a subdivision occurs the parent is set as inactive and 4 child cubes are instantiated.

Before subdivision

After subdivision

Points inside Quadtree

About

Implementation of a quadtree in Unity 2019.3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published