@share-code/collide-fns
v1.0.0
Published
functions for collision detection
Downloads
6
Maintainers
Readme
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