@xtctwins/tctwins-core 1.0.29 → 1.0.30
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 +226 -96
- package/dist/tctwins-core.min.es.js +3 -3
- package/package.json +1 -1
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +195 -187
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +7 -0
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +241 -233
- package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +8 -0
package/dist/tctwins-core.es.js
CHANGED
|
@@ -11435,6 +11435,7 @@ class AngleMeasurement extends Component {
|
|
|
11435
11435
|
this._needUpdate();
|
|
11436
11436
|
});
|
|
11437
11437
|
|
|
11438
|
+
this.precision = cfg.precision !== undefined ? cfg.precision : 2;
|
|
11438
11439
|
this.approximate = cfg.approximate;
|
|
11439
11440
|
this.visible = cfg.visible;
|
|
11440
11441
|
|
|
@@ -11571,12 +11572,12 @@ class AngleMeasurement extends Component {
|
|
|
11571
11572
|
math.normalizeVec3(targetVec);
|
|
11572
11573
|
const angle = Math.abs(math.angleVec3(originVec, targetVec));
|
|
11573
11574
|
this._angle = angle / math.DEGTORAD;
|
|
11574
|
-
this._angleLabel.setText(tilde + this._angle.toFixed(
|
|
11575
|
+
this._angleLabel.setText(tilde + this._angle.toFixed(this._precision) + "°");
|
|
11575
11576
|
} else {
|
|
11576
11577
|
this._angleLabel.setText("");
|
|
11577
11578
|
}
|
|
11578
11579
|
|
|
11579
|
-
// this._angleLabel.setText((Math.abs(math.lenVec3(math.subVec3(this._targetWorld, this._originWorld, distVec3)) * scale).toFixed(
|
|
11580
|
+
// this._angleLabel.setText((Math.abs(math.lenVec3(math.subVec3(this._targetWorld, this._originWorld, distVec3)) * scale).toFixed(this._precision)) + unitAbbrev);
|
|
11580
11581
|
|
|
11581
11582
|
this._originDot.setVisible(this._visible && this._originVisible);
|
|
11582
11583
|
this._cornerDot.setVisible(this._visible && this._cornerVisible);
|
|
@@ -11630,6 +11631,23 @@ class AngleMeasurement extends Component {
|
|
|
11630
11631
|
return this._approximate;
|
|
11631
11632
|
}
|
|
11632
11633
|
|
|
11634
|
+
/**
|
|
11635
|
+
* 设置精度
|
|
11636
|
+
* @param {number} precision
|
|
11637
|
+
*/
|
|
11638
|
+
set precision(precision) {
|
|
11639
|
+
if (this._precision === precision) {
|
|
11640
|
+
return;
|
|
11641
|
+
}
|
|
11642
|
+
this._precision = precision;
|
|
11643
|
+
this._cpDirty = true;
|
|
11644
|
+
this._needUpdate(0);
|
|
11645
|
+
}
|
|
11646
|
+
|
|
11647
|
+
get precision() {
|
|
11648
|
+
return this._precision;
|
|
11649
|
+
}
|
|
11650
|
+
|
|
11633
11651
|
/**
|
|
11634
11652
|
* Gets the origin {@link Marker}.
|
|
11635
11653
|
*
|
|
@@ -12246,11 +12264,16 @@ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-spa
|
|
|
12246
12264
|
angleMeasurementsPlugin.on("mouseLeave", (e) => {
|
|
12247
12265
|
hover = false;
|
|
12248
12266
|
});
|
|
12267
|
+
|
|
12268
|
+
angleMeasurementsPlugin.on("measureDelete", (e) => {
|
|
12269
|
+
hover = false;
|
|
12270
|
+
});
|
|
12271
|
+
|
|
12249
12272
|
const scene = this.scene;
|
|
12250
12273
|
scene.input;
|
|
12251
12274
|
const canvas = scene.canvas.canvas;
|
|
12252
12275
|
const clickTolerance = 20;
|
|
12253
|
-
const cameraControl =
|
|
12276
|
+
const cameraControl = angleMeasurementsPlugin.viewer.cameraControl;
|
|
12254
12277
|
const pointerLens = this.pointerLens;
|
|
12255
12278
|
let mouseHovering = false;
|
|
12256
12279
|
let hoveredEntity = null;
|
|
@@ -12350,7 +12373,7 @@ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-spa
|
|
|
12350
12373
|
switch (this._mouseState) {
|
|
12351
12374
|
case MOUSE_FINDING_ORIGIN:
|
|
12352
12375
|
if (mouseHovering) {
|
|
12353
|
-
this._currentAngleMeasurement =
|
|
12376
|
+
this._currentAngleMeasurement = angleMeasurementsPlugin.createMeasurement({
|
|
12354
12377
|
id: math.createUUID(),
|
|
12355
12378
|
origin: {
|
|
12356
12379
|
worldPos: mouseWorldPos
|
|
@@ -12361,6 +12384,7 @@ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-spa
|
|
|
12361
12384
|
target: {
|
|
12362
12385
|
worldPos: mouseWorldPos
|
|
12363
12386
|
},
|
|
12387
|
+
precision: angleMeasurementsPlugin.precision,
|
|
12364
12388
|
approximate: true
|
|
12365
12389
|
});
|
|
12366
12390
|
this._currentAngleMeasurement.clickable = false;
|
|
@@ -12372,7 +12396,7 @@ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-spa
|
|
|
12372
12396
|
this._currentAngleMeasurement.angleVisible = false;
|
|
12373
12397
|
this._currentAngleMeasurement.origin.entity = hoveredEntity;
|
|
12374
12398
|
this._mouseState = MOUSE_FINDING_CORNER;
|
|
12375
|
-
|
|
12399
|
+
angleMeasurementsPlugin.fire("measurementStart", this._currentAngleMeasurement);
|
|
12376
12400
|
}
|
|
12377
12401
|
break;
|
|
12378
12402
|
case MOUSE_FINDING_CORNER:
|
|
@@ -12388,7 +12412,7 @@ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-spa
|
|
|
12388
12412
|
this._currentAngleMeasurement = null;
|
|
12389
12413
|
hoveredEntity = null;
|
|
12390
12414
|
this._mouseState = MOUSE_FINDING_ORIGIN;
|
|
12391
|
-
|
|
12415
|
+
angleMeasurementsPlugin.fire("measurementCancel", this._currentAngleMeasurement);
|
|
12392
12416
|
}
|
|
12393
12417
|
}
|
|
12394
12418
|
break;
|
|
@@ -12399,7 +12423,7 @@ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-spa
|
|
|
12399
12423
|
this._currentAngleMeasurement.target.entity = hoveredEntity;
|
|
12400
12424
|
this._currentAngleMeasurement.clickable = true;
|
|
12401
12425
|
hoveredEntity = null;
|
|
12402
|
-
|
|
12426
|
+
angleMeasurementsPlugin.fire("measurementEnd", this._currentAngleMeasurement);
|
|
12403
12427
|
this._currentAngleMeasurement = null;
|
|
12404
12428
|
this._mouseState = MOUSE_FINDING_ORIGIN;
|
|
12405
12429
|
} else {
|
|
@@ -12408,7 +12432,7 @@ s * @param {function} [cfg.canvasToPagePos] Optional function to map canvas-spa
|
|
|
12408
12432
|
this._currentAngleMeasurement = null;
|
|
12409
12433
|
hoveredEntity = null;
|
|
12410
12434
|
this._mouseState = MOUSE_FINDING_ORIGIN;
|
|
12411
|
-
|
|
12435
|
+
angleMeasurementsPlugin.fire("measurementCancel", this._currentAngleMeasurement);
|
|
12412
12436
|
}
|
|
12413
12437
|
}
|
|
12414
12438
|
break;
|
|
@@ -12775,6 +12799,8 @@ class AngleMeasurementsPlugin extends Plugin {
|
|
|
12775
12799
|
this.defaultLabelsVisible = cfg.defaultLabelsVisible !== false;
|
|
12776
12800
|
this.zIndex = cfg.zIndex || 10000;
|
|
12777
12801
|
|
|
12802
|
+
this.precision = cfg.precision !== undefined ? cfg.precision : 2;
|
|
12803
|
+
|
|
12778
12804
|
this._onMouseOver = (event, measurement) => {
|
|
12779
12805
|
this.fire("mouseOver", {
|
|
12780
12806
|
plugin: this,
|
|
@@ -12821,6 +12847,28 @@ class AngleMeasurementsPlugin extends Plugin {
|
|
|
12821
12847
|
};
|
|
12822
12848
|
}
|
|
12823
12849
|
|
|
12850
|
+
/**
|
|
12851
|
+
* 设置精度
|
|
12852
|
+
* @param {number} precision
|
|
12853
|
+
*/
|
|
12854
|
+
set precision(precision) {
|
|
12855
|
+
if (this._precision == precision) return;
|
|
12856
|
+
this._precision = precision;
|
|
12857
|
+
if (this.measureNum > 0) {
|
|
12858
|
+
for (let id in this.measurements) {
|
|
12859
|
+
this.measurements[id].precision = precision;
|
|
12860
|
+
}
|
|
12861
|
+
}
|
|
12862
|
+
}
|
|
12863
|
+
|
|
12864
|
+
get precision() {
|
|
12865
|
+
return this._precision;
|
|
12866
|
+
}
|
|
12867
|
+
|
|
12868
|
+
get measureNum() {
|
|
12869
|
+
return Object.keys(this.measurements).length;
|
|
12870
|
+
}
|
|
12871
|
+
|
|
12824
12872
|
/**
|
|
12825
12873
|
* Gets the plugin's HTML container element, if any.
|
|
12826
12874
|
* @returns {*|HTMLElement|HTMLElement}
|
|
@@ -12909,7 +12957,9 @@ class AngleMeasurementsPlugin extends Plugin {
|
|
|
12909
12957
|
onMouseLeave: this._onMouseLeave,
|
|
12910
12958
|
onMouseClick: this._onMouseClick,
|
|
12911
12959
|
onTouchStart: this._onTouchStart,
|
|
12912
|
-
onContextMenu: this._onContextMenu
|
|
12960
|
+
onContextMenu: this._onContextMenu,
|
|
12961
|
+
|
|
12962
|
+
precision: this._precision
|
|
12913
12963
|
});
|
|
12914
12964
|
this._measurements[measurement.id] = measurement;
|
|
12915
12965
|
measurement.on("destroyed", () => {
|
|
@@ -13402,7 +13452,8 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13402
13452
|
target: {
|
|
13403
13453
|
worldPos: snapPickResult.worldPos,
|
|
13404
13454
|
entity: snapPickResult.entity
|
|
13405
|
-
}
|
|
13455
|
+
},
|
|
13456
|
+
precision: plugin.precision
|
|
13406
13457
|
});
|
|
13407
13458
|
this._currentAngleMeasurement.clickable = false;
|
|
13408
13459
|
this._currentAngleMeasurement.originVisible = true;
|
|
@@ -13415,7 +13466,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13415
13466
|
} else {
|
|
13416
13467
|
this._currentAngleMeasurement.origin.worldPos = pointerWorldPos;
|
|
13417
13468
|
}
|
|
13418
|
-
|
|
13469
|
+
plugin.fire("measurementStart", this._currentAngleMeasurement);
|
|
13419
13470
|
// if (this.pointerLens) {
|
|
13420
13471
|
// this.pointerLens.cursorPos = pickResult.canvasPos;
|
|
13421
13472
|
// this.pointerLens.snapped = false;
|
|
@@ -13597,7 +13648,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13597
13648
|
this._currentAngleMeasurement.targetVisible = true;
|
|
13598
13649
|
this._currentAngleMeasurement.targetWireVisible = true;
|
|
13599
13650
|
this._currentAngleMeasurement.angleVisible = true;
|
|
13600
|
-
|
|
13651
|
+
plugin.fire("measurementStart", this._currentAngleMeasurement);
|
|
13601
13652
|
} else {
|
|
13602
13653
|
if (this.pointerLens) {
|
|
13603
13654
|
this.pointerLens.cursorPos = null;
|
|
@@ -13871,7 +13922,8 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13871
13922
|
},
|
|
13872
13923
|
target: {
|
|
13873
13924
|
worldPos: pickResult.worldPos
|
|
13874
|
-
}
|
|
13925
|
+
},
|
|
13926
|
+
precision: plugin.precision
|
|
13875
13927
|
});
|
|
13876
13928
|
// this._currentAngleMeasurement.clickable = false;
|
|
13877
13929
|
this._currentAngleMeasurement.originVisible = true;
|
|
@@ -86206,7 +86258,9 @@ class DistanceMeasurement extends Component {
|
|
|
86206
86258
|
this._needUpdate();
|
|
86207
86259
|
});
|
|
86208
86260
|
|
|
86209
|
-
this.
|
|
86261
|
+
this.precision = cfg.precision !== undefined ? cfg.precision : 2;
|
|
86262
|
+
this.approximate = cfg.approximate !== undefined ? cfg.approximate : true;
|
|
86263
|
+
|
|
86210
86264
|
this.visible = cfg.visible;
|
|
86211
86265
|
this.originVisible = cfg.originVisible;
|
|
86212
86266
|
this.targetVisible = cfg.targetVisible;
|
|
@@ -86376,7 +86430,7 @@ class DistanceMeasurement extends Component {
|
|
|
86376
86430
|
const tilde = this._approximate ? " " : " = ";
|
|
86377
86431
|
|
|
86378
86432
|
this._length = Math.abs(math.lenVec3(math.subVec3(this._targetWorld, this._originWorld, distVec3)));
|
|
86379
|
-
this._lengthLabel.setText(tilde + (this._length * scale).toFixed(
|
|
86433
|
+
this._lengthLabel.setText(tilde + (this._length * scale).toFixed(this._precision) + unitAbbrev);
|
|
86380
86434
|
|
|
86381
86435
|
const xAxisCanvasLength = Math.abs(lengthWire(cp[0], cp[1], cp[2], cp[3]));
|
|
86382
86436
|
const yAxisCanvasLength = Math.abs(lengthWire(cp[2], cp[3], cp[4], cp[5]));
|
|
@@ -86396,7 +86450,9 @@ class DistanceMeasurement extends Component {
|
|
|
86396
86450
|
|
|
86397
86451
|
if (!this._xAxisLabelCulled) {
|
|
86398
86452
|
this._xAxisLabel.setText(
|
|
86399
|
-
tilde +
|
|
86453
|
+
tilde +
|
|
86454
|
+
Math.abs((this._targetWorld[0] - this._originWorld[0]) * scale).toFixed(this._precision) +
|
|
86455
|
+
unitAbbrev
|
|
86400
86456
|
);
|
|
86401
86457
|
this._xAxisLabel.setCulled(!this.axisVisible);
|
|
86402
86458
|
} else {
|
|
@@ -86405,7 +86461,9 @@ class DistanceMeasurement extends Component {
|
|
|
86405
86461
|
|
|
86406
86462
|
if (!this._yAxisLabelCulled) {
|
|
86407
86463
|
this._yAxisLabel.setText(
|
|
86408
|
-
tilde +
|
|
86464
|
+
tilde +
|
|
86465
|
+
Math.abs((this._targetWorld[1] - this._originWorld[1]) * scale).toFixed(this._precision) +
|
|
86466
|
+
unitAbbrev
|
|
86409
86467
|
);
|
|
86410
86468
|
this._yAxisLabel.setCulled(!this.axisVisible);
|
|
86411
86469
|
} else {
|
|
@@ -86414,7 +86472,9 @@ class DistanceMeasurement extends Component {
|
|
|
86414
86472
|
|
|
86415
86473
|
if (!this._zAxisLabelCulled) {
|
|
86416
86474
|
this._zAxisLabel.setText(
|
|
86417
|
-
tilde +
|
|
86475
|
+
tilde +
|
|
86476
|
+
Math.abs((this._targetWorld[2] - this._originWorld[2]) * scale).toFixed(this._precision) +
|
|
86477
|
+
unitAbbrev
|
|
86418
86478
|
);
|
|
86419
86479
|
this._zAxisLabel.setCulled(!this.axisVisible);
|
|
86420
86480
|
} else {
|
|
@@ -86480,6 +86540,23 @@ class DistanceMeasurement extends Component {
|
|
|
86480
86540
|
return this._approximate;
|
|
86481
86541
|
}
|
|
86482
86542
|
|
|
86543
|
+
/**
|
|
86544
|
+
* 设置精度
|
|
86545
|
+
* @param {number} precision
|
|
86546
|
+
*/
|
|
86547
|
+
set precision(precision) {
|
|
86548
|
+
if (this._precision === precision) {
|
|
86549
|
+
return;
|
|
86550
|
+
}
|
|
86551
|
+
this._precision = precision;
|
|
86552
|
+
this._cpDirty = true;
|
|
86553
|
+
this._needUpdate(0);
|
|
86554
|
+
}
|
|
86555
|
+
|
|
86556
|
+
get precision() {
|
|
86557
|
+
return this._precision;
|
|
86558
|
+
}
|
|
86559
|
+
|
|
86483
86560
|
/**
|
|
86484
86561
|
* Gets the origin {@link Marker}.
|
|
86485
86562
|
*
|
|
@@ -87208,6 +87285,10 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
87208
87285
|
distanceMeasurementsPlugin.on("mouseLeave", (e) => {
|
|
87209
87286
|
hover = false;
|
|
87210
87287
|
});
|
|
87288
|
+
|
|
87289
|
+
distanceMeasurementsPlugin.on("measureDelete", (e) => {
|
|
87290
|
+
hover = false;
|
|
87291
|
+
});
|
|
87211
87292
|
const scene = this.scene;
|
|
87212
87293
|
const cameraControl = distanceMeasurementsPlugin.viewer.cameraControl;
|
|
87213
87294
|
const canvas = scene.canvas.canvas;
|
|
@@ -87335,6 +87416,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
87335
87416
|
target: {
|
|
87336
87417
|
worldPos: pointerWorldPos.slice()
|
|
87337
87418
|
},
|
|
87419
|
+
precision: distanceMeasurementsPlugin.precision,
|
|
87338
87420
|
approximate: true
|
|
87339
87421
|
});
|
|
87340
87422
|
this._currentDistanceMeasurementInitState.axisVisible =
|
|
@@ -87745,9 +87827,11 @@ class DistanceMeasurementsPlugin extends Plugin {
|
|
|
87745
87827
|
this.defaultXAxisVisible = cfg.defaultXAxisVisible !== false;
|
|
87746
87828
|
this.defaultYAxisVisible = cfg.defaultYAxisVisible !== false;
|
|
87747
87829
|
this.defaultZAxisVisible = cfg.defaultZAxisVisible !== false;
|
|
87830
|
+
this.defaultLabelsOnWires = cfg.defaultLabelsOnWires !== false;
|
|
87748
87831
|
this.defaultColor = cfg.defaultColor !== undefined ? cfg.defaultColor : "#0065fc";
|
|
87749
87832
|
this.zIndex = cfg.zIndex || 10000;
|
|
87750
|
-
|
|
87833
|
+
|
|
87834
|
+
this.precision = cfg.precision !== undefined ? cfg.precision : 2;
|
|
87751
87835
|
|
|
87752
87836
|
this._onMouseOver = (event, measurement) => {
|
|
87753
87837
|
this.fire("mouseOver", {
|
|
@@ -87794,6 +87878,46 @@ class DistanceMeasurementsPlugin extends Plugin {
|
|
|
87794
87878
|
};
|
|
87795
87879
|
}
|
|
87796
87880
|
|
|
87881
|
+
/**
|
|
87882
|
+
* 设置精度
|
|
87883
|
+
* @param {number} precision
|
|
87884
|
+
*/
|
|
87885
|
+
set precision(precision) {
|
|
87886
|
+
if (this._precision == precision) return;
|
|
87887
|
+
this._precision = precision;
|
|
87888
|
+
if (this.measureNum > 0) {
|
|
87889
|
+
for (let id in this.measurements) {
|
|
87890
|
+
this.measurements[id].precision = precision;
|
|
87891
|
+
}
|
|
87892
|
+
}
|
|
87893
|
+
}
|
|
87894
|
+
|
|
87895
|
+
get precision() {
|
|
87896
|
+
return this._precision;
|
|
87897
|
+
}
|
|
87898
|
+
|
|
87899
|
+
/**
|
|
87900
|
+
* 设置比例
|
|
87901
|
+
* @param {number} scale
|
|
87902
|
+
*/
|
|
87903
|
+
set scale(scale) {
|
|
87904
|
+
if (this._scale == scale) return;
|
|
87905
|
+
this._scale = scale;
|
|
87906
|
+
if (this.measureNum > 0) {
|
|
87907
|
+
for (let id in this.measurements) {
|
|
87908
|
+
this.measurements[id].scale = scale;
|
|
87909
|
+
}
|
|
87910
|
+
}
|
|
87911
|
+
}
|
|
87912
|
+
|
|
87913
|
+
get scale() {
|
|
87914
|
+
return this._scale;
|
|
87915
|
+
}
|
|
87916
|
+
|
|
87917
|
+
get measureNum() {
|
|
87918
|
+
return Object.keys(this.measurements).length;
|
|
87919
|
+
}
|
|
87920
|
+
|
|
87797
87921
|
/**
|
|
87798
87922
|
* Gets the plugin's HTML container element, if any.
|
|
87799
87923
|
* @returns {*|HTMLElement|HTMLElement}
|
|
@@ -87911,21 +88035,23 @@ class DistanceMeasurementsPlugin extends Plugin {
|
|
|
87911
88035
|
color: params.color,
|
|
87912
88036
|
|
|
87913
88037
|
visible: params.visible,
|
|
88038
|
+
originVisible: params.originVisible,
|
|
88039
|
+
targetVisible: params.targetVisible,
|
|
87914
88040
|
wireVisible: params.wireVisible,
|
|
87915
88041
|
axisVisible: params.axisVisible !== false && this.defaultAxisVisible !== false,
|
|
87916
88042
|
xAxisVisible: params.xAxisVisible !== false && this.defaultXAxisVisible !== false,
|
|
87917
88043
|
yAxisVisible: params.yAxisVisible !== false && this.defaultYAxisVisible !== false,
|
|
87918
88044
|
zAxisVisible: params.zAxisVisible !== false && this.defaultZAxisVisible !== false,
|
|
87919
88045
|
labelsVisible: params.labelsVisible !== false && this.defaultLabelsVisible !== false,
|
|
87920
|
-
originVisible: params.originVisible,
|
|
87921
|
-
targetVisible: params.targetVisible,
|
|
87922
88046
|
|
|
87923
88047
|
labelsOnWires: params.labelsOnWires !== false && this.defaultLabelsOnWires !== false,
|
|
87924
88048
|
onMouseOver: this._onMouseOver,
|
|
87925
88049
|
onMouseLeave: this._onMouseLeave,
|
|
87926
88050
|
onMouseClick: this._onMouseClick,
|
|
87927
88051
|
onTouchStart: this._onTouchStart,
|
|
87928
|
-
onContextMenu: this._onContextMenu
|
|
88052
|
+
onContextMenu: this._onContextMenu,
|
|
88053
|
+
|
|
88054
|
+
precision: this._precision
|
|
87929
88055
|
});
|
|
87930
88056
|
this._measurements[measurement.id] = measurement;
|
|
87931
88057
|
measurement.on("destroyed", () => {
|
|
@@ -88305,7 +88431,8 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88305
88431
|
target: {
|
|
88306
88432
|
worldPos: pointerWorldPos,
|
|
88307
88433
|
entity: snapPickResult.entity
|
|
88308
|
-
}
|
|
88434
|
+
},
|
|
88435
|
+
precision: plugin.precision
|
|
88309
88436
|
});
|
|
88310
88437
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
88311
88438
|
this._currentDistanceMeasurement.xAxisVisible = false;
|
|
@@ -88487,7 +88614,8 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88487
88614
|
target: {
|
|
88488
88615
|
worldPos: snapPickResult.worldPos,
|
|
88489
88616
|
entity: snapPickResult.entity
|
|
88490
|
-
}
|
|
88617
|
+
},
|
|
88618
|
+
precision: plugin.precision
|
|
88491
88619
|
});
|
|
88492
88620
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
88493
88621
|
this._currentDistanceMeasurement.xAxisVisible = false;
|
|
@@ -88523,7 +88651,8 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88523
88651
|
target: {
|
|
88524
88652
|
worldPos: pickResult.worldPos,
|
|
88525
88653
|
entity: pickResult.entity
|
|
88526
|
-
}
|
|
88654
|
+
},
|
|
88655
|
+
precision: plugin.precision
|
|
88527
88656
|
});
|
|
88528
88657
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
88529
88658
|
this._currentDistanceMeasurement.xAxisVisible = false;
|
|
@@ -88662,7 +88791,8 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88662
88791
|
target: {
|
|
88663
88792
|
worldPos: pickResult.worldPos,
|
|
88664
88793
|
entity: pickResult.entity
|
|
88665
|
-
}
|
|
88794
|
+
},
|
|
88795
|
+
precision: plugin.precision
|
|
88666
88796
|
});
|
|
88667
88797
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
88668
88798
|
this._currentDistanceMeasurement.xAxisVisible = false;
|
|
@@ -120185,71 +120315,71 @@ class Control {
|
|
|
120185
120315
|
//
|
|
120186
120316
|
//----------------------------------------------------------------------------------------------------------
|
|
120187
120317
|
|
|
120188
|
-
zCurve: rootNode.addChild(
|
|
120189
|
-
|
|
120190
|
-
|
|
120191
|
-
|
|
120192
|
-
|
|
120193
|
-
|
|
120194
|
-
|
|
120195
|
-
|
|
120196
|
-
|
|
120197
|
-
|
|
120198
|
-
|
|
120199
|
-
|
|
120200
|
-
|
|
120201
|
-
),
|
|
120318
|
+
// zCurve: rootNode.addChild(
|
|
120319
|
+
// new Mesh(rootNode, {
|
|
120320
|
+
// // Blue hoop about Z-axis
|
|
120321
|
+
// geometry: shapes.curve,
|
|
120322
|
+
// material: materials.blue,
|
|
120323
|
+
// matrix: math.rotationMat4v(180 * math.DEGTORAD, [1, 0, 0], math.identityMat4()),
|
|
120324
|
+
// pickable: false,
|
|
120325
|
+
// collidable: true,
|
|
120326
|
+
// clippable: false,
|
|
120327
|
+
// visible: false,
|
|
120328
|
+
// isObject: false
|
|
120329
|
+
// }),
|
|
120330
|
+
// NO_STATE_INHERIT
|
|
120331
|
+
// ),
|
|
120202
120332
|
|
|
120203
|
-
zCurveHandle: rootNode.addChild(
|
|
120204
|
-
|
|
120205
|
-
|
|
120206
|
-
|
|
120207
|
-
|
|
120208
|
-
|
|
120209
|
-
|
|
120210
|
-
|
|
120211
|
-
|
|
120212
|
-
|
|
120213
|
-
|
|
120214
|
-
|
|
120215
|
-
),
|
|
120333
|
+
// zCurveHandle: rootNode.addChild(
|
|
120334
|
+
// new Mesh(rootNode, {
|
|
120335
|
+
// geometry: shapes.curveHandle,
|
|
120336
|
+
// material: materials.pickable,
|
|
120337
|
+
// matrix: math.rotationMat4v(180 * math.DEGTORAD, [1, 0, 0], math.identityMat4()),
|
|
120338
|
+
// pickable: true,
|
|
120339
|
+
// collidable: true,
|
|
120340
|
+
// clippable: false,
|
|
120341
|
+
// visible: false,
|
|
120342
|
+
// isObject: false
|
|
120343
|
+
// }),
|
|
120344
|
+
// NO_STATE_INHERIT
|
|
120345
|
+
// ),
|
|
120216
120346
|
|
|
120217
|
-
zCurveCurveArrow1: rootNode.addChild(
|
|
120218
|
-
|
|
120219
|
-
|
|
120220
|
-
|
|
120221
|
-
|
|
120222
|
-
|
|
120223
|
-
|
|
120224
|
-
|
|
120225
|
-
|
|
120226
|
-
|
|
120227
|
-
|
|
120228
|
-
|
|
120229
|
-
|
|
120230
|
-
|
|
120231
|
-
|
|
120232
|
-
|
|
120233
|
-
),
|
|
120347
|
+
// zCurveCurveArrow1: rootNode.addChild(
|
|
120348
|
+
// new Mesh(rootNode, {
|
|
120349
|
+
// geometry: shapes.arrowHead,
|
|
120350
|
+
// material: materials.blue,
|
|
120351
|
+
// matrix: (function () {
|
|
120352
|
+
// const translate = math.translateMat4c(0.8, -0.07, 0, math.identityMat4());
|
|
120353
|
+
// const scale = math.scaleMat4v([0.6, 0.6, 0.6], math.identityMat4());
|
|
120354
|
+
// return math.mulMat4(translate, scale, math.identityMat4());
|
|
120355
|
+
// })(),
|
|
120356
|
+
// pickable: true,
|
|
120357
|
+
// collidable: true,
|
|
120358
|
+
// clippable: false,
|
|
120359
|
+
// visible: false,
|
|
120360
|
+
// isObject: false
|
|
120361
|
+
// }),
|
|
120362
|
+
// NO_STATE_INHERIT
|
|
120363
|
+
// ),
|
|
120234
120364
|
|
|
120235
|
-
zCurveArrow2: rootNode.addChild(
|
|
120236
|
-
|
|
120237
|
-
|
|
120238
|
-
|
|
120239
|
-
|
|
120240
|
-
|
|
120241
|
-
|
|
120242
|
-
|
|
120243
|
-
|
|
120244
|
-
|
|
120245
|
-
|
|
120246
|
-
|
|
120247
|
-
|
|
120248
|
-
|
|
120249
|
-
|
|
120250
|
-
|
|
120251
|
-
|
|
120252
|
-
),
|
|
120365
|
+
// zCurveArrow2: rootNode.addChild(
|
|
120366
|
+
// new Mesh(rootNode, {
|
|
120367
|
+
// geometry: shapes.arrowHead,
|
|
120368
|
+
// material: materials.blue,
|
|
120369
|
+
// matrix: (function () {
|
|
120370
|
+
// const translate = math.translateMat4c(0.05, -0.8, 0, math.identityMat4());
|
|
120371
|
+
// const scale = math.scaleMat4v([0.6, 0.6, 0.6], math.identityMat4());
|
|
120372
|
+
// const rotate = math.rotationMat4v(90 * math.DEGTORAD, [0, 0, 1], math.identityMat4());
|
|
120373
|
+
// return math.mulMat4(math.mulMat4(translate, scale, math.identityMat4()), rotate, math.identityMat4());
|
|
120374
|
+
// })(),
|
|
120375
|
+
// pickable: true,
|
|
120376
|
+
// collidable: true,
|
|
120377
|
+
// clippable: false,
|
|
120378
|
+
// visible: false,
|
|
120379
|
+
// isObject: false
|
|
120380
|
+
// }),
|
|
120381
|
+
// NO_STATE_INHERIT
|
|
120382
|
+
// ),
|
|
120253
120383
|
|
|
120254
120384
|
//----------------------------------------------------------------------------------------------------------
|
|
120255
120385
|
//
|
|
@@ -120939,10 +121069,10 @@ class Control {
|
|
|
120939
121069
|
nextDragAction = DRAG_ACTIONS.yRotate;
|
|
120940
121070
|
break;
|
|
120941
121071
|
|
|
120942
|
-
case this._displayMeshes.zCurveHandle.id:
|
|
120943
|
-
|
|
120944
|
-
|
|
120945
|
-
|
|
121072
|
+
// case this._displayMeshes.zCurveHandle.id:
|
|
121073
|
+
// affordanceMesh = this._affordanceMeshes.zHoop;
|
|
121074
|
+
// nextDragAction = DRAG_ACTIONS.zRotate;
|
|
121075
|
+
// break;
|
|
120946
121076
|
|
|
120947
121077
|
default:
|
|
120948
121078
|
nextDragAction = DRAG_ACTIONS.none;
|
|
@@ -121103,10 +121233,10 @@ class Control {
|
|
|
121103
121233
|
nextDragAction = DRAG_ACTIONS.yRotate;
|
|
121104
121234
|
break;
|
|
121105
121235
|
|
|
121106
|
-
case this._displayMeshes.zCurveHandle.id:
|
|
121107
|
-
|
|
121108
|
-
|
|
121109
|
-
|
|
121236
|
+
// case this._displayMeshes.zCurveHandle.id:
|
|
121237
|
+
// affordanceMesh = this._affordanceMeshes.zHoop;
|
|
121238
|
+
// nextDragAction = DRAG_ACTIONS.zRotate;
|
|
121239
|
+
// break;
|
|
121110
121240
|
|
|
121111
121241
|
default:
|
|
121112
121242
|
nextDragAction = DRAG_ACTIONS.none;
|