@openglobus/og 0.22.2 → 0.23.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.
Files changed (167) hide show
  1. package/css/og.css +137 -1
  2. package/lib/@openglobus/js/Object3d.d.ts +20 -10
  3. package/lib/@openglobus/js/camera/Camera.d.ts +9 -0
  4. package/lib/@openglobus/js/camera/Frustum.d.ts +3 -0
  5. package/lib/@openglobus/js/control/CameraLock.d.ts +38 -0
  6. package/lib/@openglobus/js/control/SimpleNavigation.d.ts +27 -10
  7. package/lib/@openglobus/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
  8. package/lib/@openglobus/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
  9. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
  10. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
  11. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
  12. package/lib/@openglobus/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
  13. package/lib/@openglobus/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
  14. package/lib/@openglobus/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
  15. package/lib/@openglobus/js/control/geoObjectEditor/colors.d.ts +8 -0
  16. package/lib/@openglobus/js/control/index.d.ts +2 -0
  17. package/lib/@openglobus/js/entity/Entity.d.ts +278 -19
  18. package/lib/@openglobus/js/entity/EntityCollection.d.ts +8 -9
  19. package/lib/@openglobus/js/entity/GeoObject.d.ts +141 -36
  20. package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +39 -63
  21. package/lib/@openglobus/js/entity/InstanceData.d.ts +76 -0
  22. package/lib/@openglobus/js/entity/Polyline.d.ts +19 -6
  23. package/lib/@openglobus/js/entity/PolylineHandler.d.ts +7 -0
  24. package/lib/@openglobus/js/index.d.ts +2 -1
  25. package/lib/@openglobus/js/layer/Vector.d.ts +4 -0
  26. package/lib/@openglobus/js/light/LightSource.d.ts +1 -139
  27. package/lib/@openglobus/js/math/Quat.d.ts +46 -33
  28. package/lib/@openglobus/js/math/Ray.d.ts +10 -4
  29. package/lib/@openglobus/js/math/Vec3.d.ts +15 -0
  30. package/lib/@openglobus/js/math.d.ts +2 -2
  31. package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +2 -2
  32. package/lib/@openglobus/js/quadTree/Node.d.ts +1 -1
  33. package/lib/@openglobus/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
  34. package/lib/@openglobus/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
  35. package/lib/@openglobus/js/renderer/Renderer.d.ts +63 -44
  36. package/lib/@openglobus/js/renderer/RendererEvents.d.ts +1 -0
  37. package/lib/@openglobus/js/scene/Planet.d.ts +11 -7
  38. package/lib/@openglobus/js/scene/RenderNode.d.ts +10 -25
  39. package/lib/@openglobus/js/shaders/drawnode.d.ts +1 -0
  40. package/lib/@openglobus/js/shaders/geoObject.d.ts +1 -0
  41. package/lib/@openglobus/js/shaders/utils.d.ts +1 -1
  42. package/lib/@openglobus/js/ui/Checkbox.d.ts +31 -0
  43. package/lib/@openglobus/js/ui/Dialog.d.ts +3 -0
  44. package/lib/@openglobus/js/ui/Input.d.ts +32 -0
  45. package/lib/@openglobus/js/ui/View.d.ts +3 -1
  46. package/lib/@openglobus/js/utils/objParser.d.ts +44 -12
  47. package/lib/@openglobus/js/utils/shared.d.ts +22 -0
  48. package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +0 -1
  49. package/lib/@openglobus/js/webgl/Framebuffer.d.ts +35 -8
  50. package/lib/@openglobus/js/webgl/Handler.d.ts +1 -0
  51. package/lib/@openglobus/og.css +1 -1
  52. package/lib/@openglobus/og.esm.js +1 -1
  53. package/lib/@openglobus/og.esm.js.map +1 -1
  54. package/lib/@openglobus/og.umd.js +1 -1
  55. package/lib/@openglobus/og.umd.js.map +1 -1
  56. package/lib/js/Object3d.d.ts +20 -10
  57. package/lib/js/Object3d.js +124 -48
  58. package/lib/js/camera/Camera.d.ts +9 -0
  59. package/lib/js/camera/Camera.js +27 -1
  60. package/lib/js/camera/Frustum.d.ts +3 -0
  61. package/lib/js/camera/Frustum.js +7 -0
  62. package/lib/js/control/Atmosphere.js +10 -6
  63. package/lib/js/control/CameraLock.d.ts +38 -0
  64. package/lib/js/control/CameraLock.js +216 -0
  65. package/lib/js/control/Control.js +1 -1
  66. package/lib/js/control/DebugInfo.js +13 -3
  67. package/lib/js/control/KeyboardNavigation.js +1 -1
  68. package/lib/js/control/ScaleControl.js +9 -3
  69. package/lib/js/control/SimpleNavigation.d.ts +27 -10
  70. package/lib/js/control/SimpleNavigation.js +148 -49
  71. package/lib/js/control/Sun.js +1 -1
  72. package/lib/js/control/elevationProfile/ElevationProfileScene.js +4 -4
  73. package/lib/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
  74. package/lib/js/control/geoObjectEditor/ArrowEntity.js +59 -0
  75. package/lib/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
  76. package/lib/js/control/geoObjectEditor/AxisTrackEntity.js +93 -0
  77. package/lib/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
  78. package/lib/js/control/geoObjectEditor/GeoObjectEditor.js +30 -0
  79. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
  80. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +502 -0
  81. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
  82. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +487 -43
  83. package/lib/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
  84. package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +106 -0
  85. package/lib/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
  86. package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +34 -0
  87. package/lib/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
  88. package/lib/js/control/geoObjectEditor/RotateEntity.js +105 -0
  89. package/lib/js/control/geoObjectEditor/colors.d.ts +8 -0
  90. package/lib/js/control/geoObjectEditor/colors.js +8 -0
  91. package/lib/js/control/index.d.ts +2 -0
  92. package/lib/js/control/index.js +2 -0
  93. package/lib/js/control/timeline/TimelineControl.js +2 -0
  94. package/lib/js/entity/Entity.d.ts +278 -19
  95. package/lib/js/entity/Entity.js +483 -63
  96. package/lib/js/entity/EntityCollection.d.ts +8 -9
  97. package/lib/js/entity/EntityCollection.js +48 -45
  98. package/lib/js/entity/GeoObject.d.ts +141 -36
  99. package/lib/js/entity/GeoObject.js +153 -90
  100. package/lib/js/entity/GeoObjectHandler.d.ts +39 -63
  101. package/lib/js/entity/GeoObjectHandler.js +198 -295
  102. package/lib/js/entity/InstanceData.d.ts +76 -0
  103. package/lib/js/entity/InstanceData.js +344 -0
  104. package/lib/js/entity/Polyline.d.ts +19 -6
  105. package/lib/js/entity/Polyline.js +76 -36
  106. package/lib/js/entity/PolylineHandler.d.ts +7 -0
  107. package/lib/js/entity/PolylineHandler.js +26 -1
  108. package/lib/js/index.d.ts +2 -1
  109. package/lib/js/index.js +2 -1
  110. package/lib/js/layer/Bing.js +2 -2
  111. package/lib/js/layer/Vector.d.ts +4 -0
  112. package/lib/js/layer/Vector.js +16 -0
  113. package/lib/js/light/LightSource.d.ts +1 -139
  114. package/lib/js/light/LightSource.js +21 -227
  115. package/lib/js/math/Quat.d.ts +46 -33
  116. package/lib/js/math/Quat.js +91 -90
  117. package/lib/js/math/Ray.d.ts +10 -4
  118. package/lib/js/math/Ray.js +20 -4
  119. package/lib/js/math/Vec3.d.ts +15 -0
  120. package/lib/js/math/Vec3.js +30 -1
  121. package/lib/js/math.d.ts +2 -2
  122. package/lib/js/math.js +3 -3
  123. package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
  124. package/lib/js/quadTree/EntityCollectionNode.js +8 -8
  125. package/lib/js/quadTree/Node.d.ts +1 -1
  126. package/lib/js/quadTree/Node.js +2 -2
  127. package/lib/js/quadTree/QuadTreeStrategy.js +1 -1
  128. package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
  129. package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.js +2 -2
  130. package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
  131. package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.js +2 -2
  132. package/lib/js/renderer/Renderer.d.ts +63 -44
  133. package/lib/js/renderer/Renderer.js +260 -263
  134. package/lib/js/renderer/RendererEvents.d.ts +1 -0
  135. package/lib/js/renderer/RendererEvents.js +2 -1
  136. package/lib/js/scene/Planet.d.ts +11 -7
  137. package/lib/js/scene/Planet.js +109 -87
  138. package/lib/js/scene/RenderNode.d.ts +10 -25
  139. package/lib/js/scene/RenderNode.js +70 -58
  140. package/lib/js/shaders/depth.js +2 -5
  141. package/lib/js/shaders/drawnode.d.ts +1 -0
  142. package/lib/js/shaders/drawnode.js +51 -52
  143. package/lib/js/shaders/geoObject.d.ts +1 -0
  144. package/lib/js/shaders/geoObject.js +154 -91
  145. package/lib/js/shaders/polyline.js +68 -51
  146. package/lib/js/shaders/utils.d.ts +1 -1
  147. package/lib/js/shaders/utils.js +11 -0
  148. package/lib/js/ui/Checkbox.d.ts +31 -0
  149. package/lib/js/ui/Checkbox.js +110 -0
  150. package/lib/js/ui/Color.js +2 -1
  151. package/lib/js/ui/Dialog.d.ts +3 -0
  152. package/lib/js/ui/Dialog.js +20 -0
  153. package/lib/js/ui/Input.d.ts +32 -0
  154. package/lib/js/ui/Input.js +107 -0
  155. package/lib/js/ui/View.d.ts +3 -1
  156. package/lib/js/ui/View.js +6 -0
  157. package/lib/js/utils/objParser.d.ts +44 -12
  158. package/lib/js/utils/objParser.js +241 -149
  159. package/lib/js/utils/shared.d.ts +22 -0
  160. package/lib/js/utils/shared.js +34 -0
  161. package/lib/js/webgl/BaseFramebuffer.d.ts +0 -1
  162. package/lib/js/webgl/Framebuffer.d.ts +35 -8
  163. package/lib/js/webgl/Framebuffer.js +136 -29
  164. package/lib/js/webgl/Handler.d.ts +1 -0
  165. package/lib/js/webgl/Handler.js +11 -1
  166. package/lib/js/webgl/Program.js +0 -8
  167. package/package.json +4 -2
