src/orbit-controls.js
/**
   * Update the given camera matrix with new position information, etc
   * @param  {mat4} view   A view matrix
   * @return {void}
   */
Update the given camera matrix with new position information, etc
@param  {mat4} view   A view matrix
@return {void}
Update the given camera matrix with new position information etc @param { mat4 } view A view matrix @return { void }
updateView() {
    var dx = this.target.x - this.rotation.x,
      dy = this.target.y - this.rotation.y,
      dz = this.distanceTarget - this.distance,
      cameraPosition = vec3.create();
    if(Math.abs(dx) > 0.00001 || Math.abs(dy) > 0.00001 || Math.abs(dz) > 0.00001) {
      this.rotation.x += dx * this.options.friction;
      this.rotation.y += dy * this.options.friction;
      this.distance += dz * this.options.distanceScale;
      cameraPosition[0] = this.distance * Math.sin(this.rotation.x) * Math.cos(this.rotation.y) + this.options.target[0];
      cameraPosition[1] = this.distance * Math.sin(this.rotation.y) + this.options.target[1];
      cameraPosition[2] = this.distance * Math.cos(this.rotation.x) * Math.cos(this.rotation.y) + this.options.target[2];
      this.camera.setPosition(cameraPosition);
    }
  }
updateView ( ) { var dx = this . target . x - this . rotation . x , dy = this . target . y - this . rotation . y , dz = this . distanceTarget - this . distance , cameraPosition = vec3 . create ( ) ; if ( Math . abs ( dx ) > 0.00001 || Math . abs ( dy ) > 0.00001 || Math . abs ( dz ) > 0.00001 ) { this . rotation . x += dx * this . options . friction ; this . rotation . y += dy * this . options . friction ; this . distance += dz * this . options . distanceScale ; cameraPosition [ 0 ] = this . distance * Math . sin ( this . rotation . x ) * Math . cos ( this . rotation . y ) + this . options . target [ 0 ] ; cameraPosition [ 1 ] = this . distance * Math . sin ( this . rotation . y ) + this . options . target [ 1 ] ; cameraPosition [ 2 ] = this . distance * Math . cos ( this . rotation . x ) * Math . cos ( this . rotation . y ) + this . options . target [ 2 ] ; this . camera . setPosition ( cameraPosition ) ; } }
Update the given camera matrix with new position information, etc
 @param  {mat4} view   A view matrix
 @return {void}
Update the given camera matrix with new position information etc @param { mat4 } view A view matrix @return { void }