code: function( dir, result, data ){
  
              var verts = this.vertices
                  ,val
                  ,prev
                  ,l = verts.length
                  ,i = 2
                  ,idx
                  ;
  
              result = result || new Physics.vector();
  
              if ( l < 2 ){
                  if ( data ){
                      data.idx = 0;
                  }
                  return result.clone( verts[0] );
              }
  
              prev = verts[ 0 ].dot( dir );
              val = verts[ 1 ].dot( dir );
  
              if ( l === 2 ){
                  idx = (val >= prev) ? 1 : 0;
                  if ( data ){
                      data.idx = idx;
                  }
                  return result.clone( verts[ idx ] );
              }
  
              if ( val >= prev ){
                  // go up
                  // search until the next dot product
                  // is less than the previous
                  while ( i < l && val >= prev ){
                      prev = val;
                      val = verts[ i ].dot( dir );
                      i++;
                  }
  
                  if (val >= prev){
                      i++;
                  }
  
                  // return the previous (furthest with largest dot product)
                  idx = i - 2;
                  if ( data ){
                      data.idx = i - 2;
                  }
                  return result.clone( verts[ idx ] );
  
              } else {
                  // go down
  
                  i = l;
                  while ( i > 1 && prev >= val ){
                      i--;
                      val = prev;
                      prev = verts[ i ].dot( dir );
                  }
  
                  // return the previous (furthest with largest dot product)
                  idx = (i + 1) % l;
                  if ( data ){
                      data.idx = idx;
                  }
                  return result.clone( verts[ idx ] );
              }
          }
docs: extended