@@ -231,7 +231,6 @@ const $lastSpherical = Symbol('lastSpherical');
231
231
const $jumpCamera = Symbol ( 'jumpCamera' ) ;
232
232
const $initialized = Symbol ( 'initialized' ) ;
233
233
const $maintainThetaPhi = Symbol ( 'maintainThetaPhi' ) ;
234
- const $setInterpolationDecay = Symbol ( 'setInterpolationDecay' ) ;
235
234
236
235
const $syncCameraOrbit = Symbol ( 'syncCameraOrbit' ) ;
237
236
const $syncFieldOfView = Symbol ( 'syncFieldOfView' ) ;
@@ -477,6 +476,7 @@ export const ControlsMixin = <T extends Constructor<ModelViewerElementBase>>(
477
476
super . updated ( changedProperties ) ;
478
477
479
478
const controls = this [ $controls ] ;
479
+ const scene = this [ $scene ] ;
480
480
const input = this [ $userInputElement ] ;
481
481
482
482
if ( changedProperties . has ( 'cameraControls' ) ) {
@@ -507,7 +507,7 @@ export const ControlsMixin = <T extends Constructor<ModelViewerElementBase>>(
507
507
}
508
508
509
509
if ( changedProperties . has ( 'bounds' ) ) {
510
- this [ $ scene] . tightBounds = this . bounds === 'tight' ;
510
+ scene . tightBounds = this . bounds === 'tight' ;
511
511
}
512
512
513
513
if ( changedProperties . has ( 'interactionPrompt' ) ||
@@ -537,13 +537,14 @@ export const ControlsMixin = <T extends Constructor<ModelViewerElementBase>>(
537
537
}
538
538
539
539
if ( changedProperties . has ( 'interpolationDecay' ) ) {
540
- this [ $setInterpolationDecay ] ( this . interpolationDecay ) ;
540
+ controls . setDamperDecayTime ( this . interpolationDecay ) ;
541
+ scene . setTargetDamperDecayTime ( this . interpolationDecay ) ;
541
542
}
542
543
543
544
if ( this [ $jumpCamera ] === true ) {
544
545
Promise . resolve ( ) . then ( ( ) => {
545
546
controls . jumpToGoal ( ) ;
546
- this [ $ scene] . jumpToGoal ( ) ;
547
+ scene . jumpToGoal ( ) ;
547
548
this [ $jumpCamera ] = false ;
548
549
} ) ;
549
550
}
@@ -617,7 +618,6 @@ export const ControlsMixin = <T extends Constructor<ModelViewerElementBase>>(
617
618
const moveTouches = ( ) => {
618
619
// cancel interaction if user interacts
619
620
if ( this [ $controls ] . isUserChange ) {
620
- this [ $setInterpolationDecay ] ( this . interpolationDecay ) ;
621
621
for ( const fingerElement of this [ $fingerAnimatedContainers ] ) {
622
622
fingerElement . style . opacity = '0' ;
623
623
}
@@ -630,14 +630,12 @@ export const ControlsMixin = <T extends Constructor<ModelViewerElementBase>>(
630
630
position . x = xy [ i ] . x ( time ) ;
631
631
position . y = xy [ i ] . y ( time ) ;
632
632
}
633
- this [ $setInterpolationDecay ] ( 0 ) ;
634
633
dispatchTouches ( 'pointermove' ) ;
635
634
636
635
if ( time < 1 ) {
637
636
requestAnimationFrame ( moveTouches ) ;
638
637
} else {
639
638
dispatchTouches ( 'pointerup' ) ;
640
- this [ $setInterpolationDecay ] ( this . interpolationDecay ) ;
641
639
document . removeEventListener ( 'visibilitychange' , onVisibilityChange ) ;
642
640
}
643
641
} ;
@@ -781,11 +779,6 @@ export const ControlsMixin = <T extends Constructor<ModelViewerElementBase>>(
781
779
this [ $promptElementVisibleTime ] = Infinity ;
782
780
}
783
781
784
- [ $setInterpolationDecay ] ( decay : number ) {
785
- this [ $controls ] . setDamperDecayTime ( decay ) ;
786
- this [ $scene ] . setTargetDamperDecayTime ( decay ) ;
787
- }
788
-
789
782
/**
790
783
* Updates the camera's near and far planes to enclose the scene when
791
784
* orbiting at the supplied radius.
0 commit comments