@openglobus/og 0.22.2 → 0.24.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 (205) hide show
  1. package/css/og.css +137 -1
  2. package/lib/@openglobus/js/Globe.d.ts +0 -1
  3. package/lib/@openglobus/js/Object3d.d.ts +20 -10
  4. package/lib/@openglobus/js/camera/Camera.d.ts +57 -15
  5. package/lib/@openglobus/js/camera/Frustum.d.ts +3 -0
  6. package/lib/@openglobus/js/camera/PlanetCamera.d.ts +13 -0
  7. package/lib/@openglobus/js/control/CameraLock.d.ts +38 -0
  8. package/lib/@openglobus/js/control/MouseNavigation.d.ts +62 -51
  9. package/lib/@openglobus/js/control/OldMouseNavigation.d.ts +64 -0
  10. package/lib/@openglobus/js/control/SimpleNavigation.d.ts +27 -10
  11. package/lib/@openglobus/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
  12. package/lib/@openglobus/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
  13. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
  14. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
  15. package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
  16. package/lib/@openglobus/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
  17. package/lib/@openglobus/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
  18. package/lib/@openglobus/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
  19. package/lib/@openglobus/js/control/geoObjectEditor/colors.d.ts +8 -0
  20. package/lib/@openglobus/js/control/index.d.ts +3 -2
  21. package/lib/@openglobus/js/entity/Entity.d.ts +282 -19
  22. package/lib/@openglobus/js/entity/EntityCollection.d.ts +8 -9
  23. package/lib/@openglobus/js/entity/GeoObject.d.ts +135 -39
  24. package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +39 -63
  25. package/lib/@openglobus/js/entity/InstanceData.d.ts +76 -0
  26. package/lib/@openglobus/js/entity/Polyline.d.ts +19 -6
  27. package/lib/@openglobus/js/entity/PolylineHandler.d.ts +7 -0
  28. package/lib/@openglobus/js/index.d.ts +2 -1
  29. package/lib/@openglobus/js/input/MouseHandler.d.ts +1 -0
  30. package/lib/@openglobus/js/layer/Vector.d.ts +4 -0
  31. package/lib/@openglobus/js/light/LightSource.d.ts +1 -139
  32. package/lib/@openglobus/js/math/Mat3.d.ts +1 -1
  33. package/lib/@openglobus/js/math/Mat4.d.ts +10 -1
  34. package/lib/@openglobus/js/math/Plane.d.ts +3 -1
  35. package/lib/@openglobus/js/math/Quat.d.ts +47 -33
  36. package/lib/@openglobus/js/math/Ray.d.ts +10 -14
  37. package/lib/@openglobus/js/math/Vec2.d.ts +22 -0
  38. package/lib/@openglobus/js/math/Vec3.d.ts +15 -0
  39. package/lib/@openglobus/js/math.d.ts +2 -2
  40. package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +2 -2
  41. package/lib/@openglobus/js/quadTree/Node.d.ts +1 -1
  42. package/lib/@openglobus/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
  43. package/lib/@openglobus/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
  44. package/lib/@openglobus/js/renderer/Renderer.d.ts +63 -44
  45. package/lib/@openglobus/js/renderer/RendererEvents.d.ts +2 -0
  46. package/lib/@openglobus/js/scene/Planet.d.ts +15 -7
  47. package/lib/@openglobus/js/scene/RenderNode.d.ts +10 -25
  48. package/lib/@openglobus/js/shaders/drawnode.d.ts +1 -0
  49. package/lib/@openglobus/js/shaders/geoObject.d.ts +1 -0
  50. package/lib/@openglobus/js/shaders/utils.d.ts +1 -1
  51. package/lib/@openglobus/js/ui/Checkbox.d.ts +31 -0
  52. package/lib/@openglobus/js/ui/Dialog.d.ts +3 -0
  53. package/lib/@openglobus/js/ui/Input.d.ts +32 -0
  54. package/lib/@openglobus/js/ui/View.d.ts +3 -1
  55. package/lib/@openglobus/js/utils/objParser.d.ts +44 -12
  56. package/lib/@openglobus/js/utils/shared.d.ts +22 -0
  57. package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +0 -1
  58. package/lib/@openglobus/js/webgl/Framebuffer.d.ts +35 -8
  59. package/lib/@openglobus/js/webgl/Handler.d.ts +22 -12
  60. package/lib/@openglobus/og.css +1 -1
  61. package/lib/@openglobus/og.esm.js +1 -1
  62. package/lib/@openglobus/og.esm.js.map +1 -1
  63. package/lib/@openglobus/og.umd.js +1 -1
  64. package/lib/@openglobus/og.umd.js.map +1 -1
  65. package/lib/js/Globe.d.ts +0 -1
  66. package/lib/js/Globe.js +4 -2
  67. package/lib/js/Object3d.d.ts +20 -10
  68. package/lib/js/Object3d.js +124 -48
  69. package/lib/js/Popup.js +1 -1
  70. package/lib/js/camera/Camera.d.ts +57 -15
  71. package/lib/js/camera/Camera.js +109 -29
  72. package/lib/js/camera/Frustum.d.ts +3 -0
  73. package/lib/js/camera/Frustum.js +7 -0
  74. package/lib/js/camera/PlanetCamera.d.ts +13 -0
  75. package/lib/js/camera/PlanetCamera.js +52 -5
  76. package/lib/js/control/Atmosphere.js +10 -6
  77. package/lib/js/control/CameraLock.d.ts +38 -0
  78. package/lib/js/control/CameraLock.js +216 -0
  79. package/lib/js/control/Control.js +1 -1
  80. package/lib/js/control/DebugInfo.js +38 -8
  81. package/lib/js/control/KeyboardNavigation.js +9 -9
  82. package/lib/js/control/MouseNavigation.d.ts +62 -51
  83. package/lib/js/control/MouseNavigation.js +361 -305
  84. package/lib/js/control/MouseWheelZoomControl.d.ts +0 -44
  85. package/lib/js/control/MouseWheelZoomControl.js +270 -181
  86. package/lib/js/control/OldMouseNavigation.d.ts +64 -0
  87. package/lib/js/control/OldMouseNavigation.js +368 -0
  88. package/lib/js/control/ScaleControl.js +11 -5
  89. package/lib/js/control/SimpleNavigation.d.ts +27 -10
  90. package/lib/js/control/SimpleNavigation.js +149 -49
  91. package/lib/js/control/Sun.js +6 -6
  92. package/lib/js/control/TouchNavigation.js +11 -8
  93. package/lib/js/control/elevationProfile/ElevationProfileScene.js +6 -5
  94. package/lib/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
  95. package/lib/js/control/geoObjectEditor/ArrowEntity.js +59 -0
  96. package/lib/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
  97. package/lib/js/control/geoObjectEditor/AxisTrackEntity.js +93 -0
  98. package/lib/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
  99. package/lib/js/control/geoObjectEditor/GeoObjectEditor.js +30 -0
  100. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
  101. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +488 -0
  102. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
  103. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +487 -43
  104. package/lib/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
  105. package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +107 -0
  106. package/lib/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
  107. package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +31 -0
  108. package/lib/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
  109. package/lib/js/control/geoObjectEditor/RotateEntity.js +105 -0
  110. package/lib/js/control/geoObjectEditor/colors.d.ts +8 -0
  111. package/lib/js/control/geoObjectEditor/colors.js +8 -0
  112. package/lib/js/control/index.d.ts +3 -2
  113. package/lib/js/control/index.js +3 -2
  114. package/lib/js/control/timeline/TimelineControl.js +2 -0
  115. package/lib/js/control/visibleExtent/Segment.js +4 -4
  116. package/lib/js/entity/Entity.d.ts +282 -19
  117. package/lib/js/entity/Entity.js +497 -62
  118. package/lib/js/entity/EntityCollection.d.ts +8 -9
  119. package/lib/js/entity/EntityCollection.js +48 -45
  120. package/lib/js/entity/GeoObject.d.ts +135 -39
  121. package/lib/js/entity/GeoObject.js +150 -90
  122. package/lib/js/entity/GeoObjectHandler.d.ts +39 -63
  123. package/lib/js/entity/GeoObjectHandler.js +198 -295
  124. package/lib/js/entity/InstanceData.d.ts +76 -0
  125. package/lib/js/entity/InstanceData.js +347 -0
  126. package/lib/js/entity/Polyline.d.ts +19 -6
  127. package/lib/js/entity/Polyline.js +76 -36
  128. package/lib/js/entity/PolylineHandler.d.ts +7 -0
  129. package/lib/js/entity/PolylineHandler.js +26 -1
  130. package/lib/js/index.d.ts +2 -1
  131. package/lib/js/index.js +2 -1
  132. package/lib/js/input/MouseHandler.d.ts +1 -0
  133. package/lib/js/input/MouseHandler.js +12 -1
  134. package/lib/js/layer/Bing.js +2 -2
  135. package/lib/js/layer/Vector.d.ts +4 -0
  136. package/lib/js/layer/Vector.js +16 -0
  137. package/lib/js/light/LightSource.d.ts +1 -139
  138. package/lib/js/light/LightSource.js +21 -227
  139. package/lib/js/math/Mat3.d.ts +1 -1
  140. package/lib/js/math/Mat3.js +1 -1
  141. package/lib/js/math/Mat4.d.ts +10 -1
  142. package/lib/js/math/Mat4.js +17 -1
  143. package/lib/js/math/Plane.d.ts +3 -1
  144. package/lib/js/math/Plane.js +11 -1
  145. package/lib/js/math/Quat.d.ts +47 -33
  146. package/lib/js/math/Quat.js +92 -90
  147. package/lib/js/math/Ray.d.ts +10 -14
  148. package/lib/js/math/Ray.js +56 -33
  149. package/lib/js/math/Vec2.d.ts +22 -0
  150. package/lib/js/math/Vec2.js +32 -0
  151. package/lib/js/math/Vec3.d.ts +15 -0
  152. package/lib/js/math/Vec3.js +30 -1
  153. package/lib/js/math.d.ts +2 -2
  154. package/lib/js/math.js +3 -3
  155. package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
  156. package/lib/js/quadTree/EntityCollectionNode.js +8 -8
  157. package/lib/js/quadTree/Node.d.ts +1 -1
  158. package/lib/js/quadTree/Node.js +2 -2
  159. package/lib/js/quadTree/QuadTreeStrategy.js +1 -1
  160. package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
  161. package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.js +2 -2
  162. package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
  163. package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.js +2 -2
  164. package/lib/js/renderer/Renderer.d.ts +63 -44
  165. package/lib/js/renderer/Renderer.js +267 -266
  166. package/lib/js/renderer/RendererEvents.d.ts +2 -0
  167. package/lib/js/renderer/RendererEvents.js +5 -2
  168. package/lib/js/scene/Planet.d.ts +15 -7
  169. package/lib/js/scene/Planet.js +133 -90
  170. package/lib/js/scene/RenderNode.d.ts +10 -25
  171. package/lib/js/scene/RenderNode.js +70 -58
  172. package/lib/js/segment/Segment.js +4 -4
  173. package/lib/js/shaders/depth.js +2 -5
  174. package/lib/js/shaders/drawnode.d.ts +1 -0
  175. package/lib/js/shaders/drawnode.js +51 -52
  176. package/lib/js/shaders/geoObject.d.ts +1 -0
  177. package/lib/js/shaders/geoObject.js +154 -91
  178. package/lib/js/shaders/polyline.js +68 -51
  179. package/lib/js/shaders/utils.d.ts +1 -1
  180. package/lib/js/shaders/utils.js +11 -0
  181. package/lib/js/terrain/GlobusTerrain.js +2 -2
  182. package/lib/js/ui/Checkbox.d.ts +31 -0
  183. package/lib/js/ui/Checkbox.js +110 -0
  184. package/lib/js/ui/Color.js +2 -1
  185. package/lib/js/ui/Dialog.d.ts +3 -0
  186. package/lib/js/ui/Dialog.js +20 -0
  187. package/lib/js/ui/Input.d.ts +32 -0
  188. package/lib/js/ui/Input.js +107 -0
  189. package/lib/js/ui/View.d.ts +3 -1
  190. package/lib/js/ui/View.js +6 -0
  191. package/lib/js/utils/objParser.d.ts +44 -12
  192. package/lib/js/utils/objParser.js +241 -149
  193. package/lib/js/utils/shared.d.ts +22 -0
  194. package/lib/js/utils/shared.js +34 -0
  195. package/lib/js/webgl/BaseFramebuffer.d.ts +0 -1
  196. package/lib/js/webgl/Framebuffer.d.ts +35 -8
  197. package/lib/js/webgl/Framebuffer.js +136 -29
  198. package/lib/js/webgl/Handler.d.ts +22 -12
  199. package/lib/js/webgl/Handler.js +53 -34
  200. package/lib/js/webgl/Program.js +0 -8
  201. package/package.json +5 -3
  202. package/lib/@openglobus/js/control/EarthNavigation.d.ts +0 -50
  203. package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +0 -44
  204. package/lib/js/control/EarthNavigation.d.ts +0 -50
  205. package/lib/js/control/EarthNavigation.js +0 -202