package/css/og.css CHANGED
@@ -8,6 +8,7 @@
8
8
  --grey6: #bfbfbf; /*map button icon color*/
9
9
  --grey7: #707070; /*slider progress color*/
10
10
  --grey8: #e2e2e2; /*text color*/
11
+ --grey9: #9f9f9f;
11
12
  --blue0: #1700a9ee;
12
13
  }
13
14
 
@@ -744,7 +745,7 @@ input {
744
745
  height: 20px;
745
746
  }
746
747
 
747
- .og-atmosphere.og-options-container .og-slider input{
748
+ .og-atmosphere.og-options-container .og-slider input {
748
749
  width: 87px;
749
750
  }
750
751
 
@@ -870,6 +871,7 @@ TIMELINE
870
871
  flex-direction: row;
871
872
  width: 200px;
872
873
  /*height: 20px;*/
874
+ gap: 5px;
873
875
  }
874
876
 
875
877
  .og-slider .og-slider-label {
@@ -890,6 +892,7 @@ TIMELINE
890
892
  height: 20px;
891
893
  background-color: var(--grey1);
892
894
  z-index: 1;
895
+ border-radius: 5px;
893
896
  }
894
897
 
895
898
  .og-slider .og-slider-panel .og-slider-progress {
@@ -897,6 +900,8 @@ TIMELINE
897
900
  height: 100%;
898
901
  background-color: var(--grey7);
899
902
  pointer-events: none;
903
+ border-top-left-radius: 5px;
904
+ border-bottom-left-radius: 5px;
900
905
  }
