@openglobus/og 0.23.0 → 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 (84) hide show
  1. package/lib/@openglobus/js/Globe.d.ts +0 -1
  2. package/lib/@openglobus/js/camera/Camera.d.ts +48 -15
  3. package/lib/@openglobus/js/camera/PlanetCamera.d.ts +13 -0
  4. package/lib/@openglobus/js/control/MouseNavigation.d.ts +62 -51
  5. package/lib/@openglobus/js/control/OldMouseNavigation.d.ts +64 -0
  6. package/lib/@openglobus/js/control/index.d.ts +1 -2
  7. package/lib/@openglobus/js/entity/Entity.d.ts +24 -20
  8. package/lib/@openglobus/js/entity/GeoObject.d.ts +0 -9
  9. package/lib/@openglobus/js/input/MouseHandler.d.ts +1 -0
  10. package/lib/@openglobus/js/math/Mat3.d.ts +1 -1
  11. package/lib/@openglobus/js/math/Mat4.d.ts +10 -1
  12. package/lib/@openglobus/js/math/Plane.d.ts +3 -1
  13. package/lib/@openglobus/js/math/Quat.d.ts +1 -0
  14. package/lib/@openglobus/js/math/Ray.d.ts +6 -16
  15. package/lib/@openglobus/js/math/Vec2.d.ts +22 -0
  16. package/lib/@openglobus/js/renderer/RendererEvents.d.ts +1 -0
  17. package/lib/@openglobus/js/scene/Planet.d.ts +4 -0
  18. package/lib/@openglobus/js/webgl/Handler.d.ts +21 -12
  19. package/lib/@openglobus/og.esm.js +1 -1
  20. package/lib/@openglobus/og.esm.js.map +1 -1
  21. package/lib/@openglobus/og.umd.js +1 -1
  22. package/lib/@openglobus/og.umd.js.map +1 -1
  23. package/lib/js/Globe.d.ts +0 -1
  24. package/lib/js/Globe.js +4 -2
  25. package/lib/js/Popup.js +1 -1
  26. package/lib/js/camera/Camera.d.ts +48 -15
  27. package/lib/js/camera/Camera.js +82 -28
  28. package/lib/js/camera/PlanetCamera.d.ts +13 -0
  29. package/lib/js/camera/PlanetCamera.js +52 -5
  30. package/lib/js/control/CameraLock.js +1 -1
  31. package/lib/js/control/DebugInfo.js +30 -10
  32. package/lib/js/control/KeyboardNavigation.js +8 -8
  33. package/lib/js/control/MouseNavigation.d.ts +62 -51
  34. package/lib/js/control/MouseNavigation.js +361 -305
  35. package/lib/js/control/MouseWheelZoomControl.d.ts +0 -44
  36. package/lib/js/control/MouseWheelZoomControl.js +270 -181
  37. package/lib/js/control/OldMouseNavigation.d.ts +64 -0
  38. package/lib/js/control/OldMouseNavigation.js +368 -0
  39. package/lib/js/control/ScaleControl.js +2 -2
  40. package/lib/js/control/SimpleNavigation.js +8 -7
  41. package/lib/js/control/Sun.js +5 -5
  42. package/lib/js/control/TouchNavigation.js +11 -8
  43. package/lib/js/control/elevationProfile/ElevationProfileScene.js +2 -1
  44. package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +19 -33
  45. package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +18 -18
  46. package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +3 -2
  47. package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +1 -4
  48. package/lib/js/control/geoObjectEditor/RotateEntity.js +1 -1
  49. package/lib/js/control/index.d.ts +1 -2
  50. package/lib/js/control/index.js +1 -2
  51. package/lib/js/control/visibleExtent/Segment.js +4 -4
  52. package/lib/js/entity/Entity.d.ts +24 -20
  53. package/lib/js/entity/Entity.js +62 -47
  54. package/lib/js/entity/GeoObject.d.ts +0 -9
  55. package/lib/js/entity/GeoObject.js +0 -3
  56. package/lib/js/entity/InstanceData.js +6 -3
  57. package/lib/js/input/MouseHandler.d.ts +1 -0
  58. package/lib/js/input/MouseHandler.js +12 -1
  59. package/lib/js/math/Mat3.d.ts +1 -1
  60. package/lib/js/math/Mat3.js +1 -1
  61. package/lib/js/math/Mat4.d.ts +10 -1
  62. package/lib/js/math/Mat4.js +17 -1
  63. package/lib/js/math/Plane.d.ts +3 -1
  64. package/lib/js/math/Plane.js +11 -1
  65. package/lib/js/math/Quat.d.ts +1 -0
  66. package/lib/js/math/Quat.js +1 -0
  67. package/lib/js/math/Ray.d.ts +6 -16
  68. package/lib/js/math/Ray.js +53 -46
  69. package/lib/js/math/Vec2.d.ts +22 -0
  70. package/lib/js/math/Vec2.js +32 -0
  71. package/lib/js/renderer/Renderer.js +10 -6
  72. package/lib/js/renderer/RendererEvents.d.ts +1 -0
  73. package/lib/js/renderer/RendererEvents.js +3 -1
  74. package/lib/js/scene/Planet.d.ts +4 -0
  75. package/lib/js/scene/Planet.js +24 -3
  76. package/lib/js/segment/Segment.js +4 -4
  77. package/lib/js/terrain/GlobusTerrain.js +2 -2
  78. package/lib/js/webgl/Handler.d.ts +21 -12
  79. package/lib/js/webgl/Handler.js +42 -33
  80. package/package.json +2 -2
  81. package/lib/@openglobus/js/control/EarthNavigation.d.ts +0 -50
  82. package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +0 -44
  83. package/lib/js/control/EarthNavigation.d.ts +0 -50
  84. package/lib/js/control/EarthNavigation.js +0 -202
