@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.
- package/css/og.css +137 -1
- package/lib/@openglobus/js/Globe.d.ts +0 -1
- package/lib/@openglobus/js/Object3d.d.ts +20 -10
- package/lib/@openglobus/js/camera/Camera.d.ts +57 -15
- package/lib/@openglobus/js/camera/Frustum.d.ts +3 -0
- package/lib/@openglobus/js/camera/PlanetCamera.d.ts +13 -0
- package/lib/@openglobus/js/control/CameraLock.d.ts +38 -0
- package/lib/@openglobus/js/control/MouseNavigation.d.ts +62 -51
- package/lib/@openglobus/js/control/OldMouseNavigation.d.ts +64 -0
- package/lib/@openglobus/js/control/SimpleNavigation.d.ts +27 -10
- package/lib/@openglobus/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
- package/lib/@openglobus/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
- package/lib/@openglobus/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
- package/lib/@openglobus/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
- package/lib/@openglobus/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
- package/lib/@openglobus/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
- package/lib/@openglobus/js/control/geoObjectEditor/colors.d.ts +8 -0
- package/lib/@openglobus/js/control/index.d.ts +3 -2
- package/lib/@openglobus/js/entity/Entity.d.ts +282 -19
- package/lib/@openglobus/js/entity/EntityCollection.d.ts +8 -9
- package/lib/@openglobus/js/entity/GeoObject.d.ts +135 -39
- package/lib/@openglobus/js/entity/GeoObjectHandler.d.ts +39 -63
- package/lib/@openglobus/js/entity/InstanceData.d.ts +76 -0
- package/lib/@openglobus/js/entity/Polyline.d.ts +19 -6
- package/lib/@openglobus/js/entity/PolylineHandler.d.ts +7 -0
- package/lib/@openglobus/js/index.d.ts +2 -1
- package/lib/@openglobus/js/input/MouseHandler.d.ts +1 -0
- package/lib/@openglobus/js/layer/Vector.d.ts +4 -0
- package/lib/@openglobus/js/light/LightSource.d.ts +1 -139
- package/lib/@openglobus/js/math/Mat3.d.ts +1 -1
- package/lib/@openglobus/js/math/Mat4.d.ts +10 -1
- package/lib/@openglobus/js/math/Plane.d.ts +3 -1
- package/lib/@openglobus/js/math/Quat.d.ts +47 -33
- package/lib/@openglobus/js/math/Ray.d.ts +10 -14
- package/lib/@openglobus/js/math/Vec2.d.ts +22 -0
- package/lib/@openglobus/js/math/Vec3.d.ts +15 -0
- package/lib/@openglobus/js/math.d.ts +2 -2
- package/lib/@openglobus/js/quadTree/EntityCollectionNode.d.ts +2 -2
- package/lib/@openglobus/js/quadTree/Node.d.ts +1 -1
- package/lib/@openglobus/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/@openglobus/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/@openglobus/js/renderer/Renderer.d.ts +63 -44
- package/lib/@openglobus/js/renderer/RendererEvents.d.ts +2 -0
- package/lib/@openglobus/js/scene/Planet.d.ts +15 -7
- package/lib/@openglobus/js/scene/RenderNode.d.ts +10 -25
- package/lib/@openglobus/js/shaders/drawnode.d.ts +1 -0
- package/lib/@openglobus/js/shaders/geoObject.d.ts +1 -0
- package/lib/@openglobus/js/shaders/utils.d.ts +1 -1
- package/lib/@openglobus/js/ui/Checkbox.d.ts +31 -0
- package/lib/@openglobus/js/ui/Dialog.d.ts +3 -0
- package/lib/@openglobus/js/ui/Input.d.ts +32 -0
- package/lib/@openglobus/js/ui/View.d.ts +3 -1
- package/lib/@openglobus/js/utils/objParser.d.ts +44 -12
- package/lib/@openglobus/js/utils/shared.d.ts +22 -0
- package/lib/@openglobus/js/webgl/BaseFramebuffer.d.ts +0 -1
- package/lib/@openglobus/js/webgl/Framebuffer.d.ts +35 -8
- package/lib/@openglobus/js/webgl/Handler.d.ts +22 -12
- package/lib/@openglobus/og.css +1 -1
- package/lib/@openglobus/og.esm.js +1 -1
- package/lib/@openglobus/og.esm.js.map +1 -1
- package/lib/@openglobus/og.umd.js +1 -1
- package/lib/@openglobus/og.umd.js.map +1 -1
- package/lib/js/Globe.d.ts +0 -1
- package/lib/js/Globe.js +4 -2
- package/lib/js/Object3d.d.ts +20 -10
- package/lib/js/Object3d.js +124 -48
- package/lib/js/Popup.js +1 -1
- package/lib/js/camera/Camera.d.ts +57 -15
- package/lib/js/camera/Camera.js +109 -29
- package/lib/js/camera/Frustum.d.ts +3 -0
- package/lib/js/camera/Frustum.js +7 -0
- package/lib/js/camera/PlanetCamera.d.ts +13 -0
- package/lib/js/camera/PlanetCamera.js +52 -5
- package/lib/js/control/Atmosphere.js +10 -6
- package/lib/js/control/CameraLock.d.ts +38 -0
- package/lib/js/control/CameraLock.js +216 -0
- package/lib/js/control/Control.js +1 -1
- package/lib/js/control/DebugInfo.js +38 -8
- package/lib/js/control/KeyboardNavigation.js +9 -9
- package/lib/js/control/MouseNavigation.d.ts +62 -51
- package/lib/js/control/MouseNavigation.js +361 -305
- package/lib/js/control/MouseWheelZoomControl.d.ts +0 -44
- package/lib/js/control/MouseWheelZoomControl.js +270 -181
- package/lib/js/control/OldMouseNavigation.d.ts +64 -0
- package/lib/js/control/OldMouseNavigation.js +368 -0
- package/lib/js/control/ScaleControl.js +11 -5
- package/lib/js/control/SimpleNavigation.d.ts +27 -10
- package/lib/js/control/SimpleNavigation.js +149 -49
- package/lib/js/control/Sun.js +6 -6
- package/lib/js/control/TouchNavigation.js +11 -8
- package/lib/js/control/elevationProfile/ElevationProfileScene.js +6 -5
- package/lib/js/control/geoObjectEditor/ArrowEntity.d.ts +15 -0
- package/lib/js/control/geoObjectEditor/ArrowEntity.js +59 -0
- package/lib/js/control/geoObjectEditor/AxisTrackEntity.d.ts +9 -0
- package/lib/js/control/geoObjectEditor/AxisTrackEntity.js +93 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditor.d.ts +13 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditor.js +30 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.d.ts +69 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditorDialog.js +488 -0
- package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.d.ts +78 -9
- package/lib/js/control/geoObjectEditor/GeoObjectEditorScene.js +487 -43
- package/lib/js/control/geoObjectEditor/MoveAxisEntity.d.ts +17 -0
- package/lib/js/control/geoObjectEditor/MoveAxisEntity.js +107 -0
- package/lib/js/control/geoObjectEditor/MovePlaneEntity.d.ts +7 -0
- package/lib/js/control/geoObjectEditor/MovePlaneEntity.js +31 -0
- package/lib/js/control/geoObjectEditor/RotateEntity.d.ts +9 -0
- package/lib/js/control/geoObjectEditor/RotateEntity.js +105 -0
- package/lib/js/control/geoObjectEditor/colors.d.ts +8 -0
- package/lib/js/control/geoObjectEditor/colors.js +8 -0
- package/lib/js/control/index.d.ts +3 -2
- package/lib/js/control/index.js +3 -2
- package/lib/js/control/timeline/TimelineControl.js +2 -0
- package/lib/js/control/visibleExtent/Segment.js +4 -4
- package/lib/js/entity/Entity.d.ts +282 -19
- package/lib/js/entity/Entity.js +497 -62
- package/lib/js/entity/EntityCollection.d.ts +8 -9
- package/lib/js/entity/EntityCollection.js +48 -45
- package/lib/js/entity/GeoObject.d.ts +135 -39
- package/lib/js/entity/GeoObject.js +150 -90
- package/lib/js/entity/GeoObjectHandler.d.ts +39 -63
- package/lib/js/entity/GeoObjectHandler.js +198 -295
- package/lib/js/entity/InstanceData.d.ts +76 -0
- package/lib/js/entity/InstanceData.js +347 -0
- package/lib/js/entity/Polyline.d.ts +19 -6
- package/lib/js/entity/Polyline.js +76 -36
- package/lib/js/entity/PolylineHandler.d.ts +7 -0
- package/lib/js/entity/PolylineHandler.js +26 -1
- package/lib/js/index.d.ts +2 -1
- package/lib/js/index.js +2 -1
- package/lib/js/input/MouseHandler.d.ts +1 -0
- package/lib/js/input/MouseHandler.js +12 -1
- package/lib/js/layer/Bing.js +2 -2
- package/lib/js/layer/Vector.d.ts +4 -0
- package/lib/js/layer/Vector.js +16 -0
- package/lib/js/light/LightSource.d.ts +1 -139
- package/lib/js/light/LightSource.js +21 -227
- package/lib/js/math/Mat3.d.ts +1 -1
- package/lib/js/math/Mat3.js +1 -1
- package/lib/js/math/Mat4.d.ts +10 -1
- package/lib/js/math/Mat4.js +17 -1
- package/lib/js/math/Plane.d.ts +3 -1
- package/lib/js/math/Plane.js +11 -1
- package/lib/js/math/Quat.d.ts +47 -33
- package/lib/js/math/Quat.js +92 -90
- package/lib/js/math/Ray.d.ts +10 -14
- package/lib/js/math/Ray.js +56 -33
- package/lib/js/math/Vec2.d.ts +22 -0
- package/lib/js/math/Vec2.js +32 -0
- package/lib/js/math/Vec3.d.ts +15 -0
- package/lib/js/math/Vec3.js +30 -1
- package/lib/js/math.d.ts +2 -2
- package/lib/js/math.js +3 -3
- package/lib/js/quadTree/EntityCollectionNode.d.ts +2 -2
- package/lib/js/quadTree/EntityCollectionNode.js +8 -8
- package/lib/js/quadTree/Node.d.ts +1 -1
- package/lib/js/quadTree/Node.js +2 -2
- package/lib/js/quadTree/QuadTreeStrategy.js +1 -1
- package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/js/quadTree/earth/EarthEntityCollectionNodeLonLat.js +2 -2
- package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.d.ts +1 -1
- package/lib/js/quadTree/equi/EquiEntityCollectionNodeLonLat.js +2 -2
- package/lib/js/renderer/Renderer.d.ts +63 -44
- package/lib/js/renderer/Renderer.js +267 -266
- package/lib/js/renderer/RendererEvents.d.ts +2 -0
- package/lib/js/renderer/RendererEvents.js +5 -2
- package/lib/js/scene/Planet.d.ts +15 -7
- package/lib/js/scene/Planet.js +133 -90
- package/lib/js/scene/RenderNode.d.ts +10 -25
- package/lib/js/scene/RenderNode.js +70 -58
- package/lib/js/segment/Segment.js +4 -4
- package/lib/js/shaders/depth.js +2 -5
- package/lib/js/shaders/drawnode.d.ts +1 -0
- package/lib/js/shaders/drawnode.js +51 -52
- package/lib/js/shaders/geoObject.d.ts +1 -0
- package/lib/js/shaders/geoObject.js +154 -91
- package/lib/js/shaders/polyline.js +68 -51
- package/lib/js/shaders/utils.d.ts +1 -1
- package/lib/js/shaders/utils.js +11 -0
- package/lib/js/terrain/GlobusTerrain.js +2 -2
- package/lib/js/ui/Checkbox.d.ts +31 -0
- package/lib/js/ui/Checkbox.js +110 -0
- package/lib/js/ui/Color.js +2 -1
- package/lib/js/ui/Dialog.d.ts +3 -0
- package/lib/js/ui/Dialog.js +20 -0
- package/lib/js/ui/Input.d.ts +32 -0
- package/lib/js/ui/Input.js +107 -0
- package/lib/js/ui/View.d.ts +3 -1
- package/lib/js/ui/View.js +6 -0
- package/lib/js/utils/objParser.d.ts +44 -12
- package/lib/js/utils/objParser.js +241 -149
- package/lib/js/utils/shared.d.ts +22 -0
- package/lib/js/utils/shared.js +34 -0
- package/lib/js/webgl/BaseFramebuffer.d.ts +0 -1
- package/lib/js/webgl/Framebuffer.d.ts +35 -8
- package/lib/js/webgl/Framebuffer.js +136 -29
- package/lib/js/webgl/Handler.d.ts +22 -12
- package/lib/js/webgl/Handler.js +53 -34
- package/lib/js/webgl/Program.js +0 -8
- package/package.json +5 -3
- package/lib/@openglobus/js/control/EarthNavigation.d.ts +0 -50
- package/lib/@openglobus/js/control/MouseWheelZoomControl.d.ts +0 -44
- package/lib/js/control/EarthNavigation.d.ts +0 -50
- package/lib/js/control/EarthNavigation.js +0 -202
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Entity } from "../../entity/Entity";
|
|
2
|
+
import { Vec3 } from "../../math/Vec3";
|
|
3
|
+
import { SEL_X_COLOR, SEL_Y_COLOR, SEL_Z_COLOR, X_COLOR, Y_COLOR, Z_COLOR } from "./colors";
|
|
4
|
+
import { ArrowEntity } from "./ArrowEntity";
|
|
5
|
+
import { RADIANS } from "../../math";
|
|
6
|
+
export class MoveAxisEntity extends Entity {
|
|
7
|
+
constructor(params = {}) {
|
|
8
|
+
super(params);
|
|
9
|
+
this._size = params.size != undefined ? params.size : 1.0;
|
|
10
|
+
this.childEntities = [];
|
|
11
|
+
this._init();
|
|
12
|
+
}
|
|
13
|
+
_init() {
|
|
14
|
+
let arrowX = new ArrowEntity({
|
|
15
|
+
color: X_COLOR,
|
|
16
|
+
yaw: 0,
|
|
17
|
+
pitch: 0,
|
|
18
|
+
roll: 90 * RADIANS,
|
|
19
|
+
properties: {
|
|
20
|
+
opName: "move_x",
|
|
21
|
+
noEdit: true,
|
|
22
|
+
style: {
|
|
23
|
+
color: X_COLOR,
|
|
24
|
+
selectColor: SEL_X_COLOR
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
let arrowY = new ArrowEntity({
|
|
29
|
+
color: Y_COLOR,
|
|
30
|
+
yaw: 0,
|
|
31
|
+
pitch: 0,
|
|
32
|
+
roll: 0,
|
|
33
|
+
properties: {
|
|
34
|
+
opName: "move_y",
|
|
35
|
+
noEdit: true,
|
|
36
|
+
style: {
|
|
37
|
+
color: Y_COLOR,
|
|
38
|
+
selectColor: SEL_Y_COLOR
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
let arrowZ = new ArrowEntity({
|
|
43
|
+
color: Z_COLOR,
|
|
44
|
+
yaw: 0,
|
|
45
|
+
pitch: 90 * RADIANS,
|
|
46
|
+
roll: 0,
|
|
47
|
+
properties: {
|
|
48
|
+
opName: "move_z",
|
|
49
|
+
noEdit: true,
|
|
50
|
+
style: {
|
|
51
|
+
color: Z_COLOR,
|
|
52
|
+
selectColor: SEL_Z_COLOR
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
this.appendChild(arrowX);
|
|
57
|
+
this.appendChild(arrowY);
|
|
58
|
+
this.appendChild(arrowZ);
|
|
59
|
+
this.setSize(this._size);
|
|
60
|
+
}
|
|
61
|
+
setSize(size) {
|
|
62
|
+
this.childEntities[0].setSize(size);
|
|
63
|
+
this.childEntities[1].setSize(size);
|
|
64
|
+
this.childEntities[2].setSize(size);
|
|
65
|
+
}
|
|
66
|
+
setPitch(a) {
|
|
67
|
+
let line = this.childEntities[0];
|
|
68
|
+
let tip = line.childEntities[0];
|
|
69
|
+
line.setPitch(a);
|
|
70
|
+
tip.setPitch(a);
|
|
71
|
+
line = this.childEntities[1];
|
|
72
|
+
tip = line.childEntities[0];
|
|
73
|
+
line.setPitch(a);
|
|
74
|
+
tip.setPitch(a);
|
|
75
|
+
line = this.childEntities[2];
|
|
76
|
+
tip = line.childEntities[0];
|
|
77
|
+
line.setPitch(a + 90);
|
|
78
|
+
tip.setPitch(a + 90);
|
|
79
|
+
}
|
|
80
|
+
setYaw(a) {
|
|
81
|
+
let line = this.childEntities[0];
|
|
82
|
+
let tip = line.childEntities[0];
|
|
83
|
+
line.setYaw(a);
|
|
84
|
+
tip.setYaw(a);
|
|
85
|
+
line = this.childEntities[1];
|
|
86
|
+
tip = line.childEntities[0];
|
|
87
|
+
line.setYaw(a);
|
|
88
|
+
tip.setYaw(a);
|
|
89
|
+
line = this.childEntities[2];
|
|
90
|
+
tip = line.childEntities[0];
|
|
91
|
+
line.setYaw(a);
|
|
92
|
+
tip.setYaw(a);
|
|
93
|
+
}
|
|
94
|
+
setRoll(a) {
|
|
95
|
+
let line = this.childEntities[0];
|
|
96
|
+
let tip = line.childEntities[0];
|
|
97
|
+
line.setRoll(a + 90);
|
|
98
|
+
tip.setRoll(a + 90);
|
|
99
|
+
line = this.childEntities[1];
|
|
100
|
+
tip = line.childEntities[0];
|
|
101
|
+
line.setRoll(a);
|
|
102
|
+
tip.setRoll(a);
|
|
103
|
+
}
|
|
104
|
+
getY() {
|
|
105
|
+
return this.childEntities[1].getAbsoluteRotation().mulVec3(Vec3.UP).normalize();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Entity } from "../../entity/Entity";
|
|
2
|
+
import { Object3d } from "../../Object3d";
|
|
3
|
+
import { SEL_XZ_COLOR, XZ_COLOR } from "./colors";
|
|
4
|
+
const planeObj = Object3d.createPlane(1, 1, -0.5, 0, 0.5);
|
|
5
|
+
export class MovePlaneEntity extends Entity {
|
|
6
|
+
constructor(params = {}) {
|
|
7
|
+
super(params);
|
|
8
|
+
this._init();
|
|
9
|
+
}
|
|
10
|
+
_init() {
|
|
11
|
+
let planeXZ = new Entity({
|
|
12
|
+
independentPicking: true,
|
|
13
|
+
scale: 0.025,
|
|
14
|
+
forceGlobalPosition: true,
|
|
15
|
+
geoObject: {
|
|
16
|
+
color: XZ_COLOR,
|
|
17
|
+
tag: "plane",
|
|
18
|
+
object3d: planeObj
|
|
19
|
+
},
|
|
20
|
+
properties: {
|
|
21
|
+
opName: "move_xz",
|
|
22
|
+
noEdit: true,
|
|
23
|
+
style: {
|
|
24
|
+
color: XZ_COLOR,
|
|
25
|
+
selectColor: SEL_XZ_COLOR
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
this.appendChild(planeXZ);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -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,105 @@
|
|
|
1
|
+
import { Entity } from "../../entity/Entity";
|
|
2
|
+
import { Vec3 } from "../../math/Vec3";
|
|
3
|
+
import { RADIANS } from "../../math";
|
|
4
|
+
import { Quat } from "../../math/Quat";
|
|
5
|
+
import { SEL_X_COLOR, SEL_Y_COLOR, SEL_Z_COLOR, X_COLOR, Y_COLOR, Z_COLOR } from "./colors";
|
|
6
|
+
const SEG_SIZE = 360;
|
|
7
|
+
const VISIBLESPHERE_DOT_THRESHOLD = 0.95;
|
|
8
|
+
const pitchCoords = new Array(SEG_SIZE);
|
|
9
|
+
const yawCoords = new Array(SEG_SIZE);
|
|
10
|
+
const rollCoords = new Array(SEG_SIZE);
|
|
11
|
+
export class RotateEntity extends Entity {
|
|
12
|
+
constructor(params = {}) {
|
|
13
|
+
super(params);
|
|
14
|
+
this._init();
|
|
15
|
+
}
|
|
16
|
+
_init() {
|
|
17
|
+
const length = SEG_SIZE;
|
|
18
|
+
let pitch = new Entity({
|
|
19
|
+
independentPicking: true,
|
|
20
|
+
polyline: {
|
|
21
|
+
path3v: [Array.from({ length }, (_, i) => new Vec3())],
|
|
22
|
+
thickness: 3.1,
|
|
23
|
+
color: X_COLOR,
|
|
24
|
+
isClosed: true
|
|
25
|
+
},
|
|
26
|
+
properties: {
|
|
27
|
+
opName: "rotate_pitch",
|
|
28
|
+
noEdit: true,
|
|
29
|
+
style: {
|
|
30
|
+
color: X_COLOR,
|
|
31
|
+
selectColor: SEL_X_COLOR
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
let yaw = new Entity({
|
|
36
|
+
independentPicking: true,
|
|
37
|
+
polyline: {
|
|
38
|
+
path3v: [Array.from({ length }, (_, i) => new Vec3())],
|
|
39
|
+
thickness: 2.5,
|
|
40
|
+
color: Y_COLOR,
|
|
41
|
+
isClosed: true
|
|
42
|
+
},
|
|
43
|
+
properties: {
|
|
44
|
+
opName: "rotate_yaw",
|
|
45
|
+
noEdit: true,
|
|
46
|
+
style: {
|
|
47
|
+
color: Y_COLOR,
|
|
48
|
+
selectColor: SEL_Y_COLOR
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
let roll = new Entity({
|
|
53
|
+
independentPicking: true,
|
|
54
|
+
polyline: {
|
|
55
|
+
path3v: [Array.from({ length }, (_, i) => new Vec3())],
|
|
56
|
+
thickness: 2.5,
|
|
57
|
+
color: Z_COLOR,
|
|
58
|
+
isClosed: true
|
|
59
|
+
},
|
|
60
|
+
properties: {
|
|
61
|
+
opName: "rotate_roll",
|
|
62
|
+
noEdit: true,
|
|
63
|
+
style: {
|
|
64
|
+
color: Z_COLOR,
|
|
65
|
+
selectColor: SEL_Z_COLOR
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
this.appendChild(pitch);
|
|
70
|
+
this.appendChild(yaw);
|
|
71
|
+
this.appendChild(roll);
|
|
72
|
+
}
|
|
73
|
+
setCartesian3v(cart, yaw = 0) {
|
|
74
|
+
super.setCartesian3v(cart);
|
|
75
|
+
if (this._entityCollection && this._entityCollection.renderNode) {
|
|
76
|
+
let rn = this._entityCollection.renderNode;
|
|
77
|
+
let cam = rn.renderer.activeCamera;
|
|
78
|
+
let qNorthFrame = rn.getFrameRotation(cart).conjugate();
|
|
79
|
+
let r = cam.eye.distance(cart) * 0.15;
|
|
80
|
+
let qp = Quat.xRotation(0);
|
|
81
|
+
let qy = Quat.yRotation(yaw);
|
|
82
|
+
let qr = Quat.zRotation(0);
|
|
83
|
+
let qRot = qr.mul(qp).mul(qy).mul(rn.getFrameRotation(cart)).conjugate();
|
|
84
|
+
for (let i = 0, j = 0, step = 360 / SEG_SIZE; i < SEG_SIZE; i += step, j++) {
|
|
85
|
+
let a = i * RADIANS, cos_a = Math.cos(a), sin_a = Math.sin(a);
|
|
86
|
+
let pitch_p = qRot.mulVec3(new Vec3(0, sin_a, cos_a)).normalize().scale(r).add(cart);
|
|
87
|
+
let yaw_p = qNorthFrame.mulVec3(new Vec3(cos_a, 0, sin_a)).normalize().scale(r).add(cart);
|
|
88
|
+
let roll_p = qRot.mulVec3(new Vec3(cos_a, sin_a, 0)).normalize().scale(r).add(cart);
|
|
89
|
+
pitchCoords[j] = pitch_p;
|
|
90
|
+
yawCoords[j] = yaw_p;
|
|
91
|
+
rollCoords[j] = roll_p;
|
|
92
|
+
}
|
|
93
|
+
this.childEntities[0].polyline.setPath3v([pitchCoords], undefined, true);
|
|
94
|
+
this.childEntities[1].polyline.setPath3v([yawCoords], undefined, true);
|
|
95
|
+
this.childEntities[2].polyline.setPath3v([rollCoords], undefined, true);
|
|
96
|
+
// Gets whole circle visibility
|
|
97
|
+
let dir_pitch = qRot.mulVec3(new Vec3(1, 0, 0)).normalize();
|
|
98
|
+
let dir_yaw = qNorthFrame.mulVec3(new Vec3(0, 1, 0)).normalize();
|
|
99
|
+
let dir_roll = qRot.mulVec3(new Vec3(0, 0, 1)).normalize();
|
|
100
|
+
this.childEntities[0].polyline.setVisibleSphere(cart, Math.abs(dir_pitch.dot(cam.getForward())) > VISIBLESPHERE_DOT_THRESHOLD ? 0.0 : r);
|
|
101
|
+
this.childEntities[1].polyline.setVisibleSphere(cart, Math.abs(dir_yaw.dot(cam.getForward())) > VISIBLESPHERE_DOT_THRESHOLD ? 0.0 : r);
|
|
102
|
+
this.childEntities[2].polyline.setVisibleSphere(cart, Math.abs(dir_roll.dot(cam.getForward())) > VISIBLESPHERE_DOT_THRESHOLD ? 0.0 : r);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -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)";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const X_COLOR = "rgb(253,77,77)";
|
|
2
|
+
export const SEL_X_COLOR = "rgb(248,115,115)";
|
|
3
|
+
export const Y_COLOR = "rgb(73,73,239)";
|
|
4
|
+
export const SEL_Y_COLOR = "rgb(90,90,253)";
|
|
5
|
+
export const Z_COLOR = "rgb(26,122,26)";
|
|
6
|
+
export const SEL_Z_COLOR = "rgb(55,191,55)";
|
|
7
|
+
export const XZ_COLOR = "rgba(255,255,255,0.8)";
|
|
8
|
+
export const SEL_XZ_COLOR = "rgba(255,255,255,1.0)";
|
|
@@ -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";
|
|
@@ -27,3 +26,5 @@ export * from "./selection/Selection";
|
|
|
27
26
|
export * from "./timeline/TimelineControl";
|
|
28
27
|
export * from "./elevationProfile/ElevationProfileControl";
|
|
29
28
|
export * from "./AtmosphereConfig";
|
|
29
|
+
export * from "./geoObjectEditor/GeoObjectEditor";
|
|
30
|
+
export * from "./CameraLock";
|
package/lib/js/control/index.js
CHANGED
|
@@ -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";
|
|
@@ -27,3 +26,5 @@ export * from "./selection/Selection";
|
|
|
27
26
|
export * from "./timeline/TimelineControl";
|
|
28
27
|
export * from "./elevationProfile/ElevationProfileControl";
|
|
29
28
|
export * from "./AtmosphereConfig";
|
|
29
|
+
export * from "./geoObjectEditor/GeoObjectEditor";
|
|
30
|
+
export * from "./CameraLock";
|
|
@@ -63,12 +63,14 @@ class TimelineControl extends Control {
|
|
|
63
63
|
this.renderer && this.renderer.handler.defaultClock.setDate(d);
|
|
64
64
|
});
|
|
65
65
|
this._timelineView.events.on("startdrag", () => {
|
|
66
|
+
this.planet?.sun.stop();
|
|
66
67
|
this.renderer && this.renderer.controls.mouseNavigation.deactivate();
|
|
67
68
|
});
|
|
68
69
|
this._timelineView.events.on("stopdrag", () => {
|
|
69
70
|
this.renderer && this.renderer.controls.mouseNavigation.activate();
|
|
70
71
|
});
|
|
71
72
|
this._timelineView.events.on("startdragcurrent", () => {
|
|
73
|
+
this.planet?.sun.stop();
|
|
72
74
|
this.renderer && this.renderer.controls.mouseNavigation.deactivate();
|
|
73
75
|
});
|
|
74
76
|
this._timelineView.events.on("stopdragcurrent", () => {
|
|
@@ -240,25 +240,25 @@ class Segment {
|
|
|
240
240
|
_v0.set(verts[ind_v0], verts[ind_v0 + 1], verts[ind_v0 + 2]);
|
|
241
241
|
_v1.set(verts[ind_v0 + 3], verts[ind_v0 + 4], verts[ind_v0 + 5]);
|
|
242
242
|
_v2.set(verts[ind_v2], verts[ind_v2 + 1], verts[ind_v2 + 2]);
|
|
243
|
-
let d = _ray.
|
|
243
|
+
let d = _ray.hitTriangleRes(_v0, _v1, _v2, res);
|
|
244
244
|
if (d === Ray.INSIDE) {
|
|
245
245
|
return xyz.distance(res);
|
|
246
246
|
}
|
|
247
247
|
else if (d === Ray.AWAY) {
|
|
248
248
|
_rayEx.set(xyz, norm);
|
|
249
|
-
let d = _rayEx.
|
|
249
|
+
let d = _rayEx.hitTriangleRes(_v0, _v1, _v2, res);
|
|
250
250
|
if (d === Ray.INSIDE) {
|
|
251
251
|
return -xyz.distance(res);
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
254
|
_v3.set(verts[ind_v2 + 3], verts[ind_v2 + 4], verts[ind_v2 + 5]);
|
|
255
|
-
d = _ray.
|
|
255
|
+
d = _ray.hitTriangleRes(_v1, _v3, _v2, res);
|
|
256
256
|
if (d === Ray.INSIDE) {
|
|
257
257
|
return xyz.distance(res);
|
|
258
258
|
}
|
|
259
259
|
else if (d === Ray.AWAY) {
|
|
260
260
|
_rayEx.set(xyz, norm);
|
|
261
|
-
let d = _rayEx.
|
|
261
|
+
let d = _rayEx.hitTriangleRes(_v1, _v3, _v2, res);
|
|
262
262
|
if (d === Ray.INSIDE) {
|
|
263
263
|
return -xyz.distance(res);
|
|
264
264
|
}
|