@share-code/collide-fns
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

collide-fns

to check collision detection, I chose to use SAT (Separating Axis Theorem)

according to wikipedia, the SAT (separating axis theorem) can be applied for fast collision detection between polygon meshes. Each face's normal or other feature direction is used as a separating axis. Note that this yields possible separating axes, not separating lines/planes.

Install

npm install @share-code/collide-fns

Functions

isCollide

check the two objects are collided. it's pretty obvious but each vertexes should have more than 3 vertex.

interface Vertex {
  x: number
  y: number
}

isCollide = (aVertexes: Vertex[], bVertexes: Vertex[]) => boolean

License

MIT

Dependencies (0)

    Dev Dependencies (25)

    Package Sidebar

    Install

    npm i @share-code/collide-fns

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    11.6 kB

    Total Files

    16

    Last publish

    Collaborators

    • kafelix496