@@ -2,173 +2,35 @@ import { Vec3 } from "../math/Vec3";
2
2
  import { RenderNode } from "../scene/RenderNode";
3
3
  export interface ILightSourceParams {
4
4
  position?: Vec3;
5
- directional?: boolean;
6
5
  ambient?: Vec3;
7
6
  diffuse?: Vec3;
8
7
  specular?: Vec3;
9
8
  shininess?: number;
10
9
  }
11
- /**
12
- * Represents basic light source.
13
- * @class
14
- * @param {string} [name] - Light source name.
15
- * @param {ILightSourceParams} [params] - Light parameters:
16
- * @param {Vec3} [params.position] - Light source position if it is a point light, otherwise it is a light direction vector.
17
- * @param {Vec3} [params.ambient] - Ambient RGB color.
18
- * @param {Vec3} [params.diffuse] - Diffuse RGB color.
19
- * @param {Vec3} [params.specular] - Specular RGB color.
20
- * @param {number} [params.shininess] - Specular shininess.
21
- */
22
10
  declare class LightSource {
23
- static __counter__: number;
24
- /**
25
- * Light name.
26
- * @protected
27
- * @type {string}
28
- */
29
- protected _name: string;
30
- /**
31
- * Render node where light is shines.
32
- * @protected
33
- * @type {RenderNode}
34
- */
35
11
  protected _renderNode: RenderNode | null;
36
- /**
37
- * Light position.
38
- * @public
39
- * @type {Vec3}
40
- */
41
12
  _position: Vec3;
42
- /**
43
- * True if the light is directional.
44
- * @public
45
- * @type {boolean}
46
- */
47
- directional: boolean;
48
- /**
49
- * Ambient color.
50
- * @protected
51
- * @type {Vec3}
52
- */
53
13
  protected _ambient: Vec3;
54
- /**
55
- * Diffuse color.
56
- * @protected
57
- * @type {Vec3}
58
- */
59
14
  protected _diffuse: Vec3;
60
- /**
61
- * Specular color.
62
- * @protected
63
- * @type {Vec3}
64
- */
65
15
  protected _specular: Vec3;
66
- /**
67
- * Shininess.
68
- * @protected
69
- * @type {number}
70
- */
71
16
  protected _shininess: number;
72
- /**
73
- * Light activity.
74
- * @protected
75
- * @type {boolean}
76
- */
77
17
  protected _active: boolean;
78
18
  protected _tempAmbient: Vec3;
79
19
  protected _tempDiffuse: Vec3;
80
20
  protected _tempSpecular: Vec3;
81
21
  protected _tempShininess: number;
82
- constructor(name: string, params: ILightSourceParams);
83
- /**
84
- * Creates clone of the current light object.
85
- * @todo: TODO
86
- * @public
87
- * @returns {LightSource}
88
- */
89
- clone(): void;
90
- /**
91
- * Set light activity. If activity is false the light doesn't shine.
92
- * @public
93
- * @param {boolean} active - Light activity.
94
- */
95
- setActive(active: boolean): void;
96
- /**
97
- * Gets light activity.
98
- * @public
99
- * @returns {boolean}
100
- */
22
+ constructor(params: ILightSourceParams);
101
23
  isActive(): boolean;
102
- /**
103
- * Set light source position, or if it is a directional type sets light direction vector.
104
- * @public
105
- * @param {Vec3} position - Light position or direction vector.
106
- */
107
24
  setPosition3v(position: Vec3): void;
108
- /**
109
- * Set light source position, or if it is a directional type sets light direction vector.
110
- * @public
111
- */
112
25
  setPosition(x: number, y: number, z: number): void;
113
- /**
114
- * Returns light source position, or if it is a directional type sets light direction vector.
115
- * @public
116
- * @returns {Vec3} - Light source position/direction.
117
- */
118
26
  getPosition(): Vec3;
119
- /**
120
- * Set ambient color.
121
- * @public
122
- * @param {Vec3} rgb - Ambient color.
123
- */
124
27
  setAmbient3v(rgb: Vec3): void;
125
- /**
126
- * Set diffuse color.
127
- * @public
128
- * @param {Vec3} rgb - Diffuse color.
129
- */
130
28
  setDiffuse3v(rgb: Vec3): void;
131
- /**
132
- * Set specular color.
133
- * @public
134
- * @param {Vec3} rgb - Specular color.
135
- */
136
29
  setSpecular3v(rgb: Vec3): void;
137
- /**
138
- * Set ambient color.
139
- * @public
140
- */
141
30
  setAmbient(r: number, g: number, b: number): void;
142
- /**
143
- * Set diffuse color.
144
- * @public
145
- */
146
31
  setDiffuse(r: number, g: number, b: number): void;
147
- /**
148
- * Set specular color.
149
- * @public
150
- */
151
32
  setSpecular(r: number, g: number, b: number): void;
152
- /**
153
- * Set material shininess.
154
- * @public
155
- */
156
33
  setShininess(shininess: number): void;
157
- /**
158
- * Sets light to black.
159
- * @public
160
- */
161
- setBlack(): void;
162
- /**
163
- * Adds current light to the render node scene.
164
- * @public
165
- * @param {RenderNode} renderNode - Render node scene.
166
- */
167
34
  addTo(renderNode: RenderNode): void;
168
- /**
169
- * Removes from render node scene.
170
- * @public
171
- */
172
- remove(): void;
173
35
  }
