@ujjwalvivek/tinyts
    Preparing search index...

    Interface SpatialGrid

    A 2D spatial hashing grid for broad-phase collision detection.

    interface SpatialGrid {
        cellSize: number;
        clear: () => void;
        insert: (id: number, aabb: AABB) => void;
        query: (aabb: AABB) => Set<number>;
        queryAll: () => Set<number>;
        queryAllInto: (result: Set<number>) => Set<number>;
        queryInto: (aabb: AABB, result: Set<number>) => Set<number>;
    }
    Index

    Properties

    cellSize: number

    Size of each grid cell in world units.

    clear: () => void

    Clear all entities from the grid.

    insert: (id: number, aabb: AABB) => void

    Insert an entity ID into the grid.

    query: (aabb: AABB) => Set<number>

    Query entity IDs overlapping an AABB.

    queryAll: () => Set<number>

    Get all entity IDs in the grid.

    queryAllInto: (result: Set<number>) => Set<number>

    Get all entity IDs, writing into the provided result set.

    queryInto: (aabb: AABB, result: Set<number>) => Set<number>

    Query entity IDs overlapping an AABB, writing into the provided result set.