This module has now been replaced by Matter.Detector.

All usage should be migrated to Matter.Detector or another alternative. For back-compatibility purposes this module will remain for a short term and then later removed in a future release.

The Matter.Grid module contains methods for creating and manipulating collision broadphase grid structures.

Deprecated

Hierarchy

  • default

Constructors

Methods

  • Adds a body to a bucket.

    Parameters

    Returns void

    Method

    _bucketAddBody

    Deprecated

    replaced by Matter.Detector

  • Removes a body from a bucket.

    Parameters

    Returns void

    Method

    _bucketRemoveBody

    Deprecated

    replaced by Matter.Detector

  • Generates a list of the active pairs in the grid.

    Parameters

    Returns BodyPair[]

    pairs

    Method

    _createActivePairsList

    Deprecated

    replaced by Matter.Detector

  • Creates a bucket.

    Parameters

    • buckets: Record<string, IBody[]>
    • bucketId: string

    Returns IBody[]

    bucket

    Method

    _createBucket

    Deprecated

    replaced by Matter.Detector

  • Creates a region.

    Parameters

    • startCol: number
    • endCol: number
    • startRow: number
    • endRow: number

    Returns IRegion

    region

    Method

    _createRegion

    Deprecated

    replaced by Matter.Detector

  • Gets the bucket id at the given position.

    Parameters

    • column: number
    • row: number

    Returns string

    bucket id

    Method

    _getBucketId

    Deprecated

    replaced by Matter.Detector

  • Clears the grid.

    Parameters

    Returns void

    Deprecated

    replaced by Matter.Detector

    Method

    clear

  • Creates a new grid.

    Parameters

    • options: {
          bucketHeight?: number;
          bucketWidth?: number;
          buckets?: { [x: string]: IBody[] | undefined; };
          pairs?: { [x: string]: BodyPair | undefined; };
          pairsList?: BodyPair[];
      } = {}
      • Optional bucketHeight?: number

        The height of a single grid bucket.

        Default

        48
        
      • Optional bucketWidth?: number

        The width of a single grid bucket.

        Default

        48
        
      • Optional buckets?: { [x: string]: IBody[] | undefined; }
      • Optional pairs?: { [x: string]: BodyPair | undefined; }
      • Optional pairsList?: BodyPair[]

    Returns IGrid

    A new grid

    Deprecated

    replaced by Matter.Detector

    Method

    create

  • Updates the grid.

    Parameters

    Returns void

    Deprecated

    replaced by Matter.Detector

    Method

    update

Generated using TypeDoc