174
36
  export { LightSource };
@@ -67,7 +67,7 @@ export declare class Mat3 {
67
67
  * @public
68
68
  * @returns {Mat4}
69
69
  */
70
- toMatrix4(): Mat4;
70
+ getMat4(): Mat4;
71
71
  }
72
72
  /**
73
73
  * Mat3 factory.
@@ -37,6 +37,15 @@ export declare class Mat4 {
37
37
  * @returns {Mat4} -
38
38
  */
39
39
  static identity(): Mat4;
40
+ /**
41
+ * Get rotation matrix around the point
42
+ * @public
43
+ * @param {number} angle - Rotation angle in radians
44
+ * @param {Vec3} [center] - Point that the camera rotates around
45
+ * @param {Vec3} [up] - Camera up vector
46
+ */
47
+ static getRotationAroundPoint(angle: number, center?: Vec3, up?: Vec3): Mat4;
48
+ static getRotation(angle: number, up?: Vec3): Mat4;
40
49
  /**
41
50
  * Sets column-major order array matrix.
42
51
  * @public
@@ -62,7 +71,7 @@ export declare class Mat4 {
62
71
  * @public
63
72
  * @returns {Mat3} -
64
73
  */
65
- toMatrix3(): Mat3;
74
+ getMat3(): Mat3;
66
75
  /**
67
76
  * Multiply to 3d vector.
68
77
  * @public
@@ -9,7 +9,9 @@ import { Line3 } from "./Line3";
9
9
  declare class Plane {
10
10
  p: Vec3;
11
11
  n: Vec3;
12
- constructor(p: Vec3, n: Vec3);
12
+ constructor(p?: Vec3, n?: Vec3);
13
+ setByPoints(v0: Vec3, v1: Vec3, v2: Vec3): Plane;
14
+ static fromPoints(v0: Vec3, v1: Vec3, v2: Vec3): Plane;
13
15
  set(p: Vec3, n: Vec3): void;
14
16
  getNormal(): Vec3;
15
17
  distance(p: Vec3): number;
@@ -118,13 +118,18 @@ 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;
122
121
  /**
123
122
  * Returns true if the components are zero.
124
123
  * @public
125
124
  * @returns {boolean} -
126
125
  */
127
126
  isZero(): boolean;
127
+ /**
128
+ * Returns true if a component is NaN.
129
+ * @public
130
+ * @returns {boolean} -
131
+ */
132
+ isNaN(): boolean;
128
133
  /**
129
134
  * Clear Quat. Sets zeroes.
130
135
  * @public
@@ -167,6 +172,13 @@ export declare class Quat {
167
172
  * @returns {Quat} -
168
173
  */
169
174
  add(q: Quat): Quat;
175
+ /**
176
+ * Computes the componentwise sum of two Quats.
177
+ * @public
178
+ * @param {Quat} q - Quat to add.
179
+ * @returns {Quat} -
180
+ */
181
+ addRes(q: Quat, res: Quat): Quat;
170
182
  /**
171
183
  * Computes the componentwise difference of two Quats.
172
184
  * @public
@@ -194,6 +206,15 @@ export declare class Quat {
194
206
  * @returns {Array.<number>} - (exactly 4 entries)
195
207
  */
196
208
  toVec(): [number, number, number, number];
209
+ get xyz(): Vec3;
210
+ /**
211
+ * Sets rotation with the given heading and up vectors.
212
+ * @static
213
+ * @param {Vec3} forward - Heading target coordinates.
214
+ * @param {Vec3} up - Up vector.
215
+ * @returns {Quat} -
216
+ */
217
+ setLookRotation(forward: Vec3, up: Vec3): Quat;
197
218
  /**
198
219
  * Sets current quaternion by spherical coordinates.
199
220
  * @public
@@ -203,20 +224,12 @@ export declare class Quat {
203
224
  * @returns {Quat} -
204
225
  */
