mirror of
https://github.com/liabru/matter-js.git
synced 2024-11-27 09:50:52 -05:00
changed Grid.create to accept an options object
This commit is contained in:
parent
14392b4a88
commit
eedd1f2a9c
1 changed files with 9 additions and 6 deletions
|
@ -12,18 +12,21 @@ var Grid = {};
|
||||||
/**
|
/**
|
||||||
* Description
|
* Description
|
||||||
* @method create
|
* @method create
|
||||||
* @param {number} bucketWidth
|
* @param {} options
|
||||||
* @param {number} bucketHeight
|
|
||||||
* @return {grid} A new grid
|
* @return {grid} A new grid
|
||||||
*/
|
*/
|
||||||
Grid.create = function(bucketWidth, bucketHeight) {
|
Grid.create = function(options) {
|
||||||
return {
|
var defaults = {
|
||||||
|
controller: Grid,
|
||||||
|
detector: Detector.collisions,
|
||||||
buckets: {},
|
buckets: {},
|
||||||
pairs: {},
|
pairs: {},
|
||||||
pairsList: [],
|
pairsList: [],
|
||||||
bucketWidth: bucketWidth || 48,
|
bucketWidth: 48,
|
||||||
bucketHeight: bucketHeight || 48
|
bucketHeight: 48
|
||||||
};
|
};
|
||||||
|
|
||||||
|
return Common.extend(defaults, options);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue