@openglobus/og 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/camera/Camera.d.ts +14 -5
- package/lib/camera/Frustum.d.ts +3 -2
- package/lib/control/SimpleNavigation.d.ts +12 -3
- package/lib/math/Mat4.d.ts +1 -1
- package/lib/math/Vec3.d.ts +2 -0
- package/lib/og.es.js +1 -1
- package/lib/og.es.js.map +1 -1
- package/lib/renderer/Renderer.d.ts +3 -1
- package/lib/renderer/RendererEvents.d.ts +1 -0
- package/package.json +1 -1
package/lib/camera/Camera.d.ts
CHANGED
|
@@ -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}
|
|
232
|
+
* @param {number} viewAngle - Camera view angle
|
|
225
233
|
* @param {number} aspect - Screen aspect ratio
|
|
226
234
|
*/
|
|
227
|
-
protected _setProj(
|
|
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 -
|
|
360
|
-
* @param {Vec3} r -
|
|
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;
|
package/lib/camera/Frustum.d.ts
CHANGED
|
@@ -88,12 +88,13 @@ declare class Frustum {
|
|
|
88
88
|
/**
|
|
89
89
|
* Sets up camera projection matrix.
|
|
90
90
|
* @public
|
|
91
|
-
* @param {number}
|
|
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(
|
|
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,7 +1,9 @@
|
|
|
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";
|
|
6
|
+
import { Camera } from "../camera/Camera";
|
|
5
7
|
interface ISimpleNavigationParams extends IControlParams {
|
|
6
8
|
speed?: number;
|
|
7
9
|
}
|
|
@@ -16,14 +18,19 @@ export declare class SimpleNavigation extends Control {
|
|
|
16
18
|
protected _lookPos: Vec3 | undefined;
|
|
17
19
|
protected _up: Vec3 | null;
|
|
18
20
|
protected _grabbedPoint: Vec3 | undefined;
|
|
21
|
+
protected _grabbedScreenPoint: Vec2;
|
|
19
22
|
protected _eye0: Vec3;
|
|
23
|
+
protected _wheelPos: Vec3;
|
|
24
|
+
protected _savedFocusDistance: number;
|
|
25
|
+
protected _savedEye: Vec3;
|
|
20
26
|
constructor(options?: ISimpleNavigationParams);
|
|
21
27
|
oninit(): void;
|
|
22
28
|
onactivate(): void;
|
|
23
29
|
ondeactivate(): void;
|
|
24
|
-
protected
|
|
25
|
-
protected _onMouseLeftButtonUp: (e: IMouseState) => void;
|
|
30
|
+
protected _onProjChanged: (cam: Camera) => void;
|
|
26
31
|
protected _onMouseLeftButtonDown: (e: IMouseState) => void;
|
|
32
|
+
protected _onMouseLeftButtonUp: (e: IMouseState) => void;
|
|
33
|
+
protected _onMouseLeftButtonHold: (e: IMouseState) => void;
|
|
27
34
|
protected _onRHold: (e: IMouseState) => void;
|
|
28
35
|
protected _onRDown: (e: IMouseState) => void;
|
|
29
36
|
protected _onMouseWheel: (e: IMouseState) => void;
|
|
@@ -37,7 +44,9 @@ export declare class SimpleNavigation extends Control {
|
|
|
37
44
|
protected onCameraTurnRight: () => void;
|
|
38
45
|
protected onCameraRollLeft: () => void;
|
|
39
46
|
protected onCameraRollRight: () => void;
|
|
40
|
-
protected
|
|
47
|
+
protected _handleMouseWheel(): void;
|
|
41
48
|
protected onDraw(): void;
|
|
49
|
+
protected get dt(): number;
|
|
50
|
+
protected _updateVel(): void;
|
|
42
51
|
}
|
|
43
52
|
export {};
|
package/lib/math/Mat4.d.ts
CHANGED
|
@@ -189,7 +189,7 @@ export declare class Mat4 {
|
|
|
189
189
|
* @param {number} far -
|
|
190
190
|
* @return {Mat4} -
|
|
191
191
|
*/
|
|
192
|
-
|
|
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
|
package/lib/math/Vec3.d.ts
CHANGED
|
@@ -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
|