Show:
API

Matter.Grid

This class is deprecated.

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.

Methods

Matter.Grid._bucketAddBody

(grid, bucket, body)
deprecated private

Deprecated: replaced by Matter.Detector

Adds a body to a bucket.

Parameters

Matter.Grid._bucketRemoveBody

(grid, bucket, body)
deprecated private

Deprecated: replaced by Matter.Detector

Removes a body from a bucket.

Parameters

Matter.Grid._createActivePairsList

(grid)
Object deprecated private

Deprecated: replaced by Matter.Detector

Generates a list of the active pairs in the grid.

Parameters

Returns

[] pairs

Matter.Grid._createBucket

(buckets, bucketId)
Object deprecated private

Deprecated: replaced by Matter.Detector

Creates a bucket.

Parameters

Returns

bucket

Matter.Grid._createRegion

(startCol, endCol, startRow, endRow)
Object deprecated private

Deprecated: replaced by Matter.Detector

Creates a region.

Parameters

Returns

region

Matter.Grid._getBucketId

(column, row)
String deprecated private

Deprecated: replaced by Matter.Detector

Gets the bucket id at the given position.

Parameters

Returns

String

bucket id

Matter.Grid._getRegion

(grid, body)
Object deprecated private

Deprecated: replaced by Matter.Detector

Gets the region a given body falls in for a given grid.

Parameters

Returns

region

Matter.Grid._regionUnion

(regionA, regionB)
Object deprecated private

Deprecated: replaced by Matter.Detector

Finds the union of two regions.

Parameters

Returns

region

Matter.Grid.clear

(grid)
deprecated

Deprecated: replaced by Matter.Detector

Clears the grid.

Parameters

Matter.Grid.create

(options)
Grid deprecated

Deprecated: replaced by Matter.Detector

Creates a new grid.

Parameters

Returns

Grid

A new grid

Matter.Grid.update

(grid, bodies, engine, forceUpdate)
deprecated

Deprecated: replaced by Matter.Detector

Updates the grid.

Parameters

Properties / Options

The following properties if specified below are for objects created by Matter.Grid.create and may be passed to it as options.

The height of a single grid bucket.

Default: 48

The width of a single grid bucket.

Default: 48