mirror of
https://github.com/liabru/matter-js.git
synced 2024-12-26 13:49:01 -05:00
added Body.nextCategory
This commit is contained in:
parent
5888ffcaf6
commit
d249165ea9
1 changed files with 13 additions and 1 deletions
|
@ -16,7 +16,8 @@ var Body = {};
|
|||
Body._inertiaScale = 4;
|
||||
|
||||
var _nextCollidingGroupId = 1,
|
||||
_nextNonCollidingGroupId = -1;
|
||||
_nextNonCollidingGroupId = -1,
|
||||
_nextCategory = 0x0001;
|
||||
|
||||
/**
|
||||
* Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults.
|
||||
|
@ -89,6 +90,17 @@ var Body = {};
|
|||
return _nextCollidingGroupId++;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the next unique category bitfield (starting after the initial default category `0x0001`).
|
||||
* There are 32 available. See `body.collisionFilter` for more information.
|
||||
* @method nextCategory
|
||||
* @return {Number} Unique category bitfield
|
||||
*/
|
||||
Body.nextCategory = function() {
|
||||
_nextCategory = _nextCategory << 1;
|
||||
return _nextCategory;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialises body properties.
|
||||
* @method _initProperties
|
||||
|
|
Loading…
Reference in a new issue