* Return all nodes that intercept/collide with the given node or area. * Similar to collide() but returns all colliding nodes instead of just the first. * * @param skip the node to skip in collision detection * @param area the area to check for collisions (defaults to skip node's area)
(skip: GridStackNode, area = skip, skip2?: GridStackNode)
| 198 | * console.log('Colliding with', allCollisions.length, 'nodes'); |
| 199 | */ |
| 200 | public collideAll(skip: GridStackNode, area = skip, skip2?: GridStackNode): GridStackNode[] { |
| 201 | const skipId = skip._id; |
| 202 | const skip2Id = skip2?._id; |
| 203 | return this.nodes.filter(n => n._id !== skipId && n._id !== skip2Id && Utils.isIntercepted(n, area)); |
| 204 | } |
| 205 | |
| 206 | /** does a pixel coverage collision based on where we started, returning the node that has the most coverage that is >50% mid line */ |
| 207 | protected directionCollideCoverage(node: GridStackNode, o: GridStackMoveOpts, collides: GridStackNode[]): GridStackNode | undefined { |