205
226
  setFromSphericalCoords(lat: number, lon: number, angle: number): Quat;
206
- /**
207
- * Sets rotation with the given heading and up vectors.
208
- * @static
209
- * @param {Vec3} forward - Heading target coordinates.
210
- * @param {Vec3} up - Up vector.
211
- * @returns {Quat} -
212
- */
213
- setLookRotation(forward: Vec3, up: Vec3): Quat;
214
227
  /**
215
228
  * Gets spherical coordinates.
216
229
  * @public
217
230
  * @returns {Object} Returns object with latitude, longitude and alpha.
218
231
  */
219
- toSphericalCoords(): any;
232
+ getSphericalCoords(): any;
220
233
  /**
221
234
  * Sets current Quat representing a rotation around an axis.
222
235
  * @public
@@ -228,9 +241,16 @@ export declare class Quat {
228
241
  /**
229
242
  * Returns axis and angle of the current Quat.
230
243
  * @public
231
- * @returns {Object} -
244
+ * @returns { axis: Vec3, angle: number } -
232
245
  */
233
- getAxisAngle(): any;
246
+ getAxisAngle(): {
247
+ axis: Vec3;
248
+ angle: number;
249
+ };
250
+ getPitch(): number;
251
+ getYaw(): number;
252
+ getRoll(): number;
253
+ setPitchYawRoll(pitchRad: number, yawRad: number, rollRad: number, frame?: Quat): Quat;
234
254
  /**
235
255
  * Sets current Quat by Euler's angles.
236
256
  * @public
@@ -274,6 +294,14 @@ export declare class Quat {
274
294
  * @returns {Vec3} -
275
295
  */