901
906
 
902
907
  .og-slider .og-slider-panel .og-slider-pointer {
@@ -919,6 +924,7 @@ TIMELINE
919
924
  color: var(--grey3);
920
925
  padding-left: 5px;
921
926
  width: 60px;
927
+ border-radius: 5px;
922
928
  }
923
929
 
924
930
  .og-slider input:focus-visible {
@@ -937,6 +943,116 @@ TIMELINE
937
943
  -moz-appearance: textfield;
938
944
  }
939
945
 
946
+
947
+ /*
948
+ INPUT
949
+ */
950
+
951
+ .og-checkbox,
952
+ .og-input {
953
+ display: flex;
954
+ flex-direction: row;
955
+ margin: 5px;
956
+ }
957
+
958
+ .og-checkbox .og-input-label,
959
+ .og-input .og-input-label {
960
+ width: 100%;
961
+ height: 100%;
962
+ color: var(--grey6);
963
+ font-family: "Segoe UI", Frutiger, "Frutiger Linotype", "Dejavu Sans", "Helvetica Neue", Arial, sans-serif;
964
+ font-size: 14px;
965
+ align-items: center;
966
+ text-align: left;
967
+ margin-right: 5px;
968
+ }
969
+
970
+ .og-checkbox input,
971
+ .og-input input {
972
+ position: relative;
973
+ height: 100%;
974
+ width: 100%;
975
+ background: var(--grey5);
976
+ border: 1px solid var(--grey1);
977
+ z-index: 0;
978
+ color: var(--grey3);
979
+ padding-left: 5px;
980
+ border-radius: 5px;
981
+ }
982
+
983
+ .og-checkbox input:focus-visible,
984
+ .og-input input:focus-visible {
985
+ outline: none;
986
+ }
987
+
988
+ .og-checkbox input[type="checkbox"] {
989
+ width: 14px;
990
+ height: 14px;
991
+ appearance: none;
992
+ -webkit-appearance: none;
993
+ display: flex;
994
+ align-content: center;
995
+ justify-content: center;
996
+ border: 1px solid var(--grey1);
997
+ border-radius: 3px;
998
+ background: var(--grey8);
999
+ cursor: pointer;
1000
+ position: relative;
1001
+ padding: 0;
1002
+ }
1003
+
1004
+ .og-checkbox input[type="checkbox"]::before {
1005
+ content: "";
1006
+ position: absolute;
1007
+ width: 3px;
1008
+ height: 6px;
1009
+ border: solid black;
1010
+ border-width: 0 2px 2px 0;
1011
+ transform: rotate(45deg);
1012
+ top: 2px;
1013
+ left: 3.5px;
1014
+ opacity: 0;
1015
+ transition: opacity 0.2s ease-in-out;
1016
+ }
1017
+
1018
+ .og-checkbox input[type="checkbox"]:checked::before {
1019
+ opacity: 1;
1020
+ }
1021
+
1022
+ .og-checkbox input[type="checkbox"]:hover {
1023
+ border-color: var(--grey2);
1024
+ }
1025
+
1026
+ .og-checkbox .og-input-label {
1027
+ margin-right: 0;
1028
+ }
1029
+
1030
+ .og-checkbox-input {
1031
+ width: 100%;
1032
+ }
1033
+
1034
+ .og-input-disabled {
1035
+ pointer-events: none;
1036
+ opacity: 0.7;
1037
+ }
1038
+
1039
+ .og-input-disabled input[type="checkbox"] {
1040
+ background: var(--grey9);
1041
+ }
1042
+
1043
+ /* Chrome, Safari, Edge, Opera */
1044
+ /*.og-input input::-webkit-outer-spin-button,*/
1045
+ /*.og-input input::-webkit-inner-spin-button {*/
1046
+ /* -webkit-appearance: none;*/
1047
+ /* margin: 0;*/
1048
+ /*}*/
1049
+
1050
+ /* Firefox */
1051
+ .og-input input[type=number] {
1052
+ -moz-appearance: textfield;
1053
+ }
1054
+
1055
+
940
1056
  .og-selection_button {
941
1057
  top: 117px;
942
1058
  right: 12px;
@@ -1203,4 +1319,24 @@ TIMELINE
1203
1319
 
1204
1320
  .ldio-p0v5a1f6oz div {
1205
1321
  box-sizing: content-box;
1322
+ }
1323
+
1324
+ .og-editor-ground_button {
1325
+ width: fit-content;
1326
+ background: var(--grey1);
1327
+ padding: 4px 6px 8px;
1328
+ margin-left: 5px;
1329
+ margin-top: 15px;
1330
+ }
1331
+
1332
+ .og-editor_toolbar {
1333
+ padding-bottom: 8px;
1334
+ display: flex;
1335
+ }
1336
+
1337
+ .og-editor_toolbar-button {
1338
+ width: 25px;
1339
+ height: 25px;
1340
+ float: left;
1341
+ margin: 3px;
1206
1342
  }
@@ -8,32 +8,39 @@ interface IObject3dParams {
8
8
  indices?: number[];
9
9
  normals?: number[];
10
10
  center?: boolean;
11
- src?: string;
12
11
  color?: number[] | TypedArray | string;
13
12
  scale?: number | Vec3;
13
+ ambient?: string | NumberArray3;
14
+ diffuse?: string | NumberArray3;
15
+ specular?: string | NumberArray3;
16
+ shininess?: number;
17
+ colorTexture?: string;
18
+ normalTexture?: string;
19
+ metallicRoughnessTexture?: string;
14
20
  }
15
21
  declare class Object3d {
16
22
  protected _name: string;
17
23
  protected _vertices: number[];
18
24
  protected _numVertices: number;
19
25
  protected _texCoords: number[];
20
- /**
21
- * Image src.
22
- * @protected
23
- * @type {string}
24
- */
25
- protected _src: string | null;
26
- protected color: Float32Array;
27
26
  protected _indices: number[];
28
27
  protected _normals: number[];
28
+ color: Float32Array;
29
+ ambient: Float32Array;
30
+ diffuse: Float32Array;
31
+ specular: Float32Array;
32
+ shininess: number;
33
+ colorTexture: string;
34
+ normalTexture: string;
35
+ metallicRoughnessTexture: string;
36
+ center: Vec3;
29
37
  constructor(data?: IObject3dParams);
38
+ static getCenter(verts: number[]): Vec3;
30
39
  static centering(verts: number[]): void;
31
40
  centering(): this;
32
41
  applyMat4(m: Mat4): this;
33
42
  scale(s: Vec3): this;
34
43
  translate(v: Vec3): this;
35
- get src(): string | null;
36
- set src(src: string | null);
37
44
  get name(): string;
38
45
  get vertices(): number[];
39
46
  get normals(): number[];
@@ -63,8 +70,11 @@ declare class Object3d {
63
70
  static createFrustum(length?: number, width?: number, height?: number, xOffset?: number, yOffset?: number, zOffset?: number): Object3d;
64
71
  static createCylinder(radiusTop?: number, radiusBottom?: number, height?: number, radialSegments?: number, heightSegments?: number, isTop?: boolean, isBottom?: boolean, offsetX?: number, offsetY?: number, offsetZ?: number): Object3d;
65
72
  static createCube(length?: number, height?: number, depth?: number, xOffset?: number, yOffset?: number, zOffset?: number): Object3d;
73
+ static createPlane(width?: number, height?: number, xOffset?: number, yOffset?: number, zOffset?: number): Object3d;
66
74
  static createArrow(back?: number, height?: number, front?: number): Object3d;
75
+ static readFileObj(objFile: File, mtlFile?: File): Promise<Object3d[]>;
67
76
  static loadObj(src: string): Promise<Object3d[]>;
68
77
  merge(other: Object3d): Object3d;
78
+ static merge(objects: Object3d[], maxSize?: number): Object3d;
69
79
  }
70
80
  export { Object3d };
@@ -80,6 +80,7 @@ declare class Camera {
80
80
  * @type {Mat4}
81
81
  */
82
82
  protected _viewMatrix: Mat4;
83
+ protected _viewMatrixRTE: Mat4;
83
84
  /**
84
85
  * Camera normal matrix.
85
86
  * @protected
@@ -116,6 +117,7 @@ declare class Camera {
116
117
  frustumColors: number[];
117
118
  FARTHEST_FRUSTUM_INDEX: number;
118
119
  currentFrustumIndex: number;
120
+ frustumColorIndex: number;
119
121
  isFirstPass: boolean;
120
122
  constructor(renderer: Renderer | null, options?: ICameraParams);
121
123
  checkMoveEnd(): void;
@@ -300,6 +302,12 @@ declare class Camera {
300
302
  * @return {Mat4} - Projection-view matrix.
301
303
  */
302
304
  getProjectionViewMatrix(): NumberArray16;
305
+ /**
306
+ * Returns projection and model RTE matrix product.
307
+ * @public
308
+ * @return {Mat4} - Projection-view matrix.
309
+ */
310
+ getProjectionViewRTEMatrix(): NumberArray16;
303
311
  /**
304
312
  * Returns inverse projection and model matrix product.
305
313
  * @public
@@ -312,5 +320,6 @@ declare class Camera {
312
320
  * @returns {Mat4} - Inverse projection-view matrix.
313
321
  */
314
322
  getInverseProjectionMatrix(): NumberArray16;
323
+ viewDistance(cartesian: Vec3, distance?: number): void;
315
324
  }
316
325
  export { Camera };
@@ -35,6 +35,7 @@ declare class Frustum {
35
35
  * @type {Mat4}
36
36
  */
37
37
  projectionViewMatrix: Mat4;
38
+ projectionViewRTEMatrix: Mat4;
38
39
  /**
39
40
  * Inverse projectionView Matrix.
40
41
  * @protected
@@ -81,6 +82,7 @@ declare class Frustum {
81
82
  getBackwardPlane(): NumberArray4;
82
83
  getForwardPlane(): NumberArray4;
83
84
  getProjectionViewMatrix(): NumberArray16;
85
+ getProjectionViewRTEMatrix(): NumberArray16;
84
86
  getProjectionMatrix(): NumberArray16;
85
87
  getInverseProjectionMatrix(): NumberArray16;
86
88
  /**
@@ -92,6 +94,7 @@ declare class Frustum {
92
94
  * @param {number} far - Far camera distance.
93
95
  */
94
96
  setProjectionMatrix(angle: number, aspect: number, near: number, far: number): void;
97
+ setProjectionViewRTEMatrix(viewRTEMatrix: Mat4): void;
95
98
  /**
96
99
  * Camera's projection matrix values.
97
100
  * @public
@@ -0,0 +1,38 @@
1
+ import { Control, IControlParams } from "./Control";
2
+ import { LonLat } from "../LonLat";
3
+ import { Vec3 } from "../math/Vec3";
4
+ import { EventsHandler } from "../Events";
5
+ import { Entity } from "../entity/Entity";
6
+ import { IMouseState } from "../renderer/RendererEvents";
7
+ import { Planet } from "../scene/Planet";
8
+ type CameraLockEventsList = ["lockview", "unlockview"];
9
+ interface ICameraLockParams extends IControlParams {
10
+ planet?: Planet | null;
11
+ }
12
+ export declare class CameraLock extends Control {
13
+ events: EventsHandler<CameraLockEventsList>;
14
+ protected _lockDistance: number;
15
+ protected _isFromTheBack: boolean;
16
+ protected _lockEntity: Entity | null;
17
+ protected _viewDir: Vec3;
18
+ constructor(options?: ICameraLockParams);
19
+ onactivate(): void;
20
+ ondeactivate(): void;
21
+ oninit(): void;
22
+ flyCartesian(cartesian: Vec3, dist?: number): void;
23
+ lockView(entity: Entity, fromTheBack?: boolean): void;
24
+ protected _activateNav(): void;
25
+ protected _deactivateNav(): void;
26
+ unlockView(): void;
27
+ private _getCenterDist;
28
+ protected _getDistance(entity: Entity, prevEntity?: Entity | null): number;
29
+ isVisibleDistance(cart: Vec3, C?: number): boolean;
30
+ get lockEntity(): Entity | null;
31
+ flyLonLat(lonLat: LonLat, dist?: number): void;
32
+ protected _activateLockViewEvents(): void;
33
+ protected _deactivateLockViewEvents(): void;
34
+ private _onLockViewDraw;
35
+ protected _onMouseWheel: (e: IMouseState) => void;
36
+ protected _onMouseMove: (ms: IMouseState) => void;
37
+ }
38
+ export {};
@@ -1,4 +1,6 @@
1
1
  import { Control, IControlParams } from "./Control";
2
+ import { IMouseState } from "../renderer/RendererEvents";
3
+ import { Vec3 } from "../math/Vec3";
2
4
  interface ISimpleNavigationParams extends IControlParams {
3
5
  speed?: number;
4
6
  }
@@ -7,19 +9,34 @@ interface ISimpleNavigationParams extends IControlParams {
7
9
  */
8
10
  export declare class SimpleNavigation extends Control {
9
11
  speed: number;
12
+ force: Vec3;
13
+ vel: Vec3;
14
+ mass: number;
15
+ protected _lookPos: Vec3 | undefined;
16
+ protected _up: Vec3 | null;
17
+ protected _grabbedPoint: Vec3 | undefined;
18
+ protected _eye0: Vec3;
10
19
  constructor(options?: ISimpleNavigationParams);
11
20
  oninit(): void;
12
21
  onactivate(): void;
13
22
  ondeactivate(): void;
14
- protected onCameraMoveForward(): void;
15
- protected onCameraMoveBackward(): void;
16
- protected onCameraStrifeLeft(): void;
17
- protected onCameraStrifeRight(): void;
18
- protected onCameraLookUp(): void;
19
- protected onCameraLookDown(): void;
20
- protected onCameraTurnLeft(): void;
21
- protected onCameraTurnRight(): void;
22
- protected onCameraRollLeft(): void;
23
- protected onCameraRollRight(): void;
23
+ protected _onMouseLeftButtonClick: (e: IMouseState) => void;
24
+ protected _onMouseLeftButtonUp: (e: IMouseState) => void;
25
+ protected _onMouseLeftButtonDown: (e: IMouseState) => void;
26
+ protected _onRHold: (e: IMouseState) => void;
27
+ protected _onRDown: (e: IMouseState) => void;
28
+ protected _onMouseWheel: (e: IMouseState) => void;
29
+ protected onCameraMoveForward: () => void;
30
+ protected onCameraMoveBackward: () => void;
31
+ protected onCameraStrifeLeft: () => void;
32
+ protected onCameraStrifeRight: () => void;
33
+ protected onCameraLookUp: () => void;
34
+ protected onCameraLookDown: () => void;
35
+ protected onCameraTurnLeft: () => void;
36
+ protected onCameraTurnRight: () => void;
37
+ protected onCameraRollLeft: () => void;
38
+ protected onCameraRollRight: () => void;
39
+ protected get dt(): number;
40
+ protected onDraw(): void;
24
41
  }
25
42
  export {};
@@ -0,0 +1,15 @@
1
+ import { Entity, IEntityParams } from "../../entity/Entity";
2
+ export interface IArrowEntityParams extends IEntityParams {
3
+ yaw?: number;
4
+ pitch?: number;
5
+ roll?: number;
6
+ size?: number;
7
+ color?: string;
8
+ properties?: any;
9
+ }
10
+ export declare class ArrowEntity extends Entity {
11
+ protected _size: number;
12
+ constructor(params?: IArrowEntityParams);
13
+ setSize(size: number): void;
14
+ setColorHTML(color: string): void;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { Entity, IEntityParams } from "../../entity/Entity";
2
+ import { Vec3 } from "../../math/Vec3";
3
+ export interface IAxisTrackEntityParams extends IEntityParams {
4
+ }
5
+ export declare class AxisTrackEntity extends Entity {
6
+ constructor(params?: IAxisTrackEntityParams);
7
+ private _init;
8
+ setCartesian3v(cart: Vec3): void;
9
+ }
@@ -0,0 +1,13 @@
1
+ import { Control, IControlParams } from "../Control";
2
+ import { GeoObjectEditorScene } from "./GeoObjectEditorScene";
3
+ import { GeoObjectPropertiesDialog } from "./GeoObjectEditorDialog";
4
+ export interface IGeoObjectEditorParams extends IControlParams {
5
+ }
6
+ export declare class GeoObjectEditor extends Control {
7
+ protected _geoObjectEditopScene: GeoObjectEditorScene;
8
+ protected _dialog: GeoObjectPropertiesDialog;
9
+ constructor(options?: IGeoObjectEditorParams);
10
+ oninit(): void;
11
+ onactivate(): void;
12
+ ondeactivate(): void;
13
+ }
@@ -0,0 +1,69 @@
1
+ import { Dialog, IDialogParams } from "../../ui/Dialog";
2
+ import { GeoObjectEditorScene } from "./GeoObjectEditorScene";
3
+ import { Entity } from "../../entity/Entity";
4
+ import { Input } from "../../ui/Input";
5
+ import { Checkbox } from "../../ui/Checkbox";
6
+ import { Button } from "../../ui/Button";
7
+ import { Vec3 } from "../../math/Vec3";
8
+ interface IGeoObjectPropertiesDialog extends IDialogParams {
9
+ model: GeoObjectEditorScene;
10
+ }
11
+ export declare class GeoObjectPropertiesDialog extends Dialog<GeoObjectEditorScene> {
12
+ protected _relativePositionView: Checkbox;
13
+ protected _lonView: Input;
14
+ protected _latView: Input;
15
+ protected _heightView: Input;
16
+ protected _xView: Input;
17
+ protected _yView: Input;
18
+ protected _zView: Input;
19
+ protected _absXView: Input;
20
+ protected _absYView: Input;
21
+ protected _absZView: Input;
22
+ protected _pitchView: Input;
23
+ protected _yawView: Input;
24
+ protected _rollView: Input;
25
+ protected _absolutePitchView: Input;
26
+ protected _absoluteYawView: Input;
27
+ protected _absoluteRollView: Input;
28
+ protected _scaleView: Input;
29
+ protected _scaleXView: Input;
30
+ protected _scaleYView: Input;
31
+ protected _scaleZView: Input;
32
+ protected _groundBtn: Button;
33
+ constructor(params: IGeoObjectPropertiesDialog);
34
+ render(params: any): this;
35
+ protected _onVisibility: (vis: boolean) => void;
36
+ remove(): void;
37
+ protected _initSceneEvents(): void;
38
+ protected _clearSceneEvents(): void;
39
+ protected _onSelect: (entity: Entity) => void;
40
+ protected _refresh(entity: Entity): void;
41
+ hide(): void;
42
+ protected _onUnselect: (entity: Entity) => void;
43
+ protected _onChangeRelativePosition: (checked: boolean) => void;
44
+ protected _onPosition: (pos: Vec3, entity: Entity) => void;
45
+ protected _onPitch: (a: number, entity: Entity) => void;
46
+ protected _onYaw: (a: number, entity: Entity) => void;
47
+ protected _onRoll: (a: number, entity: Entity) => void;
48
+ protected _onChangeLon: (val: string) => void;
49
+ protected _onChangeLat: (val: string) => void;
50
+ protected _onChangeHeight: (val: string) => void;
51
+ protected _onChangeX: (val: string) => void;
52
+ protected _onChangeY: (val: string) => void;
53
+ protected _onChangeZ: (val: string) => void;
54
+ protected _onChangeAbsoluteX: (val: string) => void;
55
+ protected _onChangeAbsoluteY: (val: string) => void;
56
+ protected _onChangeAbsoluteZ: (val: string) => void;
57
+ protected _onChangePitch: (val: string) => void;
58
+ protected _onChangeYaw: (val: string) => void;
59
+ protected _onChangeRoll: (val: string) => void;
60
+ protected _onChangeAbsolutePitch: (val: string) => void;
61
+ protected _onChangeAbsoluteYaw: (val: string) => void;
62
+ protected _onChangeAbsoluteRoll: (val: string) => void;
63
+ protected _onChangeScale: (val: string) => void;
64
+ protected _onChangeScaleX: (val: string) => void;
65
+ protected _onChangeScaleY: (val: string) => void;
66
+ protected _onChangeScaleZ: (val: string) => void;
67
+ protected _onGround: () => void;
68
+ }
69
+ export {};
@@ -1,12 +1,20 @@
1
1
  import { EventsHandler } from '../../Events';
2
2
  import { Planet } from "../../scene/Planet";
3
3
  import { RenderNode } from '../../scene/RenderNode';
4
- import { Vector } from '../../layer/Vector';
5
4
  import { Vec2 } from '../../math/Vec2';
5
+ import { Vec3 } from '../../math/Vec3';
6
+ import { Quat } from '../../math/Quat';
6
7
  import { IMouseState } from "../../renderer/RendererEvents";
7
8
  import { Ellipsoid } from "../../ellipsoid/Ellipsoid";
9
+ import { Entity } from "../../entity/Entity";
10
+ import { MoveAxisEntity } from "./MoveAxisEntity";
11
+ import { MovePlaneEntity } from "./MovePlaneEntity";
12
+ import { RotateEntity } from "./RotateEntity";
13
+ import { AxisTrackEntity } from "./AxisTrackEntity";
14
+ import { EntityCollection } from "../../entity/EntityCollection";
8
15
  export interface IGeoObjectEditorSceneParams {
9
16
  planet?: Planet;
17
+ name?: string;
10
18
  }
11
19
  type GeoObjectSceneEventsList = [
12
20
  "mousemove",
@@ -33,26 +41,87 @@ type GeoObjectSceneEventsList = [
33
41
  "touchend",
34
42
  "doubletouch",
35
43
  "touchleave",
36
- "touchenter"
44
+ "touchenter",
45
+ "select",
46
+ "unselect",
47
+ "change",
48
+ "position",
49
+ "pitch",
50
+ "yaw",
51
+ "roll",
52
+ "scale"
37
53
  ];
38
54
  declare class GeoObjectEditorScene extends RenderNode {
39
55
  events: EventsHandler<GeoObjectSceneEventsList>;
40
56
  protected _planet: Planet | null;
41
57
  protected _startPos: Vec2 | null;
42
58
  protected _startClick: Vec2;
43
- protected _axisLayer: Vector;
44
- protected _rotLayer: Vector;
59
+ protected _moveLayer: EntityCollection;
60
+ protected _planeLayer: EntityCollection;
61
+ protected _rotateLayer: EntityCollection;
62
+ protected _axisTrackLayer: EntityCollection;
63
+ protected _selectedEntity: Entity | null;
64
+ protected _selectedEntityCart: Vec3;
65
+ protected _selectedEntityPitch: number;
66
+ protected _selectedEntityYaw: number;
67
+ protected _selectedEntityRoll: number;
68
+ protected _clickPos: Vec2;
69
+ protected _axisEntity: MoveAxisEntity;
70
+ protected _planeEntity: MovePlaneEntity;
71
+ protected _rotateEntity: RotateEntity;
72
+ protected _axisTrackEntity: AxisTrackEntity;
73
+ protected _selectedMove: string | null;
74
+ protected _ops: Record<string, (mouseState: IMouseState) => void>;
75
+ protected _axisTrackVisibility: boolean;
45
76
  constructor(options?: IGeoObjectEditorSceneParams);
77
+ get planet(): Planet | null;
78
+ bindPlanet(planet: Planet): void;
46
79
  init(): void;
47
80
  onremove(): void;
48
- _activate(): void;
49
- protected _deactivate(): void;
50
- protected _onLUp: () => void;
81
+ protected _addAxisLayers(): void;
82
+ protected _onAxisLayerMouseEnter: (e: IMouseState) => void;
83
+ protected _onAxisLayerMouseLeave: (e: IMouseState) => void;
84
+ protected _navActivate(): void;
85
+ protected _navDeactivate(): void;
86
+ protected _onAxisLayerLUp: (e: IMouseState) => void;
87
+ protected _onAxisLayerLDown: (e: IMouseState) => void;
88
+ protected _onPlaneLayerMouseEnter: (e: IMouseState) => void;
89
+ protected _onPlaneLayerMouseLeave: (e: IMouseState) => void;
90
+ protected _onPlaneLayerLUp: (e: IMouseState) => void;
91
+ protected _onPlaneLayerLDown: (e: IMouseState) => void;
92
+ protected _onRotateLayerMouseEnter: (e: IMouseState) => void;
93
+ protected _onRotateLayerMouseLeave: (e: IMouseState) => void;
94
+ protected _onRotateLayerLUp: (e: IMouseState) => void;
95
+ protected _onRotateLayerLDown: (e: IMouseState) => void;
96
+ protected _onMouseMove: (e: IMouseState) => void;
97
+ protected _removeAxisLayers(): void;
98
+ activate(): void;
99
+ protected deactivate(): void;
100
+ protected _setAxisTrackVisibility(visibility: boolean): void;
51
101
  setVisibility(visibility: boolean): void;
102
+ readyToEdit(entity: Entity): boolean;
103
+ select(entity: Entity): void;
104
+ unselect(): void;
52
105
  protected _onLclick: (e: IMouseState) => void;
53
- protected _onMouseMove: (e: IMouseState) => void;
54
106
  clear(): void;
55
107
  frame(): void;
56
- get ellipsoid(): Ellipsoid | null;
108
+ protected get _ellipsoid(): Ellipsoid | null;
109
+ protected _moveX: (e: IMouseState) => void;
110
+ protected _moveY: (e: IMouseState) => void;
111
+ protected _moveZ: (e: IMouseState) => void;
112
+ protected _moveXZ: (e: IMouseState) => void;
113
+ protected _moveXY: (e: IMouseState) => void;
114
+ protected _moveZY: (e: IMouseState) => void;
115
+ getFrameRotation(cartesian: Vec3): Quat;
116
+ protected _rotatePitch: (e: IMouseState) => void;
117
+ protected _rotateYaw: (e: IMouseState) => void;
118
+ protected _rotateRoll: (e: IMouseState) => void;
119
+ protected _scale: (e: IMouseState) => void;
120
+ protected _scaleX: (e: IMouseState) => void;
121
+ protected _scaleY: (e: IMouseState) => void;
122
+ protected _scaleZ: (e: IMouseState) => void;
123
+ getSelectedEntity(): Entity | null;
124
+ lockView(): void;
125
+ unlockView(): void;
57
126
  }
58
127
  export { GeoObjectEditorScene };
@@ -0,0 +1,17 @@
1
+ import { Entity, IEntityParams } from "../../entity/Entity";
2
+ import { Vec3 } from "../../math/Vec3";
3
+ import { ArrowEntity } from "./ArrowEntity";
4
+ export interface IAxisEntityParams extends IEntityParams {
5
+ size?: number;
6
+ }
7
+ export declare class MoveAxisEntity extends Entity {
8
+ protected _size: number;
9
+ childEntities: ArrowEntity[];
10
+ constructor(params?: IAxisEntityParams);
11
+ private _init;
12
+ setSize(size: number): void;
13
+ setPitch(a: number): void;
14
+ setYaw(a: number): void;
15
+ setRoll(a: number): void;
16
+ getY(): Vec3;
17
+ }
@@ -0,0 +1,7 @@
1
+ import { Entity, IEntityParams } from "../../entity/Entity";
2
+ export interface IMovePlaneEntityParams extends IEntityParams {
3
+ }
4
+ export declare class MovePlaneEntity extends Entity {
5
+ constructor(params?: IMovePlaneEntityParams);
6
+ private _init;
7
+ }
@@ -0,0 +1,9 @@
1
+ import { Entity, IEntityParams } from "../../entity/Entity";
2
+ import { Vec3 } from "../../math/Vec3";
3
+ export interface IRotationEntityParams extends IEntityParams {
4
+ }
5
+ export declare class RotateEntity extends Entity {
6
+ constructor(params?: IRotationEntityParams);
7
+ private _init;
8
+ setCartesian3v(cart: Vec3, yaw?: number): void;
9
+ }
@@ -0,0 +1,8 @@
1
+ export declare const X_COLOR = "rgb(253,77,77)";
2
+ export declare const SEL_X_COLOR = "rgb(248,115,115)";
3
+ export declare const Y_COLOR = "rgb(73,73,239)";
4
+ export declare const SEL_Y_COLOR = "rgb(90,90,253)";
5
+ export declare const Z_COLOR = "rgb(26,122,26)";
6
+ export declare const SEL_Z_COLOR = "rgb(55,191,55)";
7
+ export declare const XZ_COLOR = "rgba(255,255,255,0.8)";
8
+ export declare const SEL_XZ_COLOR = "rgba(255,255,255,1.0)";
@@ -27,3 +27,5 @@ export * from "./selection/Selection";
27
27
  export * from "./timeline/TimelineControl";
28
28
  export * from "./elevationProfile/ElevationProfileControl";
29
29
  export * from "./AtmosphereConfig";
30
+ export * from "./geoObjectEditor/GeoObjectEditor";
31
+ export * from "./CameraLock";