0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-23 09:26:51 -05:00

changed Grid.create to accept an options object

This commit is contained in:
liabru 2014-06-21 19:18:35 +01:00
parent 14392b4a88
commit eedd1f2a9c

View file

@ -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);
}; };
/** /**