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
* @method create
* @param {number} bucketWidth
* @param {number} bucketHeight
* @param {} options
* @return {grid} A new grid
*/
Grid.create = function(bucketWidth, bucketHeight) {
return {
Grid.create = function(options) {
var defaults = {
controller: Grid,
detector: Detector.collisions,
buckets: {},
pairs: {},
pairsList: [],
bucketWidth: bucketWidth || 48,
bucketHeight: bucketHeight || 48
bucketWidth: 48,
bucketHeight: 48
};
return Common.extend(defaults, options);
};
/**