Methods
Static
Protected
_bucket Add Body
_bucket Add Body ( grid , bucket , body ) : void
Returns void
Static
Protected
_bucket Remove Body
_bucket Remove Body ( grid , bucket , body ) : void
Returns void
Static
Protected
_create Active Pairs List
_create Active Pairs List ( grid ) : BodyPair []
pairs
Static
Protected
_create Bucket
_create Bucket ( buckets , bucketId ) : IBody []
Parameters
buckets : Record < string , IBody [] >
bucketId : string
bucket
Static
Protected
_create Region
_create Region ( startCol , endCol , startRow , endRow ) : IRegion
Parameters
startCol : number
endCol : number
startRow : number
endRow : number
region
Static
Protected
_get Bucket Id
_get Bucket Id ( column , row ) : string
Parameters
column : number
row : number
Returns string bucket id
Static
Protected
_get Region
_get Region ( grid , body ) : IRegion
region
Static
Protected
_region Union
_region Union ( regionA , regionB ) : IRegion
region
Static
clear
clear ( grid ) : void
Returns void
Static
create
create ( options ? ) : IGrid
Parameters
options : { bucketHeight ?: number ; bucketWidth ?: number ; buckets ?: { [x: string]: IBody[] | undefined; }; pairs ?: { [x: string]: BodyPair | undefined; }; pairsList ?: BodyPair [] ; } = {}
Optional
bucket Height ?: number
Optional
bucket Width ?: number
Optional
buckets ?: { [x: string]: IBody[] | undefined; }
Optional
pairs ?: { [x: string]: BodyPair | undefined; }
Optional
pairs List ?: BodyPair []
A new grid
Static
update
update ( grid , bodies , engine , forceUpdate ) : void
Returns void
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