276
296
  mulVec3(v: Vec3): Vec3;
297
+ /**
298
+ * Returns quaternion and vector production.
299
+ * @public
300
+ * @param {Vec3} v - 3d Vector.
301
+ * @param {Vec3} res - result output vector.
302
+ * @returns {Vec3} -
303
+ */
304
+ mulVec3Res(v: Vec3, res: Vec3): Vec3;
277
305
  /**
278
306
  * Computes the product of two Quats.
279
307
  * @public
@@ -281,6 +309,13 @@ export declare class Quat {
281
309
  * @returns {Quat} -
282
310
  */
283
311
  mul(q: Quat): Quat;
312
+ /**
313
+ * Computes the product of two Quats.
314
+ * @public
315
+ * @param {Quat} q - Quat to multiply.
316
+ * @returns {Quat} -
317
+ */
318
+ mulRes(q: Quat, res: Quat): Quat;
284
319
  /**
285
320
  * Computes the product of two Quats.
286
321
  * @public
@@ -340,27 +375,6 @@ export declare class Quat {
340
375
  * @returns {Quat} -
341
376
  */
342
377
  slerp(b: Quat, t: number): Quat;
343
- /**
344
- * Returns a roll angle in radians.
345
- * @public
346
- * @param {Boolean} [reprojectAxis] -
347
- * @returns {Number} -
348
- */
349
- getRoll(reprojectAxis?: boolean): number;
350
- /**
351
- * Returns a pitch angle in radians.
352
- * @public
353
- * @param {Boolean} [reprojectAxis] -
354
- * @returns {number} -
355
- */
356
- getPitch(reprojectAxis?: boolean): number;
357
- /**
358
- * Returns a yaw angle in radians.
359
- * @public
360
- * @param {Boolean} [reprojectAxis] -
361
- * @returns {number} -
362
- */
363
- getYaw(reprojectAxis?: boolean): number;
364
378
  }
365
379
  /**
366
380
  * Creates Quat instance.
@@ -1,6 +1,7 @@
1
1
  import { Box } from "../bv/Box";
2
2
  import { Sphere } from "../bv/Sphere";
3
3
  import { Vec3 } from "./Vec3";
4
+ import { Plane } from "./Plane";
4
5
  /**
5
6
  * Represents a ray that extends infinitely from the provided origin in the provided direction.
6
7
  * @class
@@ -38,14 +39,13 @@ export declare class Ray {
38
39
  */
39
40
  set(origin: Vec3, direction: Vec3): Ray;
40
41
  /**
41
- * Computes the point along the ray on the distance.
42
- * @public
43
- * @param {number} distance - Point distance.
44
- * @returns {Vec3}
42
+ * Get a point on the ray at a given distance `t`.
43
+ * @param {number} distance - Distance from the origin along the ray.
44
+ * @returns {Vec3} The point at distance `t`.
45
45
  */
