forked from JeremyHeleine/Photo-Sphere-Viewer
-
-
Notifications
You must be signed in to change notification settings - Fork 630
/
ViewerState.ts
108 lines (89 loc) · 1.88 KB
/
ViewerState.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import { Mesh, Vector3 } from 'three';
import { SPHERE_RADIUS } from '../data/constants';
import { Size, TextureData } from '../model';
import type { Animation } from '../utils';
/**
* Internal properties of the viewer
*/
export class ViewerState {
/**
* when all components are loaded
*/
ready = false;
/**
* if the view needs to be renderer
*/
needsUpdate = false;
/**
* number of plugins requesting to continuously render the scene
*/
continuousUpdateCount = 0;
/**
* if the keyboard events are currently listened to
*/
keyboardEnabled = false;
/**
* direction of the camera
*/
direction = new Vector3(0, 0, SPHERE_RADIUS);
/**
* current camera roll
*/
roll = 0;
/**
* vertical FOV
*/
vFov = 60;
/**
* horizontal FOV
*/
hFov = 60;
/**
* renderer aspect ratio
*/
aspect = 1;
/**
* currently running animation
*/
animation: Animation = null;
/**
* currently running transition
*/
transitionAnimation: Animation = null;
/**
* promise of the last "setPanorama()" call
*/
loadingPromise: Promise<any> = null;
/**
* special tweaks for LittlePlanetAdapter
*/
littlePlanet = false;
/**
* time of the last user action
*/
idleTime = -1;
/**
* registered THREE objects observer
*/
objectsObservers: Record<string, Mesh | null> = {};
/**
* size of the container
*/
size: Size = {
width: 0,
height: 0,
};
/**
* Current panorama texture displayed
*/
textureData: TextureData;
/**
* Current override of the global cursor
*/
cursorOverride: string;
/**
* @internal
*/
// eslint-disable-next-line @typescript-eslint/no-empty-function
constructor() {}
}