clik-engine API
    Preparing search index...

    Class SpatialHash<T>

    Spatial hash grid for efficient broad-phase collision detection. Groups objects into grid cells for O(1) neighbor queries.

    Type Parameters

    • T
    Index

    Constructors

    Accessors

    Methods

    • Insert an object at a position (with optional size for multi-cell spanning)

      Parameters

      • obj: T
      • x: number
      • y: number
      • width: number = 0
      • height: number = 0

      Returns void

    • Query all objects within a rectangular region

      Parameters

      • x: number
      • y: number
      • width: number
      • height: number

      Returns Set<T>