JT Collision Detection
Utility functions for detecting collisions between points, lines, circles, rectangles, and polygones
Code Copied (almost verbatim) from Jeffrey Thompsons Collision Detection work.
Installation
Node
install using npm
# npm
npm install jt-collision-detection
# yarn
yarn add jt-collision-detection
#pnpm
yarn add jt-collision-detection
use in file
import * as cd from 'jt-collision-detection'
cd.polyCircle(...)
Browser ESM
Use unpkg.com to import
import * as cd from 'https://unpkg.com/jt-collision-detection'
cd.polyCircle(...)
Browser Global
TBD
Deno
use unpkg.com to import
import * as cd from 'https://unpkg.com/jt-collision-detection'
cd.polyCircle(...)
Documentation
TBD
Project Goals
- Should be able to run in every possible context (Currently Tracked):
- node cjs
- node esm
- deno
- browser window
- browser esm
- web workers global
- web workers esm
- iife
- Browsers should be able to import iife, or esm using https://unpkg.com/ cdn
- Types should be well defined
- Source maps should be well defined and high quality
- Must be able to leverage tree shaking
- Lightweight NO DEPENDENCIES