46
46
  getPoint(distance: number): Vec3;
47
47
  /**
48
- * Returns ray hit a triange result.
48
+ * Returns ray hit a triangle result.
49
49
  * @public
50
50
  * @param {Vec3} v0 - First triangle corner coordinate.
51
51
  * @param {Vec3} v1 - Second triangle corner coordinate.
@@ -54,17 +54,13 @@ export declare class Ray {
54
54
  * @returns {number} - Hit code, could 0 - og.Ray.OUTSIDE, 1 - og.Ray.INSIDE,
55
55
  * 2 - og.Ray.INPLANE and 3 - og.Ray.AWAY(ray goes away from triangle).
56
56
  */
57
- hitTriangle(v0: Vec3, v1: Vec3, v2: Vec3, res: Vec3): number;
57
+ hitTriangleRes(v0: Vec3, v1: Vec3, v2: Vec3, res: Vec3): number;
58
58
  /**
59
- * Gets a ray hit a plane result. If the ray cross the plane returns 1 - og.Ray.INSIDE otherwise returns 0 - og.Ray.OUTSIDE.
60
- * @public
61
- * @param {Vec3} v0 - First plane point.
62
- * @param {Vec3} v1 - Second plane point.
63
- * @param {Vec3} v2 - Third plane point.
64
- * @param {Vec3} res - Hit point object pointer that stores hit result.
65
- * @returns {number}
59
+ * Finds the intersection of the ray with a plane.
60
+ * @param {Plane} plane - The plane to intersect with.
61
+ * @returns {Vec3 | null} The intersection point or null if no intersection.
66
62
  */
67
- hitPlane(v0: Vec3, v1: Vec3, v2: Vec3, res: Vec3): number;
63
+ hitPlaneRes(plane: Plane, res: Vec3): number;
68
64
  /**
69
65
  * Returns a ray hit sphere coordiante. If there isn't hit returns null.
70
66
  * @public
@@ -92,6 +92,15 @@ export declare class Vec2 {
92
92
  * @returns {Vec2}
93
93
  */
94
94
  static orthoNormalize(normal: Vec2, tangent: Vec2): Vec2;
95
+ /**
96
+ * Get projection of the vector to plane where n - normal to the plane.
97
+ * @static
98
+ * @param {Vec2} b - Vector to project.
99
+ * @param {Vec2} n - Plane normal.
100
+ * @param {Vec2} [def] - Default value for non existed result.
101
+ * @returns {Vec2} -
102
+ */
103
+ static proj_b_to_plane(b: Vec2, n: Vec2, def?: Vec3): Vec2;
95
104
  /**
96
105
  * Converts to 3d vector, third value is 0.0.
97
106
  * @public
@@ -221,10 +230,17 @@ export declare class Vec2 {
221
230
  clear(): Vec2;
222
231
  /**
223
232
  * Returns normalized vector.
233
+ * @deprecated
224
234
  * @public
225
235
  * @returns {Vec2}
226
236
  */
227
237
  normal(): Vec2;
238
+ /**
239
+ * Returns normalized vector.
240
+ * @public
241
+ * @returns {Vec2}
242
+ */
243
+ getNormal(): Vec2;
228
244
  /**
229
245
  * Normalize current vector.
230
246
  * @public
@@ -299,6 +315,12 @@ export declare class Vec2 {
299
315
  * @returns {Vec2}
300
316
  */
301
317
  slerp(v2: Vec2, t: number): Vec2;
318
+ /**
319
+ * Returns true if vector's values are zero.
320
+ * @public
321
+ * @returns {boolean} -
322
+ */
323
+ isZero(): boolean;
302
324
  }
303
325
  /**
304
326
  * Vector 2d object creator.
@@ -241,6 +241,13 @@ export declare class Vec3 {
241
241
  * @returns {Vec3} Returns a sum vector.
242
242
  */
243
243
  add(p: Vec3): Vec3;
244
+ /**
245
+ * Gets two vectors summarization.
246
+ * @public
247
+ * @param {Vec3} p - Vector to add.
248
+ * @returns {Vec3} Returns a sum vector.
249
+ */
250
+ addRes(p: Vec3, res: Vec3): Vec3;
244
251
  /**
245
252
  * Subtract vector from the current.
246
253
  * @public
@@ -283,6 +290,13 @@ export declare class Vec3 {
283
290
  * @returns {Vec3} -
284
291
  */
285
292
  mul(vec: Vec3): Vec3;
