Releases: Jackie-Aniki/check2d
Releases · Jackie-Aniki/check2d
v9.30.1
detect-collisionsbecamecheck2d- wrote it here https://www.npmjs.com/package/detect-collisions
- as in url https://github.com/Jackie-Aniki/detect-collisions-became-check2d
v9.27.6
v9.27.4
v9.27.2
- bumped deps
v9.27.1
- reduced bundle from 500 to 250 kb because map in esm was taking so much (if you need it just copy it from repo)
v9.27.0
v9.26.2
v9.25.0
v9.24.0
added another simpler live online js edit https://code.pietal.dev/#/boilerplate/detect-collisions?pans=html,console to links in readme
added Usage in Browsers readme section
added explanation of third parameter in https://github.com/Prozi/detect-collisions?tab=readme-ov-file#raycasting System.raycast
v9.20.0
You can provide custom class to body create functions:
import { System, Polygon } from "detect-collisions";
const physics = new System();
class MyPolygon extends Polygon {
constructor(position, points, options) {
super(position, points, options);
this.foo = "bar";
}
}
// create minimal MyPolygon and insert to system
const myPolygon = physics.createPolygon({}, [{}], {}, MyPolygon);
// true
console.log(myPolygon.foo === "bar");
});this may be useful for any customizations
last optional parameter of system.create* is a class that extends the base class (extends Box for createBox, extends Circle for createCircle, etc.)