@vived/app 2.19.1 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FocusCamera } from "../Entities";
|
|
2
|
+
import { Vector3 } from "../ValueObjects";
|
|
3
|
+
export interface FocusCameraPosRotVM {
|
|
4
|
+
position: Vector3;
|
|
5
|
+
rotation: Vector3;
|
|
6
|
+
}
|
|
7
|
+
export declare class FocusCameraPosRotPM {
|
|
8
|
+
private focusCam;
|
|
9
|
+
private view;
|
|
10
|
+
dispose(): void;
|
|
11
|
+
private doUpdateView;
|
|
12
|
+
constructor(orbitCamera: FocusCamera, view: (vm: FocusCameraPosRotVM) => void);
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FocusCameraPosRotPM = void 0;
|
|
4
|
+
const Utilities_1 = require("../Utilities");
|
|
5
|
+
const ValueObjects_1 = require("../ValueObjects");
|
|
6
|
+
class FocusCameraPosRotPM {
|
|
7
|
+
constructor(orbitCamera, view) {
|
|
8
|
+
this.doUpdateView = () => {
|
|
9
|
+
const { alpha, beta } = this.focusCam;
|
|
10
|
+
const alphaRadians = Utilities_1.degreesToRadians(alpha);
|
|
11
|
+
const betaRadians = Utilities_1.degreesToRadians(beta);
|
|
12
|
+
const position = this.focusCam.cameraPosition;
|
|
13
|
+
const rotation = new ValueObjects_1.Vector3(betaRadians, alphaRadians, 0);
|
|
14
|
+
this.view({
|
|
15
|
+
position,
|
|
16
|
+
rotation,
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
this.focusCam = orbitCamera;
|
|
20
|
+
this.view = view;
|
|
21
|
+
this.doUpdateView();
|
|
22
|
+
this.focusCam.addObserver(this.doUpdateView);
|
|
23
|
+
}
|
|
24
|
+
dispose() {
|
|
25
|
+
this.focusCam.removeObserver(this.doUpdateView);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.FocusCameraPosRotPM = FocusCameraPosRotPM;
|