File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ var Body = {};
1616 Body . _inertiaScale = 4 ;
1717
1818 var _nextCollidingGroupId = 1 ,
19- _nextNonCollidingGroupId = - 1 ;
19+ _nextNonCollidingGroupId = - 1 ,
20+ _nextCategory = 0x0001 ;
2021
2122 /**
2223 * 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 = {};
8990 return _nextCollidingGroupId ++ ;
9091 } ;
9192
93+ /**
94+ * Returns the next unique category bitfield (starting after the initial default category `0x0001`).
95+ * There are 32 available. See `body.collisionFilter` for more information.
96+ * @method nextCategory
97+ * @return {Number } Unique category bitfield
98+ */
99+ Body . nextCategory = function ( ) {
100+ _nextCategory = _nextCategory << 1 ;
101+ return _nextCategory ;
102+ } ;
103+
92104 /**
93105 * Initialises body properties.
94106 * @method _initProperties
You can’t perform that action at this time.
0 commit comments