Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
pchen66 committed Jun 8, 2020
1 parent 4b3c4b1 commit f08e585
Show file tree
Hide file tree
Showing 3 changed files with 213 additions and 198 deletions.
21 changes: 14 additions & 7 deletions build/panolens.js
Original file line number Diff line number Diff line change
Expand Up @@ -8565,7 +8565,7 @@
* @param {THREE.Vector3} [options.initialLookAt=new THREE.Vector3( 0, 0, -Number.MAX_SAFE_INTEGER )] - Initial looking at vector
* @param {boolean} [options.momentum=true] - Use momentum even during mouse/touch move
* @param {number} [options.rotateSpeed=-1.0] - Drag Rotation Speed
* @param {number} [options.dampingFactor=.1] - Damping factor
* @param {number} [options.dampingFactor=.15] - Damping factor
*/
function Viewer ( options = {} ) {

Expand All @@ -8592,7 +8592,7 @@
initialLookAt: new THREE.Vector3( 0, 0, -Number.MAX_SAFE_INTEGER ),
momentum: true,
rotateSpeed: -1.0,
dampingFactor: 0.1
dampingFactor: 0.15

}, options );

Expand Down Expand Up @@ -8665,7 +8665,8 @@
},

setupCamera: function ( cameraFov, ratio, camera = new THREE.PerspectiveCamera( cameraFov, ratio, 1, 10000 ) ) {


camera.position.set( 0, 0, 1 );
return camera;

},
Expand Down Expand Up @@ -9777,6 +9778,8 @@
duration = duration !== undefined ? duration : 1000;
easing = easing || TWEEN.Easing.Exponential.Out;

const MEPS = 10e-5;

const { left, up } = this.calculateCameraDirectionDelta( vector );
const rotateControlLeft = this.rotateControlLeft.bind( this );
const rotateControlUp = this.rotateControlUp.bind( this );
Expand All @@ -9791,18 +9794,22 @@
.to( { left }, duration )
.easing( easing )
.onUpdate(function(ov){
rotateControlLeft( ov.left - nv.left );
const diff = ov.left - nv.left;
if( Math.abs( diff ) < MEPS ) this.tweenLeftAnimation.stop();
rotateControlLeft( diff );
nv.left = ov.left;
})
}.bind(this))
.start();

this.tweenUpAnimation = new TWEEN.Tween( ov )
.to( { up }, duration )
.easing( easing )
.onUpdate(function(ov){
rotateControlUp( ov.up - nv.up );
const diff = ov.up - nv.up;
if( Math.abs( diff ) < MEPS ) this.tweenUpAnimation.stop();
rotateControlUp( diff );
nv.up = ov.up;
})
}.bind(this))
.start();

},
Expand Down
Loading

0 comments on commit f08e585

Please sign in to comment.