docs: function( dt ){
  
              var opts = this._world && this._world.options;
  
              // if sleeping disabled. stop.
              if ( this.sleepDisabled || (opts && opts.sleepDisabled) ){
                  return;
              }
  
              var limit
                  ,v
                  ,d
                  ,r
                  ,aabb
                  ,scratch = Physics.scratchpad()
                  ,diff = scratch.vector()
                  ,diff2 = scratch.vector()
                  ,kfac
                  ,stats
                  ;
  
              dt = dt || 0;
              aabb = this.geometry.aabb();
              r = Math.max(aabb.hw, aabb.hh);
  
              if ( this.asleep ){
                  // check velocity
                  v = this.state.vel.norm() + Math.abs(r * this.state.angular.vel);
                  limit = this.sleepSpeedLimit || (opts && opts.sleepSpeedLimit) || 0;
  
                  if ( v >= limit ){
                      this.sleep( false );
                      return scratch.done();
                  }
              }
  
              this._sleepMeanK++;
              kfac = this._sleepMeanK > 1 ? 1/(this._sleepMeanK - 1) : 0;
              Physics.statistics.pushRunningVectorAvg( this.state.pos, this._sleepMeanK, this._sleepPosMean, this._sleepPosVariance );
              // we take the sin because that maps the discontinuous angle to a continuous value
              // then the statistics calculations work better
              stats = Physics.statistics.pushRunningAvg( Math.sin(this.state.angular.pos), this._sleepMeanK, this._sleepAngPosMean, this._sleepAngPosVariance );
              this._sleepAngPosMean = stats[0];
              this._sleepAngPosVariance = stats[1];
              v = this._sleepPosVariance.norm() + Math.abs(r * Math.asin(stats[1]));
              v *= kfac;
              limit = this.sleepVarianceLimit || (opts && opts.sleepVarianceLimit) || 0;
              // console.log(v, limit, kfac, this._sleepPosVariance.norm(), stats[1])
              if ( v <= limit ){
                  // check idle time
                  limit = this.sleepTimeLimit || (opts && opts.sleepTimeLimit) || 0;
                  this.sleepIdleTime = (this.sleepIdleTime || 0) + dt;
  
                  if ( this.sleepIdleTime > limit ){
                      this.asleep = true;
                  }
              } else {
                  this.sleep( false );
              }
  
              scratch.done();
          }