MODULE · ELASTIC
elastica
Physics engine for 2D rigid body collisions with React bindings
★ 46
Stars
↓ 25
Per week
◇ TypeScript
Language
INSTALL
$ npm i @darkroom.engineering/elasticaFeatures
Two collision modes
AABB (axis-aligned) and OBB (oriented / rotational) bounding boxes
Two rendering modes
DOM via CSS transforms, or batched 2D Canvas
Shape support
rectangles and circles
Frame-rate independent
fixed-timestep physics with an accumulator for a stable simulation
Spatial hashing
efficient broad-phase collision detection
Configurable borders
rigid (bounce) or periodic (wrap-around)