293
+ /**
294
+ * Multiply current vector object to another and returns new vector instance.
295
+ * @public
296
+ * @param {Vec3} vec - Multiply vector.
297
+ * @returns {Vec3} -
298
+ */
299
+ mulRes(vec: Vec3, res: Vec3): Vec3;
286
300
  /**
287
301
  * Divide current vector's components to another. Results stores in the current vector object.
288
302
  * @public
@@ -452,6 +466,7 @@ export declare class Vec3 {
452
466
  * @returns {Vec3} -
453
467
  */
454
468
  slerp(v2: Vec3, t: number): Vec3;
469
+ mulVecA(a: Vec3): Vec3;
455
470
  /**
456
471
  * Gets the shortest arc quaternion to rotate this vector to the destination vector.
457
472
  * @param {Vec3} dest -
@@ -70,7 +70,7 @@ export declare function log(n: number, base: number): number;
70
70
  /**
71
71
  * Clamp the number.
72
72
  * @function
73
- * @param {number} number - Input number.
73
+ * @param {number} value - Input number.
74
74
  * @param {number} min - Minimal edge.
75
75
  * @param {number} max - Maximal edge.
76
76
  * @returns {number} -
@@ -78,7 +78,7 @@ export declare function log(n: number, base: number): number;
78
78
  * clamp(12, 1, 5)
79
79
  * //returns 5
80
80
  */
81
- export declare function clamp(number: number, min: number, max: number): number;
81
+ export declare function clamp(value: number, min: number, max: number): number;
82
82
  /**
83
83
  * Converts degrees value to radians.
84
84
  * @function
@@ -16,7 +16,7 @@ declare class EntityCollectionNode {
16
16
  layer: Vector;
17
17
  strategy: EntityCollectionsTreeStrategy;
18
18
  parentNode: EntityCollectionNode | null;
19
- childrenNodes: EntityCollectionNode[];
19
+ childNodes: EntityCollectionNode[];
20
20
  partId: number;
21
21
  nodeId: number;
22
22
  state: number | null;
@@ -34,7 +34,7 @@ declare class EntityCollectionNode {
34
34
  __setLonLat__(entity: Entity): LonLat;
35
35
  buildTree(entities: Entity[], rightNow?: boolean): void;
36
36
  isInside(entity: Entity): boolean;
37
- createChildrenNodes(): void;
37
+ createChildNodes(): void;
38
38
  collectRenderCollectionsPASS1(visibleNodes: NodesDict, outArr: EntityCollection[]): void;
39
39
  collectRenderCollectionsPASS2(visibleNodes: NodesDict, outArr: EntityCollection[], renderingNodeId: number): void;
40
40
  applyCollection(): void;
@@ -33,7 +33,7 @@ declare class Node {
33
33
  inFrustum: number;
34
34
  _fadingNodes: Node[];
35
35
  constructor(SegmentPrototype: typeof Segment, planet: Planet, partId: number, parent: Node | null, tileZoom: number, extent: Extent);
36
- createChildrenNodes(): void;
36
+ createChildNodes(): void;
37
37
  createBounds(): void;
38
38
  getState(): number | null;
39
39
  /**
@@ -9,7 +9,7 @@ export declare class EarthEntityCollectionNodeLonLat extends EntityCollectionNod
9
9
  isNorth: boolean;
10
10
  strategy: EarthEntityCollectionsTreeStrategy;
11
11
  constructor(strategy: EarthEntityCollectionsTreeStrategy, partId: number, parent: EarthEntityCollectionNodeLonLat | null, extent: Extent, planet: Planet, zoom: number);
12
- createChildrenNodes(): void;
12
+ createChildNodes(): void;
13
13
  protected _setExtentBounds(): void;
14
14
  __setLonLat__(entity: Entity): LonLat;
15
15
  isVisible(): boolean;
@@ -8,7 +8,7 @@ import { EquiEntityCollectionsTreeStrategy } from "./EquiEntityCollectionsTreeSt
8
8
  export declare class EquiEntityCollectionNodeLonLat extends EntityCollectionNode {
9
9
  strategy: EquiEntityCollectionsTreeStrategy;
10
10
  constructor(strategy: EquiEntityCollectionsTreeStrategy, partId: number, parent: EquiEntityCollectionNodeLonLat | null, extent: Extent, planet: Planet, zoom: number);
11
- createChildrenNodes(): void;
11
+ createChildNodes(): void;
12
12
  protected _setExtentBounds(): void;
13
13
  __setLonLat__(entity: Entity): LonLat;
14
14
  isVisible(): boolean;