npm.io
1.4.0 • Published 8 years ago

simple-intersect

Licence
MIT
Version
1.4.0
Deps
0
Size
2.3 MB
Vulns
0
Weekly
0
Stars
564
DeprecatedThis package is deprecated

intersects

a simple collection of 2d collision/intersects functions, supporting points, circles, lines, axis-aligned boxes, and polygons

rationale

I wanted a simplified collection of collision functions that work across different shapes. If you want a more advanced implementation designed for pixi.js.

Live Example

https://davidfig.github.io/simple-intersect/

Installation

npm i simple-intersect

Usage

    var intesect = require('simple-intersect');
    var intersected = intersect.boxBox(x1, y1, w1, h1, x2, y2, w2, h2);

or

    var circleBox = require('simple-intersect/circle-box');
    var intersected = circleBox(x, y, r, x1, y1, w1, h1);

API