index.js
// determine if an entity's AABB overlaps any existing level items
determine if an entity's AABB overlaps any existing level items
determine if an entity ' s AABB overlaps any existing level items
overlaps(aabb, minRoomSpace, minAnteroomSpace, minTunnelSpace, ignoreEntity) {
    if (ignoreEntity == null) { ignoreEntity = null }
    const spacing = {
      room: minRoomSpace,
      anteroom: minAnteroomSpace,
      tunnel: minTunnelSpace,
      door: 0
    }
    const toCheck = this.qtree.get(aabb)
    for (let item of Array.from(toCheck)) {
      const minSpacing = spacing[item.type]
      if ((ignoreEntity != null ? ignoreEntity.id : undefined) !== item.id) {
        if (overlaps(aabb, item, minSpacing)) {
          return item
        }
      }
    }
    return null
  }
overlaps ( aabb , minRoomSpace , minAnteroomSpace , minTunnelSpace , ignoreEntity ) { if ( ignoreEntity == null ) { ignoreEntity = null } const spacing = { room : minRoomSpace , anteroom : minAnteroomSpace , tunnel : minTunnelSpace , door : 0 } const toCheck = this . qtree . get ( aabb ) for ( let item of Array . from ( toCheck ) ) { const minSpacing = spacing [ item . type ] if ( ( ignoreEntity != null ? ignoreEntity . id : undefined ) !== item . id ) { if ( overlaps ( aabb , item , minSpacing ) ) { return item } } } return null }
determine if an entity's AABB overlaps any existing level items
determine if an entity ' s AABB overlaps any existing level items