@@ -206,12 +206,6 @@ var Common = require('../core/Common');
206206 if ( bodyA && ! bodyA . isStatic ) {
207207 torque = Vector . cross ( offsetA , normalVelocity ) * bodyA . inverseInertia * ( 1 - constraint . angularStiffness ) ;
208208
209- Sleeping . set ( bodyA , false ) ;
210-
211- // clamp to prevent instability
212- // TODO: solve this properly
213- torque = Common . clamp ( torque , - 0.01 , 0.01 ) ;
214-
215209 // keep track of applied impulses for post solving
216210 bodyA . constraintImpulse . x -= force . x ;
217211 bodyA . constraintImpulse . y -= force . y ;
@@ -226,12 +220,6 @@ var Common = require('../core/Common');
226220 if ( bodyB && ! bodyB . isStatic ) {
227221 torque = Vector . cross ( offsetB , normalVelocity ) * bodyB . inverseInertia * ( 1 - constraint . angularStiffness ) ;
228222
229- Sleeping . set ( bodyB , false ) ;
230-
231- // clamp to prevent instability
232- // TODO: solve this properly
233- torque = Common . clamp ( torque , - 0.01 , 0.01 ) ;
234-
235223 // keep track of applied impulses for post solving
236224 bodyB . constraintImpulse . x += force . x ;
237225 bodyB . constraintImpulse . y += force . y ;
@@ -260,6 +248,8 @@ var Common = require('../core/Common');
260248 continue ;
261249 }
262250
251+ Sleeping . set ( body , false ) ;
252+
263253 // update geometry and reset
264254 for ( var j = 0 ; j < body . parts . length ; j ++ ) {
265255 var part = body . parts [ j ] ;
0 commit comments