@@ -33,7 +33,6 @@ export interface IGlobeParams {
33
33
  transitionOpacityEnabled?: boolean;
34
34
  terrain?: EmptyTerrain;
35
35
  controls?: Control[];
36
- useEarthNavigation?: boolean;
37
36
  minSlope?: number;
38
37
  sun?: {
39
38
  active?: boolean;
@@ -6,6 +6,7 @@ import { Renderer } from "../renderer/Renderer";
6
6
  import { Vec2, NumberArray2 } from "../math/Vec2";
7
7
  import { Vec3 } from "../math/Vec3";
8
8
  import { Sphere } from "../bv/Sphere";
9
+ import { Quat } from "../math/Quat";
9
10
  type CameraEvents = ["viewchange", "moveend"];
10
11
  export interface ICameraParams {
11
12
  eye?: Vec3;
@@ -89,22 +90,28 @@ declare class Camera {
89
90
  protected _normalMatrix: Mat3;
90
91
  /**
91
92
  * Camera right vector.
92
- * @public
93
+ * @protected
93
94
  * @type {Vec3}
94
95
  */
95
96
  _r: Vec3;
96
97
  /**
97
98
  * Camera up vector.
98
- * @public
99
+ * @protected
99
100
  * @type {Vec3}
100
101
  */
101
102
  _u: Vec3;
102
103
  /**
103
104
  * Camera backward vector.
104
- * @public
105
+ * @protected
105
106
  * @type {Vec3}
106
107
  */
107
108
  _b: Vec3;
109
+ /**
110
+ * Camera forward vector.
111
+ * @protected
112
+ * @type {Vec3}
113
+ */
114
+ _f: Vec3;
108
115
  protected _pr: Vec3;
109
116
  protected _pu: Vec3;
110
117
  protected _pb: Vec3;
@@ -208,23 +215,40 @@ declare class Camera {
208
215
  */
209
216
  slide(du: number, dv: number, dn: number): void;
210
217
  /**
211
- * Roll the camera to the angle in degrees
218
+ * Roll the camera to the angle in radians
219
+ * @public
220
+ * @param {number} angle - Delta roll angle in radians
221
+ */
222
+ setRoll(angle: number): void;
223
+ /**
224
+ * Pitch the camera to the angle in radians
212
225
  * @public
213
- * @param {number} angle - Delta roll angle in degrees
226
+ * @param {number} angle - Delta pitch angle in radians
214
227
  */
215
- roll(angle: number): void;
228
+ setPitch(angle: number): void;
216
229
  /**
217
- * Pitch the camera to the angle in degrees
230
+ * Yaw the camera to the angle in radians
218
231
  * @public
219
- * @param {number} angle - Delta pitch angle in degrees
232
+ * @param {number} angle - Delta yaw angle in radians
233
+ */
234
+ setYaw(angle: number): void;
235
+ setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
236
+ getPitch(): number;
237
+ getYaw(): number;
238
+ getRoll(): number;
239
+ /**
240
+ * Returns camera quaternion
220
241
  */
221
- pitch(angle: number): void;
242
+ getRotation(): Quat;
243
+ setRotation(rot: Quat, up?: Vec3, right?: Vec3, back?: Vec3): void;
244
+ rotate(rot: Quat): void;
222
245
  /**
223
- * Yaw the camera to the angle in degrees
246
+ * Returns normal vector direction to the unprojected screen point from camera eye
224
247
  * @public
225
- * @param {number} angle - Delta yaw angle in degrees
248
+ * @param {Vec2} pos - Screen X coordinate
249
+ * @returns {Vec3} - Direction vector
226
250
  */
227
- yaw(angle: number): void;
251
+ unproject2v(pos: Vec2): Vec3;
228
252
  /**
229
253
  * Returns normal vector direction to the unprojected screen point from camera eye
230
254
  * @public
@@ -239,7 +263,16 @@ declare class Camera {
239
263
  * @param {Vec3} v - Cartesian 3d coordinates
240
264
  * @returns {Vec2} - Screen point coordinates
241
265
  */
242
- project(v: Vec3): Vec2;
266
+ project3v(v: Vec3): Vec2;
267
+ /**
268
+ * Gets projected 3d point to the 2d screen coordinates
269
+ * @public
270
+ * @param {number} x - X coordinate
271
+ * @param {number} y - Y coordinate
272
+ * @param {number} z - Z coordinate
273
+ * @returns {Vec2} - Screen point coordinates
274
+ */
275
+ project(x: number, y: number, z: number): Vec2;
243
276
  /**
244
277
  * Rotates camera around center point
245
278
  * @public
@@ -249,7 +282,7 @@ declare class Camera {
249
282
  * @param {Vec3} [center] - Point that the camera rotates around
250
283
  * @param {Vec3} [up] - Camera up vector
251
284
  */
252
- rotateAround(angle: number, isArc?: boolean, center?: Vec3 | null, up?: Vec3 | null): void;
285
+ rotateAround(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
253
286
  /**
254
287
  * Rotates camera around center point by horizontal.
255
288
  * @public
@@ -259,7 +292,7 @@ declare class Camera {
259
292
  * @param {Vec3} [center] - Point that the camera rotates around.
260
293
  * @param {Vec3} [up] - Camera up vector.
261
294
  */
262
- rotateHorizontal(angle: number, isArc?: boolean, center?: Vec3 | null, up?: Vec3 | null): void;
295
+ rotateHorizontal(angle: number, isArc?: boolean, center?: Vec3, up?: Vec3): void;
263
296
  /**
264
297
  * Rotates camera around center point by vertical.
265
298
  * @param {number} angle - Rotation angle in radians.
@@ -228,7 +228,20 @@ declare class PlanetCamera extends Camera {
228
228
  checkFly(): void;
229
229
  checkTerrainCollision(): Vec3 | undefined;
230
230
  getSurfaceVisibleDistance(d: number): number;
231
+ /**
232
+ * should be yje same as getYaw
233
+ */
231
234
  getHeading(): number;
232
235
  isVisible(poi: Vec3): boolean;
236
+ getPitch(): number;
237
+ /**
238
+ * should be the same as getHeading
239
+ */
240
+ getYaw(): number;
241
+ getRoll(): number;
242
+ setPitch(a: number): void;
243
+ setYaw(a: number): void;
244
+ setRoll(a: number): void;
245
+ setPitchYawRoll(pitch: number, yaw: number, roll: number): void;
233
246
  }
234
247
  export { PlanetCamera };
@@ -1,64 +1,75 @@
1
1
  import { Control, IControlParams } from "./Control";
2
- import { Key } from "../Lock";
2
+ import { IMouseState } from "../renderer/RendererEvents";
3
3
  import { Quat } from "../math/Quat";
4
4
  import { Sphere } from "../bv/Sphere";
5
- import { Vec3 } from "../math/Vec3";
6
5
  import { Vec2 } from "../math/Vec2";
7
- import { Planet } from "../scene/Planet";
8
- import { PlanetCamera } from "../camera/PlanetCamera";
9
- import { IMouseState } from "../renderer/RendererEvents";
10
- export interface IStepForward {
11
- eye: Vec3;
12
- v: Vec3;
13
- u: Vec3;
14
- n: Vec3;
15
- }
16
- interface IMouseNavigationParams extends IControlParams {
17
- minSlope?: number;
6
+ import { Vec3 } from "../math/Vec3";
7
+ interface IEarthNavigationParams extends IControlParams {
8
+ speed?: number;
9
+ fixedUp?: boolean;
18
10
  }
19
- /**
20
- * Mouse planet camera dragging control.
21
- */
22
11
  export declare class MouseNavigation extends Control {
23
- protected grabbedPoint: Vec3;
24
- protected _eye0: Vec3;
25
- protected pointOnEarth: Vec3;
26
- protected earthUp: Vec3;
27
- inertia: number;
28
- protected grabbedSpheroid: Sphere;
29
- protected qRot: Quat;
30
- protected scaleRot: number;
31
- protected distDiff: number;
32
- protected stepsCount: number;
33
- protected stepsForward: IStepForward[] | null;
34
- protected stepIndex: number;
35
- protected _lmbDoubleClickActive: boolean;
36
- minSlope: number;
12
+ speed: number;
13
+ force: Vec3;
14
+ force_h: number;
15
+ force_v: number;
16
+ vel: Vec3;
17
+ vel_h: number;
18
+ vel_v: number;
19
+ mass: number;
20
+ vel_roll: number;
21
+ force_roll: number;
22
+ protected _lookPos: Vec3 | undefined;
23
+ protected _grabbedPoint: Vec3 | null;
24
+ protected _targetZoomPoint: Vec3 | null;
25
+ protected _targetDragPoint: Vec3 | null;
26
+ protected _targetRotationPoint: Vec3 | null;
27
+ protected _grabbedSphere: Sphere;
37
28
  protected _wheelDirection: number;
38
- protected _keyLock: Key;
39
- protected _deactivate: boolean;
29
+ protected _currScreenPos: Vec2;
30
+ protected _tUp: Vec3;
31
+ protected _tRad: number;
40
32
  protected _shiftBusy: boolean;
41
- constructor(options?: IMouseNavigationParams);
42
- static getMovePointsFromPixelTerrain(cam: PlanetCamera, planet: Planet, stepsCount: number, delta: number, point: Vec2, forward: boolean, dir?: Vec3 | null): IStepForward[] | undefined;
33
+ protected fixedUp: boolean;
34
+ protected _curPitch: number;
35
+ protected _curYaw: number;
36
+ protected _curRoll: number;
37
+ protected _rot: Quat;
38
+ protected _eye0: Vec3;
39
+ protected _grabbedCameraHeight: number;
40
+ protected _newEye: Vec3;
41
+ protected _isTouchPad: boolean;
42
+ protected _velInertia: number;
43
+ protected _hold: boolean;
44
+ protected _prevVel: Vec3;
45
+ protected _screenPosIsChanged: boolean;
46
+ protected _rotHDir: number;
47
+ protected _rotVDir: number;
48
+ constructor(options?: IEarthNavigationParams);
49
+ oninit(): void;
43
50
  onactivate(): void;
44
51
  ondeactivate(): void;
45
- activateDoubleClickZoom(): void;
46
- deactivateDoubleClickZoom(): void;
47
- protected onMouseEnter(e: IMouseState): void;
48
- protected onMouseLeave(): void;
49
- protected onMouseWheel(e: IMouseState): void;
50
- oninit(): void;
51
- protected onMouseLeftButtonDoubleClick(e: IMouseState): void;
52
- protected onMouseLeftButtonClick(): void;
53
- stopRotation(): void;
54
- protected onMouseLeftButtonUp(e: IMouseState): void;
55
- protected onMouseLeftButtonDown(e: IMouseState): void;
56
- protected onMouseRightButtonClick(e: IMouseState): void;
57
- protected onMouseRightButtonDown(e: IMouseState): void;
58
- onShiftFree(): void;
59
- protected onMouseMove(e: IMouseState): void;
60
52
  protected onDraw(): void;
61
- lockPlanet(skipTerrain?: boolean): void;
62
- freePlanet(): void;
53
+ _onShiftFree: () => void;
54
+ protected _onMouseMove: (e: IMouseState) => void;
55
+ protected _onMouseEnter: (e: IMouseState) => void;
56
+ protected _onMouseLeave: () => void;
57
+ protected _onRHold: (e: IMouseState) => void;
58
+ protected _handleRotation(): void;
59
+ protected _onRDown: (e: IMouseState) => void;
60
+ protected _getTargetPoint(p: Vec2): Vec3 | null;
61
+ protected _onMouseWheel: (e: IMouseState) => void;
62
+ protected _onLDown: (e: IMouseState) => void;
63
+ protected _onLHold: (e: IMouseState) => void;
64
+ protected _onLUp: (e: IMouseState) => void;
65
+ protected _handleDrag(): void;
66
+ protected _corrRoll(): void;
67
+ protected _handleZoom(): void;
68
+ protected _updateVel(): void;
69
+ protected _updateVel_h(): void;
70
+ protected _updateVel_v(): void;
71
+ protected _updateVel_roll(): void;
72
+ protected get dt(): number;
73
+ stop(): void;
63
74
  }
64
75
  export {};
@@ -0,0 +1,64 @@
1
+ import { Control, IControlParams } from "./Control";
2
+ import { Key } from "../Lock";
3
+ import { Quat } from "../math/Quat";
4
+ import { Sphere } from "../bv/Sphere";
5
+ import { Vec3 } from "../math/Vec3";
6
+ import { Vec2 } from "../math/Vec2";
7
+ import { Planet } from "../scene/Planet";
8
+ import { PlanetCamera } from "../camera/PlanetCamera";
9
+ import { IMouseState } from "../renderer/RendererEvents";
10
+ export interface IStepForward {
11
+ eye: Vec3;
12
+ v: Vec3;
13
+ u: Vec3;
14
+ n: Vec3;
15
+ }
16
+ interface IMouseNavigationParams extends IControlParams {
17
+ minSlope?: number;
18
+ }
19
+ /**
20
+ * Mouse planet camera dragging control.
21
+ */
22
+ export declare class OldMouseNavigation extends Control {
23
+ protected grabbedPoint: Vec3;
24
+ protected _eye0: Vec3;
25
+ protected pointOnEarth: Vec3;
26
+ protected earthUp: Vec3;
27
+ inertia: number;
28
+ protected grabbedSpheroid: Sphere;
29
+ protected qRot: Quat;
30
+ protected scaleRot: number;
31
+ protected distDiff: number;
32
+ protected stepsCount: number;
33
+ protected stepsForward: IStepForward[] | null;
34
+ protected stepIndex: number;
35
+ protected _lmbDoubleClickActive: boolean;
36
+ minSlope: number;
37
+ protected _wheelDirection: number;
38
+ protected _keyLock: Key;
39
+ protected _deactivate: boolean;
40
+ protected _shiftBusy: boolean;
41
+ constructor(options?: IMouseNavigationParams);
42
+ static getMovePointsFromPixelTerrain(cam: PlanetCamera, planet: Planet, stepsCount: number, delta: number, point: Vec2, forward: boolean, dir?: Vec3 | null): IStepForward[] | undefined;
43
+ onactivate(): void;
44
+ ondeactivate(): void;
45
+ activateDoubleClickZoom(): void;
46
+ deactivateDoubleClickZoom(): void;
47
+ protected onMouseEnter(e: IMouseState): void;
48
+ protected onMouseLeave(): void;
49
+ protected onMouseWheel(e: IMouseState): void;
50
+ oninit(): void;
51
+ protected onMouseLeftButtonDoubleClick(e: IMouseState): void;
52
+ protected onMouseLeftButtonClick(): void;
53
+ stopRotation(): void;
54
+ protected onMouseLeftButtonUp(e: IMouseState): void;
55
+ protected onMouseLeftButtonDown(e: IMouseState): void;
56
+ protected onMouseRightButtonClick(e: IMouseState): void;
57
+ protected onMouseRightButtonDown(e: IMouseState): void;
58
+ onShiftFree(): void;
59
+ protected onMouseMove(e: IMouseState): void;
60
+ protected onDraw(): void;
61
+ lockPlanet(skipTerrain?: boolean): void;
62
+ freePlanet(): void;
63
+ }
64
+ export {};
@@ -3,14 +3,13 @@ export * from "./Control";
3
3
  export * from "./DebugInfo";
4
4
  export * from "./DrawingSwitcher";
5
5
  export * from "./EarthCoordinates";
6
- export * from "./EarthNavigation";
7
6
  export * from "./GeoImageDragControl";
8
7
  export * from "./KeyboardNavigation";
9
8
  export * from "./LayerAnimation";
10
9
  export * from "./LayerSwitcher";
11
10
  export * from "./Lighting";
11
+ export * from "./OldMouseNavigation";
12
12
  export * from "./MouseNavigation";
13
- export * from "./MouseWheelZoomControl";
14
13
  export * from "./RulerSwitcher";
15
14
  export * from "./ScaleControl";
16
15
  export * from "./ShowFps";
@@ -37,7 +37,8 @@ import { Quat } from "../math/Quat";
37
37
  * @property {number} [yaw] - Rotation around local Y-axis.
38
38
  * @property {number} [roll] - Rotation around local Z-axis.
39
39
  * @property {number | Vec3 | NumberArray3} [scale] - Scaling factor.
40
- * @property {boolean} [forceGlobalPosition] - Forces global position for children entities make them the same position as the parent.
40
+ * @property {boolean} [forceGlobalPosition] - Forces global position for entity make the same position as its parent.
41
+ * @property {boolean} [forceGlobalRotation] - Forces global rotation for the entity make the same rotation as its parent.
41
42
  */
42
43
  export interface IEntityParams {
43
44
  name?: string;
@@ -61,6 +62,8 @@ export interface IEntityParams {
61
62
  roll?: number;
62
63
  scale?: number | Vec3 | NumberArray3;
63
64
  forceGlobalPosition?: boolean;
65
+ forceGlobalRotation?: boolean;
66
+ forceGlobalScale?: boolean;
64
67
  localPosition?: Vec3 | NumberArray3;
65
68
  }
66
69
  /**
@@ -85,11 +88,13 @@ export interface IEntityParams {
85
88
  * @param {Strip | IStripParams} [options.strip] - Strip object or parameters.
86
89
  * @param {boolean} [options.independentPicking] - Independent picking flag.
87
90
  * @param {boolean} [options.relativePosition] - Parent relative position flag, otherwise position is absolute.
88
- * @param {number} [options.pitch] - Rotation around local X-axis.
89
- * @param {number} [options.yaw] - Rotation around local Y-axis.
90
- * @param {number} [options.roll] - Rotation around local Z-axis.
91
+ * @param {number} [options.pitch] - Rotation around local X-axis in radians.
92
+ * @param {number} [options.yaw] - Rotation around local Y-axis in radians.
93
+ * @param {number} [options.roll] - Rotation around local Z-axis in radians.
91
94
  * @param {number | Vec3 | NumberArray3} [options.scale] - Scaling factor.
92
- * @param {boolean} [options.forceGlobalPosition] - Forces global position for children entities make them the same position as the parent.
95
+ * @param {boolean} [options.forceGlobalPosition] - Forces global position for the entity make the same position as its parent.
96
+ * @param {boolean} [options.forceGlobalRotation] - Forces global rotation for the entity make the same rotation as its parent.
97
+ * @param {boolean} [options.forceGlobalScale] - Forces global scale for the entity make the same scale as its parent.
93
98
  */
94
99
  declare class Entity {
95
100
  static __counter__: number;
@@ -112,6 +117,8 @@ declare class Entity {
112
117
  */
113
118
  childEntities: Entity[];
114
119
  forceGlobalPosition: boolean;
120
+ forceGlobalRotation: boolean;
121
+ forceGlobalScale: boolean;
115
122
  /**
116
123
  * Parent entity.
117
124
  * @public
@@ -238,9 +245,6 @@ declare class Entity {
238
245
  strip: Strip | null;
239
246
  _nodePtr?: EntityCollectionNode;
240
247
  protected _relativePosition: boolean;
241
- protected _pitch: number;
242
- protected _yaw: number;
243
- protected _roll: number;
244
248
  protected _pitchRad: number;
245
249
  protected _yawRad: number;
246
250
  protected _rollRad: number;
@@ -386,72 +390,72 @@ declare class Entity {
386
390
  setRotation(rot: Quat): void;
387
391
  /**
388
392
  * Sets the pitch rotation of the entity.
389
- * @param {number} val - The new pitch angle in degrees.
393
+ * @param {number} val - The new pitch angle in radians.
390
394
  */
391
395
  setPitch(val: number): void;
392
396
  /**
393
397
  * Sets the yaw rotation of the entity.
394
- * @param {number} val - The new yaw angle in degrees.
398
+ * @param {number} val - The new yaw angle in radians.
395
399
  */
396
400
  setYaw(val: number): void;
397
401
  /**
398
402
  * Sets the roll rotation of the entity.
399
403
  * @public
400
- * @param {number} val - The new roll angle in degrees.
404
+ * @param {number} val - The new roll angle in radians.
401
405
  */
402
406
  setRoll(val: number): void;
403
407
  /**
404
408
  * Gets the pitch angle of the entity.
405
409
  * @public
406
- * @returns {number} The pitch angle in degrees.
410
+ * @returns {number} The pitch angle in radians.
407
411
  */
408
412
  getPitch(): number;
409
413
  /**
410
414
  * Gets the yaw angle of the entity.
411
415
  * @public
412
- * @returns {number} The yaw angle in degrees.
416
+ * @returns {number} The yaw angle in radians.
413
417
  */
414
418
  getYaw(): number;
415
419
  /**
416
420
  * Gets the roll angle of the entity.
417
421
  * @public
418
- * @returns {number} The roll angle in degrees.
422
+ * @returns {number} The roll angle in radians.
419
423
  */
420
424
  getRoll(): number;
421
425
  /**
422
426
  * Sets the absolute pitch of the entity.
423
427
  * @public
424
- * @param {number} val - The absolute pitch angle in degrees.
428
+ * @param {number} val - The absolute pitch angle in radians.
425
429
  */
426
430
  setAbsolutePitch(val: number): void;
427
431
  /**
428
432
  * Sets the absolute yaw of the entity.
429
433
  * @public
430
- * @param {number} val - The absolute yaw angle in degrees.
434
+ * @param {number} val - The absolute yaw angle in radians.
431
435
  */
432
436
  setAbsoluteYaw(val: number): void;
433
437
  /**
434
438
  * Sets the absolute roll of the entity.
435
439
  * @public
436
- * @param {number} val - The absolute roll angle in degrees.
440
+ * @param {number} val - The absolute roll angle in radians.
437
441
  */
438
442
  setAbsoluteRoll(val: number): void;
439
443
  /**
440
444
  * Gets the absolute pitch angle of the entity.
441
445
  * @public
442
- * @returns {number} The absolute pitch angle in degrees.
446
+ * @returns {number} The absolute pitch angle in radians.
443
447
  */
444
448
  getAbsolutePitch(): number;
445
449
  /**
446
450
  * Gets the absolute yaw angle of the entity.
447
451
  * @public
448
- * @returns {number} The absolute yaw angle in degrees.
452
+ * @returns {number} The absolute yaw angle in radians.
449
453
  */
450
454
  getAbsoluteYaw(): number;
451
455
  /**
452
456
  * Gets the absolute roll angle of the entity.
453
457
  * @public
454
- * @returns {number} The absolute roll angle in degrees.
458
+ * @returns {number} The absolute roll angle in radians.
455
459
  */
456
460
  getAbsoluteRoll(): number;
457
461
  protected _getScaleByDistance(): number;
@@ -13,9 +13,6 @@ export declare const LOCAL_FORWARD: Vec3;
13
13
  * @property {string} [objSrc] - Source url of the 3D object.
14
14
  * @property {string} [tag] - Unique instancing drawing identifier tag.
15
15
  * @property {Vec3 | NumberArray3} [position] - Position in Cartesian coordinates.
16
- * @property {number} [pitch] - Rotation around X-axis in degrees.
17
- * @property {number} [yaw] - Rotation around Y-axis in degrees.
18
- * @property {number} [roll] - Rotation around Z-axis in degrees.
19
16
  * @property {number | Vec3 | NumberArray3} [scale] - Scale of the object.
20
17
  * @property {Vec3 | NumberArray3} [translate] - Translation offset.
21
18
  * @property {Vec4 | NumberArray4 | string} [color] - RGBA color or HTML color string.
@@ -26,9 +23,6 @@ export interface IGeoObjectParams {
26
23
  objSrc?: string;
27
24
  tag?: string;
28
25
  position?: Vec3 | NumberArray3;
29
- pitch?: number;
30
- yaw?: number;
31
- roll?: number;
32
26
  scale?: number | Vec3 | NumberArray3;
33
27
  translate?: Vec3 | NumberArray3;
34
28
  color?: Vec4 | NumberArray4 | string;
@@ -42,9 +36,6 @@ export interface IGeoObjectParams {
42
36
  * @param {string} [options.objSrc] - Source url of the 3D object.
43
37
  * @param {string} [options.tag] - Unique instancing drawing identifier tag.
44
38
  * @param {Vec3 | NumberArray3} [options.position] - Position in Cartesian coordinates.
45
- * @param {number} [options.pitch=0] - Rotation around X-axis in degrees.
46
- * @param {number} [options.yaw=0] - Rotation around Y-axis in degrees.
47
- * @param {number} [options.roll=0] - Rotation around Z-axis in degrees.
48
39
  * @param {number | Vec3 | NumberArray3} [options.scale=1] - Scale of the object.
49
40
  * @param {Vec3 | NumberArray3} [options.translate] - Translation offset.
50
41
  * @param {Vec4 | NumberArray4 | string} [options.color] - RGBA color or HTML color string.
@@ -1,6 +1,7 @@
1
1
  export type MouseEventExt = MouseEvent & {
2
2
  wheelDelta?: number;
3
3
  deltaY?: number;
4
+ isTouchPad?: boolean;
4
5
  };
5
6
  export interface MouseHandlerEvent {
6
7
  button?: number;
@@ -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;
@@ -298,6 +298,7 @@ export declare class Quat {
298
298
  * Returns quaternion and vector production.
299
299
  * @public
300
300
  * @param {Vec3} v - 3d Vector.
301
+ * @param {Vec3} res - result output vector.
301
302
  * @returns {Vec3} -
302
303
  */
303
304
  mulVec3Res(v: Vec3, res: Vec3): Vec3;
@@ -45,7 +45,7 @@ export declare class Ray {
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
@@ -73,10 +69,4 @@ export declare class Ray {
73
69
  */
74
70
  hitSphere(sphere: Sphere): Vec3 | null;
75
71
  hitBox(box: Box): void;
76
- /**
77
- * Finds the intersection of the ray with a plane.
78
- * @param {Plane} plane - The plane to intersect with.
79
- * @returns {Vec3 | null} The intersection point or null if no intersection.
80
- */
81
- hitPlane2(plane: Plane, res: Vec3): number;
82
72
  }