@openglobus/og 1.0.0-rc10 → 1.0.0-rc14
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.
- package/lib/Globe.d.ts +3 -0
- package/lib/camera/Camera.d.ts +8 -0
- package/lib/camera/PlanetCamera.d.ts +1 -1
- package/lib/control/DebugInfo.d.ts +1 -0
- package/lib/control/FreeNavigation.d.ts +253 -0
- package/lib/control/Navigation.d.ts +6 -0
- package/lib/control/ShowFps.d.ts +15 -3
- package/lib/control/Sun.d.ts +56 -0
- package/lib/control/index.d.ts +1 -0
- package/lib/entity/EntityCollection.d.ts +5 -0
- package/lib/entity/billboard/BaseBillboardHandler.d.ts +6 -0
- package/lib/entity/geoObject/InstanceData.d.ts +6 -0
- package/lib/entity/geometry/GeometryHandler.d.ts +1 -0
- package/lib/entity/label/Label.d.ts +1 -1
- package/lib/entity/pointCloud/PointCloud.d.ts +1 -0
- package/lib/entity/pointCloud/PointCloudHandler.d.ts +5 -0
- package/lib/entity/polyline/PolylineBatchRenderer.d.ts +1 -0
- package/lib/entity/polyline/PolylineHandler.d.ts +5 -0
- package/lib/entity/ray/RayHandler.d.ts +1 -0
- package/lib/input/KeyboardHandler.d.ts +1 -0
- package/lib/layer/Layer.d.ts +8 -1
- package/lib/math/Line2.d.ts +1 -1
- package/lib/og.css +1 -1
- package/lib/og.es.js +1 -1
- package/lib/og.es.js.map +1 -1
- package/lib/quadTree/QuadTreeStrategy.d.ts +7 -0
- package/lib/renderer/Renderer.d.ts +51 -5
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/GeoImageCreator.d.ts +7 -0
- package/lib/utils/Loader.d.ts +6 -0
- package/lib/utils/NormalMapCreator.d.ts +6 -0
- package/lib/utils/VectorTileCreator.d.ts +6 -0
- package/lib/webgl/Handler.d.ts +15 -0
- package/package.json +1 -1
package/lib/Globe.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export interface IGlobeParams {
|
|
|
42
42
|
sun?: {
|
|
43
43
|
active?: boolean;
|
|
44
44
|
stopped?: boolean;
|
|
45
|
+
localDateTime?: Date | null;
|
|
45
46
|
};
|
|
46
47
|
navigation?: {
|
|
47
48
|
active?: boolean;
|
|
@@ -73,6 +74,7 @@ export interface IGlobeParams {
|
|
|
73
74
|
frameOpacity?: number;
|
|
74
75
|
shadeMode?: ShadeModeInput;
|
|
75
76
|
reverseDepth?: boolean;
|
|
77
|
+
idleMode?: boolean;
|
|
76
78
|
}
|
|
77
79
|
/**
|
|
78
80
|
* @typedef {Array<number>} LonLatCoordinate
|
|
@@ -108,6 +110,7 @@ export interface IGlobeParams {
|
|
|
108
110
|
* @param {Array.<Layer>} [options.layers] - Planet layers.
|
|
109
111
|
* @param {Extent | ExtentBoundingBox} [options.viewExtent] [options.viewExtent] - Viewable starting extent.
|
|
110
112
|
* @param {boolean} [options.autoActivate=true] - Globe rendering auto activation flag. True is default.
|
|
113
|
+
* @param {boolean} [options.idleMode=false] - Skips a frame rendering when nothing has been changed. False is default.
|
|
111
114
|
* @param {HTMLElement} [options.attributionContainer] - Container for attribution list.
|
|
112
115
|
* @param {number} [options.maxGridSize=128] = Maximal segment grid size. 128 is default
|
|
113
116
|
* @param {string} [options.fontsSrc] - Fonts collection url.
|
package/lib/camera/Camera.d.ts
CHANGED
|
@@ -143,6 +143,13 @@ declare class Camera {
|
|
|
143
143
|
protected _pb: Vec3;
|
|
144
144
|
protected _peye: Vec3;
|
|
145
145
|
isMoving: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Fires when the camera view or projection has been changed. It is assigned by the renderer
|
|
148
|
+
* to wake it up from the idle mode.
|
|
149
|
+
* @public
|
|
150
|
+
* @type {?function(): void}
|
|
151
|
+
*/
|
|
152
|
+
onViewChange: (() => void) | null;
|
|
146
153
|
protected _pViewAngle: number;
|
|
147
154
|
protected _pAspect: number;
|
|
148
155
|
protected _pWidth: number;
|
|
@@ -233,6 +240,7 @@ declare class Camera {
|
|
|
233
240
|
* @param {IFlyCartesianParams} [params] - Flight parameters
|
|
234
241
|
*/
|
|
235
242
|
flyCartesian(cartesian: Vec3, params?: IFlyCartesianParams): void;
|
|
243
|
+
protected _startFlying(): void;
|
|
236
244
|
/**
|
|
237
245
|
* Breaks the flight.
|
|
238
246
|
* @public
|
|
@@ -128,7 +128,7 @@ declare class PlanetCamera extends Camera {
|
|
|
128
128
|
* @public
|
|
129
129
|
* @param {LonLat} lonlat - New camera and camera view position.
|
|
130
130
|
* @param {LonLat} [lookLonLat] - Look up coordinates.
|
|
131
|
-
* @param {Vec3} [up] - Camera UP vector.
|
|
131
|
+
* @param {Vec3} [up] - Camera UP vector. Defaults to the local surface normal for an explicit look point.
|
|
132
132
|
*/
|
|
133
133
|
setLonLat(lonlat: LonLat, lookLonLat?: LonLat, up?: Vec3): void;
|
|
134
134
|
/**
|
|
@@ -16,6 +16,7 @@ export declare class DebugInfo extends Control {
|
|
|
16
16
|
protected _toggleBtn: ToggleButton;
|
|
17
17
|
protected _dialog: Dialog<null>;
|
|
18
18
|
protected _canvasTiles: CanvasTiles;
|
|
19
|
+
protected _drawnFrames: number;
|
|
19
20
|
constructor(options?: IDebugInfoParams);
|
|
20
21
|
addWatches(watches: IDebugInfoWatch[]): void;
|
|
21
22
|
addWatch(watch: IDebugInfoWatch): void;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import type { IControlParams } from "./Control";
|
|
2
|
+
import { Control } from "./Control";
|
|
3
|
+
import type { IMouseState } from "../renderer/RendererEvents";
|
|
4
|
+
import { Navigation } from "./Navigation";
|
|
5
|
+
import type { Vec2 } from "../math/Vec2";
|
|
6
|
+
import { Vec3 } from "../math/Vec3";
|
|
7
|
+
import { type EventsHandler } from "../Events";
|
|
8
|
+
export interface IFreeNavigationParams extends IControlParams {
|
|
9
|
+
speed?: number;
|
|
10
|
+
minSpeed?: number;
|
|
11
|
+
maxSpeed?: number;
|
|
12
|
+
speedStep?: number;
|
|
13
|
+
speedFactor?: number;
|
|
14
|
+
lookSensitivity?: number;
|
|
15
|
+
rollSpeed?: number;
|
|
16
|
+
accelerationTime?: number;
|
|
17
|
+
decelerationTime?: number;
|
|
18
|
+
pitchLimit?: number;
|
|
19
|
+
invertY?: boolean;
|
|
20
|
+
pointerLock?: boolean;
|
|
21
|
+
toggleKey?: number;
|
|
22
|
+
showInfo?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export type FreeNavigationEventsList = ["move", "rotate", "speedchange", "activate", "deactivate"];
|
|
25
|
+
/**
|
|
26
|
+
* Free-flight camera navigation.
|
|
27
|
+
*
|
|
28
|
+
* - W/S — move forward/backward
|
|
29
|
+
* - A/D — strafe left/right
|
|
30
|
+
* - Space/Ctrl — increase/decrease altitude
|
|
31
|
+
* - Shift — hold to move without changing the camera height above the ellipsoid
|
|
32
|
+
* - Q/E — roll
|
|
33
|
+
* - Mouse — look around
|
|
34
|
+
* - Mouse wheel — adjust movement speed
|
|
35
|
+
* - Right mouse button — hold to keep the point under the screen center in the center
|
|
36
|
+
* - F — activate and deactivate the control, see `toggleKey`
|
|
37
|
+
*
|
|
38
|
+
* Yaw follows the local ellipsoid normal, while pitch uses the camera's right vector.
|
|
39
|
+
* The camera preserves its orientation relative to the local horizon while moving.
|
|
40
|
+
*
|
|
41
|
+
* By default, pointer lock allows unrestricted mouse rotation. Pressing Escape releases
|
|
42
|
+
* the pointer and deactivates the control. Set `pointerLock` to `false` to use regular
|
|
43
|
+
* mouse movement instead.
|
|
44
|
+
*
|
|
45
|
+
* The control conflicts with the {@link Navigation} control, so an active {@link Navigation}
|
|
46
|
+
* is deactivated while the free navigation is active, and restored back on deactivation.
|
|
47
|
+
*
|
|
48
|
+
* @class
|
|
49
|
+
* @extends {Control}
|
|
50
|
+
* @param {IFreeNavigationParams} [options] - Free navigation options:
|
|
51
|
+
* @param {number} [options.speed] - Initial selected movement speed in m/s. Default is 0
|
|
52
|
+
* @param {number} [options.minSpeed] - Minimal selected movement speed in m/s. Default is -300
|
|
53
|
+
* @param {number} [options.maxSpeed] - Maximal selected movement speed in m/s. Default is 1000000
|
|
54
|
+
* @param {number} [options.speedStep] - Mouse wheel speed step near the zero speed in m/s. Default is 1
|
|
55
|
+
* @param {number} [options.speedFactor] - Relative speed increment per one mouse wheel step. Default is 0.45
|
|
56
|
+
* @param {number} [options.lookSensitivity] - Camera rotation angle in radians per mouse move pixel
|
|
57
|
+
* @param {number} [options.rollSpeed] - Q/E roll angular speed in radians per second the smoothed
|
|
58
|
+
* roll velocity approaches
|
|
59
|
+
* @param {number} [options.accelerationTime] - Acceleration smoothing time in seconds. Default is 0.6
|
|
60
|
+
* @param {number} [options.decelerationTime] - Deceleration smoothing time in seconds. Default is 0.4
|
|
61
|
+
* @param {number} [options.pitchLimit] - Maximal pitch angle above and below the local horizon in radians
|
|
62
|
+
* @param {boolean} [options.invertY] - Inverts vertical mouse rotation direction. Default is false
|
|
63
|
+
* @param {boolean} [options.pointerLock] - Locks and hides the mouse pointer. Default is true
|
|
64
|
+
* @param {number} [options.toggleKey] - Key code which activates and deactivates the control,
|
|
65
|
+
* it works while the control is inactive as well. Zero disables it. Default is `input.KEY_F`
|
|
66
|
+
* @param {boolean} [options.showInfo] - Shows the movement speed and the key hint. Default is false
|
|
67
|
+
* @fires move
|
|
68
|
+
* @fires rotate
|
|
69
|
+
* @fires speedchange
|
|
70
|
+
* @fires activate
|
|
71
|
+
* @fires deactivate
|
|
72
|
+
*/
|
|
73
|
+
export declare class FreeNavigation extends Control {
|
|
74
|
+
events: EventsHandler<FreeNavigationEventsList>;
|
|
75
|
+
minSpeed: number;
|
|
76
|
+
maxSpeed: number;
|
|
77
|
+
speedStep: number;
|
|
78
|
+
speedFactor: number;
|
|
79
|
+
lookSensitivity: number;
|
|
80
|
+
rollSpeed: number;
|
|
81
|
+
accelerationTime: number;
|
|
82
|
+
decelerationTime: number;
|
|
83
|
+
pitchLimit: number;
|
|
84
|
+
invertY: boolean;
|
|
85
|
+
pointerLock: boolean;
|
|
86
|
+
toggleKey: number;
|
|
87
|
+
/**
|
|
88
|
+
* Current camera velocity in meters per second.
|
|
89
|
+
* @public
|
|
90
|
+
* @type {Vec3}
|
|
91
|
+
*/
|
|
92
|
+
vel: Vec3;
|
|
93
|
+
/**
|
|
94
|
+
* Current camera roll angular velocity in radians per second.
|
|
95
|
+
* @public
|
|
96
|
+
* @type {number}
|
|
97
|
+
*/
|
|
98
|
+
rollVel: number;
|
|
99
|
+
/**
|
|
100
|
+
* Selected movement speed in meters per second.
|
|
101
|
+
* @protected
|
|
102
|
+
* @type {number}
|
|
103
|
+
*/
|
|
104
|
+
protected _speed: number;
|
|
105
|
+
protected _moveForward: boolean;
|
|
106
|
+
protected _moveBackward: boolean;
|
|
107
|
+
protected _moveLeft: boolean;
|
|
108
|
+
protected _moveRight: boolean;
|
|
109
|
+
protected _moveUp: boolean;
|
|
110
|
+
protected _moveDown: boolean;
|
|
111
|
+
protected _rollDir: number;
|
|
112
|
+
protected _dx: number;
|
|
113
|
+
protected _dy: number;
|
|
114
|
+
protected _skipPointerMove: boolean;
|
|
115
|
+
protected _targetPoint: Vec3 | null;
|
|
116
|
+
protected _targetRequest: number;
|
|
117
|
+
protected _holdHeight: number | null;
|
|
118
|
+
protected _lastFrameTime: number;
|
|
119
|
+
protected _frameDeltaTime: number;
|
|
120
|
+
protected _infoEl: HTMLElement | null;
|
|
121
|
+
protected _suspendedNavigation: Navigation[];
|
|
122
|
+
constructor(options?: IFreeNavigationParams);
|
|
123
|
+
onadd(): void;
|
|
124
|
+
oninit(): void;
|
|
125
|
+
onremove(): void;
|
|
126
|
+
/**
|
|
127
|
+
* Activates the control when it is inactive and deactivates it otherwise.
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
toggle(): void;
|
|
131
|
+
protected _onToggleKey: () => void;
|
|
132
|
+
protected _updateInfo(): void;
|
|
133
|
+
onactivate(): void;
|
|
134
|
+
ondeactivate(): void;
|
|
135
|
+
/**
|
|
136
|
+
* Returns selected movement speed in meters per second.
|
|
137
|
+
* @public
|
|
138
|
+
* @return {number} -
|
|
139
|
+
*/
|
|
140
|
+
get speed(): number;
|
|
141
|
+
/**
|
|
142
|
+
* Sets selected movement speed in meters per second.
|
|
143
|
+
* @public
|
|
144
|
+
* @param {number} speed - Speed in m/s.
|
|
145
|
+
*/
|
|
146
|
+
set speed(speed: number);
|
|
147
|
+
/**
|
|
148
|
+
* Sets selected movement speed in meters per second, clamped to the min and max speed.
|
|
149
|
+
* @public
|
|
150
|
+
* @param {number} speed - Speed in m/s.
|
|
151
|
+
*/
|
|
152
|
+
setSpeed(speed: number): void;
|
|
153
|
+
/**
|
|
154
|
+
* Changes the movement speed by the given number of wheel steps.
|
|
155
|
+
*
|
|
156
|
+
* The speed step increases with the current speed. Changes are reversible,
|
|
157
|
+
* and zero speed is always reachable.
|
|
158
|
+
* @public
|
|
159
|
+
* @param {number} steps - Number of the wheel steps, negative decreases the speed.
|
|
160
|
+
*/
|
|
161
|
+
stepSpeed(steps: number): void;
|
|
162
|
+
/**
|
|
163
|
+
* True when the mouse pointer is locked by the control.
|
|
164
|
+
* @public
|
|
165
|
+
* @return {boolean} -
|
|
166
|
+
*/
|
|
167
|
+
isPointerLocked(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Locks and hides the mouse pointer over the canvas.
|
|
170
|
+
* @public
|
|
171
|
+
*/
|
|
172
|
+
requestPointerLock(): void;
|
|
173
|
+
/**
|
|
174
|
+
* Releases the mouse pointer.
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
exitPointerLock(): void;
|
|
178
|
+
/**
|
|
179
|
+
* Locked target point in the cartesian coordinates, or null when no target is locked.
|
|
180
|
+
* @public
|
|
181
|
+
* @return {Vec3 | null} -
|
|
182
|
+
*/
|
|
183
|
+
get targetPoint(): Vec3 | null;
|
|
184
|
+
/**
|
|
185
|
+
* Locks the target point, so the camera keeps looking at it wherever it moves,
|
|
186
|
+
* @public
|
|
187
|
+
* @param {Vec3} [point] - Target point in the cartesian coordinates.
|
|
188
|
+
*/
|
|
189
|
+
lockTarget(point?: Vec3 | null): void;
|
|
190
|
+
/**
|
|
191
|
+
* Releases the locked target point.
|
|
192
|
+
* @public
|
|
193
|
+
*/
|
|
194
|
+
unlockTarget(): void;
|
|
195
|
+
/**
|
|
196
|
+
* Stops the camera movement and releases the locked target point.
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
stop(): void;
|
|
200
|
+
protected onPreDraw(): void;
|
|
201
|
+
protected _hasInput(): boolean;
|
|
202
|
+
protected _resetInput(): void;
|
|
203
|
+
private _onCameraFly;
|
|
204
|
+
protected _onMouseMove: (e: IMouseState) => void;
|
|
205
|
+
protected _onLockedMouseMove: (e: MouseEvent) => void;
|
|
206
|
+
protected _onPointerLockChange: () => void;
|
|
207
|
+
protected _onLDown: () => void;
|
|
208
|
+
protected _onRDown: () => void;
|
|
209
|
+
protected _onRUp: () => void;
|
|
210
|
+
protected _onKeyEscape: () => void;
|
|
211
|
+
protected _onMouseLeave: () => void;
|
|
212
|
+
protected _onMouseWheel: (e: IMouseState) => void;
|
|
213
|
+
protected _onKeyForward: () => void;
|
|
214
|
+
protected _onKeyBackward: () => void;
|
|
215
|
+
protected _onKeyLeft: () => void;
|
|
216
|
+
protected _onKeyRight: () => void;
|
|
217
|
+
protected _onKeyUp: () => void;
|
|
218
|
+
protected _onKeyDown: () => void;
|
|
219
|
+
protected _onKeyRollLeft: () => void;
|
|
220
|
+
protected _onKeyRollRight: () => void;
|
|
221
|
+
protected _getLocalUp(eye: Vec3): Vec3;
|
|
222
|
+
protected _getTargetPixel(): Vec2;
|
|
223
|
+
protected _pickTargetPoint(px: Vec2): Vec3 | null;
|
|
224
|
+
protected _handleTargetLock(): void;
|
|
225
|
+
protected _handleRotation(): void;
|
|
226
|
+
/**
|
|
227
|
+
* Clamps the pitch rotation angle.
|
|
228
|
+
* @protected
|
|
229
|
+
* @param {number} angle - Pitch angle in radians.
|
|
230
|
+
* @param {Vec3} forward - Camera forward vector.
|
|
231
|
+
* @param {Vec3} right - Camera right vector.
|
|
232
|
+
* @param {Vec3} localUp - Local reference frame up direction.
|
|
233
|
+
* @return {number} - Applicable pitch angle in radians.
|
|
234
|
+
*/
|
|
235
|
+
protected _limitPitch(angle: number, forward: Vec3, right: Vec3, localUp: Vec3): number;
|
|
236
|
+
/**
|
|
237
|
+
* Rollls the camera around its forward axis and keeps its angular velocity smoothed.
|
|
238
|
+
* @protected
|
|
239
|
+
*/
|
|
240
|
+
protected _handleRoll(): void;
|
|
241
|
+
protected _orthonormalizeCamera(): void;
|
|
242
|
+
/**
|
|
243
|
+
* Moves the camera and keeps its orientation in the local reference frame.
|
|
244
|
+
* @protected
|
|
245
|
+
*/
|
|
246
|
+
protected _handleMove(): void;
|
|
247
|
+
protected _isHeightHold(): boolean;
|
|
248
|
+
protected _handleHeightHold(): void;
|
|
249
|
+
protected _suspendNavigation(): void;
|
|
250
|
+
protected _restoreNavigation(): void;
|
|
251
|
+
protected _updateFrameDeltaTime(): void;
|
|
252
|
+
protected get dt(): number;
|
|
253
|
+
}
|
|
@@ -100,6 +100,12 @@ export declare class Navigation extends Control {
|
|
|
100
100
|
onactivate(): void;
|
|
101
101
|
ondeactivate(): void;
|
|
102
102
|
protected onPreDraw(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Returns true while the inertia has not been damped yet.
|
|
105
|
+
* @public
|
|
106
|
+
* @returns {boolean}
|
|
107
|
+
*/
|
|
108
|
+
isMoving(): boolean;
|
|
103
109
|
_onShiftFree: () => void;
|
|
104
110
|
private _onCameraFly;
|
|
105
111
|
protected _onMouseMove: (e: IMouseState) => void;
|
package/lib/control/ShowFps.d.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
|
+
import { Button } from "../ui/Button";
|
|
1
2
|
import { Control } from "./Control";
|
|
2
3
|
import type { IControlParams } from "./Control";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Frames per second(FPS) display control. It looks like a map button in the top right
|
|
6
|
+
* corner and shows the current frame rate instead of an icon.
|
|
7
|
+
*
|
|
8
|
+
* Note that the rate is measured by the control itself and not taken from
|
|
9
|
+
* {@link Handler#deltaTime}, which is clamped and does not represent the real frame time.
|
|
10
|
+
* @class
|
|
11
|
+
* @extends {Control}
|
|
5
12
|
*/
|
|
6
13
|
export declare class ShowFps extends Control {
|
|
7
|
-
|
|
14
|
+
protected _btn: Button | null;
|
|
15
|
+
protected _text: HTMLElement | null;
|
|
16
|
+
protected _frames: number;
|
|
17
|
+
protected _measureStart: number;
|
|
18
|
+
constructor(options?: IControlParams);
|
|
8
19
|
oninit(): void;
|
|
9
|
-
|
|
20
|
+
onremove(): void;
|
|
21
|
+
protected _draw: () => void;
|
|
10
22
|
}
|
package/lib/control/Sun.d.ts
CHANGED
|
@@ -1,22 +1,47 @@
|
|
|
1
1
|
import { Control } from "./Control";
|
|
2
2
|
import type { IControlParams } from "./Control";
|
|
3
3
|
import { Clock } from "../Clock";
|
|
4
|
+
import type { JulianDate } from "../astro/jd";
|
|
4
5
|
import { Vec3 } from "../math/Vec3";
|
|
6
|
+
import type { PlanetCamera } from "../camera/PlanetCamera";
|
|
5
7
|
interface ISunParams extends IControlParams {
|
|
6
8
|
activationHeight?: number;
|
|
7
9
|
offsetVertical?: number;
|
|
8
10
|
offsetHorizontal?: number;
|
|
9
11
|
stopped?: boolean;
|
|
12
|
+
localDateTime?: Date | null;
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
12
15
|
* Real Sun geocentric position control that place the Sun on the right place by the Earth.
|
|
16
|
+
* @class
|
|
17
|
+
*
|
|
18
|
+
* @example <caption>Lighting frozen at 21:30 local solar time under the camera</caption>
|
|
19
|
+
* new Sun({ localDateTime: new Date(2026, 7, 3, 21, 30) })
|
|
20
|
+
*
|
|
21
|
+
* @param {ISunParams} [options] - Options:
|
|
22
|
+
* @param {number} [options.activationHeight=12079000.0] - Camera height above which the Sun takes its real position by the clock.
|
|
23
|
+
* @param {number} [options.offsetVertical=-5000000] - Vertical offset of the camera following light.
|
|
24
|
+
* @param {number} [options.offsetHorizontal=5000000] - Horizontal offset of the camera following light.
|
|
25
|
+
* @param {boolean} [options.stopped=false] - Stops the control, leaving the Sun on its real position by the clock.
|
|
26
|
+
* @param {Date} [options.localDateTime] - Lights the scene by a fixed local apparent solar time under the camera
|
|
27
|
+
* instead of the camera following light, below activationHeight. At 12:00 the Sun stands on the meridian there,
|
|
28
|
+
* while the date sets the season. Read for the wall clock numbers it shows locally, so it is not an instant in
|
|
29
|
+
* time: one parsed from an absolute timestamp reads as the machine's time zone renders it. The Clock is left
|
|
30
|
+
* untouched, and while the control is stopped this is ignored.
|
|
13
31
|
*/
|
|
14
32
|
export declare class Sun extends Control {
|
|
15
33
|
activationHeight: number;
|
|
16
34
|
offsetVertical: number;
|
|
17
35
|
offsetHorizontal: number;
|
|
36
|
+
/**
|
|
37
|
+
* Fixed local apparent solar time under the camera, or null for the camera following light.
|
|
38
|
+
* @public
|
|
39
|
+
* @type {Date | null}
|
|
40
|
+
*/
|
|
41
|
+
localDateTime: Date | null;
|
|
18
42
|
protected _currDate: number;
|
|
19
43
|
protected _prevDate: number;
|
|
44
|
+
protected _redrawDate: number;
|
|
20
45
|
protected _clockPtr: Clock | null;
|
|
21
46
|
protected _lightOn: boolean;
|
|
22
47
|
protected _stopped: boolean;
|
|
@@ -25,12 +50,43 @@ export declare class Sun extends Control {
|
|
|
25
50
|
protected _sunlightPosition: Vec3;
|
|
26
51
|
constructor(options?: ISunParams);
|
|
27
52
|
oninit(): void;
|
|
53
|
+
protected _onClockTick: () => void;
|
|
28
54
|
stop(): void;
|
|
29
55
|
start(): void;
|
|
30
56
|
onactivate(): void;
|
|
31
57
|
bindClock(clock: Clock): void;
|
|
32
58
|
getPosition(): Vec3;
|
|
59
|
+
/**
|
|
60
|
+
* Sets a fixed local apparent solar time under the camera.
|
|
61
|
+
* @public
|
|
62
|
+
* @param {Date | null} localDateTime - Local date and time, or null to restore the camera following light.
|
|
63
|
+
*/
|
|
64
|
+
setLocalDateTime(localDateTime: Date | null): void;
|
|
33
65
|
protected _setSunPosition3v(position: Vec3): void;
|
|
66
|
+
/**
|
|
67
|
+
* Returns a light position offset from the camera along its own up and right axes,
|
|
68
|
+
* so that nearby terrain is lit regardless of the real Sun direction.
|
|
69
|
+
* @protected
|
|
70
|
+
* @param {PlanetCamera} cam - Planet camera.
|
|
71
|
+
* @returns {Vec3} -
|
|
72
|
+
*/
|
|
73
|
+
protected _getCameraFollowingPosition(cam: PlanetCamera): Vec3;
|
|
74
|
+
/**
|
|
75
|
+
* Returns the julian date at which localDateTime is the local apparent solar time at lon.
|
|
76
|
+
* Local mean solar time is the first guess, then the measured subsolar longitude corrects it;
|
|
77
|
+
* that point drifts -360 degrees a day, so a residual of d degrees is worth -d / 360 of a day.
|
|
78
|
+
* @protected
|
|
79
|
+
* @param {number} lon - Longitude under the camera, degrees.
|
|
80
|
+
* @returns {JulianDate} -
|
|
81
|
+
*/
|
|
82
|
+
protected _getLocalDateTimeJulian(lon: number): JulianDate;
|
|
83
|
+
/**
|
|
84
|
+
* Returns the Sun position for localDateTime at the location under the camera.
|
|
85
|
+
* @protected
|
|
86
|
+
* @param {PlanetCamera} cam - Planet camera.
|
|
87
|
+
* @returns {Vec3} -
|
|
88
|
+
*/
|
|
89
|
+
protected _getLocalDateTimePosition(cam: PlanetCamera): Vec3;
|
|
34
90
|
protected _draw(): void;
|
|
35
91
|
}
|
|
36
92
|
export {};
|
package/lib/control/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./Control";
|
|
|
3
3
|
export * from "./DebugInfo";
|
|
4
4
|
export * from "./DrawingSwitcher";
|
|
5
5
|
export * from "./EarthCoordinates";
|
|
6
|
+
export * from "./FreeNavigation";
|
|
6
7
|
export * from "./GeoImageDragControl";
|
|
7
8
|
export * from "./KeyboardNavigation";
|
|
8
9
|
export * from "./LayerAnimation";
|
|
@@ -241,6 +241,11 @@ declare class EntityCollection {
|
|
|
241
241
|
* @param {boolean} visibility - Visibility flag.
|
|
242
242
|
*/
|
|
243
243
|
setVisibility(visibility: boolean): void;
|
|
244
|
+
/**
|
|
245
|
+
* Requests the next frame to be rendered.
|
|
246
|
+
* @public
|
|
247
|
+
*/
|
|
248
|
+
requestRedraw(): void;
|
|
244
249
|
/**
|
|
245
250
|
* Returns collection visibility.
|
|
246
251
|
* @public
|
|
@@ -56,6 +56,12 @@ declare class BaseBillboardHandler {
|
|
|
56
56
|
initProgram(): void;
|
|
57
57
|
setRenderer(renderer: Renderer): void;
|
|
58
58
|
refresh(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Marks a buffer to be updated in the next frame and requests the frame to be rendered.
|
|
61
|
+
* @protected
|
|
62
|
+
* @param {number} index - Buffer index.
|
|
63
|
+
*/
|
|
64
|
+
protected _setChangedBuffer(index: number): void;
|
|
59
65
|
protected _removeBillboards(): void;
|
|
60
66
|
clear(): void;
|
|
61
67
|
protected _deleteBuffers(): void;
|
|
@@ -79,6 +79,12 @@ export declare class InstanceData {
|
|
|
79
79
|
createIndicesBuffer(): void;
|
|
80
80
|
createPickingColorBuffer(): void;
|
|
81
81
|
refresh(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Marks a buffer to be updated in the next frame and requests the frame to be rendered.
|
|
84
|
+
* @public
|
|
85
|
+
* @param {number} index - Buffer index.
|
|
86
|
+
*/
|
|
87
|
+
setChangedBuffer(index: number): void;
|
|
82
88
|
update(): void;
|
|
83
89
|
private _createColorTexture;
|
|
84
90
|
private _createNormalTexture;
|
|
@@ -60,6 +60,7 @@ declare class GeometryHandler {
|
|
|
60
60
|
protected _refreshPlanetNode(treeNode: Node): void;
|
|
61
61
|
protected _updatePlanet(): void;
|
|
62
62
|
protected refresh(): void;
|
|
63
|
+
protected _setChangedBuffer(index: number): void;
|
|
63
64
|
update(): void;
|
|
64
65
|
setGeometryVisibility(geometry: Geometry): void;
|
|
65
66
|
setPolyColorArr(geometry: Geometry, color: Vec4): void;
|
|
@@ -30,6 +30,11 @@ declare class PointCloudHandler {
|
|
|
30
30
|
*/
|
|
31
31
|
protected _pointClouds: PointCloud[];
|
|
32
32
|
constructor(entityCollection: EntityCollection);
|
|
33
|
+
/**
|
|
34
|
+
* Requests the next frame to be rendered.
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
requestRedraw(): void;
|
|
33
38
|
protected _initProgram(): void;
|
|
34
39
|
bindScene(scene: Scene): void;
|
|
35
40
|
add(pointCloud: PointCloud): void;
|
|
@@ -20,6 +20,11 @@ declare class PolylineHandler {
|
|
|
20
20
|
protected _polylines: Polyline[];
|
|
21
21
|
constructor(entityCollection: EntityCollection);
|
|
22
22
|
setVisibleSphere(p: Vec3, r: number): void;
|
|
23
|
+
/**
|
|
24
|
+
* Requests the next frame to be rendered.
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
requestRedraw(): void;
|
|
23
28
|
protected _initProgram(): void;
|
|
24
29
|
bindScene(scene: Scene): void;
|
|
25
30
|
add(polyline: Polyline): void;
|
|
@@ -13,6 +13,7 @@ declare class KeyboardHandler {
|
|
|
13
13
|
protected _event: KeyboardEvent | null;
|
|
14
14
|
protected _active: boolean;
|
|
15
15
|
protected _stampCache: Record<string, number>;
|
|
16
|
+
onKeyEvent: ((event: KeyboardEvent) => void) | null;
|
|
16
17
|
constructor();
|
|
17
18
|
getcurrentlyPressedKeys(): Record<number, boolean>;
|
|
18
19
|
getPressedKeysCallbacks(): Record<number, ICallbackHandler[]>;
|
package/lib/layer/Layer.d.ts
CHANGED
|
@@ -136,7 +136,7 @@ declare class Layer {
|
|
|
136
136
|
*/
|
|
137
137
|
_planet: Planet | null;
|
|
138
138
|
createTexture: Function | null;
|
|
139
|
-
|
|
139
|
+
protected _nightTextureCoefficient: number;
|
|
140
140
|
protected _hasImageryTiles: boolean;
|
|
141
141
|
/**
|
|
142
142
|
* Layer global opacity.
|
|
@@ -225,6 +225,13 @@ declare class Layer {
|
|
|
225
225
|
get instanceName(): string;
|
|
226
226
|
get rendererEvents(): EventsHandler<LayerEventsList>;
|
|
227
227
|
set opacity(opacity: number);
|
|
228
|
+
/**
|
|
229
|
+
* Night texture blending coefficient.
|
|
230
|
+
* @public
|
|
231
|
+
* @type {number}
|
|
232
|
+
*/
|
|
233
|
+
set nightTextureCoefficient(coefficient: number);
|
|
234
|
+
get nightTextureCoefficient(): number;
|
|
228
235
|
set pickingEnabled(picking: boolean);
|
|
229
236
|
get pickingEnabled(): boolean;
|
|
230
237
|
/**
|
package/lib/math/Line2.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare class Line2 {
|
|
|
14
14
|
* Finds the intersection of the line with a circle.
|
|
15
15
|
* @param {Vec2} center - Circle center.
|
|
16
16
|
* @param {number} radius - Circle radius.
|
|
17
|
-
* @returns {
|
|
17
|
+
* @returns {Array.<Vec2>} Zero, one, or two intersection points.
|
|
18
18
|
*/
|
|
19
19
|
getCircleIntersection(center: Vec2, radius: number): [] | [Vec2] | [Vec2, Vec2];
|
|
20
20
|
}
|