File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424 }
2525
2626 // Matter aliases
27- var Example = Matter . Example ,
27+ var Body = Matter . Body ,
28+ Example = Matter . Example ,
2829 Engine = Matter . Engine ,
2930 World = Matter . World ,
3031 Common = Matter . Common ,
295296 demo . sceneEvents = [ ] ;
296297
297298 // reset id pool
299+ Body . _nextCollidingGroupId = 1 ;
300+ Body . _nextNonCollidingGroupId = - 1 ;
301+ Body . _nextCategory = 0x0001 ;
298302 Common . _nextId = 0 ;
299303
300304 // reset random seed
Original file line number Diff line number Diff line change @@ -24,10 +24,9 @@ var Axes = require('../geometry/Axes');
2424( function ( ) {
2525
2626 Body . _inertiaScale = 4 ;
27-
28- var _nextCollidingGroupId = 1 ,
29- _nextNonCollidingGroupId = - 1 ,
30- _nextCategory = 0x0001 ;
27+ Body . _nextCollidingGroupId = 1 ;
28+ Body . _nextNonCollidingGroupId = - 1 ;
29+ Body . _nextCategory = 0x0001 ;
3130
3231 /**
3332 * Creates a new rigid body model. The options parameter is an object that specifies any properties you wish to override the defaults.
@@ -100,9 +99,9 @@ var Axes = require('../geometry/Axes');
10099 */
101100 Body . nextGroup = function ( isNonColliding ) {
102101 if ( isNonColliding )
103- return _nextNonCollidingGroupId -- ;
102+ return Body . _nextNonCollidingGroupId -- ;
104103
105- return _nextCollidingGroupId ++ ;
104+ return Body . _nextCollidingGroupId ++ ;
106105 } ;
107106
108107 /**
@@ -112,8 +111,8 @@ var Axes = require('../geometry/Axes');
112111 * @return {Number } Unique category bitfield
113112 */
114113 Body . nextCategory = function ( ) {
115- _nextCategory = _nextCategory << 1 ;
116- return _nextCategory ;
114+ Body . _nextCategory = Body . _nextCategory << 1 ;
115+ return Body . _nextCategory ;
117116 } ;
118117
119118 /**
You can’t perform that action at this time.
0 commit comments