GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - CodingTrain/QuadTree: A QuadTree Example for JavaScript (with p5.js)

BranchesTags
Open more actions menu

Latest commit

 

History

107 Commits
107 Commits

Folders and files

NameName
Last commit message
Last commit date
.circleci
.circleci
 
 
examples
examples
 
 
test
test
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
quadtree.js
quadtree.js
 
 

Repository files navigation

A QuadTree example (and almost sort of a JavaScript library) with p5.js.

QuadTree

  • QuadTree on wikipedia
  • QuadTree pseudo-code
  • QuadTree video tutorial 1
  • QuadTree video tutorial 2
  • QuadTree video tutorial 3

How to use

  • You can download and include quadtree.js in your p5 sketch or refer to it via this CDN link:
<script src="https://cdn.jsdelivr.net/gh/CodingTrain/QuadTree/quadtree.js"></script>

Once you've include the library you can create a QuadTree object a Rectangle boundary and maximum capacity:

const r = new Rectangle(0, 0, width, height);
const capacity = 4;
const quadtree = new QuadTree(r, capacity);

Testing

To run tests use one of the following commands

For continuous testing

npm run test-watch

For a single run test, with coverage

npm run test

This will output to the coverage folder where you can few test coverage by opening index.html

Other QuadTree libraries in JS

  • quadtree-js
  • d3-quadtree

Other Versions

Ports to other languages

  • Carla de Beer (Processing port) - GitHub
  • Alix Poulsen (Kit port) - Github

About

A QuadTree Example for JavaScript (with p5.js)

Topics

collisionsgeometryjavascriptp5quadtree

Resources

Readme
MIT license
Activity
Custom properties

Stars

143 stars

Watchers

11 watching

Forks

41 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.