Skip to content

Commit

Permalink
Merge branch 'master' into hflatval/avoid-infinite-rule-item-spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
haakonflatval-cognite authored Aug 13, 2024
2 parents df053f8 + a8264ec commit b10abfc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions viewer/packages/api/src/api-helpers/Image360ApiHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ function moveCameraPositionTo(manager: FlexibleCameraManager, position: Vector3,
};

const tempPosition = new Vector3();
manager.controls.temporarlyDisableKeyboard = true;
manager.controls.temporarilyDisableKeyboard = true;

new TWEEN.Tween(from)
.to(to, duration)
Expand All @@ -617,11 +617,11 @@ function moveCameraPositionTo(manager: FlexibleCameraManager, position: Vector3,
.easing(num => TWEEN.Easing.Quintic.InOut(num))
.onStop(() => {
manager.setPosition(tempPosition);
manager.controls.temporarlyDisableKeyboard = false;
manager.controls.temporarilyDisableKeyboard = false;
})
.onComplete(() => {
manager.setPosition(position);
manager.controls.temporarlyDisableKeyboard = false;
manager.controls.temporarilyDisableKeyboard = false;
})
.start(TWEEN.now());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,20 +198,20 @@ export class FlexibleCameraManager extends PointerEvents implements IFlexibleCam
const from = { t: 0 };
const to = { t: 1 };
const animation = new TWEEN.Tween(from);
this.controls.temporarlyDisableKeyboard = true;
this.controls.temporarilyDisableKeyboard = true;
const tween = animation
.to(to, animationDuration)
.onUpdate(() => {
if (this.isDisposed) return;
this.controls.rotateCameraTo(startDirection, endDirection, from.t);
})
.onStop(() => {
this.controls.temporarlyDisableKeyboard = false;
this.controls.temporarilyDisableKeyboard = false;
if (this.isDisposed) return;
this.controls.rotateCameraTo(startDirection, endDirection, 1);
})
.onComplete(() => {
this.controls.temporarlyDisableKeyboard = false;
this.controls.temporarilyDisableKeyboard = false;
if (this.isDisposed) return;
this.controls.rotateCameraTo(startDirection, endDirection, 1);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class FlexibleControls {
private _isEnabled: boolean = true;
private _isInitialized: boolean = false;
private _isStationary = false; // If true the options.controlsType should not be used. Camera cannot change position and zooms by fov
public temporarlyDisableKeyboard: boolean = false;
public temporarilyDisableKeyboard: boolean = false;

private readonly _options: FlexibleControlsOptions;
private readonly _domElement: HTMLElement;
Expand Down Expand Up @@ -80,7 +80,7 @@ export class FlexibleControls {
// , - ~ ~ ~ - ,
// , ' ' ,
// , , In this state the camera rotating round the target
// , , which is in the center of the sceen.
// , , which is in the center of the screen.
// , Target ,
// , * <--------* CameraPosition
// , CameraVector,
Expand Down Expand Up @@ -928,7 +928,7 @@ export class FlexibleControls {
if (!this._options.enableKeyboardNavigation) {
return false;
}
if (this.temporarlyDisableKeyboard) {
if (this.temporarilyDisableKeyboard) {
return false;
}
let handled = false;
Expand Down
12 changes: 6 additions & 6 deletions viewer/packages/camera-manager/src/Flexible/moveCamera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function moveCameraPositionAndTargetTo(

const tempTarget = new Vector3();
const tempPosition = new Vector3();
manager.controls.temporarlyDisableKeyboard = true;
manager.controls.temporarilyDisableKeyboard = true;

const { tween, removeEventListeners } = createTweenAnimationWithStop(manager, from, to, duration);

Expand All @@ -58,12 +58,12 @@ export function moveCameraPositionAndTargetTo(
manager.setPositionAndTarget(tempPosition, tempTarget);
})
.onStop(() => {
manager.controls.temporarlyDisableKeyboard = false;
manager.controls.temporarilyDisableKeyboard = false;
removeEventListeners();
})
.onComplete(() => {
manager.setPositionAndTarget(tempPosition, tempTarget);
manager.controls.temporarlyDisableKeyboard = false;
manager.controls.temporarilyDisableKeyboard = false;
removeEventListeners();
})
.start(TWEEN.now());
Expand Down Expand Up @@ -92,7 +92,7 @@ export function moveCameraTargetTo(manager: FlexibleCameraManager, target: Vecto
};

const tempTarget = new Vector3();
manager.controls.temporarlyDisableKeyboard = true;
manager.controls.temporarilyDisableKeyboard = true;

const { tween, removeEventListeners } = createTweenAnimationWithStop(manager, from, to, duration);
tween
Expand All @@ -116,13 +116,13 @@ export function moveCameraTargetTo(manager: FlexibleCameraManager, target: Vecto
})
.onStop(() => {
manager.controls.setTempTarget(undefined);
manager.controls.temporarlyDisableKeyboard = false;
manager.controls.temporarilyDisableKeyboard = false;
removeEventListeners();
})
.onComplete(() => {
manager.controls.setTempTarget(undefined);
manager.setPositionAndTarget(manager.camera.position, tempTarget);
manager.controls.temporarlyDisableKeyboard = false;
manager.controls.temporarilyDisableKeyboard = false;
removeEventListeners();
})
.start(TWEEN.now());
Expand Down

0 comments on commit b10abfc

Please sign in to comment.