@openglobus/og 0.20.3 → 0.20.4
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 +1 -1
- package/lib/@openglobus/js/entity/EntityCollection.d.ts +4 -0
- package/lib/@openglobus/js/entity/GeoObject.d.ts +7 -3
- package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +5 -8
- package/lib/@openglobus/js/layer/Vector.d.ts +5 -0
- package/lib/@openglobus/js/math/Quat.d.ts +1 -0
- package/lib/@openglobus/js/terrain/GlobusTerrain.d.ts +2 -0
- package/lib/@openglobus/og.esm.js +1 -1
- package/lib/@openglobus/og.esm.js.map +1 -1
- package/lib/@openglobus/og.umd.js +1 -1
- package/lib/@openglobus/og.umd.js.map +1 -1
- package/lib/js/Globe.js +1 -0
- package/lib/js/entity/EntityCollection.d.ts +4 -0
- package/lib/js/entity/EntityCollection.js +7 -0
- package/lib/js/entity/GeoObject.d.ts +7 -3
- package/lib/js/entity/GeoObject.js +31 -16
- package/lib/js/entity/GeoObjectHandler.d.ts +5 -8
- package/lib/js/entity/GeoObjectHandler.js +34 -63
- package/lib/js/layer/Vector.d.ts +5 -0
- package/lib/js/layer/Vector.js +16 -1
- package/lib/js/math/Quat.d.ts +1 -0
- package/lib/js/math/Quat.js +4 -0
- package/lib/js/renderer/RendererEvents.js +1 -3
- package/lib/js/scene/Planet.js +1 -1
- package/lib/js/shaders/geoObject.js +22 -71
- package/lib/js/terrain/GlobusRgbTerrain.js +2 -2
- package/lib/js/terrain/GlobusTerrain.d.ts +2 -0
- package/lib/js/terrain/GlobusTerrain.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
English | [简体中文](README_CN.md) | [Portuguese-BR](README_pt-BR.md)
|
|
7
7
|
|
|
8
|
-
[
|
|
8
|
+
[openglobus](https://www.openglobus.org/) is a typescript/javascript library designed to display interactive 3D maps and other geospatial data at a
|
|
9
9
|
scale from planet to bee.
|
|
10
10
|
|
|
11
11
|
It supports various high-resolution terrain providers, imagery layers, renders thousands of 3D objects, provides
|
|
@@ -21,6 +21,7 @@ interface IEntityCollectionParams {
|
|
|
21
21
|
scaleByDistance?: NumberArray3;
|
|
22
22
|
pickingScale?: number;
|
|
23
23
|
opacity?: number;
|
|
24
|
+
useLighting?: boolean;
|
|
24
25
|
entities?: Entity[];
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
@@ -184,8 +185,11 @@ declare class EntityCollection {
|
|
|
184
185
|
*/
|
|
185
186
|
_layer?: Vector;
|
|
186
187
|
_quadNode?: EntityCollectionNode;
|
|
188
|
+
_useLighting: number;
|
|
187
189
|
constructor(options?: IEntityCollectionParams);
|
|
188
190
|
get id(): number;
|
|
191
|
+
get useLighting(): boolean;
|
|
192
|
+
set useLighting(f: boolean);
|
|
189
193
|
isEqual(ec: EntityCollection): boolean;
|
|
190
194
|
/**
|
|
191
195
|
* Sets collection visibility.
|
|
@@ -45,6 +45,9 @@ declare class GeoObject {
|
|
|
45
45
|
protected _pitch: number;
|
|
46
46
|
protected _yaw: number;
|
|
47
47
|
protected _roll: number;
|
|
48
|
+
protected _pitchRad: number;
|
|
49
|
+
protected _yawRad: number;
|
|
50
|
+
protected _rollRad: number;
|
|
48
51
|
protected _scale: Vec3;
|
|
49
52
|
/**
|
|
50
53
|
* RGBA color.
|
|
@@ -52,7 +55,8 @@ declare class GeoObject {
|
|
|
52
55
|
* @type {Vec4}
|
|
53
56
|
*/
|
|
54
57
|
_color: Vec4;
|
|
55
|
-
|
|
58
|
+
_qRot: Quat;
|
|
59
|
+
protected _direction: Vec3;
|
|
56
60
|
_handler: GeoObjectHandler | null;
|
|
57
61
|
_handlerIndex: number;
|
|
58
62
|
_tagData: InstanceData | null;
|
|
@@ -68,7 +72,6 @@ declare class GeoObject {
|
|
|
68
72
|
getPitch(): number;
|
|
69
73
|
getYaw(): number;
|
|
70
74
|
getRoll(): number;
|
|
71
|
-
getDirection(): Vec3;
|
|
72
75
|
get object3d(): Object3d;
|
|
73
76
|
get vertices(): number[];
|
|
74
77
|
get normals(): number[];
|
|
@@ -147,6 +150,7 @@ declare class GeoObject {
|
|
|
147
150
|
* @param {Vec3} color - Picking color.
|
|
148
151
|
*/
|
|
149
152
|
setPickingColor3v(color: Vec3): void;
|
|
150
|
-
|
|
153
|
+
updateRotation(): void;
|
|
154
|
+
getDirection(): Vec3;
|
|
151
155
|
}
|
|
152
156
|
export { GeoObject };
|
|
@@ -4,6 +4,7 @@ import { GeoObject } from "./GeoObject";
|
|
|
4
4
|
import { Planet } from "../scene/Planet";
|
|
5
5
|
import { Vec3 } from "../math/Vec3";
|
|
6
6
|
import { Vec4 } from "../math/Vec4";
|
|
7
|
+
import { Quat } from "../math/Quat";
|
|
7
8
|
import { WebGLBufferExt, WebGLTextureExt } from "../webgl/Handler";
|
|
8
9
|
import { Object3d } from "../Object3d";
|
|
9
10
|
declare class InstanceData {
|
|
@@ -14,24 +15,22 @@ declare class InstanceData {
|
|
|
14
15
|
_texture: WebGLTextureExt | null;
|
|
15
16
|
_textureSrc: string | null;
|
|
16
17
|
_objectSrc?: string;
|
|
17
|
-
_pitchRollArr: number[] | TypedArray;
|
|
18
18
|
_sizeArr: number[] | TypedArray;
|
|
19
19
|
_vertexArr: number[] | TypedArray;
|
|
20
20
|
_positionHighArr: number[] | TypedArray;
|
|
21
21
|
_positionLowArr: number[] | TypedArray;
|
|
22
|
-
|
|
22
|
+
_qRotArr: number[] | TypedArray;
|
|
23
23
|
_rgbaArr: number[] | TypedArray;
|
|
24
24
|
_normalsArr: number[] | TypedArray;
|
|
25
25
|
_indicesArr: number[] | TypedArray;
|
|
26
26
|
_pickingColorArr: number[] | TypedArray;
|
|
27
27
|
_visibleArr: number[] | TypedArray;
|
|
28
28
|
_texCoordArr: number[] | TypedArray;
|
|
29
|
-
_pitchRollBuffer: WebGLBufferExt | null;
|
|
30
29
|
_sizeBuffer: WebGLBufferExt | null;
|
|
31
30
|
_vertexBuffer: WebGLBufferExt | null;
|
|
32
31
|
_positionHighBuffer: WebGLBufferExt | null;
|
|
33
32
|
_positionLowBuffer: WebGLBufferExt | null;
|
|
34
|
-
|
|
33
|
+
_qRotBuffer: WebGLBufferExt | null;
|
|
35
34
|
_rgbaBuffer: WebGLBufferExt | null;
|
|
36
35
|
_normalsBuffer: WebGLBufferExt | null;
|
|
37
36
|
_indicesBuffer: WebGLBufferExt | null;
|
|
@@ -45,13 +44,12 @@ declare class InstanceData {
|
|
|
45
44
|
clear(): void;
|
|
46
45
|
_deleteBuffers(): void;
|
|
47
46
|
createVertexBuffer(): void;
|
|
48
|
-
createPitchRollBuffer(): void;
|
|
49
47
|
createVisibleBuffer(): void;
|
|
50
48
|
createSizeBuffer(): void;
|
|
51
49
|
createTexCoordBuffer(): void;
|
|
52
50
|
createPositionBuffer(): void;
|
|
53
51
|
createRgbaBuffer(): void;
|
|
54
|
-
|
|
52
|
+
createQRotBuffer(): void;
|
|
55
53
|
createNormalsBuffer(): void;
|
|
56
54
|
createIndicesBuffer(): void;
|
|
57
55
|
createPickingColorBuffer(): void;
|
|
@@ -84,12 +82,11 @@ declare class GeoObjectHandler {
|
|
|
84
82
|
drawPicking(): void;
|
|
85
83
|
protected _pickingPASS(): void;
|
|
86
84
|
_loadDataTagTexture(tagData: InstanceData): Promise<void>;
|
|
87
|
-
|
|
85
|
+
setQRotArr(tagData: InstanceData, tagDataIndex: number, qRot: Quat): void;
|
|
88
86
|
setVisibility(tagData: InstanceData, tagDataIndex: number, visibility: boolean): void;
|
|
89
87
|
setPositionArr(tagData: InstanceData, tagDataIndex: number, positionHigh: Vec3, positionLow: Vec3): void;
|
|
90
88
|
setRgbaArr(tagData: InstanceData, tagDataIndex: number, rgba: Vec4): void;
|
|
91
89
|
setPickingColorArr(tagData: InstanceData, tagDataIndex: number, color: Vec3): void;
|
|
92
|
-
setPitchRollArr(tagData: InstanceData, tagDataIndex: number, pitch: number, roll: number): void;
|
|
93
90
|
setScaleArr(tagData: InstanceData, tagDataIndex: number, scale: Vec3): void;
|
|
94
91
|
protected _updateTag(dataTag: InstanceData): void;
|
|
95
92
|
update(): void;
|
|
@@ -19,6 +19,7 @@ export interface IVectorParams extends ILayerParams {
|
|
|
19
19
|
pickingScale?: number;
|
|
20
20
|
scaleByDistance?: NumberArray3;
|
|
21
21
|
labelMaxLetters?: number;
|
|
22
|
+
useLighting?: boolean;
|
|
22
23
|
}
|
|
23
24
|
type VectorEventsList = [
|
|
24
25
|
"draw",
|
|
@@ -44,6 +45,7 @@ export type VectorEventsType = EventsHandler<VectorEventsList> & EventsHandler<L
|
|
|
44
45
|
* First index - near distance to the entity, after entity becomes full scale.
|
|
45
46
|
* Second index - far distance to the entity, when entity becomes zero scale.
|
|
46
47
|
* Third index - far distance to the entity, when entity becomes invisible.
|
|
48
|
+
* Use [1.0, 1.0, 1.0] for real sized objects
|
|
47
49
|
* @param {number} [options.nodeCapacity=30] - Maximum entities quantity in the tree node. Rendering optimization parameter. 30 is default.
|
|
48
50
|
* @param {boolean} [options.async=true] - Asynchronous vector data handling before rendering. True for optimization huge data.
|
|
49
51
|
* @param {boolean} [options.clampToGround = false] - Clamp vector data to the ground.
|
|
@@ -121,7 +123,10 @@ declare class Vector extends Layer {
|
|
|
121
123
|
polygonOffsetUnits: number;
|
|
122
124
|
_secondPASS: EntityCollectionNode[];
|
|
123
125
|
protected _labelMaxLetters: number;
|
|
126
|
+
protected _useLighting: boolean;
|
|
124
127
|
constructor(name?: string | null, options?: IVectorParams);
|
|
128
|
+
get useLighting(): boolean;
|
|
129
|
+
set useLighting(f: boolean);
|
|
125
130
|
get labelMaxLetters(): number;
|
|
126
131
|
get instanceName(): string;
|
|
127
132
|
protected _bindPicking(): void;
|
|
@@ -118,6 +118,7 @@ export declare class Quat {
|
|
|
118
118
|
* @returns {Quat} -
|
|
119
119
|
*/
|
|
120
120
|
static getRotationBetweenVectorsUp(source: Vec3, dest: Vec3, up: Vec3): Quat;
|
|
121
|
+
static setFromEulerAngles(pitch: number, yaw: number, roll: number): Quat;
|
|
121
122
|
/**
|
|
122
123
|
* Returns true if the components are zero.
|
|
123
124
|
* @public
|