https://github.com/ndbaker1/quadtree-visualizer
Pure Typescript 🌴 Quadtree implementation with a live demo
https://github.com/ndbaker1/quadtree-visualizer
physics-simulation playground-app quadtree quadtree-js visualization
Last synced: 3 months ago
JSON representation
Pure Typescript 🌴 Quadtree implementation with a live demo
- Host: GitHub
- URL: https://github.com/ndbaker1/quadtree-visualizer
- Owner: ndbaker1
- Created: 2021-01-09T09:24:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-27T00:42:52.000Z (over 3 years ago)
- Last Synced: 2024-12-30T04:27:15.148Z (5 months ago)
- Topics: physics-simulation, playground-app, quadtree, quadtree-js, visualization
- Language: TypeScript
- Homepage: https://ndbaker1.github.io/quadtree-visualizer/
- Size: 16.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# QuadTree Collision Visualizer
[Demo ✨](https://ndbaker1.github.io/quadtree-visualizer/)
A Visual demonstration of how `Quadtrees` group entities and perform in order to optimize collision detection alogrithms
## Background
`Quadtrees` help with gathering information about which collisions in an environment are worth testing by only making computations between objects in similar nodes/quads.
> - Quadtree nodes split into four evenly-sized leaf nodes when the number of objects inside them reach a certain capacity.
> - Objects are inserted into a fresh Quadtree every iteration, which places each object in its __deepest possible node__.
> - The Quadtree algorithm improves upon the naive *T(n) = θ(n2)* algorithm and achieves *T(n) = O(n2), T(n) = Ω(nlog(n))*.
> - Quadtrees based on pixels are incidentally a type of trie.## Simulation
This Visualizer provides an interactive environment where you can change configurations of the __Quadtree__ and __Physics__ at runtime.
The Quadtree visualization sits atop a `2D Collision System` with a configurable __coefficient of restitution__, used to adjust between __elastic__ and __inelastic__ collisions.## Development
Run the development server:
```bash
npm run dev
```
Opens on [http://localhost:3000](http://localhost:3000).