diff --git a/readme.md b/readme.md index 71aea7c..e067a4a 100644 --- a/readme.md +++ b/readme.md @@ -643,6 +643,12 @@ Returns the focal offset, which is how much the camera appears to be translated --- +#### `stop()` + +stop all transitions. + +--- + #### `saveState()` Set current camera position as the default position @@ -653,8 +659,6 @@ Set current camera position as the default position Normalize camera azimuth angle rotation between 0 and 360 degrees. ---- - #### `reset( enableTransition )` Reset all rotation and position to default. diff --git a/src/CameraControls.ts b/src/CameraControls.ts index ccb5396..05f7498 100644 --- a/src/CameraControls.ts +++ b/src/CameraControls.ts @@ -2402,6 +2402,18 @@ export class CameraControls extends EventDispatcher { } + /** + * stop all transitions. + */ + stop() { + + this._focalOffset.copy( this._focalOffsetEnd ); + this._target.copy( this._targetEnd ); + this._spherical.copy( this._sphericalEnd ); + this._zoom = this._zoomEnd; + + } + /** * Reset all rotation and position to defaults. * @param enableTransition