@openglobus/og 0.27.0 → 0.27.2

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.
@@ -21,6 +21,8 @@ export interface ICameraParams {
21
21
  frustums?: NumberArray2[];
22
22
  width?: number;
23
23
  height?: number;
24
+ isOrthographic?: boolean;
25
+ focusDistance?: number;
24
26
  }
25
27
  export interface IFlyCartesianParams extends IFlyBaseParams {
26
28
  look?: Vec3 | LonLat;
@@ -71,6 +73,8 @@ declare class Camera {
71
73
  * @type {Events}
72
74
  */
73
75
  events: EventsHandler<CameraEvents>;
76
+ protected _isOrthographic: boolean;
77
+ protected _focusDistance: number;
74
78
  /**
75
79
  * Camera position.
76
80
  * @public
@@ -154,6 +158,10 @@ declare class Camera {
154
158
  protected _frameCallback: Function | null;
155
159
  protected _flying: boolean;
156
160
  constructor(options?: ICameraParams);
161
+ get isOrthographic(): boolean;
162
+ set isOrthographic(isOrthographic: boolean);
163
+ get focusDistance(): number;
164
+ set focusDistance(dist: number);
157
165
  get id(): number;
158
166
  /**
159
167
  * Flies to the cartesian coordinates.
@@ -221,10 +229,10 @@ declare class Camera {
221
229
  /**
222
230
  * Sets up camera projection
223
231
  * @public
224
- * @param {number} angle - Camera view angle
232
+ * @param {number} viewAngle - Camera view angle
225
233
  * @param {number} aspect - Screen aspect ratio
226
234
  */
227
- protected _setProj(angle: number, aspect: number): void;
235
+ protected _setProj(viewAngle: number, aspect: number): void;
228
236
  protected _updateViewportParameters(): void;
229
237
  /**
230
238
  * Sets camera view angle in degrees
@@ -310,7 +318,7 @@ declare class Camera {
310
318
  * @param {number} y - Screen Y coordinate
311
319
  * @returns {Vec3} - Direction vector
312
320
  */
313
- unproject(x: number, y: number): Vec3;
321
+ unproject(x: number, y: number, dist?: number, outPos?: Vec3): Vec3;
314
322
  /**
315
323
  * Gets projected 3d point to the 2d screen coordinates
316
324
  * @public
@@ -355,9 +363,10 @@ declare class Camera {
355
363
  rotateVertical(angle: number, center?: Vec3): void;
356
364
  /**
357
365
  * Gets 3d size factor. Uses in LOD distance calculation.
366
+ * It is very important function used in Node.ts
358
367
  * @public
359
- * @param {Vec3} p - Far point.
360
- * @param {Vec3} r - Far point.
368
+ * @param {Vec3} p - Point in 3d.
369
+ * @param {Vec3} r - size.
361
370
  * @returns {number} - Size factor.
362
371
  */
363
372
  projectedSize(p: Vec3, r: number): number;
@@ -88,12 +88,13 @@ declare class Frustum {
88
88
  /**
89
89
  * Sets up camera projection matrix.
90
90
  * @public
91
- * @param {number} angle - Camera's vertical fov view angle.
91
+ * @param {number} viewAngle - Camera's vertical fov view angle.
92
92
  * @param {number} aspect - Screen aspect ratio.
93
93
  * @param {number} near - Near camera distance.
94
94
  * @param {number} far - Far camera distance.
95
95
  */
96
- setProjectionMatrix(angle: number, aspect: number, near: number, far: number): void;
96
+ setProjectionMatrix(viewAngle: number, aspect: number, near: number, far: number, isOrthographic?: boolean, focusDistance?: number): void;
97
+ protected _setFrustumParams(top: number, right: number, near: number, far: number): void;
97
98
  setProjectionViewRTEMatrix(viewRTEMatrix: Mat4): void;
98
99
  /**
99
100
  * Camera's projection matrix values.
@@ -1,6 +1,7 @@
1
1
  import { Control } from "./Control";
2
2
  import type { IControlParams } from "./Control";
3
3
  import type { IMouseState } from "../renderer/RendererEvents";
4
+ import { Vec2 } from "../math/Vec2";
4
5
  import { Vec3 } from "../math/Vec3";
5
6
  interface ISimpleNavigationParams extends IControlParams {
6
7
  speed?: number;
@@ -16,14 +17,16 @@ export declare class SimpleNavigation extends Control {
16
17
  protected _lookPos: Vec3 | undefined;
17
18
  protected _up: Vec3 | null;
18
19
  protected _grabbedPoint: Vec3 | undefined;
20
+ protected _grabbedScreenPoint: Vec2;
19
21
  protected _eye0: Vec3;
22
+ protected _wheelPos: Vec3;
20
23
  constructor(options?: ISimpleNavigationParams);
21
24
  oninit(): void;
22
25
  onactivate(): void;
23
26
  ondeactivate(): void;
24
- protected _onMouseLeftButtonClick: (e: IMouseState) => void;
25
- protected _onMouseLeftButtonUp: (e: IMouseState) => void;
26
27
  protected _onMouseLeftButtonDown: (e: IMouseState) => void;
28
+ protected _onMouseLeftButtonUp: (e: IMouseState) => void;
29
+ protected _onMouseLeftButtonHold: (e: IMouseState) => void;
27
30
  protected _onRHold: (e: IMouseState) => void;
28
31
  protected _onRDown: (e: IMouseState) => void;
29
32
  protected _onMouseWheel: (e: IMouseState) => void;
@@ -37,7 +40,9 @@ export declare class SimpleNavigation extends Control {
37
40
  protected onCameraTurnRight: () => void;
38
41
  protected onCameraRollLeft: () => void;
39
42
  protected onCameraRollRight: () => void;
40
- protected get dt(): number;
43
+ protected _handleMouseWheel(): void;
41
44
  protected onDraw(): void;
45
+ protected get dt(): number;
46
+ protected _updateVel(): void;
42
47
  }
43
48
  export {};
@@ -189,7 +189,7 @@ export declare class Mat4 {
189
189
  * @param {number} far -
190
190
  * @return {Mat4} -
191
191
  */
192
- setOrtho(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4;
192
+ setOrthographic(left: number, right: number, bottom: number, top: number, near: number, far: number): Mat4;
193
193
  /**
194
194
  * Sets current rotation matrix by euler's angles.
195
195
  * @public
@@ -156,6 +156,8 @@ export declare class Vec3 {
156
156
  * @returns {Vec3} -
157
157
  */
158
158
  static orthoNormalize(normal: Vec3, tangent: Vec3): Vec3;
159
+ static isOrthogonal(a: Vec3, b: Vec3, epsilon?: number): boolean;
160
+ isOrthogonal(b: Vec3, epsilon?: number): boolean;
159
161
  /**
160
162
  * Returns vector components division product one to another.
161
163
  * @static