@openglobus/og 1.0.0-rc2 → 1.0.0-rc21
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/README.md +2 -0
- package/lib/Globe.d.ts +21 -8
- package/lib/Object3d.d.ts +1 -1
- package/lib/assets/LabelWorker.worker-C24YLEkW.js.map +1 -0
- package/lib/assets/PlainSegmentWorker.worker-DJHXd0bF.js.map +1 -0
- package/lib/assets/TerrainWorker.worker-BwueoQpg.js.map +1 -0
- package/lib/camera/Camera.d.ts +57 -8
- package/lib/camera/Frustum.d.ts +37 -1
- package/lib/camera/PlanetCamera.d.ts +29 -4
- package/lib/control/DebugInfo.d.ts +1 -0
- package/lib/control/FramebufferPreview.d.ts +18 -2
- package/lib/control/FreeNavigation.d.ts +253 -0
- package/lib/control/LayerSwitcher.d.ts +18 -0
- package/lib/control/Lighting.d.ts +3 -0
- package/lib/control/Navigation.d.ts +18 -1
- package/lib/control/ShowFps.d.ts +15 -3
- package/lib/control/Sun.d.ts +59 -0
- package/lib/control/depthCamera/DepthCamera.d.ts +132 -0
- package/lib/control/depthCamera/DepthCameraHandler.d.ts +25 -0
- package/lib/control/depthCamera/depth_camera.d.ts +2 -0
- package/lib/control/entityEditor/CameraEditorView.d.ts +60 -0
- package/lib/control/entityEditor/EntityEditor.d.ts +2 -1
- package/lib/control/entityEditor/EntityEditorDialog.d.ts +15 -47
- package/lib/control/entityEditor/EntityEditorScene.d.ts +16 -0
- package/lib/control/entityEditor/EntityEditorView.d.ts +68 -0
- package/lib/control/entityEditor/ProjectorEditorView.d.ts +31 -0
- package/lib/control/entityEditor/RotateEntity.d.ts +5 -1
- package/lib/control/index.d.ts +3 -3
- package/lib/control/timeline/TimelineControl.d.ts +86 -0
- package/lib/control/timeline/TimelineModel.d.ts +46 -1
- package/lib/control/timeline/TimelineView.d.ts +55 -2
- package/lib/entity/Entity.d.ts +18 -0
- package/lib/entity/EntityCollection.d.ts +71 -13
- package/lib/entity/billboard/BaseBillboardHandler.d.ts +16 -0
- package/lib/entity/geoObject/GeoObjectHandler.d.ts +3 -0
- package/lib/entity/geoObject/InstanceData.d.ts +6 -0
- package/lib/entity/geometry/Geometry.d.ts +18 -0
- package/lib/entity/geometry/GeometryHandler.d.ts +1 -0
- package/lib/entity/label/Label.d.ts +8 -6
- package/lib/entity/pointCloud/PointCloud.d.ts +1 -0
- package/lib/entity/pointCloud/PointCloudHandler.d.ts +5 -0
- package/lib/entity/polyline/Polyline.d.ts +15 -0
- package/lib/entity/polyline/PolylineBatchRenderer.d.ts +1 -0
- package/lib/entity/polyline/PolylineHandler.d.ts +5 -0
- package/lib/entity/ray/Ray.d.ts +2 -0
- package/lib/entity/ray/RayHandler.d.ts +1 -0
- package/lib/index.d.ts +20 -3
- package/lib/input/KeyboardHandler.d.ts +5 -1
- package/lib/layer/BaseTileMaterialLayer.d.ts +36 -0
- package/lib/layer/CanvasTiles.d.ts +8 -12
- package/lib/layer/Layer.d.ts +8 -1
- package/lib/layer/Vector.d.ts +74 -18
- package/lib/layer/XYZ.d.ts +5 -21
- package/lib/math/Line2.d.ts +9 -0
- package/lib/math.d.ts +8 -0
- package/lib/og.css +2 -1
- package/lib/og.es.js +1 -1
- package/lib/og.es.js.map +1 -1
- package/lib/quadTree/EntityCollectionsTreeStrategy.d.ts +3 -0
- package/lib/quadTree/QuadTreeStrategy.d.ts +18 -1
- package/lib/quadTree/earth/EarthEntityCollectionsTreeStrategy.d.ts +3 -0
- package/lib/quadTree/equi/EquiEntityCollectionsTreeStrategy.d.ts +3 -0
- package/lib/renderer/PhongDeferredShading.d.ts +2 -0
- package/lib/renderer/Renderer.d.ts +89 -6
- package/lib/renderer/RendererEvents.d.ts +2 -0
- package/lib/renderer/cascadeShadows/CascadeShadowManager.d.ts +34 -0
- package/lib/renderer/cascadeShadows/CascadeShadowMap.d.ts +110 -0
- package/lib/renderer/cascadeShadows/cascade_shadow_depth.d.ts +2 -0
- package/lib/renderer/projectors/Projector.d.ts +67 -0
- package/lib/renderer/projectors/ProjectorManager.d.ts +86 -0
- package/lib/renderer/projectors/ProjectorsPass.d.ts +37 -0
- package/lib/renderer/shadows/ShadowManager.d.ts +41 -0
- package/lib/renderer/shadows/ShadowMap.d.ts +21 -0
- package/lib/renderer/textureUnits.d.ts +6 -0
- package/lib/scene/Planet.d.ts +80 -8
- package/lib/scene/Scene.d.ts +1 -8
- package/lib/scene/SkyBox.d.ts +2 -1
- package/lib/segment/Segment.d.ts +18 -1
- package/lib/shaders/common/uniforms.d.ts +29 -0
- package/lib/shaders/geo_object/geo_object.d.ts +1 -0
- package/lib/shaders/projectorsPass/projectorsPass.d.ts +2 -0
- package/lib/shaders/tone_mapping/toneMapping.d.ts +1 -1
- package/lib/shaders/varianceBlur.d.ts +2 -0
- package/lib/terrain/EmptyTerrain.d.ts +43 -2
- package/lib/terrain/GlobusRgbTerrain.d.ts +1 -0
- package/lib/terrain/MapterhornTerrain.d.ts +11 -0
- package/lib/terrain/RgbTerrain.d.ts +11 -0
- package/lib/terrain/index.d.ts +6 -2
- package/lib/ui/Button.d.ts +1 -0
- package/lib/ui/Checkbox.d.ts +1 -0
- package/lib/ui/Color.d.ts +6 -2
- package/lib/ui/Dialog.d.ts +46 -1
- package/lib/ui/Dock.d.ts +151 -0
- package/lib/ui/Input.d.ts +14 -1
- package/lib/ui/Slider.d.ts +1 -0
- package/lib/ui/TitleBarView.d.ts +21 -0
- package/lib/ui/index.d.ts +2 -0
- package/lib/utils/FontAtlas.d.ts +5 -3
- 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/TerrainWorker.d.ts +1 -0
- package/lib/utils/VectorTileCreator.d.ts +6 -0
- package/lib/utils/cameraFootprint.d.ts +72 -0
- package/lib/utils/gltf/types.d.ts +5 -4
- package/lib/utils/shadowCameraFit.d.ts +175 -0
- package/lib/utils/shared.d.ts +11 -0
- package/lib/webgl/BaseFramebuffer.d.ts +28 -0
- package/lib/webgl/Framebuffer.d.ts +5 -7
- package/lib/webgl/Handler.d.ts +28 -0
- package/package.json +11 -9
- package/lib/assets/LabelWorker.worker-DYd7xn3M.js.map +0 -1
- package/lib/assets/PlainSegmentWorker.worker-JsKldq-e.js.map +0 -1
- package/lib/assets/TerrainWorker.worker-CqUJvMOv.js.map +0 -1
- package/lib/control/CameraFrameComposer.d.ts +0 -19
- package/lib/control/CameraFrameHandler.d.ts +0 -26
- package/lib/control/cameraDepthHandler/CameraDepthHandler.d.ts +0 -42
- package/lib/control/cameraDepthHandler/camera_depth.d.ts +0 -2
- package/lib/tsconfig.tsbuildinfo +0 -1
package/lib/entity/Entity.d.ts
CHANGED
|
@@ -152,6 +152,12 @@ declare class Entity {
|
|
|
152
152
|
protected _rootCartesian: Vec3;
|
|
153
153
|
protected _localPosition: Vec3;
|
|
154
154
|
protected _absoluteLocalPosition: Vec3;
|
|
155
|
+
/**
|
|
156
|
+
* Absolute cartesian position of the entity itself, i.e. `_rootCartesian + _absoluteLocalPosition`.
|
|
157
|
+
* @protected
|
|
158
|
+
* @type {Vec3}
|
|
159
|
+
*/
|
|
160
|
+
protected _absoluteCartesian: Vec3;
|
|
155
161
|
/**
|
|
156
162
|
* Geodetic entity coordinates.
|
|
157
163
|
* @public
|
|
@@ -265,6 +271,7 @@ declare class Entity {
|
|
|
265
271
|
protected _absoluteScale: Vec3;
|
|
266
272
|
protected _qFrame: Quat;
|
|
267
273
|
protected _qRot: Quat;
|
|
274
|
+
protected _directQRot: Quat;
|
|
268
275
|
_absoluteQRot: Quat;
|
|
269
276
|
protected _useDirectQuaternion: boolean;
|
|
270
277
|
protected _opacity: number | null;
|
|
@@ -377,6 +384,7 @@ declare class Entity {
|
|
|
377
384
|
* @param {Vec3} scale - Scale vector.
|
|
378
385
|
*/
|
|
379
386
|
setScale3v(scale: Vec3): void;
|
|
387
|
+
protected _propagateGlobalScale(scale: Vec3): void;
|
|
380
388
|
/**
|
|
381
389
|
* Sets uniform local scale.
|
|
382
390
|
* @public
|
|
@@ -441,6 +449,14 @@ declare class Entity {
|
|
|
441
449
|
* @param {number} val - The new roll angle in radians.
|
|
442
450
|
*/
|
|
443
451
|
setRoll(val: number): void;
|
|
452
|
+
/**
|
|
453
|
+
* Sets pitch, yaw and roll at once.
|
|
454
|
+
* @public
|
|
455
|
+
* @param {number} pitch - The new pitch angle in radians.
|
|
456
|
+
* @param {number} yaw - The new yaw angle in radians.
|
|
457
|
+
* @param {number} roll - The new roll angle in radians.
|
|
458
|
+
*/
|
|
459
|
+
setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
|
|
444
460
|
/**
|
|
445
461
|
* Gets the pitch angle of the entity.
|
|
446
462
|
* @public
|
|
@@ -524,8 +540,10 @@ declare class Entity {
|
|
|
524
540
|
* @param {number} z - Z coordinate in 3D space.
|
|
525
541
|
*/
|
|
526
542
|
setCartesian(x: number, y: number, z: number): void;
|
|
543
|
+
protected _propagateGlobalPosition(x: number, y: number, z: number): void;
|
|
527
544
|
protected _updatePitchYawRoll(): void;
|
|
528
545
|
_updateAbsolutePosition(): void;
|
|
546
|
+
protected _applyTransformToFeatures(): void;
|
|
529
547
|
/**
|
|
530
548
|
* Sets local cartesian position without dispatching events.
|
|
531
549
|
* @public
|
|
@@ -8,6 +8,7 @@ import { GeoObjectHandler } from "./geoObject/GeoObjectHandler";
|
|
|
8
8
|
import { LabelHandler } from "./label/LabelHandler";
|
|
9
9
|
import { Vec3 } from "../math/Vec3";
|
|
10
10
|
import type { NumberArray3 } from "../math/Vec3";
|
|
11
|
+
import type { NumberArray4 } from "../math/Vec4";
|
|
11
12
|
import { PointCloudHandler } from "./pointCloud/PointCloudHandler";
|
|
12
13
|
import { PolylineHandler } from "./polyline/PolylineHandler";
|
|
13
14
|
import { RayHandler } from "./ray/RayHandler";
|
|
@@ -22,7 +23,10 @@ interface IEntityCollectionParams {
|
|
|
22
23
|
visibility?: boolean;
|
|
23
24
|
labelMaxLetters?: number;
|
|
24
25
|
pickingEnabled?: boolean;
|
|
25
|
-
|
|
26
|
+
receiveProjectors?: boolean;
|
|
27
|
+
receiveShadows?: boolean;
|
|
28
|
+
receiveFrameTransparency?: boolean;
|
|
29
|
+
scaleByDistance?: NumberArray3 | NumberArray4;
|
|
26
30
|
pickingScale?: number | NumberArray3;
|
|
27
31
|
opacity?: number;
|
|
28
32
|
shadeMode?: ShadeModeInput;
|
|
@@ -39,10 +43,14 @@ interface IEntityCollectionParams {
|
|
|
39
43
|
* @param {boolean} [options.visibility=true] - Entity visibility.
|
|
40
44
|
* @param {number} [options.labelMaxLetters] - Maximum label letters per line used by the label handler.
|
|
41
45
|
* @param {boolean} [options.pickingEnabled] - Enables/disables picking for all entity handlers.
|
|
42
|
-
* @param {
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
+
* @param {boolean} [options.receiveProjectors=true] - Enables/disables projector effect reception for this collection.
|
|
47
|
+
* @param {boolean} [options.receiveFrameTransparency=false] - Enables/disables frame transparency reception for this collection.
|
|
48
|
+
* @param {boolean} [options.receiveShadows=true] - Enables/disables shadow map reception for this collection.
|
|
49
|
+
* @param {Array.<number>} [options.scaleByDistance] - Scale by distance parameters:
|
|
50
|
+
* `[near, far, vanish, scale]`. The fourth entry is a plain multiplier and defaults to `1`, so
|
|
51
|
+
* three entries are accepted as well.
|
|
52
|
+
* See {@link EntityCollection#scaleByDistance} for what each entry means.
|
|
53
|
+
* Default is `[MAX32, MAX32, MAX32, 1]` (no distance scaling).
|
|
46
54
|
* @param {number|Array.<number>} [options.pickingScale] - Picking scale value or xyz scale array.
|
|
47
55
|
* @param {number} [options.opacity] - Entity global opacity.
|
|
48
56
|
* @param {number|string} [options.shadeMode=1] - Geo object shading mode: `0|none|unlit`, `0.5|phong`, `1|pbr`.
|
|
@@ -161,13 +169,17 @@ declare class EntityCollection {
|
|
|
161
169
|
*/
|
|
162
170
|
_entities: Entity[];
|
|
163
171
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
172
|
+
* Distance-based scaling for geoObjects, billboards, and labels.
|
|
173
|
+
* [0] near - GeoObjects keep a fixed world size below this distance, then scale to
|
|
174
|
+
* maintain a fixed screen size until `far`. Ignored by billboards and labels.
|
|
175
|
+
* Set `near` to `0` to disable distance-based scaling.
|
|
176
|
+
* [1] far - GeoObjects stop growing here. If `vanish > far`, all types start fading.
|
|
177
|
+
* [2] vanish - Distance where the entity fades to zero. `vanish <= far` disables fading.
|
|
178
|
+
* [3] scale - Optional multiplier for all types. Default is `1`.
|
|
167
179
|
* @public
|
|
168
180
|
* @type {Array.<number>}
|
|
169
181
|
*/
|
|
170
|
-
scaleByDistance:
|
|
182
|
+
scaleByDistance: NumberArray4;
|
|
171
183
|
pickingScale: Float32Array;
|
|
172
184
|
/**
|
|
173
185
|
* Global opacity.
|
|
@@ -194,6 +206,25 @@ declare class EntityCollection {
|
|
|
194
206
|
_layer?: Vector;
|
|
195
207
|
_quadNode?: EntityCollectionNode;
|
|
196
208
|
_shadeMode: ShadeMode;
|
|
209
|
+
/**
|
|
210
|
+
* Enables/disables projector effect reception for this collection.
|
|
211
|
+
* @public
|
|
212
|
+
* @type {boolean}
|
|
213
|
+
*/
|
|
214
|
+
receiveProjectors: boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Enables/disables frame transparency reception for this collection.
|
|
217
|
+
* @public
|
|
218
|
+
* @type {boolean}
|
|
219
|
+
*/
|
|
220
|
+
receiveFrameTransparency: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Enables/disables shadow map reception for this collection.
|
|
223
|
+
* Stored in the same material flags channel as projectors and frame transparency.
|
|
224
|
+
* @public
|
|
225
|
+
* @type {boolean}
|
|
226
|
+
*/
|
|
227
|
+
receiveShadows: boolean;
|
|
197
228
|
/**
|
|
198
229
|
* Disables `gl.CULL_FACE` for geo objects rendering passes (opaque/transparent).
|
|
199
230
|
* Useful for rendering models with inverted/inconsistent triangle winding.
|
|
@@ -216,6 +247,11 @@ declare class EntityCollection {
|
|
|
216
247
|
* @param {boolean} visibility - Visibility flag.
|
|
217
248
|
*/
|
|
218
249
|
setVisibility(visibility: boolean): void;
|
|
250
|
+
/**
|
|
251
|
+
* Requests the next frame to be rendered.
|
|
252
|
+
* @public
|
|
253
|
+
*/
|
|
254
|
+
requestRedraw(): void;
|
|
219
255
|
/**
|
|
220
256
|
* Returns collection visibility.
|
|
221
257
|
* @public
|
|
@@ -234,6 +270,24 @@ declare class EntityCollection {
|
|
|
234
270
|
* @param {boolean} enable - Picking enable flag.
|
|
235
271
|
*/
|
|
236
272
|
setPickingEnabled(enable: boolean): void;
|
|
273
|
+
/**
|
|
274
|
+
* Sets whether this collection receives projector effects.
|
|
275
|
+
* @public
|
|
276
|
+
* @param {boolean} enable - `true` to receive projector effects, `false` to ignore them.
|
|
277
|
+
*/
|
|
278
|
+
setReceiveProjectors(enable: boolean): void;
|
|
279
|
+
/**
|
|
280
|
+
* Sets whether this collection receives frame transparency.
|
|
281
|
+
* @public
|
|
282
|
+
* @param {boolean} enable - `true` to receive frame transparency, `false` to ignore it.
|
|
283
|
+
*/
|
|
284
|
+
setReceiveFrameTransparency(enable: boolean): void;
|
|
285
|
+
/**
|
|
286
|
+
* Sets whether this collection receives shadow map effects.
|
|
287
|
+
* @public
|
|
288
|
+
* @param {boolean} enable - `true` to receive shadow map effects, `false` to ignore them.
|
|
289
|
+
*/
|
|
290
|
+
setReceiveShadows(enable: boolean): void;
|
|
237
291
|
/**
|
|
238
292
|
* Gets collection opacity.
|
|
239
293
|
* @public
|
|
@@ -243,11 +297,15 @@ declare class EntityCollection {
|
|
|
243
297
|
/**
|
|
244
298
|
* Sets scale by distance parameters.
|
|
245
299
|
* @public
|
|
246
|
-
* @param {number} near -
|
|
247
|
-
*
|
|
248
|
-
* @param {number}
|
|
300
|
+
* @param {number} near - Distance below which a geoObject keeps its world size. Billboards
|
|
301
|
+
* and labels ignore it; pass `0` to disable the world scale ramp.
|
|
302
|
+
* @param {number} far - Distance up to which an entity keeps its size.
|
|
303
|
+
* @param {number} [vanish] - Distance at which the size reaches zero. Defaults to `far`, which
|
|
304
|
+
* means no fading at all: past `far` a billboard or a label keeps its screen size, and a
|
|
305
|
+
* geoObject keeps the world size it reached there.
|
|
306
|
+
* @param {number} [scale] - Plain multiplier applied on top, for every entity type.
|
|
249
307
|
*/
|
|
250
|
-
setScaleByDistance(near: number, far: number,
|
|
308
|
+
setScaleByDistance(near: number, far: number, vanish?: number, scale?: number): void;
|
|
251
309
|
setVisibleSphere(p: Vec3, r: number): void;
|
|
252
310
|
/**
|
|
253
311
|
* Aligns collection entities to terrain.
|
|
@@ -43,6 +43,8 @@ declare class BaseBillboardHandler {
|
|
|
43
43
|
protected _pickingColorArr: Float32Array;
|
|
44
44
|
protected _buffersUpdateCallbacks: Function[];
|
|
45
45
|
protected _changedBuffers: boolean[];
|
|
46
|
+
protected _changedPositionFrom: number;
|
|
47
|
+
protected _changedPositionTo: number;
|
|
46
48
|
protected _configureDepthPass(depthWrite: boolean): void;
|
|
47
49
|
protected _restoreDepthPass(depthWrite: boolean): void;
|
|
48
50
|
constructor(entityCollection: EntityCollection);
|
|
@@ -56,6 +58,20 @@ declare class BaseBillboardHandler {
|
|
|
56
58
|
initProgram(): void;
|
|
57
59
|
setRenderer(renderer: Renderer): void;
|
|
58
60
|
refresh(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Marks a buffer to be updated in the next frame and requests the frame to be rendered.
|
|
63
|
+
* @protected
|
|
64
|
+
* @param {number} index - Buffer index.
|
|
65
|
+
*/
|
|
66
|
+
protected _setChangedBuffer(index: number): void;
|
|
67
|
+
/**
|
|
68
|
+
* Marks a half open range of the position arrays as changed, so that the next update uploads
|
|
69
|
+
* only that range instead of the whole buffer.
|
|
70
|
+
* @protected
|
|
71
|
+
* @param {number} from - First changed float index.
|
|
72
|
+
* @param {number} to - Index past the last changed float.
|
|
73
|
+
*/
|
|
74
|
+
protected _setChangedPositionRange(from: number, to: number): void;
|
|
59
75
|
protected _removeBillboards(): void;
|
|
60
76
|
clear(): void;
|
|
61
77
|
protected _deleteBuffers(): void;
|
|
@@ -8,6 +8,7 @@ import { Object3d } from "../../Object3d";
|
|
|
8
8
|
import { InstanceData } from "./InstanceData";
|
|
9
9
|
import type { Renderer } from "../../renderer/Renderer";
|
|
10
10
|
import type { Scene } from "../../scene/Scene";
|
|
11
|
+
import type { Camera } from "../../camera/Camera";
|
|
11
12
|
import type { ShaderProgram } from "../../webgl/ShaderProgram";
|
|
12
13
|
export declare const VERTEX_BUFFER = 0;
|
|
13
14
|
export declare const RTC_POSITION_BUFFER = 1;
|
|
@@ -68,6 +69,8 @@ export declare class GeoObjectHandler {
|
|
|
68
69
|
_displayForwardPASS(): void;
|
|
69
70
|
protected _depthPASS(): void;
|
|
70
71
|
drawDepth(): void;
|
|
72
|
+
protected _depthCameraPASS(camera: Camera): void;
|
|
73
|
+
drawDepthCameraPass(camera: Camera): void;
|
|
71
74
|
drawPicking(): void;
|
|
72
75
|
protected _pickingPASS(): void;
|
|
73
76
|
setQRotArr(tagData: InstanceData, tagDataIndex: number, qRot: Quat): 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;
|
|
@@ -110,6 +110,24 @@ declare class Geometry {
|
|
|
110
110
|
setLineColor(r: number, g: number, b: number, a?: number): Geometry;
|
|
111
111
|
setStrokeColor4v(rgba: Vec4): Geometry;
|
|
112
112
|
setLineColor4v(rgba: Vec4): Geometry;
|
|
113
|
+
/**
|
|
114
|
+
* Gets geometry fill color.
|
|
115
|
+
* @public
|
|
116
|
+
* @returns {Vec4} Copy of the normalized RGBA fill color.
|
|
117
|
+
*/
|
|
118
|
+
getFillColor4v(): Vec4;
|
|
119
|
+
/**
|
|
120
|
+
* Gets geometry line color.
|
|
121
|
+
* @public
|
|
122
|
+
* @returns {Vec4} Copy of the normalized RGBA line color.
|
|
123
|
+
*/
|
|
124
|
+
getLineColor4v(): Vec4;
|
|
125
|
+
/**
|
|
126
|
+
* Gets geometry stroke color.
|
|
127
|
+
* @public
|
|
128
|
+
* @returns {Vec4} Copy of the normalized RGBA stroke color.
|
|
129
|
+
*/
|
|
130
|
+
getStrokeColor4v(): Vec4;
|
|
113
131
|
setStrokeOpacity(opacity: number): Geometry;
|
|
114
132
|
setLineOpacity(opacity: number): Geometry;
|
|
115
133
|
setStrokeWidth(width: number): Geometry;
|
|
@@ -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;
|
|
@@ -32,7 +32,7 @@ declare const ALIGN: Record<string, number>;
|
|
|
32
32
|
* @param {number} [options.size] - Font size in pixels.
|
|
33
33
|
* @param {string} [options.style] - HTML5 font style. Example 'normal', 'italic'.
|
|
34
34
|
* @param {string} [options.weight] - HTML5 font weight. Example 'normal', 'bold'.
|
|
35
|
-
* @param {number} [options.outline] - Text outline
|
|
35
|
+
* @param {number} [options.outline] - Text outline width in pixels. 0 - no outline. Default 0.
|
|
36
36
|
* @param {Vec4|string|Array.<number>} [options.outlineColor] - Outline color.
|
|
37
37
|
* @param {string} [options.align] - Text horizontal align: "left", "right" and "center".
|
|
38
38
|
*/
|
|
@@ -57,7 +57,7 @@ declare class Label extends BaseBillboard {
|
|
|
57
57
|
*/
|
|
58
58
|
protected _size: number;
|
|
59
59
|
/**
|
|
60
|
-
* Label outline.
|
|
60
|
+
* Label outline width in pixels.
|
|
61
61
|
* @protected
|
|
62
62
|
* @type {number}
|
|
63
63
|
*/
|
|
@@ -130,7 +130,7 @@ declare class Label extends BaseBillboard {
|
|
|
130
130
|
* @public
|
|
131
131
|
* @returns {string}
|
|
132
132
|
*/
|
|
133
|
-
getAlign():
|
|
133
|
+
getAlign(): string;
|
|
134
134
|
/**
|
|
135
135
|
* Sets font face family.
|
|
136
136
|
* @public
|
|
@@ -156,13 +156,15 @@ declare class Label extends BaseBillboard {
|
|
|
156
156
|
*/
|
|
157
157
|
getSize(): number;
|
|
158
158
|
/**
|
|
159
|
-
* Sets text outline border
|
|
159
|
+
* Sets text outline border width in pixels. Where 0 - is no outline.
|
|
160
|
+
* The visible width is capped by the font atlas distance field range,
|
|
161
|
+
* which grows with the label font size.
|
|
160
162
|
* @public
|
|
161
|
-
* @param {number} outline - Text outline
|
|
163
|
+
* @param {number} outline - Text outline width in pixels.
|
|
162
164
|
*/
|
|
163
165
|
setOutline(outline: number): void;
|
|
164
166
|
/**
|
|
165
|
-
* Gets text current outline
|
|
167
|
+
* Gets text current outline width in pixels.
|
|
166
168
|
* @public
|
|
167
169
|
* @returns {number}
|
|
168
170
|
*/
|
|
@@ -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;
|
|
@@ -3,6 +3,7 @@ import { LonLat } from "../../LonLat";
|
|
|
3
3
|
import { Vec3 } from "../../math/Vec3";
|
|
4
4
|
import type { NumberArray3 } from "../../math/Vec3";
|
|
5
5
|
import type { NumberArray2 } from "../../math/Vec2";
|
|
6
|
+
import { Vec4 } from "../../math/Vec4";
|
|
6
7
|
import type { NumberArray4 } from "../../math/Vec4";
|
|
7
8
|
import type { HTMLImageElementExt } from "../../utils/ImagesCacheManager";
|
|
8
9
|
import { PolylineHandler } from "./PolylineHandler";
|
|
@@ -228,6 +229,20 @@ declare class Polyline {
|
|
|
228
229
|
* @param {string} htmlColor - HTML color.
|
|
229
230
|
*/
|
|
230
231
|
setColorHTML(htmlColor: string): void;
|
|
232
|
+
/**
|
|
233
|
+
* Gets polyline HTML color.
|
|
234
|
+
* @public
|
|
235
|
+
* @param {number} [index=0] - Segment index.
|
|
236
|
+
* @returns {string | undefined} HTML color, or undefined when no color is set.
|
|
237
|
+
*/
|
|
238
|
+
getColorHTML(index?: number): string | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* Gets polyline color as a normalized RGBA vector.
|
|
241
|
+
* @public
|
|
242
|
+
* @param {number} [index=0] - Segment index.
|
|
243
|
+
* @returns {Vec4 | undefined} Normalized RGBA color, or undefined when no color is set.
|
|
244
|
+
*/
|
|
245
|
+
getColor4v(index?: number): Vec4 | undefined;
|
|
231
246
|
/**
|
|
232
247
|
* Clear polyline data.
|
|
233
248
|
* @public
|
|
@@ -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;
|
package/lib/entity/ray/Ray.d.ts
CHANGED
|
@@ -114,6 +114,8 @@ declare class Ray {
|
|
|
114
114
|
*/
|
|
115
115
|
setImage(image: HTMLImageElement): void;
|
|
116
116
|
getImage(): HTMLImageElementExt | null;
|
|
117
|
+
protected _applyImageTexture(image: HTMLImageElementExt): void;
|
|
118
|
+
reloadTexture(): void;
|
|
117
119
|
/**
|
|
118
120
|
* Sets ray start position.
|
|
119
121
|
* @public
|
package/lib/index.d.ts
CHANGED
|
@@ -15,13 +15,29 @@ export * from "./entity/index";
|
|
|
15
15
|
export * from "./layer/index";
|
|
16
16
|
export * from "./Globe";
|
|
17
17
|
export type { IControlParams } from "./control/Control";
|
|
18
|
-
export type { ITouchState } from "./renderer/RendererEvents";
|
|
18
|
+
export type { IMouseState, ITouchState } from "./renderer/RendererEvents";
|
|
19
19
|
export type { IDeferredShadingPass } from "./renderer/IDeferredShadingPass";
|
|
20
20
|
export type { ITransparencyPass } from "./renderer/ITransparencyPass";
|
|
21
|
+
export type { ProjectorSourceType, ProjectorRenderMode, IProjectorParams } from "./renderer/projectors/Projector";
|
|
22
|
+
export { Projector } from "./renderer/projectors/Projector";
|
|
23
|
+
export type { IShadowMapParams } from "./renderer/shadows/ShadowMap";
|
|
24
|
+
export { ShadowMap } from "./renderer/shadows/ShadowMap";
|
|
25
|
+
export { CascadeShadowMap } from "./renderer/cascadeShadows/CascadeShadowMap";
|
|
26
|
+
export type { IDepthCameraParams } from "./control/depthCamera/DepthCamera";
|
|
27
|
+
export { DepthCamera } from "./control/depthCamera/DepthCamera";
|
|
28
|
+
export type { IDepthCameraHandlerParams } from "./control/depthCamera/DepthCameraHandler";
|
|
29
|
+
export { DepthCameraHandler } from "./control/depthCamera/DepthCameraHandler";
|
|
21
30
|
export { PhongDeferredShading } from "./renderer/PhongDeferredShading";
|
|
22
31
|
export { AtmosphereDeferredShading } from "./renderer/AtmosphereDeferredShading";
|
|
23
32
|
export { WOITPass } from "./renderer/WOITPass";
|
|
33
|
+
export { ProjectorsPass } from "./renderer/projectors/ProjectorsPass";
|
|
34
|
+
export { ProjectorManager } from "./renderer/projectors/ProjectorManager";
|
|
35
|
+
export { ShadowManager } from "./renderer/shadows/ShadowManager";
|
|
24
36
|
export { SHADE_UNLIT, SHADE_PHONG, SHADE_PBR, type ShadeMode, type ShadeModeInput } from "./shadeModeConstants";
|
|
37
|
+
export type { CameraFootprintCorners, ICameraFootprintParams } from "./utils/cameraFootprint";
|
|
38
|
+
export { CameraFootprint, getCameraFootprint } from "./utils/cameraFootprint";
|
|
39
|
+
export type { ILightSpaceBounds, IOrthoBounds, IShadowCameraFitParams, IShadowCameraFitStats } from "./utils/shadowCameraFit";
|
|
40
|
+
export { ShadowCameraFit } from "./utils/shadowCameraFit";
|
|
25
41
|
export declare const version: string;
|
|
26
42
|
import { Geoid } from "./terrain/Geoid";
|
|
27
43
|
import { input } from "./input/input";
|
|
@@ -30,6 +46,7 @@ import { Camera, PlanetCamera } from "./camera/index";
|
|
|
30
46
|
import { Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4 } from "./math/index";
|
|
31
47
|
import { Renderer } from "./renderer/Renderer";
|
|
32
48
|
import { Clock } from "./Clock";
|
|
49
|
+
import { TimelineModel } from "./control/timeline/TimelineModel";
|
|
33
50
|
import { Events, type EventsHandler, createEvents } from "./Events";
|
|
34
51
|
import { Extent } from "./Extent";
|
|
35
52
|
import { LonLat } from "./LonLat";
|
|
@@ -40,9 +57,9 @@ import { Loader, type IResponse } from "./utils/Loader";
|
|
|
40
57
|
import { EarthQuadTreeStrategy, EquiQuadTreeStrategy, QuadTreeStrategy, quadTreeStrategyType, Wgs84QuadTreeStrategy } from "./quadTree/index";
|
|
41
58
|
import { Object3d } from "./Object3d";
|
|
42
59
|
import { Handler, ShaderProgram, Framebuffer, Multisample } from "./webgl/index";
|
|
43
|
-
import { EmptyTerrain, GlobusTerrain, RgbTerrain, BilTerrain, GlobusRgbTerrain } from "./terrain/index";
|
|
60
|
+
import { EmptyTerrain, GlobusTerrain, RgbTerrain, BilTerrain, GlobusRgbTerrain, MapterhornTerrain, rgbToHeightByEncoding, rgbToHeightRgb, rgbToHeightTerrarium, resolveRgbToHeightFunc } from "./terrain/index";
|
|
44
61
|
import { MoveAxisEntity } from "./control/entityEditor/MoveAxisEntity";
|
|
45
62
|
import { Gltf } from "./utils/gltf/gltfParser";
|
|
46
63
|
import { Easing } from "./utils/easing";
|
|
47
64
|
import type { EasingFunction } from "./utils/easing";
|
|
48
|
-
export { bv, jd, math, mercator, utils, input, control, scene, quadTreeStrategyType, wgs84, moon, mars, terrain, layer, ui, webgl, Easing, EasingFunction, Framebuffer, EmptyTerrain, GlobusTerrain, RgbTerrain, GlobusRgbTerrain, BilTerrain, Camera, Ellipsoid, Planet, PlanetCamera, ShaderProgram, Handler, Multisample, Renderer, Clock, Events, EventsHandler, createEvents, Extent, LonLat, Scene, Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, Geoid, Popup, QuadTreeStrategy, EquiQuadTreeStrategy, EarthQuadTreeStrategy, Wgs84QuadTreeStrategy, Object3d, Gltf, MoveAxisEntity, Loader, IResponse };
|
|
65
|
+
export { bv, jd, math, mercator, utils, input, control, scene, quadTreeStrategyType, wgs84, moon, mars, terrain, layer, ui, webgl, Easing, EasingFunction, Framebuffer, EmptyTerrain, GlobusTerrain, RgbTerrain, GlobusRgbTerrain, MapterhornTerrain, rgbToHeightByEncoding, rgbToHeightRgb, rgbToHeightTerrarium, resolveRgbToHeightFunc, BilTerrain, Camera, Ellipsoid, Planet, PlanetCamera, ShaderProgram, Handler, Multisample, Renderer, Clock, TimelineModel, Events, EventsHandler, createEvents, Extent, LonLat, Scene, Line2, Line3, Mat3, Mat4, Plane, Quat, Ray, Vec2, Vec3, Vec4, Geoid, Popup, QuadTreeStrategy, EquiQuadTreeStrategy, EarthQuadTreeStrategy, Wgs84QuadTreeStrategy, Object3d, Gltf, MoveAxisEntity, Loader, IResponse };
|
|
@@ -13,13 +13,17 @@ 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();
|
|
18
|
+
protected _onDocumentKeyDown: (event: KeyboardEvent) => void;
|
|
19
|
+
protected _onDocumentKeyUp: (event: KeyboardEvent) => void;
|
|
20
|
+
destroy(): void;
|
|
17
21
|
getcurrentlyPressedKeys(): Record<number, boolean>;
|
|
18
22
|
getPressedKeysCallbacks(): Record<number, ICallbackHandler[]>;
|
|
19
23
|
getUnpressedKeysCallbacks(): Record<number, ICallbackHandler[]>;
|
|
20
24
|
getCharkeysCallbacks(): Record<number, ICallbackHandler[]>;
|
|
21
25
|
removeEvent(event: string, keyCode: number, callback: EventCallback): void;
|
|
22
|
-
protected _removeCallback(handlers: ICallbackHandler[], callback: EventCallbackStamp): void;
|
|
26
|
+
protected _removeCallback(handlers: ICallbackHandler[] | undefined, callback: EventCallbackStamp): void;
|
|
23
27
|
protected _getStamp(name: string, keyCode: number, ogid: number): string;
|
|
24
28
|
protected _stamp(name: string, keyCode: number, obj: any): boolean;
|
|
25
29
|
setActivity(activity: boolean): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Layer } from "./Layer";
|
|
2
|
+
import type { ILayerParams } from "./Layer";
|
|
3
|
+
import { Material } from "./Material";
|
|
4
|
+
import type { NumberArray4 } from "../math/Vec4";
|
|
5
|
+
import type { Node } from "../quadTree/Node";
|
|
6
|
+
import { Segment } from "../segment/Segment";
|
|
7
|
+
export interface IBaseTileMaterialLayerParams extends ILayerParams {
|
|
8
|
+
minNativeZoom?: number;
|
|
9
|
+
maxNativeZoom?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Shared tile material application for imagery/canvas tile layers.
|
|
13
|
+
* It can be applied to any type of tiled data that can be displayed on the planet in either of these two ways, such as BUildings, vector tiles etc.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class BaseTileMaterialLayer extends Layer {
|
|
16
|
+
minNativeZoom: number;
|
|
17
|
+
maxNativeZoom: number;
|
|
18
|
+
constructor(name?: string | null, options?: IBaseTileMaterialLayerParams);
|
|
19
|
+
applyMaterial(material: Material, forceLoading?: boolean): NumberArray4;
|
|
20
|
+
protected _applyMaterialDefaultCore(material: Material, forceLoading?: boolean): NumberArray4;
|
|
21
|
+
protected _applyMaterialFastCore(material: Material, forceLoading?: boolean): NumberArray4;
|
|
22
|
+
protected _applyReadyParentTexture(material: Material, segment: Segment, layerId: number): void;
|
|
23
|
+
protected _allowsLoadWithoutPassReady(): boolean;
|
|
24
|
+
protected _hasParentMaterial(psegm: Material): boolean;
|
|
25
|
+
protected _applyNoParentMaterial(material: Material, segment: Segment): void;
|
|
26
|
+
protected _onMaterialReady(_material: Material): void;
|
|
27
|
+
protected _onParentMaterialApplied(_material: Material, _psegm: Material): void;
|
|
28
|
+
protected _beforeFastMaterialParentWalk(material: Material, segment: Segment, forceLoading: boolean): void;
|
|
29
|
+
protected _applyFastPassReadyLoading(material: Material, segment: Segment, pn: Node, forceLoading: boolean): void;
|
|
30
|
+
/** pn from parent walk is at maxNativeZoom. */
|
|
31
|
+
protected _fastWhenWalkerAtMaxNativeZoom(material: Material, segment: Segment): void;
|
|
32
|
+
protected _fastLoadParentAtMaxNativeZoom(material: Material, segment: Segment, maxNativeZoom: number): void;
|
|
33
|
+
protected _triggerDefaultMaterialLoad(mat: Material, material: Material, targetNode: Node, forceLoading: boolean): void;
|
|
34
|
+
protected _defaultMaterialLoadForce(_mat: Material, material: Material, targetNode: Node, forceLoading: boolean): boolean;
|
|
35
|
+
clearMaterial(material: Material): void;
|
|
36
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { EventCallback, EventsHandler } from "../Events";
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
2
|
+
import { BaseTileMaterialLayer } from "./BaseTileMaterialLayer";
|
|
3
|
+
import type { IBaseTileMaterialLayerParams } from "./BaseTileMaterialLayer";
|
|
4
|
+
import type { LayerEventsList } from "./Layer";
|
|
4
5
|
import { Material } from "../layer/Material";
|
|
5
|
-
import type { NumberArray4 } from "../math/Vec4";
|
|
6
6
|
import { Planet } from "../scene/Planet";
|
|
7
7
|
type ApplyImageFunc = (material: HTMLCanvasElement | ImageBitmap | HTMLImageElement) => void;
|
|
8
8
|
type DrawTileCallback = (material: Material, applyImage: ApplyImageFunc) => void;
|
|
9
|
-
export interface ICanvasTilesParams extends
|
|
9
|
+
export interface ICanvasTilesParams extends IBaseTileMaterialLayerParams {
|
|
10
10
|
drawTile: DrawTileCallback;
|
|
11
11
|
animated?: boolean;
|
|
12
12
|
minNativeZoom?: number;
|
|
@@ -33,13 +33,11 @@ type CanvasTilesEventsType = EventsHandler<CanvasTilesEventsList> & EventsHandle
|
|
|
33
33
|
* @fires load
|
|
34
34
|
* @fires loadend
|
|
35
35
|
*/
|
|
36
|
-
declare class CanvasTiles extends
|
|
36
|
+
declare class CanvasTiles extends BaseTileMaterialLayer {
|
|
37
37
|
static MAX_REQUESTS: number;
|
|
38
38
|
static __requestsCounter: number;
|
|
39
39
|
events: CanvasTilesEventsType;
|
|
40
40
|
animated: boolean;
|
|
41
|
-
minNativeZoom: number;
|
|
42
|
-
maxNativeZoom: number;
|
|
43
41
|
/**
|
|
44
42
|
* Current creating tiles counter.
|
|
45
43
|
* @protected
|
|
@@ -82,7 +80,7 @@ declare class CanvasTiles extends Layer {
|
|
|
82
80
|
* @virtual
|
|
83
81
|
* @param {Material} material -
|
|
84
82
|
*/
|
|
85
|
-
loadMaterial(material: Material): void;
|
|
83
|
+
loadMaterial(material: Material, _forceLoading?: boolean): void;
|
|
86
84
|
/**
|
|
87
85
|
* Loads material image and apply it to the planet segment.
|
|
88
86
|
* @protected
|
|
@@ -98,9 +96,7 @@ declare class CanvasTiles extends Layer {
|
|
|
98
96
|
abortMaterialLoading(material: Material): void;
|
|
99
97
|
protected _dequeueRequest(): void;
|
|
100
98
|
protected _whilePendings(): Material | null;
|
|
101
|
-
|
|
102
|
-
protected
|
|
103
|
-
protected _applyMaterialFast(material: Material): NumberArray4;
|
|
104
|
-
clearMaterial(material: Material): void;
|
|
99
|
+
protected _onMaterialReady(material: Material): void;
|
|
100
|
+
protected _onParentMaterialApplied(material: Material, _psegm: Material): void;
|
|
105
101
|
}
|
|
106
102
|
export { CanvasTiles };
|
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
|
/**
|