Skip to content

Commit

Permalink
Be able to set the arcball rotate speed
Browse files Browse the repository at this point in the history
  • Loading branch information
begmec committed Jun 26, 2023
1 parent cdfefb4 commit df0555a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/jsm/controls/ArcballControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ class ArcballControls extends EventDispatcher {
this.cursorZoom = false; //if wheel zoom should be cursor centered
this.minFov = 5;
this.maxFov = 90;
this.rotateSpeed = 1;

this.enabled = true;
this.enablePan = true;
Expand Down Expand Up @@ -445,7 +446,7 @@ class ArcballControls extends EventDispatcher {

const distance = this._startCursorPosition.distanceTo( this._currentCursorPosition );
const angle = this._startCursorPosition.angleTo( this._currentCursorPosition );
const amount = Math.max( distance / this._tbRadius, angle ); //effective rotation angle
const amount = Math.max( distance / this._tbRadius, angle ) * this.rotateSpeed; //effective rotation angle

this.applyTransformMatrix( this.rotate( this.calculateRotationAxis( this._startCursorPosition, this._currentCursorPosition ), amount ) );

Expand Down

0 comments on commit df0555a

Please sign in to comment.