@xtctwins/tctwins-core 1.0.25 → 1.0.27
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/dist/tctwins-core.es.js
CHANGED
|
@@ -11669,7 +11669,7 @@ class AngleMeasurement extends Component {
|
|
|
11669
11669
|
/**
|
|
11670
11670
|
* Gets the color of the angle measurement.
|
|
11671
11671
|
*
|
|
11672
|
-
* The color is an HTML string representation, eg. "#
|
|
11672
|
+
* The color is an HTML string representation, eg. "#0065fc" and "blue".
|
|
11673
11673
|
*
|
|
11674
11674
|
* @type {String}
|
|
11675
11675
|
*/
|
|
@@ -12460,9 +12460,6 @@ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-spa
|
|
|
12460
12460
|
if (this.pointerLens) {
|
|
12461
12461
|
this.pointerLens.visible = false;
|
|
12462
12462
|
}
|
|
12463
|
-
if (this.markerDiv) {
|
|
12464
|
-
this._destroyMarkerDiv();
|
|
12465
|
-
}
|
|
12466
12463
|
this.reset();
|
|
12467
12464
|
const canvas = this.scene.canvas.canvas;
|
|
12468
12465
|
canvas.removeEventListener("mousedown", this._onMouseDown);
|
|
@@ -12505,7 +12502,6 @@ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-spa
|
|
|
12505
12502
|
destroy() {
|
|
12506
12503
|
this.deactivate();
|
|
12507
12504
|
this._destroyMarkerDiv();
|
|
12508
|
-
|
|
12509
12505
|
if (this.pointerLens) {
|
|
12510
12506
|
this.pointerLens.destroy();
|
|
12511
12507
|
}
|
|
@@ -12776,7 +12772,7 @@ class AngleMeasurementsPlugin extends Plugin {
|
|
|
12776
12772
|
|
|
12777
12773
|
this._measurements = {};
|
|
12778
12774
|
|
|
12779
|
-
this.defaultColor = cfg.defaultColor !== undefined ? cfg.defaultColor : "#
|
|
12775
|
+
this.defaultColor = cfg.defaultColor !== undefined ? cfg.defaultColor : "#0065fc";
|
|
12780
12776
|
this.defaultLabelsVisible = cfg.defaultLabelsVisible !== false;
|
|
12781
12777
|
this.zIndex = cfg.zIndex || 10000;
|
|
12782
12778
|
|
|
@@ -13321,6 +13317,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13321
13317
|
canvas.addEventListener(
|
|
13322
13318
|
"touchstart",
|
|
13323
13319
|
(this._onCanvasTouchStart = (event) => {
|
|
13320
|
+
if (!event.isTrusted) return;
|
|
13324
13321
|
const currentNumTouches = event.touches.length;
|
|
13325
13322
|
|
|
13326
13323
|
//多指触碰
|
|
@@ -13847,6 +13844,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13847
13844
|
touchEndCanvasPos.set([touchX, touchY]);
|
|
13848
13845
|
|
|
13849
13846
|
switch (this._touchState) {
|
|
13847
|
+
//起点短按
|
|
13850
13848
|
case WAITING_FOR_ORIGIN_QUICK_TOUCH_END$1:
|
|
13851
13849
|
{
|
|
13852
13850
|
if (
|
|
@@ -13876,7 +13874,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13876
13874
|
worldPos: pickResult.worldPos
|
|
13877
13875
|
}
|
|
13878
13876
|
});
|
|
13879
|
-
this._currentAngleMeasurement.clickable = false;
|
|
13877
|
+
// this._currentAngleMeasurement.clickable = false;
|
|
13880
13878
|
this._currentAngleMeasurement.originVisible = true;
|
|
13881
13879
|
this._currentAngleMeasurement.originWireVisible = false;
|
|
13882
13880
|
this._currentAngleMeasurement.cornerVisible = false;
|
|
@@ -13898,6 +13896,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13898
13896
|
enableCameraNavigation();
|
|
13899
13897
|
break;
|
|
13900
13898
|
|
|
13899
|
+
//起点长按
|
|
13901
13900
|
case WAITING_FOR_ORIGIN_LONG_TOUCH_END$1:
|
|
13902
13901
|
if (this.pointerLens) {
|
|
13903
13902
|
this.pointerLens.visible = false;
|
|
@@ -13916,6 +13915,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13916
13915
|
enableCameraNavigation();
|
|
13917
13916
|
break;
|
|
13918
13917
|
|
|
13918
|
+
//拐角短按
|
|
13919
13919
|
case WAITING_FOR_CORNER_QUICK_TOUCH_END:
|
|
13920
13920
|
{
|
|
13921
13921
|
if (
|
|
@@ -13955,6 +13955,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13955
13955
|
enableCameraNavigation();
|
|
13956
13956
|
break;
|
|
13957
13957
|
|
|
13958
|
+
//拐角长按
|
|
13958
13959
|
case WAITING_FOR_CORNER_LONG_TOUCH_END:
|
|
13959
13960
|
if (this.pointerLens) {
|
|
13960
13961
|
this.pointerLens.visible = false;
|
|
@@ -13964,6 +13965,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13964
13965
|
enableCameraNavigation();
|
|
13965
13966
|
break;
|
|
13966
13967
|
|
|
13968
|
+
//终点短按
|
|
13967
13969
|
case WAITING_FOR_TARGET_QUICK_TOUCH_END$1:
|
|
13968
13970
|
{
|
|
13969
13971
|
if (
|
|
@@ -14004,6 +14006,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
14004
14006
|
enableCameraNavigation();
|
|
14005
14007
|
break;
|
|
14006
14008
|
|
|
14009
|
+
//终点长按
|
|
14007
14010
|
case WAITING_FOR_TARGET_LONG_TOUCH_END$1:
|
|
14008
14011
|
if (this.pointerLens) {
|
|
14009
14012
|
this.pointerLens.visible = false;
|
|
@@ -14029,6 +14032,8 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
14029
14032
|
{ passive: true }
|
|
14030
14033
|
);
|
|
14031
14034
|
|
|
14035
|
+
canvas.addEventListener("touchcancel", this._onCanvasTouchEnd);
|
|
14036
|
+
|
|
14032
14037
|
this._active = true;
|
|
14033
14038
|
}
|
|
14034
14039
|
|
|
@@ -14048,6 +14053,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
14048
14053
|
const canvas = this.plugin.viewer.scene.canvas.canvas;
|
|
14049
14054
|
canvas.removeEventListener("touchstart", this._onCanvasTouchStart);
|
|
14050
14055
|
canvas.removeEventListener("touchend", this._onCanvasTouchEnd);
|
|
14056
|
+
canvas.removeEventListener("touchcancel", this._onCanvasTouchEnd);
|
|
14051
14057
|
if (this._currentAngleMeasurement) {
|
|
14052
14058
|
this.angleMeasurementsPlugin.fire("measurementCancel", this._currentAngleMeasurement);
|
|
14053
14059
|
this._currentAngleMeasurement.destroy();
|
|
@@ -21697,6 +21703,7 @@ class Input extends Component {
|
|
|
21697
21703
|
if (!this.enabled) {
|
|
21698
21704
|
return;
|
|
21699
21705
|
}
|
|
21706
|
+
if (!e.isTrusted) return;
|
|
21700
21707
|
if (e.touches.length == 1) {
|
|
21701
21708
|
this.touchDown = true;
|
|
21702
21709
|
}
|
|
@@ -21720,6 +21727,8 @@ class Input extends Component {
|
|
|
21720
21727
|
}),
|
|
21721
21728
|
true
|
|
21722
21729
|
);
|
|
21730
|
+
//touchcancel
|
|
21731
|
+
this.element.addEventListener("touchcancel", this._touchUpListener, true);
|
|
21723
21732
|
//touchmove
|
|
21724
21733
|
this.element.addEventListener(
|
|
21725
21734
|
"touchmove",
|
|
@@ -21789,6 +21798,7 @@ class Input extends Component {
|
|
|
21789
21798
|
|
|
21790
21799
|
this.element.removeEventListener("touchstart", this._touchDownListener);
|
|
21791
21800
|
document.removeEventListener("touchend", this._touchUpListener);
|
|
21801
|
+
document.removeEventListener("touchcancel", this._touchUpListener);
|
|
21792
21802
|
this.element.removeEventListener("touchmove", this._touchMoveListener);
|
|
21793
21803
|
|
|
21794
21804
|
if (window.OrientationChangeEvent) {
|
|
@@ -32035,13 +32045,13 @@ class Scene extends Component {
|
|
|
32035
32045
|
*/
|
|
32036
32046
|
destroy(callback) {
|
|
32037
32047
|
super.destroy();
|
|
32038
|
-
|
|
32039
32048
|
for (const id in this.components) {
|
|
32040
32049
|
if (this.components.hasOwnProperty(id)) {
|
|
32041
32050
|
this.components[id].destroy();
|
|
32042
32051
|
}
|
|
32043
32052
|
}
|
|
32044
|
-
this.canvas.destroy();
|
|
32053
|
+
// this.canvas.destroy(); // canvas是scene的其中一个component,所有以不必再destroy
|
|
32054
|
+
|
|
32045
32055
|
// Memory leak prevention
|
|
32046
32056
|
this.components = null;
|
|
32047
32057
|
this.models = null;
|
|
@@ -32063,13 +32073,14 @@ class Scene extends Component {
|
|
|
32063
32073
|
this._selectedObjectIds = null;
|
|
32064
32074
|
this._colorizedObjectIds = null;
|
|
32065
32075
|
this.types = null;
|
|
32066
|
-
this.components = null;
|
|
32067
|
-
this.canvas = null;
|
|
32068
32076
|
this._renderer = null;
|
|
32069
32077
|
this.input = null;
|
|
32070
32078
|
this._viewport = null;
|
|
32071
32079
|
this._camera = null;
|
|
32072
|
-
|
|
32080
|
+
this.canvas = null;
|
|
32081
|
+
if (typeof callback === "function") {
|
|
32082
|
+
callback();
|
|
32083
|
+
}
|
|
32073
32084
|
}
|
|
32074
32085
|
}
|
|
32075
32086
|
|
|
@@ -87380,13 +87391,10 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
87380
87391
|
if (this.pointerLens) {
|
|
87381
87392
|
this.pointerLens.visible = false;
|
|
87382
87393
|
}
|
|
87383
|
-
if (this._markerDiv) {
|
|
87384
|
-
this._destroyMarkerDiv();
|
|
87385
|
-
}
|
|
87386
87394
|
this.reset();
|
|
87387
87395
|
const canvas = this.scene.canvas.canvas;
|
|
87388
|
-
canvas.removeEventListener("mousedown"
|
|
87389
|
-
canvas.removeEventListener("mouseup"
|
|
87396
|
+
canvas.removeEventListener("mousedown", this._onMouseDown);
|
|
87397
|
+
canvas.removeEventListener("mouseup", this._onMouseUp);
|
|
87390
87398
|
const cameraControl = this.distanceMeasurementsPlugin.viewer.cameraControl;
|
|
87391
87399
|
cameraControl.off(this._onCameraControlHoverSnapOrSurface);
|
|
87392
87400
|
cameraControl.off(this._onCameraControlHoverSnapOrSurfaceOff);
|
|
@@ -87710,7 +87718,7 @@ class DistanceMeasurementsPlugin extends Plugin {
|
|
|
87710
87718
|
* @param {boolean} [cfg.defaultXAxisVisible=true] The default value of the DistanceMeasurements `xAxisVisible` property.
|
|
87711
87719
|
* @param {boolean} [cfg.defaultYAxisVisible=true] The default value of the DistanceMeasurements `yAxisVisible` property.
|
|
87712
87720
|
* @param {boolean} [cfg.defaultZAxisVisible=true] The default value of the DistanceMeasurements `zAxisVisible` property.
|
|
87713
|
-
* @param {string} [cfg.defaultColor=#
|
|
87721
|
+
* @param {string} [cfg.defaultColor=#0065fc] The default color of the length dots, wire and label.
|
|
87714
87722
|
* @param {number} [cfg.zIndex] If set, the wires, dots and labels will have this zIndex (+1 for dots and +2 for labels).
|
|
87715
87723
|
* @param {boolean} [cfg.defaultLabelsOnWires=true] The default value of the DistanceMeasurements `labelsOnWires` property.
|
|
87716
87724
|
* @param {PointerCircle} [cfg.pointerLens] A PointerLens to help the user position the pointer. This can be shared with other plugins.
|
|
@@ -87737,7 +87745,7 @@ class DistanceMeasurementsPlugin extends Plugin {
|
|
|
87737
87745
|
this.defaultXAxisVisible = cfg.defaultXAxisVisible !== false;
|
|
87738
87746
|
this.defaultYAxisVisible = cfg.defaultYAxisVisible !== false;
|
|
87739
87747
|
this.defaultZAxisVisible = cfg.defaultZAxisVisible !== false;
|
|
87740
|
-
this.defaultColor = cfg.defaultColor !== undefined ? cfg.defaultColor : "#
|
|
87748
|
+
this.defaultColor = cfg.defaultColor !== undefined ? cfg.defaultColor : "#0065fc";
|
|
87741
87749
|
this.zIndex = cfg.zIndex || 10000;
|
|
87742
87750
|
this.defaultLabelsOnWires = cfg.defaultLabelsOnWires !== false;
|
|
87743
87751
|
|
|
@@ -88217,6 +88225,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88217
88225
|
canvas.addEventListener(
|
|
88218
88226
|
"touchstart",
|
|
88219
88227
|
(this._onCanvasTouchStart = (event) => {
|
|
88228
|
+
if (!event.isTrusted) return;
|
|
88220
88229
|
const currentNumTouches = event.touches.length;
|
|
88221
88230
|
|
|
88222
88231
|
if (currentNumTouches !== 1) {
|
|
@@ -88626,6 +88635,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88626
88635
|
touchEndCanvasPos.set([touchX, touchY]);
|
|
88627
88636
|
|
|
88628
88637
|
switch (this._touchState) {
|
|
88638
|
+
//等待起点短按
|
|
88629
88639
|
case WAITING_FOR_ORIGIN_QUICK_TOUCH_END:
|
|
88630
88640
|
{
|
|
88631
88641
|
if (
|
|
@@ -88661,7 +88671,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88661
88671
|
this._currentDistanceMeasurement.wireVisible = false;
|
|
88662
88672
|
this._currentDistanceMeasurement.originVisible = true;
|
|
88663
88673
|
this._currentDistanceMeasurement.targetVisible = false;
|
|
88664
|
-
this._currentDistanceMeasurement.clickable = false;
|
|
88674
|
+
// this._currentDistanceMeasurement.clickable = false;
|
|
88665
88675
|
this._touchState = WAITING_FOR_TARGET_TOUCH_START;
|
|
88666
88676
|
this.distanceMeasurementsPlugin.fire("measurementStart", this._currentDistanceMeasurement);
|
|
88667
88677
|
// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_QUICK_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
|
|
@@ -88759,6 +88769,8 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88759
88769
|
{ passive: true }
|
|
88760
88770
|
);
|
|
88761
88771
|
|
|
88772
|
+
canvas.addEventListener("touchcancel", this._onCanvasTouchEnd);
|
|
88773
|
+
|
|
88762
88774
|
this._active = true;
|
|
88763
88775
|
}
|
|
88764
88776
|
|
|
@@ -88778,6 +88790,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88778
88790
|
const canvas = this.plugin.viewer.scene.canvas.canvas;
|
|
88779
88791
|
canvas.removeEventListener("touchstart", this._onCanvasTouchStart);
|
|
88780
88792
|
canvas.removeEventListener("touchend", this._onCanvasTouchEnd);
|
|
88793
|
+
canvas.removeEventListener("touchcancel", this._onCanvasTouchEnd);
|
|
88781
88794
|
if (this._currentDistanceMeasurement) {
|
|
88782
88795
|
this.distanceMeasurementsPlugin.fire("measurementCancel", this._currentDistanceMeasurement);
|
|
88783
88796
|
this._currentDistanceMeasurement.destroy();
|
|
@@ -95183,7 +95196,7 @@ class MousePanRotateDollyHandler {
|
|
|
95183
95196
|
|
|
95184
95197
|
let mouseMovedOnCanvasSinceLastWheel = true;
|
|
95185
95198
|
|
|
95186
|
-
|
|
95199
|
+
this.canvas = this._scene.canvas.canvas;
|
|
95187
95200
|
|
|
95188
95201
|
const keyDown = [];
|
|
95189
95202
|
|
|
@@ -95209,13 +95222,13 @@ class MousePanRotateDollyHandler {
|
|
|
95209
95222
|
})
|
|
95210
95223
|
);
|
|
95211
95224
|
|
|
95212
|
-
|
|
95213
|
-
canvas.style.cursor = "move";
|
|
95225
|
+
const setMousedownState = (pick = true) => {
|
|
95226
|
+
this.canvas.style.cursor = "move";
|
|
95214
95227
|
setMousedownPositions();
|
|
95215
95228
|
if (pick) {
|
|
95216
95229
|
setMousedownPick();
|
|
95217
95230
|
}
|
|
95218
|
-
}
|
|
95231
|
+
};
|
|
95219
95232
|
|
|
95220
95233
|
function setMousedownPositions() {
|
|
95221
95234
|
|
|
@@ -95243,7 +95256,7 @@ class MousePanRotateDollyHandler {
|
|
|
95243
95256
|
}
|
|
95244
95257
|
}
|
|
95245
95258
|
|
|
95246
|
-
canvas.addEventListener(
|
|
95259
|
+
this.canvas.addEventListener(
|
|
95247
95260
|
"mousedown",
|
|
95248
95261
|
(this._mouseDownHandler = (e) => {
|
|
95249
95262
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
@@ -95350,7 +95363,7 @@ class MousePanRotateDollyHandler {
|
|
|
95350
95363
|
})
|
|
95351
95364
|
);
|
|
95352
95365
|
|
|
95353
|
-
canvas.addEventListener(
|
|
95366
|
+
this.canvas.addEventListener(
|
|
95354
95367
|
"mousemove",
|
|
95355
95368
|
(this._canvasMouseMoveHandler = (e) => {
|
|
95356
95369
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
@@ -95391,7 +95404,7 @@ class MousePanRotateDollyHandler {
|
|
|
95391
95404
|
})
|
|
95392
95405
|
);
|
|
95393
95406
|
|
|
95394
|
-
canvas.addEventListener(
|
|
95407
|
+
this.canvas.addEventListener(
|
|
95395
95408
|
"mouseup",
|
|
95396
95409
|
(this._mouseUpHandler = (e) => {
|
|
95397
95410
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
@@ -95416,11 +95429,11 @@ class MousePanRotateDollyHandler {
|
|
|
95416
95429
|
}
|
|
95417
95430
|
break;
|
|
95418
95431
|
}
|
|
95419
|
-
canvas.style.removeProperty("cursor");
|
|
95432
|
+
this.canvas.style.removeProperty("cursor");
|
|
95420
95433
|
})
|
|
95421
95434
|
);
|
|
95422
95435
|
|
|
95423
|
-
canvas.addEventListener(
|
|
95436
|
+
this.canvas.addEventListener(
|
|
95424
95437
|
"mouseenter",
|
|
95425
95438
|
(this._mouseEnterHandler = () => {
|
|
95426
95439
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
@@ -95434,7 +95447,7 @@ class MousePanRotateDollyHandler {
|
|
|
95434
95447
|
|
|
95435
95448
|
let secsNowLast = null;
|
|
95436
95449
|
|
|
95437
|
-
canvas.addEventListener(
|
|
95450
|
+
this.canvas.addEventListener(
|
|
95438
95451
|
"wheel",
|
|
95439
95452
|
(this._mouseWheelHandler = (e) => {
|
|
95440
95453
|
e.preventDefault();
|
|
@@ -95468,17 +95481,17 @@ class MousePanRotateDollyHandler {
|
|
|
95468
95481
|
reset() {}
|
|
95469
95482
|
|
|
95470
95483
|
destroy() {
|
|
95471
|
-
|
|
95472
|
-
|
|
95484
|
+
if (this.canvas != null) {
|
|
95485
|
+
this.canvas.removeEventListener("mousedown", this._mouseDownHandler);
|
|
95486
|
+
this.canvas.removeEventListener("mousemove", this._canvasMouseMoveHandler);
|
|
95487
|
+
this.canvas.removeEventListener("mouseup", this._mouseUpHandler);
|
|
95488
|
+
this.canvas.removeEventListener("mouseenter", this._mouseEnterHandler);
|
|
95489
|
+
this.canvas.removeEventListener("wheel", this._mouseWheelHandler);
|
|
95490
|
+
}
|
|
95473
95491
|
document.removeEventListener("keydown", this._documentKeyDownHandler);
|
|
95474
95492
|
document.removeEventListener("keyup", this._documentKeyUpHandler);
|
|
95475
|
-
canvas.removeEventListener("mousedown", this._mouseDownHandler);
|
|
95476
95493
|
document.removeEventListener("mousemove", this._documentMouseMoveHandler);
|
|
95477
|
-
canvas.removeEventListener("mousemove", this._canvasMouseMoveHandler);
|
|
95478
95494
|
document.removeEventListener("mouseup", this._documentMouseUpHandler);
|
|
95479
|
-
canvas.removeEventListener("mouseup", this._mouseUpHandler);
|
|
95480
|
-
canvas.removeEventListener("mouseenter", this._mouseEnterHandler);
|
|
95481
|
-
canvas.removeEventListener("wheel", this._mouseWheelHandler);
|
|
95482
95495
|
}
|
|
95483
95496
|
}
|
|
95484
95497
|
|
|
@@ -95489,116 +95502,113 @@ const tempVec3c$1 = math.vec3();
|
|
|
95489
95502
|
const tempVec3d = math.vec3();
|
|
95490
95503
|
|
|
95491
95504
|
const tempCameraTarget = {
|
|
95492
|
-
|
|
95493
|
-
|
|
95494
|
-
|
|
95505
|
+
eye: math.vec3(),
|
|
95506
|
+
look: math.vec3(),
|
|
95507
|
+
up: math.vec3()
|
|
95495
95508
|
};
|
|
95496
95509
|
|
|
95497
95510
|
/**
|
|
95498
95511
|
* @private
|
|
95499
95512
|
*/
|
|
95500
95513
|
class KeyboardAxisViewHandler {
|
|
95514
|
+
constructor(scene, controllers, configs, states) {
|
|
95515
|
+
this._scene = scene;
|
|
95516
|
+
this.input = scene.input;
|
|
95517
|
+
const cameraControl = controllers.cameraControl;
|
|
95518
|
+
const camera = scene.camera;
|
|
95501
95519
|
|
|
95502
|
-
|
|
95503
|
-
|
|
95504
|
-
|
|
95505
|
-
|
|
95506
|
-
const camera = scene.camera;
|
|
95507
|
-
|
|
95508
|
-
this._onSceneKeyDown = scene.input.on("keydown", () => {
|
|
95509
|
-
|
|
95510
|
-
if (!(configs.active && configs.pointerEnabled) || (!scene.input.keyboardEnabled)) {
|
|
95511
|
-
return;
|
|
95512
|
-
}
|
|
95513
|
-
|
|
95514
|
-
if (!states.mouseover) {
|
|
95515
|
-
return;
|
|
95516
|
-
}
|
|
95517
|
-
|
|
95518
|
-
const axisViewRight = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_RIGHT);
|
|
95519
|
-
const axisViewBack = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BACK);
|
|
95520
|
-
const axisViewLeft = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_LEFT);
|
|
95521
|
-
const axisViewFront = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_FRONT);
|
|
95522
|
-
const axisViewTop = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_TOP);
|
|
95523
|
-
const axisViewBottom = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BOTTOM);
|
|
95524
|
-
|
|
95525
|
-
if ((!axisViewRight) && (!axisViewBack) && (!axisViewLeft) && (!axisViewFront) && (!axisViewTop) && (!axisViewBottom)) {
|
|
95526
|
-
return;
|
|
95527
|
-
}
|
|
95528
|
-
|
|
95529
|
-
const aabb = scene.aabb;
|
|
95530
|
-
const diag = math.getAABB3Diag(aabb);
|
|
95531
|
-
|
|
95532
|
-
math.getAABB3Center(aabb, center);
|
|
95533
|
-
|
|
95534
|
-
const perspectiveDist = Math.abs(diag / Math.tan(controllers.cameraFlight.fitFOV * math.DEGTORAD));
|
|
95535
|
-
const orthoScale = diag * 1.1;
|
|
95536
|
-
|
|
95537
|
-
tempCameraTarget.orthoScale = orthoScale;
|
|
95538
|
-
|
|
95539
|
-
if (axisViewRight) {
|
|
95540
|
-
|
|
95541
|
-
tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, perspectiveDist, tempVec3a$5), tempVec3d));
|
|
95542
|
-
tempCameraTarget.look.set(center);
|
|
95543
|
-
tempCameraTarget.up.set(camera.worldUp);
|
|
95544
|
-
|
|
95545
|
-
} else if (axisViewBack) {
|
|
95546
|
-
|
|
95547
|
-
tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, perspectiveDist, tempVec3a$5), tempVec3d));
|
|
95548
|
-
tempCameraTarget.look.set(center);
|
|
95549
|
-
tempCameraTarget.up.set(camera.worldUp);
|
|
95550
|
-
|
|
95551
|
-
} else if (axisViewLeft) {
|
|
95520
|
+
this._onSceneKeyDown = scene.input.on("keydown", () => {
|
|
95521
|
+
if (!(configs.active && configs.pointerEnabled) || !scene.input.keyboardEnabled) {
|
|
95522
|
+
return;
|
|
95523
|
+
}
|
|
95552
95524
|
|
|
95553
|
-
|
|
95554
|
-
|
|
95555
|
-
|
|
95525
|
+
if (!states.mouseover) {
|
|
95526
|
+
return;
|
|
95527
|
+
}
|
|
95556
95528
|
|
|
95557
|
-
|
|
95529
|
+
const axisViewRight = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_RIGHT);
|
|
95530
|
+
const axisViewBack = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BACK);
|
|
95531
|
+
const axisViewLeft = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_LEFT);
|
|
95532
|
+
const axisViewFront = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_FRONT);
|
|
95533
|
+
const axisViewTop = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_TOP);
|
|
95534
|
+
const axisViewBottom = cameraControl._isKeyDownForAction(cameraControl.AXIS_VIEW_BOTTOM);
|
|
95558
95535
|
|
|
95559
|
-
|
|
95560
|
-
|
|
95561
|
-
|
|
95536
|
+
if (!axisViewRight && !axisViewBack && !axisViewLeft && !axisViewFront && !axisViewTop && !axisViewBottom) {
|
|
95537
|
+
return;
|
|
95538
|
+
}
|
|
95562
95539
|
|
|
95563
|
-
|
|
95540
|
+
const aabb = scene.aabb;
|
|
95541
|
+
const diag = math.getAABB3Diag(aabb);
|
|
95564
95542
|
|
|
95565
|
-
|
|
95566
|
-
tempCameraTarget.look.set(center);
|
|
95567
|
-
tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, 1, tempVec3b$2), tempVec3c$1));
|
|
95543
|
+
math.getAABB3Center(aabb, center);
|
|
95568
95544
|
|
|
95569
|
-
|
|
95545
|
+
const perspectiveDist = Math.abs(diag / Math.tan(controllers.cameraFlight.fitFOV * math.DEGTORAD));
|
|
95546
|
+
const orthoScale = diag * 1.1;
|
|
95570
95547
|
|
|
95571
|
-
|
|
95572
|
-
tempCameraTarget.look.set(center);
|
|
95573
|
-
tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, -1, tempVec3b$2)));
|
|
95574
|
-
}
|
|
95548
|
+
tempCameraTarget.orthoScale = orthoScale;
|
|
95575
95549
|
|
|
95576
|
-
|
|
95577
|
-
|
|
95578
|
-
|
|
95550
|
+
if (axisViewRight) {
|
|
95551
|
+
tempCameraTarget.eye.set(
|
|
95552
|
+
math.addVec3(center, math.mulVec3Scalar(camera.worldRight, perspectiveDist, tempVec3a$5), tempVec3d)
|
|
95553
|
+
);
|
|
95554
|
+
tempCameraTarget.look.set(center);
|
|
95555
|
+
tempCameraTarget.up.set(camera.worldUp);
|
|
95556
|
+
} else if (axisViewBack) {
|
|
95557
|
+
tempCameraTarget.eye.set(
|
|
95558
|
+
math.addVec3(center, math.mulVec3Scalar(camera.worldForward, perspectiveDist, tempVec3a$5), tempVec3d)
|
|
95559
|
+
);
|
|
95560
|
+
tempCameraTarget.look.set(center);
|
|
95561
|
+
tempCameraTarget.up.set(camera.worldUp);
|
|
95562
|
+
} else if (axisViewLeft) {
|
|
95563
|
+
tempCameraTarget.eye.set(
|
|
95564
|
+
math.addVec3(center, math.mulVec3Scalar(camera.worldRight, -perspectiveDist, tempVec3a$5), tempVec3d)
|
|
95565
|
+
);
|
|
95566
|
+
tempCameraTarget.look.set(center);
|
|
95567
|
+
tempCameraTarget.up.set(camera.worldUp);
|
|
95568
|
+
} else if (axisViewFront) {
|
|
95569
|
+
tempCameraTarget.eye.set(
|
|
95570
|
+
math.addVec3(center, math.mulVec3Scalar(camera.worldForward, -perspectiveDist, tempVec3a$5), tempVec3d)
|
|
95571
|
+
);
|
|
95572
|
+
tempCameraTarget.look.set(center);
|
|
95573
|
+
tempCameraTarget.up.set(camera.worldUp);
|
|
95574
|
+
} else if (axisViewTop) {
|
|
95575
|
+
tempCameraTarget.eye.set(
|
|
95576
|
+
math.addVec3(center, math.mulVec3Scalar(camera.worldUp, perspectiveDist, tempVec3a$5), tempVec3d)
|
|
95577
|
+
);
|
|
95578
|
+
tempCameraTarget.look.set(center);
|
|
95579
|
+
tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, 1, tempVec3b$2), tempVec3c$1));
|
|
95580
|
+
} else if (axisViewBottom) {
|
|
95581
|
+
tempCameraTarget.eye.set(
|
|
95582
|
+
math.addVec3(center, math.mulVec3Scalar(camera.worldUp, -perspectiveDist, tempVec3a$5), tempVec3d)
|
|
95583
|
+
);
|
|
95584
|
+
tempCameraTarget.look.set(center);
|
|
95585
|
+
tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, -1, tempVec3b$2)));
|
|
95586
|
+
}
|
|
95579
95587
|
|
|
95580
|
-
|
|
95581
|
-
|
|
95582
|
-
|
|
95583
|
-
controllers.pivotController.showPivot();
|
|
95584
|
-
}
|
|
95585
|
-
});
|
|
95588
|
+
if (!configs.firstPerson && configs.followPointer) {
|
|
95589
|
+
controllers.pivotController.setPivotPos(center);
|
|
95590
|
+
}
|
|
95586
95591
|
|
|
95587
|
-
|
|
95588
|
-
|
|
95589
|
-
|
|
95590
|
-
|
|
95591
|
-
|
|
95592
|
-
|
|
95593
|
-
|
|
95594
|
-
|
|
95592
|
+
if (controllers.cameraFlight.duration > 0) {
|
|
95593
|
+
controllers.cameraFlight.flyTo(tempCameraTarget, () => {
|
|
95594
|
+
if (controllers.pivotController.getPivoting() && configs.followPointer) {
|
|
95595
|
+
controllers.pivotController.showPivot();
|
|
95596
|
+
}
|
|
95597
|
+
});
|
|
95598
|
+
} else {
|
|
95599
|
+
controllers.cameraFlight.jumpTo(tempCameraTarget);
|
|
95600
|
+
if (controllers.pivotController.getPivoting() && configs.followPointer) {
|
|
95601
|
+
controllers.pivotController.showPivot();
|
|
95602
|
+
}
|
|
95603
|
+
}
|
|
95604
|
+
});
|
|
95605
|
+
}
|
|
95595
95606
|
|
|
95596
|
-
|
|
95597
|
-
}
|
|
95607
|
+
reset() {}
|
|
95598
95608
|
|
|
95599
|
-
|
|
95600
|
-
|
|
95601
|
-
|
|
95609
|
+
destroy() {
|
|
95610
|
+
this.input.off(this._onSceneKeyDown);
|
|
95611
|
+
}
|
|
95602
95612
|
}
|
|
95603
95613
|
|
|
95604
95614
|
/**
|
|
@@ -95619,7 +95629,7 @@ class MousePickHandler {
|
|
|
95619
95629
|
let leftDown = false;
|
|
95620
95630
|
let rightDown = false;
|
|
95621
95631
|
|
|
95622
|
-
|
|
95632
|
+
this.canvas = this._scene.canvas.canvas;
|
|
95623
95633
|
|
|
95624
95634
|
const tickifiedMouseMoveFn = scene.tickify(
|
|
95625
95635
|
(this._canvasMouseMoveHandler = (e) => {
|
|
@@ -95701,8 +95711,8 @@ class MousePickHandler {
|
|
|
95701
95711
|
})
|
|
95702
95712
|
);
|
|
95703
95713
|
|
|
95704
|
-
canvas.addEventListener("mousemove", tickifiedMouseMoveFn);
|
|
95705
|
-
canvas.addEventListener(
|
|
95714
|
+
this.canvas.addEventListener("mousemove", tickifiedMouseMoveFn);
|
|
95715
|
+
this.canvas.addEventListener(
|
|
95706
95716
|
"dblclick",
|
|
95707
95717
|
(this._canvasDblClickHandler = (e) => {
|
|
95708
95718
|
states.mouseDownClientX = e.clientX;
|
|
@@ -95733,7 +95743,7 @@ class MousePickHandler {
|
|
|
95733
95743
|
})
|
|
95734
95744
|
);
|
|
95735
95745
|
|
|
95736
|
-
canvas.addEventListener(
|
|
95746
|
+
this.canvas.addEventListener(
|
|
95737
95747
|
"mousedown",
|
|
95738
95748
|
(this._canvasMouseDownHandler = (e) => {
|
|
95739
95749
|
if (e.which === 1) {
|
|
@@ -95772,6 +95782,7 @@ class MousePickHandler {
|
|
|
95772
95782
|
const pickResult = pickController.pickResult;
|
|
95773
95783
|
|
|
95774
95784
|
if (pickResult && pickResult.worldPos) {
|
|
95785
|
+
pivotController.setCanvasPivotPos(states.pointerCanvasPos);
|
|
95775
95786
|
cameraControl.fire("mouseDownEntity", pickController.pickResult, true);
|
|
95776
95787
|
} else {
|
|
95777
95788
|
if (configs.smartPivot) {
|
|
@@ -95804,7 +95815,7 @@ class MousePickHandler {
|
|
|
95804
95815
|
})
|
|
95805
95816
|
);
|
|
95806
95817
|
|
|
95807
|
-
canvas.addEventListener(
|
|
95818
|
+
this.canvas.addEventListener(
|
|
95808
95819
|
"mouseup",
|
|
95809
95820
|
(this._canvasMouseUpHandler = (e) => {
|
|
95810
95821
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
@@ -95978,12 +95989,13 @@ class MousePickHandler {
|
|
|
95978
95989
|
}
|
|
95979
95990
|
|
|
95980
95991
|
destroy() {
|
|
95981
|
-
|
|
95982
|
-
|
|
95983
|
-
|
|
95984
|
-
|
|
95992
|
+
if (this.canvas != null) {
|
|
95993
|
+
this.canvas.removeEventListener("mousemove", this._canvasMouseMoveHandler);
|
|
95994
|
+
this.canvas.removeEventListener("mousedown", this._canvasMouseDownHandler);
|
|
95995
|
+
this.canvas.removeEventListener("dblclick", this._canvasDblClickHandler);
|
|
95996
|
+
this.canvas.removeEventListener("mouseup", this._canvasMouseUpHandler);
|
|
95997
|
+
}
|
|
95985
95998
|
document.removeEventListener("mouseup", this._documentMouseUpHandler);
|
|
95986
|
-
canvas.removeEventListener("mouseup", this._canvasMouseUpHandler);
|
|
95987
95999
|
if (this._timeout) {
|
|
95988
96000
|
window.clearTimeout(this._timeout);
|
|
95989
96001
|
this._timeout = null;
|
|
@@ -95999,7 +96011,7 @@ class KeyboardPanRotateDollyHandler {
|
|
|
95999
96011
|
this._scene = scene;
|
|
96000
96012
|
this._updates = updates;
|
|
96001
96013
|
const input = scene.input;
|
|
96002
|
-
|
|
96014
|
+
this.input = input;
|
|
96003
96015
|
const keyDownMap = [];
|
|
96004
96016
|
|
|
96005
96017
|
const canvas = scene.canvas.canvas;
|
|
@@ -96153,9 +96165,9 @@ class KeyboardPanRotateDollyHandler {
|
|
|
96153
96165
|
destroy() {
|
|
96154
96166
|
this._scene.off(this._onTick);
|
|
96155
96167
|
|
|
96156
|
-
this.
|
|
96157
|
-
this.
|
|
96158
|
-
this.
|
|
96168
|
+
this.input.off(this._onSceneMouseMove);
|
|
96169
|
+
this.input.off(this._onSceneKeyDown);
|
|
96170
|
+
this.input.off(this._onSceneKeyUp);
|
|
96159
96171
|
}
|
|
96160
96172
|
}
|
|
96161
96173
|
|
|
@@ -96274,7 +96286,7 @@ class CameraUpdater {
|
|
|
96274
96286
|
|
|
96275
96287
|
if ((!configs.firstPerson) && configs.followPointer && pivotController.getPivoting()) {
|
|
96276
96288
|
pivotController.continuePivot(updates.rotateDeltaY, updates.rotateDeltaX);
|
|
96277
|
-
pivotController.showPivot();
|
|
96289
|
+
// pivotController.showPivot();
|
|
96278
96290
|
|
|
96279
96291
|
} else {
|
|
96280
96292
|
|
|
@@ -96475,42 +96487,42 @@ class MouseMiscHandler {
|
|
|
96475
96487
|
constructor(scene, controllers, configs, states, updates) {
|
|
96476
96488
|
this._scene = scene;
|
|
96477
96489
|
|
|
96478
|
-
|
|
96490
|
+
this.canvas = this._scene.canvas.canvas;
|
|
96479
96491
|
|
|
96480
|
-
canvas.addEventListener(
|
|
96492
|
+
this.canvas.addEventListener(
|
|
96481
96493
|
"mouseenter",
|
|
96482
96494
|
(this._mouseEnterHandler = () => {
|
|
96483
96495
|
states.mouseover = true;
|
|
96484
96496
|
})
|
|
96485
96497
|
);
|
|
96486
96498
|
|
|
96487
|
-
canvas.addEventListener(
|
|
96499
|
+
this.canvas.addEventListener(
|
|
96488
96500
|
"mouseleave",
|
|
96489
96501
|
(this._mouseLeaveHandler = () => {
|
|
96490
96502
|
states.mouseover = false;
|
|
96491
|
-
canvas.style.cursor = null;
|
|
96503
|
+
this.canvas.style.cursor = null;
|
|
96492
96504
|
})
|
|
96493
96505
|
);
|
|
96494
96506
|
|
|
96495
96507
|
document.addEventListener(
|
|
96496
96508
|
"mousemove",
|
|
96497
96509
|
(this._mouseMoveHandler = (e) => {
|
|
96498
|
-
getCanvasPosFromEvent$2(e, canvas, states.pointerCanvasPos);
|
|
96510
|
+
getCanvasPosFromEvent$2(e, this.canvas, states.pointerCanvasPos);
|
|
96499
96511
|
})
|
|
96500
96512
|
);
|
|
96501
96513
|
|
|
96502
|
-
canvas.addEventListener(
|
|
96514
|
+
this.canvas.addEventListener(
|
|
96503
96515
|
"mousedown",
|
|
96504
96516
|
(this._mouseDownHandler = (e) => {
|
|
96505
96517
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
96506
96518
|
return;
|
|
96507
96519
|
}
|
|
96508
|
-
getCanvasPosFromEvent$2(e, canvas, states.pointerCanvasPos);
|
|
96520
|
+
getCanvasPosFromEvent$2(e, this.canvas, states.pointerCanvasPos);
|
|
96509
96521
|
states.mouseover = true;
|
|
96510
96522
|
})
|
|
96511
96523
|
);
|
|
96512
96524
|
|
|
96513
|
-
canvas.addEventListener(
|
|
96525
|
+
this.canvas.addEventListener(
|
|
96514
96526
|
"mouseup",
|
|
96515
96527
|
(this._mouseUpHandler = (e) => {
|
|
96516
96528
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
@@ -96523,16 +96535,15 @@ class MouseMiscHandler {
|
|
|
96523
96535
|
reset() {}
|
|
96524
96536
|
|
|
96525
96537
|
destroy() {
|
|
96526
|
-
const canvas = this._scene.canvas.canvas;
|
|
96527
96538
|
//网络问题导致的模型加载失败等情况时,如果切换模型,会找不到canvas
|
|
96528
96539
|
//因此暂时在此加判断
|
|
96529
|
-
if (canvas) {
|
|
96530
|
-
|
|
96531
|
-
canvas.removeEventListener("
|
|
96532
|
-
canvas.removeEventListener("
|
|
96533
|
-
canvas.removeEventListener("
|
|
96534
|
-
canvas.removeEventListener("mouseup", this._mouseUpHandler);
|
|
96540
|
+
if (this.canvas != null) {
|
|
96541
|
+
this.canvas.removeEventListener("mouseenter", this._mouseEnterHandler);
|
|
96542
|
+
this.canvas.removeEventListener("mouseleave", this._mouseLeaveHandler);
|
|
96543
|
+
this.canvas.removeEventListener("mousedown", this._mouseDownHandler);
|
|
96544
|
+
this.canvas.removeEventListener("mouseup", this._mouseUpHandler);
|
|
96535
96545
|
}
|
|
96546
|
+
document.removeEventListener("mousemove", this._mouseMoveHandler);
|
|
96536
96547
|
}
|
|
96537
96548
|
}
|
|
96538
96549
|
|
|
@@ -96585,7 +96596,7 @@ class TouchPanRotateAndDollyHandler {
|
|
|
96585
96596
|
const touch0Vec = math.vec2();
|
|
96586
96597
|
|
|
96587
96598
|
const lastCanvasTouchPosList = [];
|
|
96588
|
-
|
|
96599
|
+
this.canvas = this._scene.canvas.canvas;
|
|
96589
96600
|
|
|
96590
96601
|
let numTouches = 0;
|
|
96591
96602
|
let waitForTick = false;
|
|
@@ -96594,12 +96605,13 @@ class TouchPanRotateAndDollyHandler {
|
|
|
96594
96605
|
waitForTick = false;
|
|
96595
96606
|
});
|
|
96596
96607
|
|
|
96597
|
-
canvas.addEventListener(
|
|
96608
|
+
this.canvas.addEventListener(
|
|
96598
96609
|
"touchstart",
|
|
96599
96610
|
(this._canvasTouchStartHandler = (event) => {
|
|
96600
96611
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
96601
96612
|
return;
|
|
96602
96613
|
}
|
|
96614
|
+
if (!event.isTrusted) return;
|
|
96603
96615
|
|
|
96604
96616
|
event.preventDefault();
|
|
96605
96617
|
|
|
@@ -96617,31 +96629,33 @@ class TouchPanRotateAndDollyHandler {
|
|
|
96617
96629
|
pickController.pickCursorPos = tapStartCanvasPos;
|
|
96618
96630
|
pickController.schedulePickSurface = true;
|
|
96619
96631
|
pickController.update();
|
|
96620
|
-
|
|
96621
|
-
|
|
96622
|
-
|
|
96623
|
-
|
|
96624
|
-
|
|
96625
|
-
|
|
96626
|
-
|
|
96627
|
-
|
|
96628
|
-
|
|
96629
|
-
|
|
96630
|
-
|
|
96631
|
-
|
|
96632
|
-
|
|
96633
|
-
|
|
96634
|
-
|
|
96635
|
-
|
|
96636
|
-
|
|
96637
|
-
|
|
96638
|
-
|
|
96639
|
-
|
|
96640
|
-
|
|
96641
|
-
|
|
96642
|
-
|
|
96643
|
-
|
|
96644
|
-
}
|
|
96632
|
+
pivotController.setPivotPos(scene.camera.look);
|
|
96633
|
+
|
|
96634
|
+
// if (!configs.planView) {
|
|
96635
|
+
// if (
|
|
96636
|
+
// pickController.picked &&
|
|
96637
|
+
// pickController.pickedSurface &&
|
|
96638
|
+
// pickController.pickResult &&
|
|
96639
|
+
// pickController.pickResult.worldPos
|
|
96640
|
+
// ) {
|
|
96641
|
+
// // pivotController.setPivotPos(pickController.pickResult.worldPos);
|
|
96642
|
+
// pivotController.setPivotPos(scene.camera.look);
|
|
96643
|
+
// if (!configs.firstPerson && pivotController.startPivot()) {
|
|
96644
|
+
// // pivotController.showPivot();
|
|
96645
|
+
// }
|
|
96646
|
+
// } else {
|
|
96647
|
+
// if (configs.smartPivot) {
|
|
96648
|
+
// pivotController.setPivotPos(scene.camera.look);
|
|
96649
|
+
// // pivotController.setCanvasPivotPos(states.pointerCanvasPos);
|
|
96650
|
+
// } else {
|
|
96651
|
+
// pivotController.setPivotPos(scene.camera.look);
|
|
96652
|
+
// }
|
|
96653
|
+
|
|
96654
|
+
// if (!configs.firstPerson && pivotController.startPivot()) {
|
|
96655
|
+
// // pivotController.showPivot();
|
|
96656
|
+
// }
|
|
96657
|
+
// }
|
|
96658
|
+
// }
|
|
96645
96659
|
}
|
|
96646
96660
|
}
|
|
96647
96661
|
|
|
@@ -96657,7 +96671,7 @@ class TouchPanRotateAndDollyHandler {
|
|
|
96657
96671
|
})
|
|
96658
96672
|
);
|
|
96659
96673
|
|
|
96660
|
-
canvas.addEventListener(
|
|
96674
|
+
this.canvas.addEventListener(
|
|
96661
96675
|
"touchend",
|
|
96662
96676
|
(this._canvasTouchEndHandler = () => {
|
|
96663
96677
|
if (pivotController.getPivoting()) {
|
|
@@ -96666,8 +96680,9 @@ class TouchPanRotateAndDollyHandler {
|
|
|
96666
96680
|
}
|
|
96667
96681
|
})
|
|
96668
96682
|
);
|
|
96683
|
+
this.canvas.addEventListener("touchcancel", this._canvasTouchEndHandler);
|
|
96669
96684
|
|
|
96670
|
-
canvas.addEventListener(
|
|
96685
|
+
this.canvas.addEventListener(
|
|
96671
96686
|
"touchmove",
|
|
96672
96687
|
(this._canvasTouchMoveHandler = (event) => {
|
|
96673
96688
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
@@ -96813,10 +96828,12 @@ class TouchPanRotateAndDollyHandler {
|
|
|
96813
96828
|
reset() {}
|
|
96814
96829
|
|
|
96815
96830
|
destroy() {
|
|
96816
|
-
|
|
96817
|
-
|
|
96818
|
-
|
|
96819
|
-
|
|
96831
|
+
if (this.canvas != null) {
|
|
96832
|
+
this.canvas.removeEventListener("touchstart", this._canvasTouchStartHandler);
|
|
96833
|
+
this.canvas.removeEventListener("touchend", this._canvasTouchEndHandler);
|
|
96834
|
+
this.canvas.removeEventListener("touchcancel", this._canvasTouchEndHandler);
|
|
96835
|
+
this.canvas.removeEventListener("touchmove", this._canvasTouchMoveHandler);
|
|
96836
|
+
}
|
|
96820
96837
|
this._scene.off(this._onTick);
|
|
96821
96838
|
}
|
|
96822
96839
|
}
|
|
@@ -96861,7 +96878,7 @@ class TouchPickHandler {
|
|
|
96861
96878
|
let tapStartTime = -1;
|
|
96862
96879
|
let lastTapTime = -1;
|
|
96863
96880
|
|
|
96864
|
-
|
|
96881
|
+
this.canvas = this._scene.canvas.canvas;
|
|
96865
96882
|
|
|
96866
96883
|
const flyCameraTo = (pickResult) => {
|
|
96867
96884
|
let pos;
|
|
@@ -96885,12 +96902,13 @@ class TouchPickHandler {
|
|
|
96885
96902
|
}
|
|
96886
96903
|
};
|
|
96887
96904
|
|
|
96888
|
-
canvas.addEventListener(
|
|
96905
|
+
this.canvas.addEventListener(
|
|
96889
96906
|
"touchstart",
|
|
96890
96907
|
(this._canvasTouchStartHandler = (e) => {
|
|
96891
96908
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
96892
96909
|
return;
|
|
96893
96910
|
}
|
|
96911
|
+
if (!e.isTrusted) return;
|
|
96894
96912
|
|
|
96895
96913
|
if (states.longTouchTimeout !== null) {
|
|
96896
96914
|
clearTimeout(states.longTouchTimeout);
|
|
@@ -96962,7 +96980,7 @@ class TouchPickHandler {
|
|
|
96962
96980
|
{ passive: true }
|
|
96963
96981
|
);
|
|
96964
96982
|
|
|
96965
|
-
canvas.addEventListener(
|
|
96983
|
+
this.canvas.addEventListener(
|
|
96966
96984
|
"touchend",
|
|
96967
96985
|
(this._canvasTouchEndHandler = (e) => {
|
|
96968
96986
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
@@ -97058,6 +97076,8 @@ class TouchPickHandler {
|
|
|
97058
97076
|
}),
|
|
97059
97077
|
{ passive: true }
|
|
97060
97078
|
);
|
|
97079
|
+
|
|
97080
|
+
this.canvas.addEventListener("touchcancel", this._canvasTouchEndHandler);
|
|
97061
97081
|
}
|
|
97062
97082
|
|
|
97063
97083
|
reset() {
|
|
@@ -97067,9 +97087,11 @@ class TouchPickHandler {
|
|
|
97067
97087
|
}
|
|
97068
97088
|
|
|
97069
97089
|
destroy() {
|
|
97070
|
-
|
|
97071
|
-
|
|
97072
|
-
|
|
97090
|
+
if (this.canvas != null) {
|
|
97091
|
+
this.canvas.removeEventListener("touchstart", this._canvasTouchStartHandler);
|
|
97092
|
+
this.canvas.removeEventListener("touchend", this._canvasTouchEndHandler);
|
|
97093
|
+
this.canvas.removeEventListener("touchcancel", this._canvasTouchEndHandler);
|
|
97094
|
+
}
|
|
97073
97095
|
}
|
|
97074
97096
|
}
|
|
97075
97097
|
|
|
@@ -108358,13 +108380,16 @@ class Viewer {
|
|
|
108358
108380
|
this._snapshotBegun = false;
|
|
108359
108381
|
}
|
|
108360
108382
|
|
|
108361
|
-
/**
|
|
108383
|
+
/**
|
|
108384
|
+
* Destroys this Viewer.
|
|
108362
108385
|
*/
|
|
108363
108386
|
destroy(callback) {
|
|
108364
108387
|
const plugins = this._plugins.slice(); // Array will modify as we delete plugins
|
|
108365
|
-
|
|
108366
|
-
|
|
108367
|
-
|
|
108388
|
+
if (plugins.length > 0) {
|
|
108389
|
+
for (let i = 0, len = plugins.length; i < len; i++) {
|
|
108390
|
+
const plugin = plugins[i];
|
|
108391
|
+
plugin.destroy();
|
|
108392
|
+
}
|
|
108368
108393
|
}
|
|
108369
108394
|
this.cameraControl.destroy();
|
|
108370
108395
|
this.scene.destroy(callback);
|
|
@@ -120912,7 +120937,7 @@ class Control {
|
|
|
120912
120937
|
//touchend
|
|
120913
120938
|
canvas.addEventListener(
|
|
120914
120939
|
"touchend",
|
|
120915
|
-
(this.
|
|
120940
|
+
(this._canvasTouchEndListener = (e) => {
|
|
120916
120941
|
// if (!this._visible) return;
|
|
120917
120942
|
this._viewer.cameraControl.pointerEnabled = true;
|
|
120918
120943
|
if (lastAffordanceMesh) {
|
|
@@ -120924,6 +120949,7 @@ class Control {
|
|
|
120924
120949
|
grabbed = false;
|
|
120925
120950
|
})
|
|
120926
120951
|
);
|
|
120952
|
+
canvas.addEventListener("touchcancel", this._canvasTouchEndListener);
|
|
120927
120953
|
}
|
|
120928
120954
|
}
|
|
120929
120955
|
|
|
@@ -120945,6 +120971,8 @@ class Control {
|
|
|
120945
120971
|
canvas.removeEventListener("mousemove", this._canvasMouseMoveListener);
|
|
120946
120972
|
canvas.removeEventListener("mouseup", this._canvasMouseUpListener);
|
|
120947
120973
|
canvas.removeEventListener("wheel", this._canvasWheelListener);
|
|
120974
|
+
canvas.removeEventListener("touchend", this._canvasTouchEndListener);
|
|
120975
|
+
canvas.removeEventListener("touchcancel", this._canvasTouchEndListener);
|
|
120948
120976
|
|
|
120949
120977
|
camera.off(this._onCameraViewMatrix);
|
|
120950
120978
|
camera.off(this._onCameraProjMatrix);
|
|
@@ -121131,235 +121159,241 @@ class Plane$1 {
|
|
|
121131
121159
|
* @private
|
|
121132
121160
|
*/
|
|
121133
121161
|
class Overview$1 {
|
|
121162
|
+
/**
|
|
121163
|
+
* @private
|
|
121164
|
+
*/
|
|
121165
|
+
constructor(plugin, cfg) {
|
|
121166
|
+
if (!cfg.onHoverEnterPlane || !cfg.onHoverLeavePlane || !cfg.onClickedNothing || !cfg.onClickedPlane) {
|
|
121167
|
+
throw "Missing config(s): onHoverEnterPlane, onHoverLeavePlane, onClickedNothing || onClickedPlane";
|
|
121168
|
+
}
|
|
121134
121169
|
|
|
121135
|
-
|
|
121136
|
-
|
|
121137
|
-
|
|
121138
|
-
|
|
121139
|
-
|
|
121140
|
-
|
|
121141
|
-
throw "Missing config(s): onHoverEnterPlane, onHoverLeavePlane, onClickedNothing || onClickedPlane";
|
|
121142
|
-
}
|
|
121143
|
-
|
|
121144
|
-
/**
|
|
121145
|
-
* The {@link SectionPlanesPlugin} that owns this SectionPlanesOverview.
|
|
121146
|
-
*
|
|
121147
|
-
* @type {SectionPlanesPlugin}
|
|
121148
|
-
*/
|
|
121149
|
-
this.plugin = plugin;
|
|
121170
|
+
/**
|
|
121171
|
+
* The {@link SectionPlanesPlugin} that owns this SectionPlanesOverview.
|
|
121172
|
+
*
|
|
121173
|
+
* @type {SectionPlanesPlugin}
|
|
121174
|
+
*/
|
|
121175
|
+
this.plugin = plugin;
|
|
121150
121176
|
|
|
121151
|
-
|
|
121177
|
+
this._viewer = plugin.viewer;
|
|
121152
121178
|
|
|
121153
|
-
|
|
121154
|
-
|
|
121155
|
-
|
|
121156
|
-
|
|
121157
|
-
|
|
121179
|
+
this._onHoverEnterPlane = cfg.onHoverEnterPlane;
|
|
121180
|
+
this._onHoverLeavePlane = cfg.onHoverLeavePlane;
|
|
121181
|
+
this._onClickedNothing = cfg.onClickedNothing;
|
|
121182
|
+
this._onClickedPlane = cfg.onClickedPlane;
|
|
121183
|
+
this._visible = true;
|
|
121158
121184
|
|
|
121159
|
-
|
|
121185
|
+
this._planes = {};
|
|
121160
121186
|
|
|
121161
|
-
|
|
121162
|
-
|
|
121163
|
-
|
|
121187
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121188
|
+
// Init canvas
|
|
121189
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121164
121190
|
|
|
121165
|
-
|
|
121191
|
+
this._canvas = cfg.overviewCanvas;
|
|
121166
121192
|
|
|
121167
|
-
|
|
121168
|
-
|
|
121169
|
-
|
|
121193
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121194
|
+
// Init scene
|
|
121195
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121170
121196
|
|
|
121171
|
-
|
|
121172
|
-
|
|
121173
|
-
|
|
121174
|
-
|
|
121175
|
-
|
|
121176
|
-
|
|
121177
|
-
|
|
121178
|
-
|
|
121179
|
-
|
|
121180
|
-
|
|
121181
|
-
|
|
121182
|
-
|
|
121183
|
-
|
|
121184
|
-
|
|
121185
|
-
|
|
121186
|
-
|
|
121187
|
-
|
|
121188
|
-
|
|
121189
|
-
|
|
121190
|
-
|
|
121191
|
-
|
|
121192
|
-
|
|
121193
|
-
|
|
121197
|
+
this._scene = new Scene(this._viewer, {
|
|
121198
|
+
canvasId: this._canvas.id,
|
|
121199
|
+
transparent: true
|
|
121200
|
+
});
|
|
121201
|
+
this._scene.clearLights();
|
|
121202
|
+
new DirLight(this._scene, {
|
|
121203
|
+
dir: [0.4, -0.4, 0.8],
|
|
121204
|
+
color: [0.8, 1.0, 1.0],
|
|
121205
|
+
intensity: 1.0,
|
|
121206
|
+
space: "view"
|
|
121207
|
+
});
|
|
121208
|
+
new DirLight(this._scene, {
|
|
121209
|
+
dir: [-0.8, -0.3, -0.4],
|
|
121210
|
+
color: [0.8, 0.8, 0.8],
|
|
121211
|
+
intensity: 1.0,
|
|
121212
|
+
space: "view"
|
|
121213
|
+
});
|
|
121214
|
+
new DirLight(this._scene, {
|
|
121215
|
+
dir: [0.8, -0.6, -0.8],
|
|
121216
|
+
color: [1.0, 1.0, 1.0],
|
|
121217
|
+
intensity: 1.0,
|
|
121218
|
+
space: "view"
|
|
121219
|
+
});
|
|
121194
121220
|
|
|
121195
|
-
|
|
121196
|
-
|
|
121221
|
+
this._scene.camera;
|
|
121222
|
+
this._scene.camera.perspective.fov = 70;
|
|
121197
121223
|
|
|
121198
|
-
|
|
121224
|
+
this._zUp = false;
|
|
121199
121225
|
|
|
121200
|
-
|
|
121201
|
-
|
|
121202
|
-
|
|
121226
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121227
|
+
// Synchronize overview scene camera with viewer camera
|
|
121228
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121203
121229
|
|
|
121204
|
-
|
|
121205
|
-
|
|
121206
|
-
|
|
121207
|
-
|
|
121208
|
-
|
|
121209
|
-
|
|
121210
|
-
|
|
121211
|
-
|
|
121212
|
-
|
|
121213
|
-
|
|
121214
|
-
|
|
121215
|
-
|
|
121216
|
-
|
|
121217
|
-
|
|
121218
|
-
|
|
121219
|
-
|
|
121220
|
-
|
|
121221
|
-
|
|
121222
|
-
|
|
121223
|
-
|
|
121224
|
-
|
|
121225
|
-
|
|
121226
|
-
|
|
121227
|
-
|
|
121228
|
-
|
|
121230
|
+
{
|
|
121231
|
+
const camera = this._scene.camera;
|
|
121232
|
+
const matrix = math.rotationMat4c(-90 * math.DEGTORAD, 1, 0, 0);
|
|
121233
|
+
const eyeLookVec = math.vec3();
|
|
121234
|
+
const eyeLookVecOverview = math.vec3();
|
|
121235
|
+
const upOverview = math.vec3();
|
|
121236
|
+
|
|
121237
|
+
this._synchCamera = () => {
|
|
121238
|
+
const eye = this._viewer.camera.eye;
|
|
121239
|
+
const look = this._viewer.camera.look;
|
|
121240
|
+
const up = this._viewer.camera.up;
|
|
121241
|
+
math.mulVec3Scalar(math.normalizeVec3(math.subVec3(eye, look, eyeLookVec)), 7);
|
|
121242
|
+
if (this._zUp) {
|
|
121243
|
+
// +Z up
|
|
121244
|
+
math.transformVec3(matrix, eyeLookVec, eyeLookVecOverview);
|
|
121245
|
+
math.transformVec3(matrix, up, upOverview);
|
|
121246
|
+
camera.look = [0, 0, 0];
|
|
121247
|
+
camera.eye = math.transformVec3(matrix, eyeLookVec, eyeLookVecOverview);
|
|
121248
|
+
camera.up = math.transformPoint3(matrix, up, upOverview);
|
|
121249
|
+
} else {
|
|
121250
|
+
// +Y up
|
|
121251
|
+
camera.look = [0, 0, 0];
|
|
121252
|
+
camera.eye = eyeLookVec;
|
|
121253
|
+
camera.up = up;
|
|
121254
|
+
}
|
|
121255
|
+
};
|
|
121256
|
+
}
|
|
121229
121257
|
|
|
121230
|
-
|
|
121258
|
+
this._onViewerCameraMatrix = this._viewer.camera.on("matrix", this._synchCamera);
|
|
121231
121259
|
|
|
121232
|
-
|
|
121260
|
+
this._onViewerCameraWorldAxis = this._viewer.camera.on("worldAxis", this._synchCamera);
|
|
121233
121261
|
|
|
121234
|
-
|
|
121235
|
-
|
|
121236
|
-
|
|
121262
|
+
this._onViewerCameraFOV = this._viewer.camera.perspective.on("fov", (fov) => {
|
|
121263
|
+
this._scene.camera.perspective.fov = fov;
|
|
121264
|
+
});
|
|
121237
121265
|
|
|
121238
|
-
|
|
121239
|
-
|
|
121240
|
-
|
|
121266
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121267
|
+
// Bind overview canvas events
|
|
121268
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121241
121269
|
|
|
121242
|
-
|
|
121243
|
-
|
|
121270
|
+
{
|
|
121271
|
+
var hoveredEntity = null;
|
|
121244
121272
|
|
|
121245
|
-
|
|
121246
|
-
|
|
121247
|
-
|
|
121248
|
-
|
|
121249
|
-
|
|
121250
|
-
|
|
121251
|
-
|
|
121252
|
-
|
|
121253
|
-
|
|
121254
|
-
|
|
121255
|
-
|
|
121256
|
-
|
|
121257
|
-
|
|
121258
|
-
|
|
121259
|
-
|
|
121260
|
-
|
|
121261
|
-
|
|
121262
|
-
|
|
121263
|
-
|
|
121264
|
-
|
|
121265
|
-
|
|
121266
|
-
|
|
121267
|
-
|
|
121268
|
-
|
|
121269
|
-
|
|
121273
|
+
this._onInputMouseMove = this._scene.input.on("mousemove", (coords) => {
|
|
121274
|
+
const hit = this._scene.pick({
|
|
121275
|
+
canvasPos: coords
|
|
121276
|
+
});
|
|
121277
|
+
if (hit) {
|
|
121278
|
+
if (!hoveredEntity || hit.entity.id !== hoveredEntity.id) {
|
|
121279
|
+
if (hoveredEntity) {
|
|
121280
|
+
const plane = this._planes[hoveredEntity.id];
|
|
121281
|
+
if (plane) {
|
|
121282
|
+
this._onHoverLeavePlane(hoveredEntity.id);
|
|
121283
|
+
}
|
|
121284
|
+
}
|
|
121285
|
+
hoveredEntity = hit.entity;
|
|
121286
|
+
const plane = this._planes[hoveredEntity.id];
|
|
121287
|
+
if (plane) {
|
|
121288
|
+
this._onHoverEnterPlane(hoveredEntity.id);
|
|
121289
|
+
}
|
|
121290
|
+
}
|
|
121291
|
+
} else {
|
|
121292
|
+
if (hoveredEntity) {
|
|
121293
|
+
this._onHoverLeavePlane(hoveredEntity.id);
|
|
121294
|
+
hoveredEntity = null;
|
|
121295
|
+
}
|
|
121296
|
+
}
|
|
121297
|
+
});
|
|
121270
121298
|
|
|
121271
|
-
|
|
121272
|
-
|
|
121273
|
-
|
|
121274
|
-
|
|
121275
|
-
|
|
121276
|
-
|
|
121277
|
-
|
|
121278
|
-
|
|
121279
|
-
|
|
121280
|
-
|
|
121299
|
+
this._scene.canvas.canvas.addEventListener(
|
|
121300
|
+
"mouseup",
|
|
121301
|
+
(this._onCanvasMouseUp = () => {
|
|
121302
|
+
if (hoveredEntity) {
|
|
121303
|
+
const plane = this._planes[hoveredEntity.id];
|
|
121304
|
+
if (plane) {
|
|
121305
|
+
this._onClickedPlane(hoveredEntity.id);
|
|
121306
|
+
}
|
|
121307
|
+
} else {
|
|
121308
|
+
this._onClickedNothing();
|
|
121309
|
+
}
|
|
121310
|
+
})
|
|
121311
|
+
);
|
|
121281
121312
|
|
|
121282
|
-
|
|
121283
|
-
|
|
121284
|
-
|
|
121285
|
-
|
|
121286
|
-
|
|
121287
|
-
|
|
121288
|
-
|
|
121313
|
+
this._scene.canvas.canvas.addEventListener(
|
|
121314
|
+
"mouseout",
|
|
121315
|
+
(this._onCanvasMouseOut = () => {
|
|
121316
|
+
if (hoveredEntity) {
|
|
121317
|
+
this._onHoverLeavePlane(hoveredEntity.id);
|
|
121318
|
+
hoveredEntity = null;
|
|
121319
|
+
}
|
|
121320
|
+
})
|
|
121321
|
+
);
|
|
121322
|
+
}
|
|
121289
121323
|
|
|
121290
|
-
|
|
121291
|
-
|
|
121292
|
-
|
|
121324
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121325
|
+
// Configure overview
|
|
121326
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
121293
121327
|
|
|
121294
|
-
|
|
121295
|
-
|
|
121328
|
+
this.setVisible(cfg.overviewVisible);
|
|
121329
|
+
}
|
|
121296
121330
|
|
|
121297
|
-
|
|
121298
|
-
|
|
121299
|
-
|
|
121300
|
-
|
|
121301
|
-
|
|
121302
|
-
|
|
121331
|
+
/** Called by SectionPlanesPlugin#createSectionPlane()
|
|
121332
|
+
* @private
|
|
121333
|
+
*/
|
|
121334
|
+
addSectionPlane(sectionPlane) {
|
|
121335
|
+
this._planes[sectionPlane.id] = new Plane$1(this, this._scene, sectionPlane);
|
|
121336
|
+
}
|
|
121303
121337
|
|
|
121304
|
-
|
|
121305
|
-
|
|
121306
|
-
|
|
121307
|
-
|
|
121308
|
-
|
|
121309
|
-
|
|
121310
|
-
|
|
121311
|
-
|
|
121338
|
+
/** @private
|
|
121339
|
+
*/
|
|
121340
|
+
setPlaneHighlighted(id, highlighted) {
|
|
121341
|
+
const plane = this._planes[id];
|
|
121342
|
+
if (plane) {
|
|
121343
|
+
plane.setHighlighted(highlighted);
|
|
121344
|
+
}
|
|
121345
|
+
}
|
|
121312
121346
|
|
|
121313
|
-
|
|
121314
|
-
|
|
121315
|
-
|
|
121316
|
-
|
|
121317
|
-
|
|
121318
|
-
|
|
121319
|
-
|
|
121320
|
-
|
|
121347
|
+
/** @private
|
|
121348
|
+
*/
|
|
121349
|
+
setPlaneSelected(id, selected) {
|
|
121350
|
+
const plane = this._planes[id];
|
|
121351
|
+
if (plane) {
|
|
121352
|
+
plane.setSelected(selected);
|
|
121353
|
+
}
|
|
121354
|
+
}
|
|
121321
121355
|
|
|
121322
|
-
|
|
121323
|
-
|
|
121324
|
-
|
|
121325
|
-
|
|
121326
|
-
|
|
121327
|
-
|
|
121328
|
-
|
|
121329
|
-
|
|
121330
|
-
|
|
121356
|
+
/** @private
|
|
121357
|
+
*/
|
|
121358
|
+
removeSectionPlane(sectionPlane) {
|
|
121359
|
+
const plane = this._planes[sectionPlane.id];
|
|
121360
|
+
if (plane) {
|
|
121361
|
+
plane.destroy();
|
|
121362
|
+
delete this._planes[sectionPlane.id];
|
|
121363
|
+
}
|
|
121364
|
+
}
|
|
121331
121365
|
|
|
121332
|
-
|
|
121333
|
-
|
|
121334
|
-
|
|
121335
|
-
|
|
121336
|
-
|
|
121337
|
-
|
|
121338
|
-
|
|
121339
|
-
|
|
121340
|
-
|
|
121366
|
+
/**
|
|
121367
|
+
* Sets if this SectionPlanesOverview is visible.
|
|
121368
|
+
*
|
|
121369
|
+
* @param {Boolean} visible Whether or not this SectionPlanesOverview is visible.
|
|
121370
|
+
*/
|
|
121371
|
+
setVisible(visible = true) {
|
|
121372
|
+
this._visible = visible;
|
|
121373
|
+
this._canvas.style.visibility = visible ? "visible" : "hidden";
|
|
121374
|
+
}
|
|
121341
121375
|
|
|
121342
|
-
|
|
121343
|
-
|
|
121344
|
-
|
|
121345
|
-
|
|
121346
|
-
|
|
121347
|
-
|
|
121348
|
-
|
|
121349
|
-
|
|
121376
|
+
/**
|
|
121377
|
+
* Gets if this SectionPlanesOverview is visible.
|
|
121378
|
+
*
|
|
121379
|
+
* @return {Boolean} True when this SectionPlanesOverview is visible.
|
|
121380
|
+
*/
|
|
121381
|
+
getVisible() {
|
|
121382
|
+
return this._visible;
|
|
121383
|
+
}
|
|
121350
121384
|
|
|
121351
|
-
|
|
121352
|
-
|
|
121353
|
-
|
|
121354
|
-
|
|
121355
|
-
|
|
121356
|
-
|
|
121385
|
+
/** @private
|
|
121386
|
+
*/
|
|
121387
|
+
destroy() {
|
|
121388
|
+
this._viewer.camera.off(this._onViewerCameraMatrix);
|
|
121389
|
+
this._viewer.camera.off(this._onViewerCameraWorldAxis);
|
|
121390
|
+
this._viewer.camera.perspective.off(this._onViewerCameraFOV);
|
|
121357
121391
|
|
|
121358
|
-
|
|
121359
|
-
|
|
121360
|
-
|
|
121361
|
-
|
|
121362
|
-
|
|
121392
|
+
this._scene.input.off(this._onInputMouseMove);
|
|
121393
|
+
this._scene.canvas.canvas.removeEventListener("mouseup", this._onCanvasMouseUp);
|
|
121394
|
+
this._scene.canvas.canvas.removeEventListener("mouseout", this._onCanvasMouseOut);
|
|
121395
|
+
this._scene.destroy();
|
|
121396
|
+
}
|
|
121363
121397
|
}
|
|
121364
121398
|
|
|
121365
121399
|
const tempAABB$1 = math.AABB3();
|
|
@@ -122669,597 +122703,677 @@ const quat = new Float64Array(4);
|
|
|
122669
122703
|
* Controls a {@link SectionPlane} with mouse and touch input.
|
|
122670
122704
|
*/
|
|
122671
122705
|
class FaceAlignedSectionPlanesControl {
|
|
122706
|
+
/** @private */
|
|
122707
|
+
constructor(plugin) {
|
|
122708
|
+
/**
|
|
122709
|
+
* ID of this FaceAlignedSectionPlanesControl.
|
|
122710
|
+
*
|
|
122711
|
+
* FaceAlignedSectionPlanesControl are mapped by this ID in {@link FaceAlignedSectionPlanesPlugin#controls}.
|
|
122712
|
+
*
|
|
122713
|
+
* @property id
|
|
122714
|
+
* @type {String|Number}
|
|
122715
|
+
*/
|
|
122716
|
+
this.id = null;
|
|
122672
122717
|
|
|
122673
|
-
|
|
122674
|
-
|
|
122675
|
-
|
|
122676
|
-
|
|
122677
|
-
|
|
122678
|
-
|
|
122679
|
-
* FaceAlignedSectionPlanesControl are mapped by this ID in {@link FaceAlignedSectionPlanesPlugin#controls}.
|
|
122680
|
-
*
|
|
122681
|
-
* @property id
|
|
122682
|
-
* @type {String|Number}
|
|
122683
|
-
*/
|
|
122684
|
-
this.id = null;
|
|
122685
|
-
|
|
122686
|
-
this._viewer = plugin.viewer;
|
|
122687
|
-
this._plugin = plugin;
|
|
122688
|
-
this._visible = false;
|
|
122689
|
-
this._pos = math.vec3(); // Full-precision position of the center of the FaceAlignedSectionPlanesControl
|
|
122690
|
-
this._origin = math.vec3();
|
|
122691
|
-
this._rtcPos = math.vec3();
|
|
122692
|
-
|
|
122693
|
-
this._baseDir = math.vec3(); // Saves direction of clip plane when we start dragging an arrow or ring.
|
|
122694
|
-
this._rootNode = null; // Root of Node graph that represents this control in the 3D scene
|
|
122695
|
-
this._displayMeshes = null; // Meshes that are always visible
|
|
122696
|
-
this._affordanceMeshes = null; // Meshes displayed momentarily for affordance
|
|
122718
|
+
this._viewer = plugin.viewer;
|
|
122719
|
+
this._plugin = plugin;
|
|
122720
|
+
this._visible = false;
|
|
122721
|
+
this._pos = math.vec3(); // Full-precision position of the center of the FaceAlignedSectionPlanesControl
|
|
122722
|
+
this._origin = math.vec3();
|
|
122723
|
+
this._rtcPos = math.vec3();
|
|
122697
122724
|
|
|
122698
|
-
|
|
122725
|
+
this._baseDir = math.vec3(); // Saves direction of clip plane when we start dragging an arrow or ring.
|
|
122726
|
+
this._rootNode = null; // Root of Node graph that represents this control in the 3D scene
|
|
122727
|
+
this._displayMeshes = null; // Meshes that are always visible
|
|
122728
|
+
this._affordanceMeshes = null; // Meshes displayed momentarily for affordance
|
|
122699
122729
|
|
|
122700
|
-
|
|
122701
|
-
this._bindEvents();
|
|
122702
|
-
}
|
|
122730
|
+
this._ignoreNextSectionPlaneDirUpdate = false;
|
|
122703
122731
|
|
|
122704
|
-
|
|
122705
|
-
|
|
122706
|
-
|
|
122707
|
-
* Call with a null or undefined value to disconnect the FaceAlignedSectionPlanesControl ffrom whatever SectionPlane it was assigned to.
|
|
122708
|
-
* @private
|
|
122709
|
-
*/
|
|
122710
|
-
_setSectionPlane(sectionPlane) {
|
|
122711
|
-
if (this._sectionPlane) {
|
|
122712
|
-
this._sectionPlane.off(this._onSectionPlanePos);
|
|
122713
|
-
this._sectionPlane.off(this._onSectionPlaneDir);
|
|
122714
|
-
this._onSectionPlanePos = null;
|
|
122715
|
-
this._onSectionPlaneDir = null;
|
|
122716
|
-
this._sectionPlane = null;
|
|
122717
|
-
}
|
|
122718
|
-
if (sectionPlane) {
|
|
122719
|
-
this.id = sectionPlane.id;
|
|
122720
|
-
this._setPos(sectionPlane.pos);
|
|
122721
|
-
this._setDir(sectionPlane.dir);
|
|
122722
|
-
this._sectionPlane = sectionPlane;
|
|
122723
|
-
this._onSectionPlanePos = sectionPlane.on("pos", () => {
|
|
122724
|
-
this._setPos(this._sectionPlane.pos);
|
|
122725
|
-
});
|
|
122726
|
-
this._onSectionPlaneDir = sectionPlane.on("dir", () => {
|
|
122727
|
-
if (!this._ignoreNextSectionPlaneDirUpdate) {
|
|
122728
|
-
this._setDir(this._sectionPlane.dir);
|
|
122729
|
-
} else {
|
|
122730
|
-
this._ignoreNextSectionPlaneDirUpdate = false;
|
|
122731
|
-
}
|
|
122732
|
-
});
|
|
122733
|
-
}
|
|
122734
|
-
}
|
|
122732
|
+
this._createNodes();
|
|
122733
|
+
this._bindEvents();
|
|
122734
|
+
}
|
|
122735
122735
|
|
|
122736
|
-
|
|
122737
|
-
|
|
122738
|
-
|
|
122739
|
-
|
|
122740
|
-
|
|
122741
|
-
|
|
122742
|
-
|
|
122736
|
+
/**
|
|
122737
|
+
* Called by FaceAlignedSectionPlanesPlugin to assign this FaceAlignedSectionPlanesControl to a SectionPlane.
|
|
122738
|
+
* FaceAlignedSectionPlanesPlugin keeps FaceAlignedSectionPlanesControls in a reuse pool.
|
|
122739
|
+
* Call with a null or undefined value to disconnect the FaceAlignedSectionPlanesControl ffrom whatever SectionPlane it was assigned to.
|
|
122740
|
+
* @private
|
|
122741
|
+
*/
|
|
122742
|
+
_setSectionPlane(sectionPlane) {
|
|
122743
|
+
if (this._sectionPlane) {
|
|
122744
|
+
this._sectionPlane.off(this._onSectionPlanePos);
|
|
122745
|
+
this._sectionPlane.off(this._onSectionPlaneDir);
|
|
122746
|
+
this._onSectionPlanePos = null;
|
|
122747
|
+
this._onSectionPlaneDir = null;
|
|
122748
|
+
this._sectionPlane = null;
|
|
122749
|
+
}
|
|
122750
|
+
if (sectionPlane) {
|
|
122751
|
+
this.id = sectionPlane.id;
|
|
122752
|
+
this._setPos(sectionPlane.pos);
|
|
122753
|
+
this._setDir(sectionPlane.dir);
|
|
122754
|
+
this._sectionPlane = sectionPlane;
|
|
122755
|
+
this._onSectionPlanePos = sectionPlane.on("pos", () => {
|
|
122756
|
+
this._setPos(this._sectionPlane.pos);
|
|
122757
|
+
});
|
|
122758
|
+
this._onSectionPlaneDir = sectionPlane.on("dir", () => {
|
|
122759
|
+
if (!this._ignoreNextSectionPlaneDirUpdate) {
|
|
122760
|
+
this._setDir(this._sectionPlane.dir);
|
|
122761
|
+
} else {
|
|
122762
|
+
this._ignoreNextSectionPlaneDirUpdate = false;
|
|
122763
|
+
}
|
|
122764
|
+
});
|
|
122765
|
+
}
|
|
122766
|
+
}
|
|
122743
122767
|
|
|
122744
|
-
|
|
122745
|
-
|
|
122768
|
+
/**
|
|
122769
|
+
* Gets the {@link SectionPlane} controlled by this FaceAlignedSectionPlanesControl.
|
|
122770
|
+
* @returns {SectionPlane} The SectionPlane.
|
|
122771
|
+
*/
|
|
122772
|
+
get sectionPlane() {
|
|
122773
|
+
return this._sectionPlane;
|
|
122774
|
+
}
|
|
122746
122775
|
|
|
122747
|
-
|
|
122776
|
+
/** @private */
|
|
122777
|
+
_setPos(xyz) {
|
|
122778
|
+
this._pos.set(xyz);
|
|
122748
122779
|
|
|
122749
|
-
|
|
122780
|
+
worldToRTCPos(this._pos, this._origin, this._rtcPos);
|
|
122750
122781
|
|
|
122751
|
-
|
|
122752
|
-
|
|
122753
|
-
|
|
122782
|
+
this._rootNode.origin = this._origin;
|
|
122783
|
+
this._rootNode.position = this._rtcPos;
|
|
122784
|
+
}
|
|
122754
122785
|
|
|
122755
|
-
|
|
122756
|
-
|
|
122757
|
-
|
|
122758
|
-
|
|
122759
|
-
|
|
122786
|
+
/** @private */
|
|
122787
|
+
_setDir(xyz) {
|
|
122788
|
+
this._baseDir.set(xyz);
|
|
122789
|
+
this._rootNode.quaternion = math.vec3PairToQuaternion(zeroVec, xyz, quat);
|
|
122790
|
+
}
|
|
122760
122791
|
|
|
122761
|
-
|
|
122762
|
-
|
|
122763
|
-
|
|
122764
|
-
|
|
122765
|
-
|
|
122766
|
-
|
|
122792
|
+
_setSectionPlaneDir(dir) {
|
|
122793
|
+
if (this._sectionPlane) {
|
|
122794
|
+
this._ignoreNextSectionPlaneDirUpdate = true;
|
|
122795
|
+
this._sectionPlane.dir = dir;
|
|
122796
|
+
}
|
|
122797
|
+
}
|
|
122767
122798
|
|
|
122768
|
-
|
|
122769
|
-
|
|
122770
|
-
|
|
122771
|
-
|
|
122772
|
-
|
|
122773
|
-
|
|
122774
|
-
|
|
122775
|
-
|
|
122776
|
-
|
|
122777
|
-
|
|
122778
|
-
|
|
122779
|
-
|
|
122780
|
-
|
|
122781
|
-
|
|
122782
|
-
|
|
122783
|
-
|
|
122784
|
-
|
|
122785
|
-
|
|
122786
|
-
|
|
122787
|
-
|
|
122788
|
-
|
|
122789
|
-
|
|
122790
|
-
|
|
122791
|
-
|
|
122799
|
+
/**
|
|
122800
|
+
* Sets if this FaceAlignedSectionPlanesControl is visible.
|
|
122801
|
+
*
|
|
122802
|
+
* @type {Boolean}
|
|
122803
|
+
*/
|
|
122804
|
+
setVisible(visible = true) {
|
|
122805
|
+
if (this._visible === visible) {
|
|
122806
|
+
return;
|
|
122807
|
+
}
|
|
122808
|
+
this._visible = visible;
|
|
122809
|
+
var id;
|
|
122810
|
+
for (id in this._displayMeshes) {
|
|
122811
|
+
if (this._displayMeshes.hasOwnProperty(id)) {
|
|
122812
|
+
this._displayMeshes[id].visible = visible;
|
|
122813
|
+
}
|
|
122814
|
+
}
|
|
122815
|
+
if (!visible) {
|
|
122816
|
+
for (id in this._affordanceMeshes) {
|
|
122817
|
+
if (this._affordanceMeshes.hasOwnProperty(id)) {
|
|
122818
|
+
this._affordanceMeshes[id].visible = visible;
|
|
122819
|
+
}
|
|
122820
|
+
}
|
|
122821
|
+
}
|
|
122822
|
+
}
|
|
122792
122823
|
|
|
122793
|
-
|
|
122794
|
-
|
|
122795
|
-
|
|
122796
|
-
|
|
122797
|
-
|
|
122798
|
-
|
|
122799
|
-
|
|
122800
|
-
|
|
122824
|
+
/**
|
|
122825
|
+
* Gets if this FaceAlignedSectionPlanesControl is visible.
|
|
122826
|
+
*
|
|
122827
|
+
* @type {Boolean}
|
|
122828
|
+
*/
|
|
122829
|
+
getVisible() {
|
|
122830
|
+
return this._visible;
|
|
122831
|
+
}
|
|
122801
122832
|
|
|
122802
|
-
|
|
122803
|
-
|
|
122804
|
-
|
|
122805
|
-
|
|
122806
|
-
|
|
122807
|
-
|
|
122808
|
-
|
|
122809
|
-
|
|
122810
|
-
|
|
122811
|
-
|
|
122812
|
-
|
|
122813
|
-
|
|
122814
|
-
|
|
122815
|
-
|
|
122816
|
-
|
|
122817
|
-
|
|
122818
|
-
|
|
122819
|
-
|
|
122820
|
-
|
|
122821
|
-
|
|
122833
|
+
/**
|
|
122834
|
+
* Sets if this FaceAlignedSectionPlanesControl is culled. This is called by FaceAlignedSectionPlanesPlugin to
|
|
122835
|
+
* temporarily hide the FaceAlignedSectionPlanesControl while a snapshot is being taken by Viewer#getSnapshot().
|
|
122836
|
+
* @param culled
|
|
122837
|
+
*/
|
|
122838
|
+
setCulled(culled) {
|
|
122839
|
+
var id;
|
|
122840
|
+
for (id in this._displayMeshes) {
|
|
122841
|
+
if (this._displayMeshes.hasOwnProperty(id)) {
|
|
122842
|
+
this._displayMeshes[id].culled = culled;
|
|
122843
|
+
}
|
|
122844
|
+
}
|
|
122845
|
+
if (!culled) {
|
|
122846
|
+
for (id in this._affordanceMeshes) {
|
|
122847
|
+
if (this._affordanceMeshes.hasOwnProperty(id)) {
|
|
122848
|
+
this._affordanceMeshes[id].culled = culled;
|
|
122849
|
+
}
|
|
122850
|
+
}
|
|
122851
|
+
}
|
|
122852
|
+
}
|
|
122822
122853
|
|
|
122823
|
-
|
|
122824
|
-
|
|
122825
|
-
|
|
122826
|
-
|
|
122827
|
-
|
|
122854
|
+
/**
|
|
122855
|
+
* Builds the Entities that represent this FaceAlignedSectionPlanesControl.
|
|
122856
|
+
* @private
|
|
122857
|
+
*/
|
|
122858
|
+
_createNodes() {
|
|
122859
|
+
const NO_STATE_INHERIT = false;
|
|
122860
|
+
const scene = this._viewer.scene;
|
|
122861
|
+
const radius = 1.0;
|
|
122862
|
+
const tubeRadius = 0.01;
|
|
122863
|
+
const arrowRadius = 0.07;
|
|
122828
122864
|
|
|
122829
|
-
|
|
122830
|
-
|
|
122831
|
-
|
|
122832
|
-
|
|
122833
|
-
const arrowRadius = 0.07;
|
|
122865
|
+
this._rootNode = new Node$2(scene, {
|
|
122866
|
+
position: [0, 0, 0],
|
|
122867
|
+
scale: [5, 5, 5]
|
|
122868
|
+
});
|
|
122834
122869
|
|
|
122835
|
-
|
|
122836
|
-
position: [0, 0, 0],
|
|
122837
|
-
scale: [5, 5, 5]
|
|
122838
|
-
});
|
|
122870
|
+
const rootNode = this._rootNode;
|
|
122839
122871
|
|
|
122840
|
-
|
|
122872
|
+
const shapes = {
|
|
122873
|
+
// Reusable geometries
|
|
122841
122874
|
|
|
122842
|
-
|
|
122875
|
+
arrowHead: new ReadableGeometry(
|
|
122876
|
+
rootNode,
|
|
122877
|
+
buildCylinderGeometry({
|
|
122878
|
+
radiusTop: 0.001,
|
|
122879
|
+
radiusBottom: arrowRadius,
|
|
122880
|
+
radialSegments: 32,
|
|
122881
|
+
heightSegments: 1,
|
|
122882
|
+
height: 0.2,
|
|
122883
|
+
openEnded: false
|
|
122884
|
+
})
|
|
122885
|
+
),
|
|
122843
122886
|
|
|
122844
|
-
|
|
122845
|
-
|
|
122846
|
-
|
|
122847
|
-
|
|
122848
|
-
|
|
122849
|
-
|
|
122850
|
-
|
|
122851
|
-
|
|
122887
|
+
arrowHeadBig: new ReadableGeometry(
|
|
122888
|
+
rootNode,
|
|
122889
|
+
buildCylinderGeometry({
|
|
122890
|
+
radiusTop: 0.001,
|
|
122891
|
+
radiusBottom: 0.09,
|
|
122892
|
+
radialSegments: 32,
|
|
122893
|
+
heightSegments: 1,
|
|
122894
|
+
height: 0.25,
|
|
122895
|
+
openEnded: false
|
|
122896
|
+
})
|
|
122897
|
+
),
|
|
122852
122898
|
|
|
122853
|
-
|
|
122854
|
-
|
|
122855
|
-
|
|
122856
|
-
|
|
122857
|
-
|
|
122858
|
-
|
|
122859
|
-
|
|
122860
|
-
|
|
122899
|
+
axis: new ReadableGeometry(
|
|
122900
|
+
rootNode,
|
|
122901
|
+
buildCylinderGeometry({
|
|
122902
|
+
radiusTop: tubeRadius,
|
|
122903
|
+
radiusBottom: tubeRadius,
|
|
122904
|
+
radialSegments: 20,
|
|
122905
|
+
heightSegments: 1,
|
|
122906
|
+
height: radius,
|
|
122907
|
+
openEnded: false
|
|
122908
|
+
})
|
|
122909
|
+
)
|
|
122910
|
+
};
|
|
122861
122911
|
|
|
122862
|
-
|
|
122863
|
-
|
|
122864
|
-
radiusBottom: tubeRadius,
|
|
122865
|
-
radialSegments: 20,
|
|
122866
|
-
heightSegments: 1,
|
|
122867
|
-
height: radius,
|
|
122868
|
-
openEnded: false
|
|
122869
|
-
}))
|
|
122870
|
-
};
|
|
122912
|
+
const materials = {
|
|
122913
|
+
// Reusable materials
|
|
122871
122914
|
|
|
122872
|
-
|
|
122915
|
+
red: new PhongMaterial(rootNode, {
|
|
122916
|
+
diffuse: [1, 0.0, 0.0],
|
|
122917
|
+
emissive: [1, 0.0, 0.0],
|
|
122918
|
+
ambient: [0.0, 0.0, 0.0],
|
|
122919
|
+
specular: [0.6, 0.6, 0.3],
|
|
122920
|
+
shininess: 80,
|
|
122921
|
+
lineWidth: 2
|
|
122922
|
+
}),
|
|
122873
122923
|
|
|
122874
|
-
|
|
122875
|
-
|
|
122876
|
-
|
|
122877
|
-
|
|
122878
|
-
|
|
122879
|
-
|
|
122880
|
-
|
|
122881
|
-
|
|
122924
|
+
green: new PhongMaterial(rootNode, {
|
|
122925
|
+
diffuse: [0, 1.0, 0.0],
|
|
122926
|
+
emissive: [1, 0.0, 0.0],
|
|
122927
|
+
ambient: [0.0, 0.0, 0.0],
|
|
122928
|
+
specular: [0.6, 0.6, 0.3],
|
|
122929
|
+
shininess: 80,
|
|
122930
|
+
lineWidth: 2
|
|
122931
|
+
}),
|
|
122882
122932
|
|
|
122883
|
-
|
|
122884
|
-
|
|
122885
|
-
|
|
122886
|
-
|
|
122887
|
-
|
|
122888
|
-
|
|
122889
|
-
|
|
122890
|
-
|
|
122933
|
+
blue: new PhongMaterial(rootNode, {
|
|
122934
|
+
diffuse: [0, 0.0, 1.0],
|
|
122935
|
+
emissive: [1, 0.0, 0.0],
|
|
122936
|
+
ambient: [0.0, 0.0, 0.0],
|
|
122937
|
+
specular: [0.6, 0.6, 0.3],
|
|
122938
|
+
shininess: 80,
|
|
122939
|
+
lineWidth: 2
|
|
122940
|
+
}),
|
|
122891
122941
|
|
|
122892
|
-
|
|
122893
|
-
|
|
122894
|
-
|
|
122895
|
-
|
|
122896
|
-
|
|
122897
|
-
|
|
122898
|
-
|
|
122899
|
-
|
|
122942
|
+
highlightRed: new EmphasisMaterial(rootNode, {
|
|
122943
|
+
// Emphasis for red rotation affordance hoop
|
|
122944
|
+
edges: false,
|
|
122945
|
+
fill: true,
|
|
122946
|
+
fillColor: [1, 0, 0],
|
|
122947
|
+
fillAlpha: 0.6
|
|
122948
|
+
})
|
|
122949
|
+
};
|
|
122900
122950
|
|
|
122901
|
-
|
|
122902
|
-
|
|
122903
|
-
|
|
122904
|
-
|
|
122905
|
-
|
|
122906
|
-
|
|
122907
|
-
|
|
122951
|
+
this._displayMeshes = {
|
|
122952
|
+
plane: rootNode.addChild(
|
|
122953
|
+
new Mesh(rootNode, {
|
|
122954
|
+
geometry: new ReadableGeometry(rootNode, {
|
|
122955
|
+
primitive: "triangles",
|
|
122956
|
+
positions: [
|
|
122957
|
+
0.5,
|
|
122958
|
+
0.5,
|
|
122959
|
+
0.0,
|
|
122960
|
+
0.5,
|
|
122961
|
+
-0.5,
|
|
122962
|
+
0.0, // 0
|
|
122963
|
+
-0.5,
|
|
122964
|
+
-0.5,
|
|
122965
|
+
0.0,
|
|
122966
|
+
-0.5,
|
|
122967
|
+
0.5,
|
|
122968
|
+
0.0, // 1
|
|
122969
|
+
0.5,
|
|
122970
|
+
0.5,
|
|
122971
|
+
-0.0,
|
|
122972
|
+
0.5,
|
|
122973
|
+
-0.5,
|
|
122974
|
+
-0.0, // 2
|
|
122975
|
+
-0.5,
|
|
122976
|
+
-0.5,
|
|
122977
|
+
-0.0,
|
|
122978
|
+
-0.5,
|
|
122979
|
+
0.5,
|
|
122980
|
+
-0.0 // 3
|
|
122981
|
+
],
|
|
122982
|
+
indices: [0, 1, 2, 2, 3, 0]
|
|
122983
|
+
}),
|
|
122984
|
+
material: new PhongMaterial(rootNode, {
|
|
122985
|
+
emissive: [0, 0.0, 0],
|
|
122986
|
+
diffuse: [0, 0, 0],
|
|
122987
|
+
backfaces: true
|
|
122988
|
+
}),
|
|
122989
|
+
opacity: 0.6,
|
|
122990
|
+
ghosted: true,
|
|
122991
|
+
pickable: false,
|
|
122992
|
+
collidable: true,
|
|
122993
|
+
clippable: false,
|
|
122994
|
+
visible: false,
|
|
122995
|
+
scale: [2.4, 2.4, 1]
|
|
122996
|
+
}),
|
|
122997
|
+
NO_STATE_INHERIT
|
|
122998
|
+
),
|
|
122908
122999
|
|
|
122909
|
-
|
|
123000
|
+
planeFrame: rootNode.addChild(
|
|
123001
|
+
new Mesh(rootNode, {
|
|
123002
|
+
// Visible frame
|
|
123003
|
+
geometry: new ReadableGeometry(
|
|
123004
|
+
rootNode,
|
|
123005
|
+
buildTorusGeometry({
|
|
123006
|
+
center: [0, 0, 0],
|
|
123007
|
+
radius: 1.7,
|
|
123008
|
+
tube: tubeRadius * 2,
|
|
123009
|
+
radialSegments: 4,
|
|
123010
|
+
tubeSegments: 4,
|
|
123011
|
+
arc: Math.PI * 2.0
|
|
123012
|
+
})
|
|
123013
|
+
),
|
|
123014
|
+
material: new PhongMaterial(rootNode, {
|
|
123015
|
+
emissive: [0, 0, 0],
|
|
123016
|
+
diffuse: [0, 0, 0],
|
|
123017
|
+
specular: [0, 0, 0],
|
|
123018
|
+
shininess: 0
|
|
123019
|
+
}),
|
|
123020
|
+
pickable: false,
|
|
123021
|
+
collidable: false,
|
|
123022
|
+
clippable: false,
|
|
123023
|
+
visible: false,
|
|
123024
|
+
scale: [1, 1, 0.1],
|
|
123025
|
+
rotation: [0, 0, 45]
|
|
123026
|
+
}),
|
|
123027
|
+
NO_STATE_INHERIT
|
|
123028
|
+
),
|
|
122910
123029
|
|
|
122911
|
-
|
|
122912
|
-
|
|
122913
|
-
|
|
122914
|
-
|
|
122915
|
-
|
|
122916
|
-
|
|
122917
|
-
|
|
122918
|
-
|
|
122919
|
-
|
|
122920
|
-
|
|
122921
|
-
|
|
122922
|
-
|
|
122923
|
-
|
|
122924
|
-
|
|
122925
|
-
|
|
122926
|
-
|
|
122927
|
-
opacity: 0.6,
|
|
122928
|
-
ghosted: true,
|
|
122929
|
-
pickable: false,
|
|
122930
|
-
collidable: true,
|
|
122931
|
-
clippable: false,
|
|
122932
|
-
visible: false,
|
|
122933
|
-
scale: [2.4, 2.4, 1]
|
|
122934
|
-
}), NO_STATE_INHERIT),
|
|
122935
|
-
|
|
122936
|
-
planeFrame: rootNode.addChild(new Mesh(rootNode, { // Visible frame
|
|
122937
|
-
geometry: new ReadableGeometry(rootNode, buildTorusGeometry({
|
|
122938
|
-
center: [0, 0, 0],
|
|
122939
|
-
radius: 1.7,
|
|
122940
|
-
tube: tubeRadius * 2,
|
|
122941
|
-
radialSegments: 4,
|
|
122942
|
-
tubeSegments: 4,
|
|
122943
|
-
arc: Math.PI * 2.0
|
|
122944
|
-
})),
|
|
122945
|
-
material: new PhongMaterial(rootNode, {
|
|
122946
|
-
emissive: [0, 0, 0],
|
|
122947
|
-
diffuse: [0, 0, 0],
|
|
122948
|
-
specular: [0, 0, 0],
|
|
122949
|
-
shininess: 0
|
|
122950
|
-
}),
|
|
122951
|
-
pickable: false,
|
|
122952
|
-
collidable: false,
|
|
122953
|
-
clippable: false,
|
|
122954
|
-
visible: false,
|
|
122955
|
-
scale: [1, 1, .1],
|
|
122956
|
-
rotation: [0, 0, 45]
|
|
122957
|
-
}), NO_STATE_INHERIT),
|
|
122958
|
-
|
|
122959
|
-
center: rootNode.addChild(new Mesh(rootNode, {
|
|
122960
|
-
geometry: new ReadableGeometry(rootNode, buildSphereGeometry({
|
|
122961
|
-
radius: 0.05
|
|
122962
|
-
})),
|
|
122963
|
-
material: materials.center,
|
|
122964
|
-
pickable: false,
|
|
122965
|
-
collidable: true,
|
|
122966
|
-
clippable: false,
|
|
122967
|
-
visible: false
|
|
122968
|
-
}), NO_STATE_INHERIT),
|
|
122969
|
-
|
|
122970
|
-
zAxisArrow: rootNode.addChild(new Mesh(rootNode, {
|
|
122971
|
-
geometry: shapes.arrowHead,
|
|
122972
|
-
material: materials.blue,
|
|
122973
|
-
matrix: (function () {
|
|
122974
|
-
const translate = math.translateMat4c(0, radius + .1, 0, math.identityMat4());
|
|
122975
|
-
const rotate = math.rotationMat4v(-90 * math.DEGTORAD, [0.8, 0, 0], math.identityMat4());
|
|
122976
|
-
return math.mulMat4(rotate, translate, math.identityMat4());
|
|
122977
|
-
})(),
|
|
122978
|
-
pickable: false,
|
|
122979
|
-
collidable: true,
|
|
122980
|
-
clippable: false,
|
|
122981
|
-
visible: false
|
|
122982
|
-
}), NO_STATE_INHERIT),
|
|
122983
|
-
|
|
122984
|
-
zShaft: rootNode.addChild(new Mesh(rootNode, {
|
|
122985
|
-
geometry: shapes.axis,
|
|
122986
|
-
material: materials.blue,
|
|
122987
|
-
matrix: (function () {
|
|
122988
|
-
const translate = math.translateMat4c(0, radius / 2, 0, math.identityMat4());
|
|
122989
|
-
const rotate = math.rotationMat4v(-90 * math.DEGTORAD, [1, 0, 0], math.identityMat4());
|
|
122990
|
-
return math.mulMat4(rotate, translate, math.identityMat4());
|
|
122991
|
-
})(),
|
|
122992
|
-
clippable: false,
|
|
122993
|
-
pickable: false,
|
|
122994
|
-
collidable: true,
|
|
122995
|
-
visible: false
|
|
122996
|
-
}), NO_STATE_INHERIT)
|
|
122997
|
-
};
|
|
123030
|
+
center: rootNode.addChild(
|
|
123031
|
+
new Mesh(rootNode, {
|
|
123032
|
+
geometry: new ReadableGeometry(
|
|
123033
|
+
rootNode,
|
|
123034
|
+
buildSphereGeometry({
|
|
123035
|
+
radius: 0.05
|
|
123036
|
+
})
|
|
123037
|
+
),
|
|
123038
|
+
material: materials.center,
|
|
123039
|
+
pickable: false,
|
|
123040
|
+
collidable: true,
|
|
123041
|
+
clippable: false,
|
|
123042
|
+
visible: false
|
|
123043
|
+
}),
|
|
123044
|
+
NO_STATE_INHERIT
|
|
123045
|
+
),
|
|
122998
123046
|
|
|
122999
|
-
|
|
123047
|
+
zAxisArrow: rootNode.addChild(
|
|
123048
|
+
new Mesh(rootNode, {
|
|
123049
|
+
geometry: shapes.arrowHead,
|
|
123050
|
+
material: materials.blue,
|
|
123051
|
+
matrix: (function () {
|
|
123052
|
+
const translate = math.translateMat4c(0, radius + 0.1, 0, math.identityMat4());
|
|
123053
|
+
const rotate = math.rotationMat4v(-90 * math.DEGTORAD, [0.8, 0, 0], math.identityMat4());
|
|
123054
|
+
return math.mulMat4(rotate, translate, math.identityMat4());
|
|
123055
|
+
})(),
|
|
123056
|
+
pickable: false,
|
|
123057
|
+
collidable: true,
|
|
123058
|
+
clippable: false,
|
|
123059
|
+
visible: false
|
|
123060
|
+
}),
|
|
123061
|
+
NO_STATE_INHERIT
|
|
123062
|
+
),
|
|
123000
123063
|
|
|
123001
|
-
|
|
123002
|
-
|
|
123003
|
-
|
|
123004
|
-
|
|
123005
|
-
|
|
123006
|
-
|
|
123007
|
-
|
|
123008
|
-
|
|
123009
|
-
|
|
123010
|
-
|
|
123011
|
-
|
|
123012
|
-
|
|
123013
|
-
|
|
123014
|
-
|
|
123015
|
-
|
|
123016
|
-
|
|
123017
|
-
|
|
123018
|
-
filled: true,
|
|
123019
|
-
fillColor: [1, 1, 0],
|
|
123020
|
-
fillAlpha: 1.0
|
|
123021
|
-
}),
|
|
123022
|
-
pickable: false,
|
|
123023
|
-
collidable: false,
|
|
123024
|
-
clippable: false,
|
|
123025
|
-
visible: false,
|
|
123026
|
-
scale: [1, 1, 1],
|
|
123027
|
-
rotation: [0, 0, 45]
|
|
123028
|
-
}), NO_STATE_INHERIT),
|
|
123029
|
-
|
|
123030
|
-
zAxisArrow: rootNode.addChild(new Mesh(rootNode, {
|
|
123031
|
-
geometry: shapes.arrowHeadBig,
|
|
123032
|
-
material: materials.blue,
|
|
123033
|
-
matrix: (function () {
|
|
123034
|
-
const translate = math.translateMat4c(0, radius + .1, 0, math.identityMat4());
|
|
123035
|
-
const rotate = math.rotationMat4v(-90 * math.DEGTORAD, [0.8, 0, 0], math.identityMat4());
|
|
123036
|
-
return math.mulMat4(rotate, translate, math.identityMat4());
|
|
123037
|
-
})(),
|
|
123038
|
-
pickable: false,
|
|
123039
|
-
collidable: true,
|
|
123040
|
-
clippable: false,
|
|
123041
|
-
visible: false
|
|
123042
|
-
}), NO_STATE_INHERIT)
|
|
123043
|
-
};
|
|
123044
|
-
}
|
|
123064
|
+
zShaft: rootNode.addChild(
|
|
123065
|
+
new Mesh(rootNode, {
|
|
123066
|
+
geometry: shapes.axis,
|
|
123067
|
+
material: materials.blue,
|
|
123068
|
+
matrix: (function () {
|
|
123069
|
+
const translate = math.translateMat4c(0, radius / 2, 0, math.identityMat4());
|
|
123070
|
+
const rotate = math.rotationMat4v(-90 * math.DEGTORAD, [1, 0, 0], math.identityMat4());
|
|
123071
|
+
return math.mulMat4(rotate, translate, math.identityMat4());
|
|
123072
|
+
})(),
|
|
123073
|
+
clippable: false,
|
|
123074
|
+
pickable: false,
|
|
123075
|
+
collidable: true,
|
|
123076
|
+
visible: false
|
|
123077
|
+
}),
|
|
123078
|
+
NO_STATE_INHERIT
|
|
123079
|
+
)
|
|
123080
|
+
};
|
|
123045
123081
|
|
|
123046
|
-
|
|
123082
|
+
this._affordanceMeshes = {
|
|
123083
|
+
planeFrame: rootNode.addChild(
|
|
123084
|
+
new Mesh(rootNode, {
|
|
123085
|
+
geometry: new ReadableGeometry(
|
|
123086
|
+
rootNode,
|
|
123087
|
+
buildTorusGeometry({
|
|
123088
|
+
center: [0, 0, 0],
|
|
123089
|
+
radius: 2,
|
|
123090
|
+
tube: tubeRadius,
|
|
123091
|
+
radialSegments: 4,
|
|
123092
|
+
tubeSegments: 4,
|
|
123093
|
+
arc: Math.PI * 2.0
|
|
123094
|
+
})
|
|
123095
|
+
),
|
|
123096
|
+
material: new PhongMaterial(rootNode, {
|
|
123097
|
+
ambient: [1, 1, 1],
|
|
123098
|
+
diffuse: [0, 0, 0],
|
|
123099
|
+
emissive: [1, 1, 0]
|
|
123100
|
+
}),
|
|
123101
|
+
highlighted: true,
|
|
123102
|
+
highlightMaterial: new EmphasisMaterial(rootNode, {
|
|
123103
|
+
edges: false,
|
|
123104
|
+
filled: true,
|
|
123105
|
+
fillColor: [1, 1, 0],
|
|
123106
|
+
fillAlpha: 1.0
|
|
123107
|
+
}),
|
|
123108
|
+
pickable: false,
|
|
123109
|
+
collidable: false,
|
|
123110
|
+
clippable: false,
|
|
123111
|
+
visible: false,
|
|
123112
|
+
scale: [1, 1, 1],
|
|
123113
|
+
rotation: [0, 0, 45]
|
|
123114
|
+
}),
|
|
123115
|
+
NO_STATE_INHERIT
|
|
123116
|
+
),
|
|
123047
123117
|
|
|
123048
|
-
|
|
123049
|
-
|
|
123050
|
-
|
|
123051
|
-
|
|
123118
|
+
zAxisArrow: rootNode.addChild(
|
|
123119
|
+
new Mesh(rootNode, {
|
|
123120
|
+
geometry: shapes.arrowHeadBig,
|
|
123121
|
+
material: materials.blue,
|
|
123122
|
+
matrix: (function () {
|
|
123123
|
+
const translate = math.translateMat4c(0, radius + 0.1, 0, math.identityMat4());
|
|
123124
|
+
const rotate = math.rotationMat4v(-90 * math.DEGTORAD, [0.8, 0, 0], math.identityMat4());
|
|
123125
|
+
return math.mulMat4(rotate, translate, math.identityMat4());
|
|
123126
|
+
})(),
|
|
123127
|
+
pickable: false,
|
|
123128
|
+
collidable: true,
|
|
123129
|
+
clippable: false,
|
|
123130
|
+
visible: false
|
|
123131
|
+
}),
|
|
123132
|
+
NO_STATE_INHERIT
|
|
123133
|
+
)
|
|
123134
|
+
};
|
|
123135
|
+
}
|
|
123052
123136
|
|
|
123053
|
-
|
|
123054
|
-
|
|
123137
|
+
_bindEvents() {
|
|
123138
|
+
const rootNode = this._rootNode;
|
|
123139
|
+
const lastCanvasPos = math.vec2();
|
|
123140
|
+
const camera = this._viewer.camera;
|
|
123141
|
+
const scene = this._viewer.scene;
|
|
123055
123142
|
|
|
123056
|
-
|
|
123143
|
+
let deltaUpdate = 0;
|
|
123144
|
+
let waitForTick = false;
|
|
123057
123145
|
|
|
123058
|
-
|
|
123059
|
-
|
|
123146
|
+
{
|
|
123147
|
+
// Keep gizmo screen size constant
|
|
123060
123148
|
|
|
123061
|
-
|
|
123062
|
-
|
|
123149
|
+
const tempVec3a = math.vec3([0, 0, 0]);
|
|
123150
|
+
let lastDist = -1;
|
|
123063
123151
|
|
|
123064
|
-
|
|
123065
|
-
|
|
123152
|
+
this._onCameraViewMatrix = scene.camera.on("viewMatrix", () => {
|
|
123153
|
+
});
|
|
123066
123154
|
|
|
123067
|
-
|
|
123155
|
+
this._onCameraProjMatrix = scene.camera.on("projMatrix", () => {
|
|
123156
|
+
});
|
|
123068
123157
|
|
|
123069
|
-
|
|
123070
|
-
|
|
123158
|
+
this._onSceneTick = scene.on("tick", () => {
|
|
123159
|
+
waitForTick = false;
|
|
123160
|
+
const dist = Math.abs(math.lenVec3(math.subVec3(scene.camera.eye, this._pos, tempVec3a)));
|
|
123071
123161
|
|
|
123072
|
-
|
|
123073
|
-
|
|
123074
|
-
|
|
123075
|
-
|
|
123076
|
-
|
|
123077
|
-
|
|
123078
|
-
|
|
123079
|
-
|
|
123162
|
+
if (dist !== lastDist) {
|
|
123163
|
+
if (camera.projection === "perspective") {
|
|
123164
|
+
const worldSize = Math.tan(camera.perspective.fov * math.DEGTORAD) * dist;
|
|
123165
|
+
const size = 0.07 * worldSize;
|
|
123166
|
+
rootNode.scale = [size, size, size];
|
|
123167
|
+
lastDist = dist;
|
|
123168
|
+
}
|
|
123169
|
+
}
|
|
123080
123170
|
|
|
123081
|
-
|
|
123082
|
-
|
|
123083
|
-
|
|
123084
|
-
|
|
123085
|
-
|
|
123086
|
-
|
|
123171
|
+
if (camera.projection === "ortho") {
|
|
123172
|
+
const worldSize = camera.ortho.scale / 10;
|
|
123173
|
+
const size = worldSize;
|
|
123174
|
+
rootNode.scale = [size, size, size];
|
|
123175
|
+
lastDist = dist;
|
|
123176
|
+
}
|
|
123087
123177
|
|
|
123088
|
-
|
|
123089
|
-
|
|
123090
|
-
|
|
123091
|
-
|
|
123092
|
-
|
|
123093
|
-
|
|
123178
|
+
if (deltaUpdate !== 0) {
|
|
123179
|
+
moveSectionPlane(deltaUpdate);
|
|
123180
|
+
deltaUpdate = 0;
|
|
123181
|
+
}
|
|
123182
|
+
});
|
|
123183
|
+
}
|
|
123094
123184
|
|
|
123095
|
-
|
|
123096
|
-
|
|
123097
|
-
|
|
123098
|
-
|
|
123099
|
-
|
|
123100
|
-
|
|
123101
|
-
|
|
123102
|
-
|
|
123103
|
-
|
|
123104
|
-
|
|
123105
|
-
|
|
123106
|
-
|
|
123107
|
-
while (element.offsetParent) {
|
|
123108
|
-
totalOffsetLeft += element.offsetLeft;
|
|
123109
|
-
totalOffsetTop += element.offsetTop;
|
|
123110
|
-
element = element.offsetParent;
|
|
123111
|
-
}
|
|
123112
|
-
canvasPos[0] = event.pageX - totalOffsetLeft;
|
|
123113
|
-
canvasPos[1] = event.pageY - totalOffsetTop;
|
|
123114
|
-
}
|
|
123115
|
-
return canvasPos;
|
|
123116
|
-
};
|
|
123117
|
-
})();
|
|
123185
|
+
const getClickCoordsWithinElement = (function () {
|
|
123186
|
+
const canvasPos = new Float64Array(2);
|
|
123187
|
+
return function (event) {
|
|
123188
|
+
if (!event) {
|
|
123189
|
+
event = window.event;
|
|
123190
|
+
canvasPos[0] = event.x;
|
|
123191
|
+
canvasPos[1] = event.y;
|
|
123192
|
+
} else {
|
|
123193
|
+
var element = event.target;
|
|
123194
|
+
var totalOffsetLeft = 0;
|
|
123195
|
+
var totalOffsetTop = 0;
|
|
123118
123196
|
|
|
123119
|
-
|
|
123120
|
-
|
|
123121
|
-
|
|
123122
|
-
|
|
123123
|
-
|
|
123124
|
-
|
|
123197
|
+
while (element.offsetParent) {
|
|
123198
|
+
totalOffsetLeft += element.offsetLeft;
|
|
123199
|
+
totalOffsetTop += element.offsetTop;
|
|
123200
|
+
element = element.offsetParent;
|
|
123201
|
+
}
|
|
123202
|
+
canvasPos[0] = event.pageX - totalOffsetLeft;
|
|
123203
|
+
canvasPos[1] = event.pageY - totalOffsetTop;
|
|
123204
|
+
}
|
|
123205
|
+
return canvasPos;
|
|
123206
|
+
};
|
|
123207
|
+
})();
|
|
123125
123208
|
|
|
123126
|
-
|
|
123127
|
-
|
|
123209
|
+
const moveSectionPlane = (delta) => {
|
|
123210
|
+
const pos = this._sectionPlane.pos;
|
|
123211
|
+
const dir = this._sectionPlane.dir;
|
|
123212
|
+
math.addVec3(pos, math.mulVec3Scalar(dir, 0.1 * delta * this._plugin.getDragSensitivity(), math.vec3()));
|
|
123213
|
+
this._sectionPlane.pos = pos;
|
|
123214
|
+
};
|
|
123128
123215
|
|
|
123129
|
-
|
|
123130
|
-
|
|
123131
|
-
if (!this._visible) {
|
|
123132
|
-
return;
|
|
123133
|
-
}
|
|
123134
|
-
this._viewer.cameraControl.pointerEnabled = false;
|
|
123135
|
-
switch (e.which) {
|
|
123136
|
-
case 1: // Left button
|
|
123137
|
-
down = true;
|
|
123138
|
-
var canvasPos = getClickCoordsWithinElement(e);
|
|
123139
|
-
lastCanvasPos[0] = canvasPos[0];
|
|
123140
|
-
lastCanvasPos[1] = canvasPos[1];
|
|
123141
|
-
break;
|
|
123142
|
-
}
|
|
123143
|
-
});
|
|
123216
|
+
{
|
|
123217
|
+
let down = false;
|
|
123144
123218
|
|
|
123145
|
-
|
|
123146
|
-
|
|
123147
|
-
|
|
123148
|
-
|
|
123149
|
-
|
|
123150
|
-
|
|
123151
|
-
|
|
123152
|
-
|
|
123153
|
-
|
|
123154
|
-
|
|
123155
|
-
|
|
123156
|
-
|
|
123157
|
-
|
|
123158
|
-
|
|
123159
|
-
|
|
123160
|
-
|
|
123161
|
-
|
|
123219
|
+
this._plugin._controlElement.addEventListener(
|
|
123220
|
+
"mousedown",
|
|
123221
|
+
(this._canvasMouseDownListener = (e) => {
|
|
123222
|
+
e.preventDefault();
|
|
123223
|
+
if (!this._visible) {
|
|
123224
|
+
return;
|
|
123225
|
+
}
|
|
123226
|
+
this._viewer.cameraControl.pointerEnabled = false;
|
|
123227
|
+
switch (e.which) {
|
|
123228
|
+
case 1: // Left button
|
|
123229
|
+
down = true;
|
|
123230
|
+
var canvasPos = getClickCoordsWithinElement(e);
|
|
123231
|
+
lastCanvasPos[0] = canvasPos[0];
|
|
123232
|
+
lastCanvasPos[1] = canvasPos[1];
|
|
123233
|
+
break;
|
|
123234
|
+
}
|
|
123235
|
+
})
|
|
123236
|
+
);
|
|
123162
123237
|
|
|
123163
|
-
|
|
123164
|
-
|
|
123165
|
-
|
|
123166
|
-
|
|
123167
|
-
|
|
123168
|
-
|
|
123169
|
-
|
|
123170
|
-
|
|
123171
|
-
|
|
123172
|
-
|
|
123173
|
-
|
|
123174
|
-
|
|
123238
|
+
this._plugin._controlElement.addEventListener(
|
|
123239
|
+
"mousemove",
|
|
123240
|
+
(this._canvasMouseMoveListener = (e) => {
|
|
123241
|
+
if (!this._visible) {
|
|
123242
|
+
return;
|
|
123243
|
+
}
|
|
123244
|
+
if (!down) {
|
|
123245
|
+
return;
|
|
123246
|
+
}
|
|
123247
|
+
if (waitForTick) {
|
|
123248
|
+
// Limit changes detection to one per frame
|
|
123249
|
+
return;
|
|
123250
|
+
}
|
|
123251
|
+
var canvasPos = getClickCoordsWithinElement(e);
|
|
123252
|
+
const x = canvasPos[0];
|
|
123253
|
+
const y = canvasPos[1];
|
|
123254
|
+
moveSectionPlane(y - lastCanvasPos[1]);
|
|
123255
|
+
lastCanvasPos[0] = x;
|
|
123256
|
+
lastCanvasPos[1] = y;
|
|
123257
|
+
})
|
|
123258
|
+
);
|
|
123175
123259
|
|
|
123176
|
-
|
|
123177
|
-
|
|
123178
|
-
|
|
123179
|
-
|
|
123180
|
-
|
|
123181
|
-
|
|
123182
|
-
|
|
123260
|
+
this._plugin._controlElement.addEventListener(
|
|
123261
|
+
"mouseup",
|
|
123262
|
+
(this._canvasMouseUpListener = (e) => {
|
|
123263
|
+
if (!this._visible) {
|
|
123264
|
+
return;
|
|
123265
|
+
}
|
|
123266
|
+
this._viewer.cameraControl.pointerEnabled = true;
|
|
123267
|
+
if (!down) {
|
|
123268
|
+
return;
|
|
123269
|
+
}
|
|
123270
|
+
switch (e.which) {
|
|
123271
|
+
}
|
|
123272
|
+
down = false;
|
|
123273
|
+
})
|
|
123274
|
+
);
|
|
123183
123275
|
|
|
123184
|
-
|
|
123185
|
-
|
|
123186
|
-
|
|
123276
|
+
this._plugin._controlElement.addEventListener(
|
|
123277
|
+
"wheel",
|
|
123278
|
+
(this._canvasWheelListener = (e) => {
|
|
123279
|
+
if (!this._visible) {
|
|
123280
|
+
return;
|
|
123281
|
+
}
|
|
123282
|
+
deltaUpdate += Math.max(-1, Math.min(1, -e.deltaY * 40));
|
|
123283
|
+
})
|
|
123284
|
+
);
|
|
123285
|
+
}
|
|
123187
123286
|
|
|
123188
|
-
|
|
123189
|
-
|
|
123190
|
-
|
|
123191
|
-
if (!this._visible) {
|
|
123192
|
-
return;
|
|
123193
|
-
}
|
|
123194
|
-
touchStartY = e.touches[0].clientY;
|
|
123195
|
-
lastTouchY = touchStartY;
|
|
123196
|
-
deltaUpdate = 0;
|
|
123197
|
-
});
|
|
123287
|
+
{
|
|
123288
|
+
let touchStartY, touchEndY;
|
|
123289
|
+
let lastTouchY = null;
|
|
123198
123290
|
|
|
123199
|
-
|
|
123200
|
-
|
|
123201
|
-
|
|
123202
|
-
|
|
123203
|
-
|
|
123204
|
-
|
|
123205
|
-
|
|
123206
|
-
|
|
123207
|
-
|
|
123208
|
-
|
|
123209
|
-
|
|
123210
|
-
|
|
123211
|
-
|
|
123212
|
-
}
|
|
123213
|
-
lastTouchY = touchEndY;
|
|
123214
|
-
});
|
|
123291
|
+
this._plugin._controlElement.addEventListener(
|
|
123292
|
+
"touchstart",
|
|
123293
|
+
(this._handleTouchStart = (e) => {
|
|
123294
|
+
e.stopPropagation();
|
|
123295
|
+
e.preventDefault();
|
|
123296
|
+
if (!this._visible) {
|
|
123297
|
+
return;
|
|
123298
|
+
}
|
|
123299
|
+
touchStartY = e.touches[0].clientY;
|
|
123300
|
+
lastTouchY = touchStartY;
|
|
123301
|
+
deltaUpdate = 0;
|
|
123302
|
+
})
|
|
123303
|
+
);
|
|
123215
123304
|
|
|
123216
|
-
|
|
123217
|
-
|
|
123218
|
-
|
|
123219
|
-
|
|
123220
|
-
|
|
123221
|
-
|
|
123222
|
-
|
|
123223
|
-
|
|
123224
|
-
|
|
123225
|
-
|
|
123226
|
-
|
|
123227
|
-
|
|
123305
|
+
this._plugin._controlElement.addEventListener(
|
|
123306
|
+
"touchmove",
|
|
123307
|
+
(this._handleTouchMove = (e) => {
|
|
123308
|
+
e.stopPropagation();
|
|
123309
|
+
e.preventDefault();
|
|
123310
|
+
if (!this._visible) {
|
|
123311
|
+
return;
|
|
123312
|
+
}
|
|
123313
|
+
if (waitForTick) {
|
|
123314
|
+
// Limit changes detection to one per frame
|
|
123315
|
+
return;
|
|
123316
|
+
}
|
|
123317
|
+
waitForTick = true;
|
|
123318
|
+
touchEndY = e.touches[0].clientY;
|
|
123319
|
+
if (lastTouchY !== null) {
|
|
123320
|
+
deltaUpdate += touchEndY - lastTouchY;
|
|
123321
|
+
}
|
|
123322
|
+
lastTouchY = touchEndY;
|
|
123323
|
+
})
|
|
123324
|
+
);
|
|
123228
123325
|
|
|
123229
|
-
|
|
123230
|
-
|
|
123231
|
-
|
|
123232
|
-
|
|
123326
|
+
this._plugin._controlElement.addEventListener(
|
|
123327
|
+
"touchend",
|
|
123328
|
+
(this._handleTouchEnd = (e) => {
|
|
123329
|
+
e.stopPropagation();
|
|
123330
|
+
e.preventDefault();
|
|
123331
|
+
if (!this._visible) {
|
|
123332
|
+
return;
|
|
123333
|
+
}
|
|
123334
|
+
touchStartY = null;
|
|
123335
|
+
touchEndY = null;
|
|
123336
|
+
deltaUpdate = 0;
|
|
123337
|
+
})
|
|
123338
|
+
);
|
|
123339
|
+
this._plugin._controlElement.addEventListener("touchcancel", this._handleTouchEnd);
|
|
123340
|
+
}
|
|
123341
|
+
}
|
|
123233
123342
|
|
|
123234
|
-
|
|
123343
|
+
_destroy() {
|
|
123344
|
+
this._unbindEvents();
|
|
123345
|
+
this._destroyNodes();
|
|
123346
|
+
}
|
|
123235
123347
|
|
|
123236
|
-
|
|
123237
|
-
|
|
123238
|
-
|
|
123239
|
-
|
|
123240
|
-
|
|
123348
|
+
_unbindEvents() {
|
|
123349
|
+
const viewer = this._viewer;
|
|
123350
|
+
const scene = viewer.scene;
|
|
123351
|
+
const canvas = scene.canvas.canvas;
|
|
123352
|
+
const camera = viewer.camera;
|
|
123353
|
+
const controlElement = this._plugin._controlElement;
|
|
123241
123354
|
|
|
123242
|
-
|
|
123355
|
+
scene.off(this._onSceneTick);
|
|
123243
123356
|
|
|
123244
|
-
|
|
123245
|
-
|
|
123246
|
-
|
|
123247
|
-
|
|
123357
|
+
canvas.removeEventListener("mousedown", this._canvasMouseDownListener);
|
|
123358
|
+
canvas.removeEventListener("mousemove", this._canvasMouseMoveListener);
|
|
123359
|
+
canvas.removeEventListener("mouseup", this._canvasMouseUpListener);
|
|
123360
|
+
canvas.removeEventListener("wheel", this._canvasWheelListener);
|
|
123248
123361
|
|
|
123249
|
-
|
|
123250
|
-
|
|
123251
|
-
|
|
123362
|
+
controlElement.removeEventListener("touchstart", this._handleTouchStart);
|
|
123363
|
+
controlElement.removeEventListener("touchmove", this._handleTouchMove);
|
|
123364
|
+
controlElement.removeEventListener("touchend", this._handleTouchEnd);
|
|
123365
|
+
controlElement.removeEventListener("touchcancel", this._handleTouchEnd);
|
|
123252
123366
|
|
|
123253
|
-
|
|
123254
|
-
|
|
123255
|
-
|
|
123367
|
+
camera.off(this._onCameraViewMatrix);
|
|
123368
|
+
camera.off(this._onCameraProjMatrix);
|
|
123369
|
+
}
|
|
123256
123370
|
|
|
123257
|
-
|
|
123258
|
-
|
|
123259
|
-
|
|
123260
|
-
|
|
123261
|
-
|
|
123262
|
-
|
|
123371
|
+
_destroyNodes() {
|
|
123372
|
+
this._setSectionPlane(null);
|
|
123373
|
+
this._rootNode.destroy();
|
|
123374
|
+
this._displayMeshes = {};
|
|
123375
|
+
this._affordanceMeshes = {};
|
|
123376
|
+
}
|
|
123263
123377
|
}
|
|
123264
123378
|
|
|
123265
123379
|
/**
|
|
@@ -123432,235 +123546,241 @@ class Plane {
|
|
|
123432
123546
|
* @private
|
|
123433
123547
|
*/
|
|
123434
123548
|
class Overview {
|
|
123549
|
+
/**
|
|
123550
|
+
* @private
|
|
123551
|
+
*/
|
|
123552
|
+
constructor(plugin, cfg) {
|
|
123553
|
+
if (!cfg.onHoverEnterPlane || !cfg.onHoverLeavePlane || !cfg.onClickedNothing || !cfg.onClickedPlane) {
|
|
123554
|
+
throw "Missing config(s): onHoverEnterPlane, onHoverLeavePlane, onClickedNothing || onClickedPlane";
|
|
123555
|
+
}
|
|
123435
123556
|
|
|
123436
|
-
|
|
123437
|
-
|
|
123438
|
-
|
|
123439
|
-
|
|
123440
|
-
|
|
123441
|
-
|
|
123442
|
-
throw "Missing config(s): onHoverEnterPlane, onHoverLeavePlane, onClickedNothing || onClickedPlane";
|
|
123443
|
-
}
|
|
123444
|
-
|
|
123445
|
-
/**
|
|
123446
|
-
* The {@link FaceAlignedSectionPlanesPlugin} that owns this SectionPlanesOverview.
|
|
123447
|
-
*
|
|
123448
|
-
* @type {FaceAlignedSectionPlanesPlugin}
|
|
123449
|
-
*/
|
|
123450
|
-
this.plugin = plugin;
|
|
123557
|
+
/**
|
|
123558
|
+
* The {@link FaceAlignedSectionPlanesPlugin} that owns this SectionPlanesOverview.
|
|
123559
|
+
*
|
|
123560
|
+
* @type {FaceAlignedSectionPlanesPlugin}
|
|
123561
|
+
*/
|
|
123562
|
+
this.plugin = plugin;
|
|
123451
123563
|
|
|
123452
|
-
|
|
123564
|
+
this._viewer = plugin.viewer;
|
|
123453
123565
|
|
|
123454
|
-
|
|
123455
|
-
|
|
123456
|
-
|
|
123457
|
-
|
|
123458
|
-
|
|
123566
|
+
this._onHoverEnterPlane = cfg.onHoverEnterPlane;
|
|
123567
|
+
this._onHoverLeavePlane = cfg.onHoverLeavePlane;
|
|
123568
|
+
this._onClickedNothing = cfg.onClickedNothing;
|
|
123569
|
+
this._onClickedPlane = cfg.onClickedPlane;
|
|
123570
|
+
this._visible = true;
|
|
123459
123571
|
|
|
123460
|
-
|
|
123572
|
+
this._planes = {};
|
|
123461
123573
|
|
|
123462
|
-
|
|
123463
|
-
|
|
123464
|
-
|
|
123574
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123575
|
+
// Init canvas
|
|
123576
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123465
123577
|
|
|
123466
|
-
|
|
123578
|
+
this._canvas = cfg.overviewCanvas;
|
|
123467
123579
|
|
|
123468
|
-
|
|
123469
|
-
|
|
123470
|
-
|
|
123580
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123581
|
+
// Init scene
|
|
123582
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123471
123583
|
|
|
123472
|
-
|
|
123473
|
-
|
|
123474
|
-
|
|
123475
|
-
|
|
123476
|
-
|
|
123477
|
-
|
|
123478
|
-
|
|
123479
|
-
|
|
123480
|
-
|
|
123481
|
-
|
|
123482
|
-
|
|
123483
|
-
|
|
123484
|
-
|
|
123485
|
-
|
|
123486
|
-
|
|
123487
|
-
|
|
123488
|
-
|
|
123489
|
-
|
|
123490
|
-
|
|
123491
|
-
|
|
123492
|
-
|
|
123493
|
-
|
|
123494
|
-
|
|
123584
|
+
this._scene = new Scene(this._viewer, {
|
|
123585
|
+
canvasId: this._canvas.id,
|
|
123586
|
+
transparent: true
|
|
123587
|
+
});
|
|
123588
|
+
this._scene.clearLights();
|
|
123589
|
+
new DirLight(this._scene, {
|
|
123590
|
+
dir: [0.4, -0.4, 0.8],
|
|
123591
|
+
color: [0.8, 1.0, 1.0],
|
|
123592
|
+
intensity: 1.0,
|
|
123593
|
+
space: "view"
|
|
123594
|
+
});
|
|
123595
|
+
new DirLight(this._scene, {
|
|
123596
|
+
dir: [-0.8, -0.3, -0.4],
|
|
123597
|
+
color: [0.8, 0.8, 0.8],
|
|
123598
|
+
intensity: 1.0,
|
|
123599
|
+
space: "view"
|
|
123600
|
+
});
|
|
123601
|
+
new DirLight(this._scene, {
|
|
123602
|
+
dir: [0.8, -0.6, -0.8],
|
|
123603
|
+
color: [1.0, 1.0, 1.0],
|
|
123604
|
+
intensity: 1.0,
|
|
123605
|
+
space: "view"
|
|
123606
|
+
});
|
|
123495
123607
|
|
|
123496
|
-
|
|
123497
|
-
|
|
123608
|
+
this._scene.camera;
|
|
123609
|
+
this._scene.camera.perspective.fov = 70;
|
|
123498
123610
|
|
|
123499
|
-
|
|
123611
|
+
this._zUp = false;
|
|
123500
123612
|
|
|
123501
|
-
|
|
123502
|
-
|
|
123503
|
-
|
|
123613
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123614
|
+
// Synchronize overview scene camera with viewer camera
|
|
123615
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123504
123616
|
|
|
123505
|
-
|
|
123506
|
-
|
|
123507
|
-
|
|
123508
|
-
|
|
123509
|
-
|
|
123510
|
-
|
|
123511
|
-
|
|
123512
|
-
|
|
123513
|
-
|
|
123514
|
-
|
|
123515
|
-
|
|
123516
|
-
|
|
123517
|
-
|
|
123518
|
-
|
|
123519
|
-
|
|
123520
|
-
|
|
123521
|
-
|
|
123522
|
-
|
|
123523
|
-
|
|
123524
|
-
|
|
123525
|
-
|
|
123526
|
-
|
|
123527
|
-
|
|
123528
|
-
|
|
123529
|
-
|
|
123617
|
+
{
|
|
123618
|
+
const camera = this._scene.camera;
|
|
123619
|
+
const matrix = math.rotationMat4c(-90 * math.DEGTORAD, 1, 0, 0);
|
|
123620
|
+
const eyeLookVec = math.vec3();
|
|
123621
|
+
const eyeLookVecOverview = math.vec3();
|
|
123622
|
+
const upOverview = math.vec3();
|
|
123623
|
+
|
|
123624
|
+
this._synchCamera = () => {
|
|
123625
|
+
const eye = this._viewer.camera.eye;
|
|
123626
|
+
const look = this._viewer.camera.look;
|
|
123627
|
+
const up = this._viewer.camera.up;
|
|
123628
|
+
math.mulVec3Scalar(math.normalizeVec3(math.subVec3(eye, look, eyeLookVec)), 7);
|
|
123629
|
+
if (this._zUp) {
|
|
123630
|
+
// +Z up
|
|
123631
|
+
math.transformVec3(matrix, eyeLookVec, eyeLookVecOverview);
|
|
123632
|
+
math.transformVec3(matrix, up, upOverview);
|
|
123633
|
+
camera.look = [0, 0, 0];
|
|
123634
|
+
camera.eye = math.transformVec3(matrix, eyeLookVec, eyeLookVecOverview);
|
|
123635
|
+
camera.up = math.transformPoint3(matrix, up, upOverview);
|
|
123636
|
+
} else {
|
|
123637
|
+
// +Y up
|
|
123638
|
+
camera.look = [0, 0, 0];
|
|
123639
|
+
camera.eye = eyeLookVec;
|
|
123640
|
+
camera.up = up;
|
|
123641
|
+
}
|
|
123642
|
+
};
|
|
123643
|
+
}
|
|
123530
123644
|
|
|
123531
|
-
|
|
123645
|
+
this._onViewerCameraMatrix = this._viewer.camera.on("matrix", this._synchCamera);
|
|
123532
123646
|
|
|
123533
|
-
|
|
123647
|
+
this._onViewerCameraWorldAxis = this._viewer.camera.on("worldAxis", this._synchCamera);
|
|
123534
123648
|
|
|
123535
|
-
|
|
123536
|
-
|
|
123537
|
-
|
|
123649
|
+
this._onViewerCameraFOV = this._viewer.camera.perspective.on("fov", (fov) => {
|
|
123650
|
+
this._scene.camera.perspective.fov = fov;
|
|
123651
|
+
});
|
|
123538
123652
|
|
|
123539
|
-
|
|
123540
|
-
|
|
123541
|
-
|
|
123653
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123654
|
+
// Bind overview canvas events
|
|
123655
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123542
123656
|
|
|
123543
|
-
|
|
123544
|
-
|
|
123657
|
+
{
|
|
123658
|
+
var hoveredEntity = null;
|
|
123545
123659
|
|
|
123546
|
-
|
|
123547
|
-
|
|
123548
|
-
|
|
123549
|
-
|
|
123550
|
-
|
|
123551
|
-
|
|
123552
|
-
|
|
123553
|
-
|
|
123554
|
-
|
|
123555
|
-
|
|
123556
|
-
|
|
123557
|
-
|
|
123558
|
-
|
|
123559
|
-
|
|
123560
|
-
|
|
123561
|
-
|
|
123562
|
-
|
|
123563
|
-
|
|
123564
|
-
|
|
123565
|
-
|
|
123566
|
-
|
|
123567
|
-
|
|
123568
|
-
|
|
123569
|
-
|
|
123570
|
-
|
|
123660
|
+
this._onInputMouseMove = this._scene.input.on("mousemove", (coords) => {
|
|
123661
|
+
const hit = this._scene.pick({
|
|
123662
|
+
canvasPos: coords
|
|
123663
|
+
});
|
|
123664
|
+
if (hit) {
|
|
123665
|
+
if (!hoveredEntity || hit.entity.id !== hoveredEntity.id) {
|
|
123666
|
+
if (hoveredEntity) {
|
|
123667
|
+
const plane = this._planes[hoveredEntity.id];
|
|
123668
|
+
if (plane) {
|
|
123669
|
+
this._onHoverLeavePlane(hoveredEntity.id);
|
|
123670
|
+
}
|
|
123671
|
+
}
|
|
123672
|
+
hoveredEntity = hit.entity;
|
|
123673
|
+
const plane = this._planes[hoveredEntity.id];
|
|
123674
|
+
if (plane) {
|
|
123675
|
+
this._onHoverEnterPlane(hoveredEntity.id);
|
|
123676
|
+
}
|
|
123677
|
+
}
|
|
123678
|
+
} else {
|
|
123679
|
+
if (hoveredEntity) {
|
|
123680
|
+
this._onHoverLeavePlane(hoveredEntity.id);
|
|
123681
|
+
hoveredEntity = null;
|
|
123682
|
+
}
|
|
123683
|
+
}
|
|
123684
|
+
});
|
|
123571
123685
|
|
|
123572
|
-
|
|
123573
|
-
|
|
123574
|
-
|
|
123575
|
-
|
|
123576
|
-
|
|
123577
|
-
|
|
123578
|
-
|
|
123579
|
-
|
|
123580
|
-
|
|
123581
|
-
|
|
123686
|
+
this._scene.canvas.canvas.addEventListener(
|
|
123687
|
+
"mouseup",
|
|
123688
|
+
(this._onCanvasMouseUp = () => {
|
|
123689
|
+
if (hoveredEntity) {
|
|
123690
|
+
const plane = this._planes[hoveredEntity.id];
|
|
123691
|
+
if (plane) {
|
|
123692
|
+
this._onClickedPlane(hoveredEntity.id);
|
|
123693
|
+
}
|
|
123694
|
+
} else {
|
|
123695
|
+
this._onClickedNothing();
|
|
123696
|
+
}
|
|
123697
|
+
})
|
|
123698
|
+
);
|
|
123582
123699
|
|
|
123583
|
-
|
|
123584
|
-
|
|
123585
|
-
|
|
123586
|
-
|
|
123587
|
-
|
|
123588
|
-
|
|
123589
|
-
|
|
123700
|
+
this._scene.canvas.canvas.addEventListener(
|
|
123701
|
+
"mouseout",
|
|
123702
|
+
(this._onCanvasMouseOut = () => {
|
|
123703
|
+
if (hoveredEntity) {
|
|
123704
|
+
this._onHoverLeavePlane(hoveredEntity.id);
|
|
123705
|
+
hoveredEntity = null;
|
|
123706
|
+
}
|
|
123707
|
+
})
|
|
123708
|
+
);
|
|
123709
|
+
}
|
|
123590
123710
|
|
|
123591
|
-
|
|
123592
|
-
|
|
123593
|
-
|
|
123711
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123712
|
+
// Configure overview
|
|
123713
|
+
//--------------------------------------------------------------------------------------------------------------
|
|
123594
123714
|
|
|
123595
|
-
|
|
123596
|
-
|
|
123715
|
+
this.setVisible(cfg.overviewVisible);
|
|
123716
|
+
}
|
|
123597
123717
|
|
|
123598
|
-
|
|
123599
|
-
|
|
123600
|
-
|
|
123601
|
-
|
|
123602
|
-
|
|
123603
|
-
|
|
123718
|
+
/** Called by SectionPlanesPlugin#createSectionPlane()
|
|
123719
|
+
* @private
|
|
123720
|
+
*/
|
|
123721
|
+
addSectionPlane(sectionPlane) {
|
|
123722
|
+
this._planes[sectionPlane.id] = new Plane(this, this._scene, sectionPlane);
|
|
123723
|
+
}
|
|
123604
123724
|
|
|
123605
|
-
|
|
123606
|
-
|
|
123607
|
-
|
|
123608
|
-
|
|
123609
|
-
|
|
123610
|
-
|
|
123611
|
-
|
|
123612
|
-
|
|
123725
|
+
/** @private
|
|
123726
|
+
*/
|
|
123727
|
+
setPlaneHighlighted(id, highlighted) {
|
|
123728
|
+
const plane = this._planes[id];
|
|
123729
|
+
if (plane) {
|
|
123730
|
+
plane.setHighlighted(highlighted);
|
|
123731
|
+
}
|
|
123732
|
+
}
|
|
123613
123733
|
|
|
123614
|
-
|
|
123615
|
-
|
|
123616
|
-
|
|
123617
|
-
|
|
123618
|
-
|
|
123619
|
-
|
|
123620
|
-
|
|
123621
|
-
|
|
123734
|
+
/** @private
|
|
123735
|
+
*/
|
|
123736
|
+
setPlaneSelected(id, selected) {
|
|
123737
|
+
const plane = this._planes[id];
|
|
123738
|
+
if (plane) {
|
|
123739
|
+
plane.setSelected(selected);
|
|
123740
|
+
}
|
|
123741
|
+
}
|
|
123622
123742
|
|
|
123623
|
-
|
|
123624
|
-
|
|
123625
|
-
|
|
123626
|
-
|
|
123627
|
-
|
|
123628
|
-
|
|
123629
|
-
|
|
123630
|
-
|
|
123631
|
-
|
|
123743
|
+
/** @private
|
|
123744
|
+
*/
|
|
123745
|
+
removeSectionPlane(sectionPlane) {
|
|
123746
|
+
const plane = this._planes[sectionPlane.id];
|
|
123747
|
+
if (plane) {
|
|
123748
|
+
plane.destroy();
|
|
123749
|
+
delete this._planes[sectionPlane.id];
|
|
123750
|
+
}
|
|
123751
|
+
}
|
|
123632
123752
|
|
|
123633
|
-
|
|
123634
|
-
|
|
123635
|
-
|
|
123636
|
-
|
|
123637
|
-
|
|
123638
|
-
|
|
123639
|
-
|
|
123640
|
-
|
|
123641
|
-
|
|
123753
|
+
/**
|
|
123754
|
+
* Sets if this SectionPlanesOverview is visible.
|
|
123755
|
+
*
|
|
123756
|
+
* @param {Boolean} visible Whether or not this SectionPlanesOverview is visible.
|
|
123757
|
+
*/
|
|
123758
|
+
setVisible(visible = true) {
|
|
123759
|
+
this._visible = visible;
|
|
123760
|
+
this._canvas.style.visibility = visible ? "visible" : "hidden";
|
|
123761
|
+
}
|
|
123642
123762
|
|
|
123643
|
-
|
|
123644
|
-
|
|
123645
|
-
|
|
123646
|
-
|
|
123647
|
-
|
|
123648
|
-
|
|
123649
|
-
|
|
123650
|
-
|
|
123763
|
+
/**
|
|
123764
|
+
* Gets if this SectionPlanesOverview is visible.
|
|
123765
|
+
*
|
|
123766
|
+
* @return {Boolean} True when this SectionPlanesOverview is visible.
|
|
123767
|
+
*/
|
|
123768
|
+
getVisible() {
|
|
123769
|
+
return this._visible;
|
|
123770
|
+
}
|
|
123651
123771
|
|
|
123652
|
-
|
|
123653
|
-
|
|
123654
|
-
|
|
123655
|
-
|
|
123656
|
-
|
|
123657
|
-
|
|
123772
|
+
/** @private
|
|
123773
|
+
*/
|
|
123774
|
+
destroy() {
|
|
123775
|
+
this._viewer.camera.off(this._onViewerCameraMatrix);
|
|
123776
|
+
this._viewer.camera.off(this._onViewerCameraWorldAxis);
|
|
123777
|
+
this._viewer.camera.perspective.off(this._onViewerCameraFOV);
|
|
123658
123778
|
|
|
123659
|
-
|
|
123660
|
-
|
|
123661
|
-
|
|
123662
|
-
|
|
123663
|
-
|
|
123779
|
+
this._scene.input.off(this._onInputMouseMove);
|
|
123780
|
+
this._scene.canvas.canvas.removeEventListener("mouseup", this._onCanvasMouseUp);
|
|
123781
|
+
this._scene.canvas.canvas.removeEventListener("mouseout", this._onCanvasMouseOut);
|
|
123782
|
+
this._scene.destroy();
|
|
123783
|
+
}
|
|
123664
123784
|
}
|
|
123665
123785
|
|
|
123666
123786
|
const tempAABB = math.AABB3();
|