|
|
@@ -196,6 +196,7 @@ class ArcballControls extends Controls {
|
|
|
this._farPos0 = 0;
|
|
|
this._cameraMatrixState0 = new Matrix4();
|
|
|
this._gizmoMatrixState0 = new Matrix4();
|
|
|
+ this._target0 = new Vector3();
|
|
|
|
|
|
//pointers array
|
|
|
this._button = - 1;
|
|
|
@@ -2229,6 +2230,7 @@ class ArcballControls extends Controls {
|
|
|
*/
|
|
|
reset() {
|
|
|
|
|
|
+ this.target.copy( this._target0 );
|
|
|
this.object.zoom = this._zoom0;
|
|
|
|
|
|
if ( this.object.isPerspectiveCamera ) {
|
|
|
@@ -2301,7 +2303,8 @@ class ArcballControls extends Controls {
|
|
|
cameraNear: this.object.near,
|
|
|
cameraUp: this.object.up,
|
|
|
cameraZoom: this.object.zoom,
|
|
|
- gizmoMatrix: this._gizmos.matrix
|
|
|
+ gizmoMatrix: this._gizmos.matrix,
|
|
|
+ target: this.target
|
|
|
|
|
|
}
|
|
|
} );
|
|
|
@@ -2316,7 +2319,8 @@ class ArcballControls extends Controls {
|
|
|
cameraNear: this.object.near,
|
|
|
cameraUp: this.object.up,
|
|
|
cameraZoom: this.object.zoom,
|
|
|
- gizmoMatrix: this._gizmos.matrix
|
|
|
+ gizmoMatrix: this._gizmos.matrix,
|
|
|
+ target: this.target
|
|
|
|
|
|
}
|
|
|
} );
|
|
|
@@ -2347,6 +2351,10 @@ class ArcballControls extends Controls {
|
|
|
*/
|
|
|
saveState() {
|
|
|
|
|
|
+ this.object.updateMatrix();
|
|
|
+ this._gizmos.updateMatrix();
|
|
|
+
|
|
|
+ this._target0.copy( this.target );
|
|
|
this._cameraMatrixState0.copy( this.object.matrix );
|
|
|
this._gizmoMatrixState0.copy( this._gizmos.matrix );
|
|
|
this._nearPos = this.object.near;
|
|
|
@@ -2947,6 +2955,8 @@ class ArcballControls extends Controls {
|
|
|
|
|
|
if ( state.arcballState != undefined ) {
|
|
|
|
|
|
+ this.target.fromArray( state.arcballState.target );
|
|
|
+
|
|
|
this._cameraMatrixState.fromArray( state.arcballState.cameraMatrix.elements );
|
|
|
this._cameraMatrixState.decompose( this.object.position, this.object.quaternion, this.object.scale );
|
|
|
|