@xeokit/xeokit-sdk 2.6.0-beta-13 → 2.6.0-beta-15
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/web-ifc.wasm +0 -0
- package/dist/xeokit-sdk.cjs.js +152 -84
- package/dist/xeokit-sdk.es.js +152 -84
- package/dist/xeokit-sdk.es5.js +38 -38
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +3 -3
- package/dist/xeokit-sdk.min.es5.js +3 -3
- package/package.json +1 -1
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.js +6 -3
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.js +10 -3
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsMouseControl.js +5 -3
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsTouchControl.js +22 -8
- package/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +1 -1
- package/src/plugins/GLTFLoaderPlugin/GLTFSceneModelLoader.js +22 -16
- package/src/plugins/SectionPlanesPlugin/Control.js +70 -35
- package/src/viewer/scene/CameraControl/lib/controllers/PickController.js +1 -0
- package/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +12 -12
- package/src/viewer/scene/model/SceneModel.js +1 -1
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -12403,13 +12403,16 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
12403
12403
|
this._currentAngleMeasurement = this.angleMeasurementsPlugin.createMeasurement({
|
|
12404
12404
|
id: math.createUUID(),
|
|
12405
12405
|
origin: {
|
|
12406
|
-
worldPos: mouseWorldPos
|
|
12406
|
+
worldPos: mouseWorldPos,
|
|
12407
|
+
entity: hoveredEntity
|
|
12407
12408
|
},
|
|
12408
12409
|
corner: {
|
|
12409
|
-
worldPos: mouseWorldPos
|
|
12410
|
+
worldPos: mouseWorldPos,
|
|
12411
|
+
entity: hoveredEntity
|
|
12410
12412
|
},
|
|
12411
12413
|
target: {
|
|
12412
|
-
worldPos: mouseWorldPos
|
|
12414
|
+
worldPos: mouseWorldPos,
|
|
12415
|
+
entity: hoveredEntity
|
|
12413
12416
|
},
|
|
12414
12417
|
approximate: true
|
|
12415
12418
|
});
|
|
@@ -12770,7 +12773,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
12770
12773
|
* start, corner or end point will cause the point to snap to the nearest vertex or edge. A quick
|
|
12771
12774
|
* touch-release will immediately set the point at the tapped position on the object surface.
|
|
12772
12775
|
*
|
|
12773
|
-
* [[Run example](/examples/measurement/#angle_createWithTouch_snapping)]
|
|
12776
|
+
* [[Run example](https://xeokit.github.io/xeokit-sdk/examples/measurement/#angle_createWithTouch_snapping)]
|
|
12774
12777
|
*
|
|
12775
12778
|
* ````javascript
|
|
12776
12779
|
* import {Viewer, XKTLoaderPlugin, AngleMeasurementsPlugin, AngleMeasurementsTouchControl} from "xeokit-sdk.es.js";
|
|
@@ -13245,13 +13248,16 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13245
13248
|
this._currentAngleMeasurement = plugin.createMeasurement({
|
|
13246
13249
|
id: math.createUUID(),
|
|
13247
13250
|
origin: {
|
|
13248
|
-
worldPos: snapPickResult.worldPos
|
|
13251
|
+
worldPos: snapPickResult.worldPos,
|
|
13252
|
+
entity: snapPickResult.entity
|
|
13249
13253
|
},
|
|
13250
13254
|
corner: {
|
|
13251
|
-
worldPos: snapPickResult.worldPos
|
|
13255
|
+
worldPos: snapPickResult.worldPos,
|
|
13256
|
+
entity: snapPickResult.entity
|
|
13252
13257
|
},
|
|
13253
13258
|
target: {
|
|
13254
|
-
worldPos: snapPickResult.worldPos
|
|
13259
|
+
worldPos: snapPickResult.worldPos,
|
|
13260
|
+
entity: snapPickResult.entity
|
|
13255
13261
|
}
|
|
13256
13262
|
});
|
|
13257
13263
|
this._currentAngleMeasurement.clickable = false;
|
|
@@ -13320,6 +13326,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13320
13326
|
this.pointerCircle.start(snapPickResult.snappedCanvasPos);
|
|
13321
13327
|
pointerWorldPos.set(snapPickResult.worldPos);
|
|
13322
13328
|
this._currentAngleMeasurement.corner.worldPos = snapPickResult.worldPos;
|
|
13329
|
+
this._currentAngleMeasurement.corner.entity = snapPickResult.entity;
|
|
13323
13330
|
this._currentAngleMeasurement.originVisible = true;
|
|
13324
13331
|
this._currentAngleMeasurement.originWireVisible = true;
|
|
13325
13332
|
this._currentAngleMeasurement.cornerVisible = true;
|
|
@@ -13341,6 +13348,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13341
13348
|
this.pointerCircle.start(pickResult.canvasPos);
|
|
13342
13349
|
pointerWorldPos.set(pickResult.worldPos);
|
|
13343
13350
|
this._currentAngleMeasurement.corner.worldPos = pickResult.worldPos;
|
|
13351
|
+
this._currentAngleMeasurement.corner.entity = pickResult.entity;
|
|
13344
13352
|
this._currentAngleMeasurement.originVisible = true;
|
|
13345
13353
|
this._currentAngleMeasurement.originWireVisible = true;
|
|
13346
13354
|
this._currentAngleMeasurement.cornerVisible = true;
|
|
@@ -13411,6 +13419,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13411
13419
|
this.pointerCircle.start(snapPickResult.snappedCanvasPos);
|
|
13412
13420
|
pointerWorldPos.set(snapPickResult.worldPos);
|
|
13413
13421
|
this._currentAngleMeasurement.target.worldPos = snapPickResult.worldPos;
|
|
13422
|
+
this._currentAngleMeasurement.target.entity = snapPickResult.entity;
|
|
13414
13423
|
this._currentAngleMeasurement.originVisible = true;
|
|
13415
13424
|
this._currentAngleMeasurement.originWireVisible = true;
|
|
13416
13425
|
this._currentAngleMeasurement.cornerVisible = true;
|
|
@@ -13432,6 +13441,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13432
13441
|
this.pointerCircle.start(pickResult.canvasPos);
|
|
13433
13442
|
pointerWorldPos.set(pickResult.worldPos);
|
|
13434
13443
|
this._currentAngleMeasurement.target.worldPos = pickResult.worldPos;
|
|
13444
|
+
this._currentAngleMeasurement.target.entity = pickResult.entity;
|
|
13435
13445
|
this._currentAngleMeasurement.originVisible = true;
|
|
13436
13446
|
this._currentAngleMeasurement.originWireVisible = true;
|
|
13437
13447
|
this._currentAngleMeasurement.cornerVisible = true;
|
|
@@ -83349,7 +83359,7 @@ class SceneModel extends Component {
|
|
|
83349
83359
|
return;
|
|
83350
83360
|
}
|
|
83351
83361
|
let parentTransform;
|
|
83352
|
-
if (
|
|
83362
|
+
if (cfg.parentTransformId) {
|
|
83353
83363
|
parentTransform = this._transforms[cfg.parentTransformId];
|
|
83354
83364
|
if (!parentTransform) {
|
|
83355
83365
|
this.error("[createTransform] SceneModel.createTransform() config missing: id");
|
|
@@ -87192,10 +87202,12 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
87192
87202
|
this._currentDistanceMeasurement = distanceMeasurementsPlugin.createMeasurement({
|
|
87193
87203
|
id: math.createUUID(),
|
|
87194
87204
|
origin: {
|
|
87195
|
-
worldPos: pointerWorldPos.slice()
|
|
87205
|
+
worldPos: pointerWorldPos.slice(),
|
|
87206
|
+
entity: hoveredEntity
|
|
87196
87207
|
},
|
|
87197
87208
|
target: {
|
|
87198
|
-
worldPos: pointerWorldPos.slice()
|
|
87209
|
+
worldPos: pointerWorldPos.slice(),
|
|
87210
|
+
entity: hoveredEntity
|
|
87199
87211
|
},
|
|
87200
87212
|
approximate: true
|
|
87201
87213
|
});
|
|
@@ -87208,7 +87220,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
87208
87220
|
this._currentDistanceMeasurement.clickable = false;
|
|
87209
87221
|
this._currentDistanceMeasurement.origin.entity = hoveredEntity;
|
|
87210
87222
|
hoveredEntity = null;
|
|
87211
|
-
this.fire("measurementStart", this._currentDistanceMeasurement);
|
|
87223
|
+
this.distanceMeasurementsPlugin.fire("measurementStart", this._currentDistanceMeasurement);
|
|
87212
87224
|
}
|
|
87213
87225
|
}
|
|
87214
87226
|
});
|
|
@@ -87529,7 +87541,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
87529
87541
|
* start or end point will cause the point to snap to the nearest vertex or edge. A quick
|
|
87530
87542
|
* touch-release will immediately set the point at the tapped position on the object surface.
|
|
87531
87543
|
*
|
|
87532
|
-
* [[Run example](/examples/measurement/#distance_createWithTouch_snapping)]
|
|
87544
|
+
* [[Run example](https://xeokit.github.io/xeokit-sdk/examples/measurement/#distance_createWithTouch_snapping)]
|
|
87533
87545
|
*
|
|
87534
87546
|
* ````javascript
|
|
87535
87547
|
* import {Viewer, XKTLoaderPlugin, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl} from "xeokit-sdk.es.js";
|
|
@@ -88093,10 +88105,12 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88093
88105
|
this._currentDistanceMeasurement = plugin.createMeasurement({
|
|
88094
88106
|
id: math.createUUID(),
|
|
88095
88107
|
origin: {
|
|
88096
|
-
worldPos: pointerWorldPos
|
|
88108
|
+
worldPos: pointerWorldPos,
|
|
88109
|
+
entity: snapPickResult.entity
|
|
88097
88110
|
},
|
|
88098
88111
|
target: {
|
|
88099
|
-
worldPos: pointerWorldPos
|
|
88112
|
+
worldPos: pointerWorldPos,
|
|
88113
|
+
entity: snapPickResult.entity
|
|
88100
88114
|
}
|
|
88101
88115
|
});
|
|
88102
88116
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
@@ -88166,6 +88180,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88166
88180
|
this.pointerCircle.start(snapPickResult.snappedCanvasPos);
|
|
88167
88181
|
pointerWorldPos.set(snapPickResult.worldPos);
|
|
88168
88182
|
this._currentDistanceMeasurement.target.worldPos = snapPickResult.worldPos;
|
|
88183
|
+
this._currentDistanceMeasurement.target.entity = snapPickResult.entity;
|
|
88169
88184
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88170
88185
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88171
88186
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -88183,6 +88198,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88183
88198
|
this.pointerCircle.start(pickResult.canvasPos);
|
|
88184
88199
|
pointerWorldPos.set(pickResult.worldPos);
|
|
88185
88200
|
this._currentDistanceMeasurement.target.worldPos = pickResult.worldPos;
|
|
88201
|
+
this._currentDistanceMeasurement.target.entity = pickResult.entity;
|
|
88186
88202
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88187
88203
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88188
88204
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -88273,10 +88289,12 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88273
88289
|
this._currentDistanceMeasurement = plugin.createMeasurement({
|
|
88274
88290
|
id: math.createUUID(),
|
|
88275
88291
|
origin: {
|
|
88276
|
-
worldPos: snapPickResult.worldPos
|
|
88292
|
+
worldPos: snapPickResult.worldPos,
|
|
88293
|
+
entity: snapPickResult.entity
|
|
88277
88294
|
},
|
|
88278
88295
|
target: {
|
|
88279
|
-
worldPos: snapPickResult.worldPos
|
|
88296
|
+
worldPos: snapPickResult.worldPos,
|
|
88297
|
+
entity: snapPickResult.entity
|
|
88280
88298
|
}
|
|
88281
88299
|
});
|
|
88282
88300
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
@@ -88307,10 +88325,12 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88307
88325
|
this._currentDistanceMeasurement = plugin.createMeasurement({
|
|
88308
88326
|
id: math.createUUID(),
|
|
88309
88327
|
origin: {
|
|
88310
|
-
worldPos: pickResult.worldPos
|
|
88328
|
+
worldPos: pickResult.worldPos,
|
|
88329
|
+
entity: pickResult.entity
|
|
88311
88330
|
},
|
|
88312
88331
|
target: {
|
|
88313
|
-
worldPos: pickResult.worldPos
|
|
88332
|
+
worldPos: pickResult.worldPos,
|
|
88333
|
+
entity: pickResult.entity
|
|
88314
88334
|
}
|
|
88315
88335
|
});
|
|
88316
88336
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
@@ -88367,6 +88387,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88367
88387
|
this.pointerLens.snapped = true;
|
|
88368
88388
|
}
|
|
88369
88389
|
this._currentDistanceMeasurement.target.worldPos = snapPickResult.worldPos;
|
|
88390
|
+
this._currentDistanceMeasurement.target.entity = snapPickResult.entity;
|
|
88370
88391
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88371
88392
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88372
88393
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -88381,6 +88402,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88381
88402
|
this.pointerLens.snapped = false;
|
|
88382
88403
|
}
|
|
88383
88404
|
this._currentDistanceMeasurement.target.worldPos = pickResult.worldPos;
|
|
88405
|
+
this._currentDistanceMeasurement.target.entity = pickResult.entity;
|
|
88384
88406
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88385
88407
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88386
88408
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -88436,10 +88458,12 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88436
88458
|
this._currentDistanceMeasurement = plugin.createMeasurement({
|
|
88437
88459
|
id: math.createUUID(),
|
|
88438
88460
|
origin: {
|
|
88439
|
-
worldPos: pickResult.worldPos
|
|
88461
|
+
worldPos: pickResult.worldPos,
|
|
88462
|
+
entity: pickResult.entity
|
|
88440
88463
|
},
|
|
88441
88464
|
target: {
|
|
88442
|
-
worldPos: pickResult.worldPos
|
|
88465
|
+
worldPos: pickResult.worldPos,
|
|
88466
|
+
entity: pickResult.entity
|
|
88443
88467
|
}
|
|
88444
88468
|
});
|
|
88445
88469
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
@@ -88451,6 +88475,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88451
88475
|
this._currentDistanceMeasurement.targetVisible = false;
|
|
88452
88476
|
this._currentDistanceMeasurement.clickable = false;
|
|
88453
88477
|
this._touchState = WAITING_FOR_TARGET_TOUCH_START;
|
|
88478
|
+
this.distanceMeasurementsPlugin.fire("measurementStart", this._currentDistanceMeasurement);
|
|
88454
88479
|
// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_QUICK_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
|
|
88455
88480
|
} else {
|
|
88456
88481
|
if (this._currentDistanceMeasurement) {
|
|
@@ -88496,6 +88521,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88496
88521
|
});
|
|
88497
88522
|
if (pickResult && pickResult.worldPos) {
|
|
88498
88523
|
this._currentDistanceMeasurement.target.worldPos = pickResult.worldPos;
|
|
88524
|
+
this._currentDistanceMeasurement.target.entity = pickResult.entity;
|
|
88499
88525
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88500
88526
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88501
88527
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -94873,6 +94899,7 @@ class PickController {
|
|
|
94873
94899
|
if (this.snappedOrPicked) {
|
|
94874
94900
|
if (this.snapPickResult) {
|
|
94875
94901
|
const pickResult = new PickResult();
|
|
94902
|
+
pickResult.entity = this.snapPickResult.entity;
|
|
94876
94903
|
pickResult.snappedToVertex = this.snapPickResult.snappedToVertex;
|
|
94877
94904
|
pickResult.snappedToEdge = this.snapPickResult.snappedToEdge;
|
|
94878
94905
|
pickResult.worldPos = this.snapPickResult.worldPos;
|
|
@@ -95081,7 +95108,7 @@ class MousePanRotateDollyHandler {
|
|
|
95081
95108
|
}
|
|
95082
95109
|
});
|
|
95083
95110
|
|
|
95084
|
-
document.addEventListener("mousemove", this._documentMouseMoveHandler = () => {
|
|
95111
|
+
document.addEventListener("mousemove", this._documentMouseMoveHandler = (e) => {
|
|
95085
95112
|
|
|
95086
95113
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
95087
95114
|
return;
|
|
@@ -95102,10 +95129,10 @@ class MousePanRotateDollyHandler {
|
|
|
95102
95129
|
|
|
95103
95130
|
const panning = keyDown[scene.input.KEY_SHIFT] || configs.planView || (!configs.panRightClick && mouseDownMiddle) || (configs.panRightClick && mouseDownRight);
|
|
95104
95131
|
|
|
95105
|
-
|
|
95132
|
+
const xDelta = document.pointerLockElement ? e.movementX : (x - lastX);
|
|
95133
|
+
const yDelta = document.pointerLockElement ? e.movementY : (y - lastY);
|
|
95106
95134
|
|
|
95107
|
-
|
|
95108
|
-
const yPanDelta = (y - lastY);
|
|
95135
|
+
if (panning) {
|
|
95109
95136
|
|
|
95110
95137
|
const camera = scene.camera;
|
|
95111
95138
|
|
|
@@ -95116,13 +95143,13 @@ class MousePanRotateDollyHandler {
|
|
|
95116
95143
|
const depth = Math.abs(mouseDownPicked ? math.lenVec3(math.subVec3(pickedWorldPos, scene.camera.eye, [])) : scene.camera.eyeLookDist);
|
|
95117
95144
|
const targetDistance = depth * Math.tan((camera.perspective.fov / 2) * Math.PI / 180.0);
|
|
95118
95145
|
|
|
95119
|
-
updates.panDeltaX += (1.5 *
|
|
95120
|
-
updates.panDeltaY += (1.5 *
|
|
95146
|
+
updates.panDeltaX += (1.5 * xDelta * targetDistance / canvasHeight);
|
|
95147
|
+
updates.panDeltaY += (1.5 * yDelta * targetDistance / canvasHeight);
|
|
95121
95148
|
|
|
95122
95149
|
} else {
|
|
95123
95150
|
|
|
95124
|
-
updates.panDeltaX += 0.5 * camera.ortho.scale * (
|
|
95125
|
-
updates.panDeltaY += 0.5 * camera.ortho.scale * (
|
|
95151
|
+
updates.panDeltaX += 0.5 * camera.ortho.scale * (xDelta / canvasHeight);
|
|
95152
|
+
updates.panDeltaY += 0.5 * camera.ortho.scale * (yDelta / canvasHeight);
|
|
95126
95153
|
}
|
|
95127
95154
|
|
|
95128
95155
|
} else if (mouseDownLeft && !mouseDownMiddle && !mouseDownRight) {
|
|
@@ -95130,12 +95157,12 @@ class MousePanRotateDollyHandler {
|
|
|
95130
95157
|
if (!configs.planView) { // No rotating in plan-view mode
|
|
95131
95158
|
|
|
95132
95159
|
if (configs.firstPerson) {
|
|
95133
|
-
updates.rotateDeltaY -= (
|
|
95134
|
-
updates.rotateDeltaX += (
|
|
95160
|
+
updates.rotateDeltaY -= (xDelta / canvasWidth) * configs.dragRotationRate / 2;
|
|
95161
|
+
updates.rotateDeltaX += (yDelta / canvasHeight) * (configs.dragRotationRate / 4);
|
|
95135
95162
|
|
|
95136
95163
|
} else {
|
|
95137
|
-
updates.rotateDeltaY -= (
|
|
95138
|
-
updates.rotateDeltaX += (
|
|
95164
|
+
updates.rotateDeltaY -= (xDelta / canvasWidth) * (configs.dragRotationRate * 1.5);
|
|
95165
|
+
updates.rotateDeltaX += (yDelta / canvasHeight) * (configs.dragRotationRate * 1.5);
|
|
95139
95166
|
}
|
|
95140
95167
|
}
|
|
95141
95168
|
}
|
|
@@ -115503,6 +115530,7 @@ function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok) {
|
|
|
115503
115530
|
loadBuffer: options.loadBuffer,
|
|
115504
115531
|
basePath: options.basePath,
|
|
115505
115532
|
handlenode: options.handlenode,
|
|
115533
|
+
backfaces: !!options.backfaces,
|
|
115506
115534
|
gltfData: gltfData,
|
|
115507
115535
|
scene: sceneModel.scene,
|
|
115508
115536
|
plugin: plugin,
|
|
@@ -115708,7 +115736,8 @@ function loadMaterialAttributes(ctx, material) { // Substitute RGBA for material
|
|
|
115708
115736
|
color: new Float32Array([1, 1, 1, 1]),
|
|
115709
115737
|
opacity: 1,
|
|
115710
115738
|
metallic: 0,
|
|
115711
|
-
roughness: 1
|
|
115739
|
+
roughness: 1,
|
|
115740
|
+
doubleSided : true
|
|
115712
115741
|
};
|
|
115713
115742
|
if (extensions) {
|
|
115714
115743
|
const specularPBR = extensions["KHR_materials_pbrSpecularGlossiness"];
|
|
@@ -115759,6 +115788,7 @@ function loadMaterialAttributes(ctx, material) { // Substitute RGBA for material
|
|
|
115759
115788
|
materialAttributes.roughness = roughnessFactor;
|
|
115760
115789
|
}
|
|
115761
115790
|
}
|
|
115791
|
+
materialAttributes.doubleSided = (material.doubleSided !== false);
|
|
115762
115792
|
return materialAttributes;
|
|
115763
115793
|
}
|
|
115764
115794
|
|
|
@@ -115869,6 +115899,20 @@ function loadNode(ctx, node, depth, matrix) {
|
|
|
115869
115899
|
id: sceneModel.id + "." + ctx.numObjects++
|
|
115870
115900
|
};
|
|
115871
115901
|
|
|
115902
|
+
const material = primitive.material;
|
|
115903
|
+
if (material) {
|
|
115904
|
+
meshCfg.textureSetId = material._textureSetId;
|
|
115905
|
+
meshCfg.color = material._attributes.color;
|
|
115906
|
+
meshCfg.opacity = material._attributes.opacity;
|
|
115907
|
+
meshCfg.metallic = material._attributes.metallic;
|
|
115908
|
+
meshCfg.roughness = material._attributes.roughness;
|
|
115909
|
+
} else {
|
|
115910
|
+
meshCfg.color = new Float32Array([1.0, 1.0, 1.0]);
|
|
115911
|
+
meshCfg.opacity = 1.0;
|
|
115912
|
+
}
|
|
115913
|
+
|
|
115914
|
+
const backfaces = ((ctx.backfaces !== false) || (material.doubleSided !== false));
|
|
115915
|
+
|
|
115872
115916
|
switch (primitive.mode) {
|
|
115873
115917
|
case 0: // POINTS
|
|
115874
115918
|
meshCfg.primitive = "points";
|
|
@@ -115883,16 +115927,16 @@ function loadNode(ctx, node, depth, matrix) {
|
|
|
115883
115927
|
meshCfg.primitive = "lines";
|
|
115884
115928
|
break;
|
|
115885
115929
|
case 4: // TRIANGLES
|
|
115886
|
-
meshCfg.primitive = "triangles";
|
|
115930
|
+
meshCfg.primitive = backfaces ? "triangles" : "solid";
|
|
115887
115931
|
break;
|
|
115888
115932
|
case 5: // TRIANGLE_STRIP
|
|
115889
|
-
meshCfg.primitive = "triangles";
|
|
115933
|
+
meshCfg.primitive = backfaces ? "triangles" : "solid";
|
|
115890
115934
|
break;
|
|
115891
115935
|
case 6: // TRIANGLE_FAN
|
|
115892
|
-
meshCfg.primitive = "triangles";
|
|
115936
|
+
meshCfg.primitive = backfaces ? "triangles" : "solid";
|
|
115893
115937
|
break;
|
|
115894
115938
|
default:
|
|
115895
|
-
meshCfg.primitive = "triangles";
|
|
115939
|
+
meshCfg.primitive = backfaces ? "triangles" : "solid";
|
|
115896
115940
|
}
|
|
115897
115941
|
|
|
115898
115942
|
const POSITION = primitive.attributes.POSITION;
|
|
@@ -115921,17 +115965,6 @@ function loadNode(ctx, node, depth, matrix) {
|
|
|
115921
115965
|
meshCfg.origin = origin;
|
|
115922
115966
|
}
|
|
115923
115967
|
|
|
115924
|
-
const material = primitive.material;
|
|
115925
|
-
if (material) {
|
|
115926
|
-
meshCfg.textureSetId = material._textureSetId;
|
|
115927
|
-
meshCfg.color = material._attributes.color;
|
|
115928
|
-
meshCfg.opacity = material._attributes.opacity;
|
|
115929
|
-
meshCfg.metallic = material._attributes.metallic;
|
|
115930
|
-
meshCfg.roughness = material._attributes.roughness;
|
|
115931
|
-
} else {
|
|
115932
|
-
meshCfg.color = new Float32Array([1.0, 1.0, 1.0]);
|
|
115933
|
-
meshCfg.opacity = 1.0;
|
|
115934
|
-
}
|
|
115935
115968
|
// if (createEntity) {
|
|
115936
115969
|
// if (createEntity.colorize) {
|
|
115937
115970
|
// meshCfg.color = createEntity.colorize;
|
|
@@ -116274,7 +116307,7 @@ class GLTFLoaderPlugin extends Plugin {
|
|
|
116274
116307
|
* @param {Boolean} [params.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) is enabled for the model. SAO is configured by the Scene's {@link SAO} component. Only works when {@link SAO#enabled} is also ````true````
|
|
116275
116308
|
* @param {Boolean} [params.pbrEnabled=true] Indicates if physically-based rendering (PBR) is enabled for the model. Overrides ````colorTextureEnabled````. Only works when {@link Scene#pbrEnabled} is also ````true````.
|
|
116276
116309
|
* @param {Boolean} [params.colorTextureEnabled=true] Indicates if base color texture rendering is enabled for the model. Overridden by ````pbrEnabled````. Only works when {@link Scene#colorTextureEnabled} is also ````true````.
|
|
116277
|
-
* @param {Boolean} [params.backfaces=
|
|
116310
|
+
* @param {Boolean} [params.backfaces=true] When true, always show backfaces, even on objects for which the glTF material is single-sided. When false, only show backfaces on geometries whenever the glTF material is double-sided.
|
|
116278
116311
|
* @param {Number} [params.edgeThreshold=10] When xraying, highlighting, selecting or edging, this is the threshold angle between normals of adjacent triangles, below which their shared wireframe edge is not drawn.
|
|
116279
116312
|
* @param {Boolean} [params.dtxEnabled=true] When ````true```` (default) use data textures (DTX), where appropriate, to
|
|
116280
116313
|
* represent the returned model. Set false to always use vertex buffer objects (VBOs). Note that DTX is only applicable
|
|
@@ -118536,7 +118569,8 @@ class Control {
|
|
|
118536
118569
|
|
|
118537
118570
|
this._rootNode = new Node$2(scene, {
|
|
118538
118571
|
position: [0, 0, 0],
|
|
118539
|
-
scale: [5, 5, 5]
|
|
118572
|
+
scale: [5, 5, 5],
|
|
118573
|
+
isObject: false
|
|
118540
118574
|
});
|
|
118541
118575
|
|
|
118542
118576
|
const rootNode = this._rootNode;
|
|
@@ -118727,7 +118761,8 @@ class Control {
|
|
|
118727
118761
|
collidable: true,
|
|
118728
118762
|
clippable: false,
|
|
118729
118763
|
visible: false,
|
|
118730
|
-
scale: [2.4, 2.4, 1]
|
|
118764
|
+
scale: [2.4, 2.4, 1],
|
|
118765
|
+
isObject: false
|
|
118731
118766
|
}), NO_STATE_INHERIT),
|
|
118732
118767
|
|
|
118733
118768
|
planeFrame: rootNode.addChild(new Mesh(rootNode, { // Visible frame
|
|
@@ -118758,7 +118793,8 @@ class Control {
|
|
|
118758
118793
|
clippable: false,
|
|
118759
118794
|
visible: false,
|
|
118760
118795
|
scale: [1, 1, .1],
|
|
118761
|
-
rotation: [0, 0, 45]
|
|
118796
|
+
rotation: [0, 0, 45],
|
|
118797
|
+
isObject: false
|
|
118762
118798
|
}), NO_STATE_INHERIT),
|
|
118763
118799
|
|
|
118764
118800
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118777,7 +118813,8 @@ class Control {
|
|
|
118777
118813
|
collidable: true,
|
|
118778
118814
|
clippable: false,
|
|
118779
118815
|
backfaces: true,
|
|
118780
|
-
visible: false
|
|
118816
|
+
visible: false,
|
|
118817
|
+
isObject: false
|
|
118781
118818
|
}), NO_STATE_INHERIT),
|
|
118782
118819
|
|
|
118783
118820
|
xCurveHandle: rootNode.addChild(new Mesh(rootNode, { // Red hoop about Y-axis
|
|
@@ -118792,7 +118829,8 @@ class Control {
|
|
|
118792
118829
|
collidable: true,
|
|
118793
118830
|
clippable: false,
|
|
118794
118831
|
backfaces: true,
|
|
118795
|
-
visible: false
|
|
118832
|
+
visible: false,
|
|
118833
|
+
isObject: false
|
|
118796
118834
|
}), NO_STATE_INHERIT),
|
|
118797
118835
|
|
|
118798
118836
|
xCurveArrow1: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118807,7 +118845,8 @@ class Control {
|
|
|
118807
118845
|
pickable: true,
|
|
118808
118846
|
collidable: true,
|
|
118809
118847
|
clippable: false,
|
|
118810
|
-
visible: false
|
|
118848
|
+
visible: false,
|
|
118849
|
+
isObject: false
|
|
118811
118850
|
}), NO_STATE_INHERIT),
|
|
118812
118851
|
|
|
118813
118852
|
xCurveArrow2: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118822,7 +118861,8 @@ class Control {
|
|
|
118822
118861
|
pickable: true,
|
|
118823
118862
|
collidable: true,
|
|
118824
118863
|
clippable: false,
|
|
118825
|
-
visible: false
|
|
118864
|
+
visible: false,
|
|
118865
|
+
isObject: false
|
|
118826
118866
|
}), NO_STATE_INHERIT),
|
|
118827
118867
|
|
|
118828
118868
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118837,7 +118877,8 @@ class Control {
|
|
|
118837
118877
|
collidable: true,
|
|
118838
118878
|
clippable: false,
|
|
118839
118879
|
backfaces: true,
|
|
118840
|
-
visible: false
|
|
118880
|
+
visible: false,
|
|
118881
|
+
isObject: false
|
|
118841
118882
|
}), NO_STATE_INHERIT),
|
|
118842
118883
|
|
|
118843
118884
|
yCurveHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118848,7 +118889,8 @@ class Control {
|
|
|
118848
118889
|
collidable: true,
|
|
118849
118890
|
clippable: false,
|
|
118850
118891
|
backfaces: true,
|
|
118851
|
-
visible: false
|
|
118892
|
+
visible: false,
|
|
118893
|
+
isObject: false
|
|
118852
118894
|
}), NO_STATE_INHERIT),
|
|
118853
118895
|
|
|
118854
118896
|
yCurveArrow1: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118863,7 +118905,8 @@ class Control {
|
|
|
118863
118905
|
pickable: true,
|
|
118864
118906
|
collidable: true,
|
|
118865
118907
|
clippable: false,
|
|
118866
|
-
visible: false
|
|
118908
|
+
visible: false,
|
|
118909
|
+
isObject: false
|
|
118867
118910
|
}), NO_STATE_INHERIT),
|
|
118868
118911
|
|
|
118869
118912
|
yCurveArrow2: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118878,7 +118921,8 @@ class Control {
|
|
|
118878
118921
|
pickable: true,
|
|
118879
118922
|
collidable: true,
|
|
118880
118923
|
clippable: false,
|
|
118881
|
-
visible: false
|
|
118924
|
+
visible: false,
|
|
118925
|
+
isObject: false
|
|
118882
118926
|
}), NO_STATE_INHERIT),
|
|
118883
118927
|
|
|
118884
118928
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118892,7 +118936,8 @@ class Control {
|
|
|
118892
118936
|
pickable: false,
|
|
118893
118937
|
collidable: true,
|
|
118894
118938
|
clippable: false,
|
|
118895
|
-
visible: false
|
|
118939
|
+
visible: false,
|
|
118940
|
+
isObject: false
|
|
118896
118941
|
}), NO_STATE_INHERIT),
|
|
118897
118942
|
|
|
118898
118943
|
zCurveHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118902,7 +118947,8 @@ class Control {
|
|
|
118902
118947
|
pickable: true,
|
|
118903
118948
|
collidable: true,
|
|
118904
118949
|
clippable: false,
|
|
118905
|
-
visible: false
|
|
118950
|
+
visible: false,
|
|
118951
|
+
isObject: false
|
|
118906
118952
|
}), NO_STATE_INHERIT),
|
|
118907
118953
|
|
|
118908
118954
|
zCurveCurveArrow1: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118916,7 +118962,8 @@ class Control {
|
|
|
118916
118962
|
pickable: true,
|
|
118917
118963
|
collidable: true,
|
|
118918
118964
|
clippable: false,
|
|
118919
|
-
visible: false
|
|
118965
|
+
visible: false,
|
|
118966
|
+
isObject: false
|
|
118920
118967
|
}), NO_STATE_INHERIT),
|
|
118921
118968
|
|
|
118922
118969
|
zCurveArrow2: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118931,7 +118978,8 @@ class Control {
|
|
|
118931
118978
|
pickable: true,
|
|
118932
118979
|
collidable: true,
|
|
118933
118980
|
clippable: false,
|
|
118934
|
-
visible: false
|
|
118981
|
+
visible: false,
|
|
118982
|
+
isObject: false
|
|
118935
118983
|
}), NO_STATE_INHERIT),
|
|
118936
118984
|
|
|
118937
118985
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118946,7 +118994,8 @@ class Control {
|
|
|
118946
118994
|
pickable: false,
|
|
118947
118995
|
collidable: true,
|
|
118948
118996
|
clippable: false,
|
|
118949
|
-
visible: false
|
|
118997
|
+
visible: false,
|
|
118998
|
+
isObject: false
|
|
118950
118999
|
}), NO_STATE_INHERIT),
|
|
118951
119000
|
|
|
118952
119001
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -118964,7 +119013,8 @@ class Control {
|
|
|
118964
119013
|
pickable: false,
|
|
118965
119014
|
collidable: true,
|
|
118966
119015
|
clippable: false,
|
|
118967
|
-
visible: false
|
|
119016
|
+
visible: false,
|
|
119017
|
+
isObject: false
|
|
118968
119018
|
}), NO_STATE_INHERIT),
|
|
118969
119019
|
|
|
118970
119020
|
xAxisArrowHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118978,7 +119028,8 @@ class Control {
|
|
|
118978
119028
|
pickable: true,
|
|
118979
119029
|
collidable: true,
|
|
118980
119030
|
clippable: false,
|
|
118981
|
-
visible: false
|
|
119031
|
+
visible: false,
|
|
119032
|
+
isObject: false
|
|
118982
119033
|
}), NO_STATE_INHERIT),
|
|
118983
119034
|
|
|
118984
119035
|
xAxis: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -118992,7 +119043,8 @@ class Control {
|
|
|
118992
119043
|
pickable: false,
|
|
118993
119044
|
collidable: true,
|
|
118994
119045
|
clippable: false,
|
|
118995
|
-
visible: false
|
|
119046
|
+
visible: false,
|
|
119047
|
+
isObject: false
|
|
118996
119048
|
}), NO_STATE_INHERIT),
|
|
118997
119049
|
|
|
118998
119050
|
xAxisHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119006,7 +119058,8 @@ class Control {
|
|
|
119006
119058
|
pickable: true,
|
|
119007
119059
|
collidable: true,
|
|
119008
119060
|
clippable: false,
|
|
119009
|
-
visible: false
|
|
119061
|
+
visible: false,
|
|
119062
|
+
isObject: false
|
|
119010
119063
|
}), NO_STATE_INHERIT),
|
|
119011
119064
|
|
|
119012
119065
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -119024,7 +119077,8 @@ class Control {
|
|
|
119024
119077
|
pickable: false,
|
|
119025
119078
|
collidable: true,
|
|
119026
119079
|
clippable: false,
|
|
119027
|
-
visible: false
|
|
119080
|
+
visible: false,
|
|
119081
|
+
isObject: false
|
|
119028
119082
|
}), NO_STATE_INHERIT),
|
|
119029
119083
|
|
|
119030
119084
|
yAxisArrowHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119039,7 +119093,8 @@ class Control {
|
|
|
119039
119093
|
collidable: true,
|
|
119040
119094
|
clippable: false,
|
|
119041
119095
|
visible: false,
|
|
119042
|
-
opacity: 0.2
|
|
119096
|
+
opacity: 0.2,
|
|
119097
|
+
isObject: false
|
|
119043
119098
|
}), NO_STATE_INHERIT),
|
|
119044
119099
|
|
|
119045
119100
|
yShaft: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119049,7 +119104,8 @@ class Control {
|
|
|
119049
119104
|
pickable: false,
|
|
119050
119105
|
collidable: true,
|
|
119051
119106
|
clippable: false,
|
|
119052
|
-
visible: false
|
|
119107
|
+
visible: false,
|
|
119108
|
+
isObject: false
|
|
119053
119109
|
}), NO_STATE_INHERIT),
|
|
119054
119110
|
|
|
119055
119111
|
yShaftHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119059,7 +119115,8 @@ class Control {
|
|
|
119059
119115
|
pickable: true,
|
|
119060
119116
|
collidable: true,
|
|
119061
119117
|
clippable: false,
|
|
119062
|
-
visible: false
|
|
119118
|
+
visible: false,
|
|
119119
|
+
isObject: false
|
|
119063
119120
|
}), NO_STATE_INHERIT),
|
|
119064
119121
|
|
|
119065
119122
|
//----------------------------------------------------------------------------------------------------------
|
|
@@ -119077,7 +119134,8 @@ class Control {
|
|
|
119077
119134
|
pickable: false,
|
|
119078
119135
|
collidable: true,
|
|
119079
119136
|
clippable: false,
|
|
119080
|
-
visible: false
|
|
119137
|
+
visible: false,
|
|
119138
|
+
isObject: false
|
|
119081
119139
|
}), NO_STATE_INHERIT),
|
|
119082
119140
|
|
|
119083
119141
|
zAxisArrowHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119091,7 +119149,8 @@ class Control {
|
|
|
119091
119149
|
pickable: true,
|
|
119092
119150
|
collidable: true,
|
|
119093
119151
|
clippable: false,
|
|
119094
|
-
visible: false
|
|
119152
|
+
visible: false,
|
|
119153
|
+
isObject: false
|
|
119095
119154
|
}), NO_STATE_INHERIT),
|
|
119096
119155
|
|
|
119097
119156
|
|
|
@@ -119106,7 +119165,8 @@ class Control {
|
|
|
119106
119165
|
clippable: false,
|
|
119107
119166
|
pickable: false,
|
|
119108
119167
|
collidable: true,
|
|
119109
|
-
visible: false
|
|
119168
|
+
visible: false,
|
|
119169
|
+
isObject: false
|
|
119110
119170
|
}), NO_STATE_INHERIT),
|
|
119111
119171
|
|
|
119112
119172
|
zAxisHandle: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119120,7 +119180,8 @@ class Control {
|
|
|
119120
119180
|
clippable: false,
|
|
119121
119181
|
pickable: true,
|
|
119122
119182
|
collidable: true,
|
|
119123
|
-
visible: false
|
|
119183
|
+
visible: false,
|
|
119184
|
+
isObject: false
|
|
119124
119185
|
}), NO_STATE_INHERIT)
|
|
119125
119186
|
};
|
|
119126
119187
|
|
|
@@ -119152,7 +119213,8 @@ class Control {
|
|
|
119152
119213
|
clippable: false,
|
|
119153
119214
|
visible: false,
|
|
119154
119215
|
scale: [1, 1, 1],
|
|
119155
|
-
rotation: [0, 0, 45]
|
|
119216
|
+
rotation: [0, 0, 45],
|
|
119217
|
+
isObject: false
|
|
119156
119218
|
}), NO_STATE_INHERIT),
|
|
119157
119219
|
|
|
119158
119220
|
xHoop: rootNode.addChild(new Mesh(rootNode, { // Full
|
|
@@ -119168,7 +119230,8 @@ class Control {
|
|
|
119168
119230
|
pickable: false,
|
|
119169
119231
|
collidable: true,
|
|
119170
119232
|
clippable: false,
|
|
119171
|
-
visible: false
|
|
119233
|
+
visible: false,
|
|
119234
|
+
isObject: false
|
|
119172
119235
|
}), NO_STATE_INHERIT),
|
|
119173
119236
|
|
|
119174
119237
|
yHoop: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119180,7 +119243,8 @@ class Control {
|
|
|
119180
119243
|
pickable: false,
|
|
119181
119244
|
collidable: true,
|
|
119182
119245
|
clippable: false,
|
|
119183
|
-
visible: false
|
|
119246
|
+
visible: false,
|
|
119247
|
+
isObject: false
|
|
119184
119248
|
}), NO_STATE_INHERIT),
|
|
119185
119249
|
|
|
119186
119250
|
zHoop: rootNode.addChild(new Mesh(rootNode, { // Blue hoop about Z-axis
|
|
@@ -119193,7 +119257,8 @@ class Control {
|
|
|
119193
119257
|
collidable: true,
|
|
119194
119258
|
clippable: false,
|
|
119195
119259
|
backfaces: true,
|
|
119196
|
-
visible: false
|
|
119260
|
+
visible: false,
|
|
119261
|
+
isObject: false
|
|
119197
119262
|
}), NO_STATE_INHERIT),
|
|
119198
119263
|
|
|
119199
119264
|
xAxisArrow: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119207,7 +119272,8 @@ class Control {
|
|
|
119207
119272
|
pickable: false,
|
|
119208
119273
|
collidable: true,
|
|
119209
119274
|
clippable: false,
|
|
119210
|
-
visible: false
|
|
119275
|
+
visible: false,
|
|
119276
|
+
isObject: false
|
|
119211
119277
|
}), NO_STATE_INHERIT),
|
|
119212
119278
|
|
|
119213
119279
|
yAxisArrow: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119221,7 +119287,8 @@ class Control {
|
|
|
119221
119287
|
pickable: false,
|
|
119222
119288
|
collidable: true,
|
|
119223
119289
|
clippable: false,
|
|
119224
|
-
visible: false
|
|
119290
|
+
visible: false,
|
|
119291
|
+
isObject: false
|
|
119225
119292
|
}), NO_STATE_INHERIT),
|
|
119226
119293
|
|
|
119227
119294
|
zAxisArrow: rootNode.addChild(new Mesh(rootNode, {
|
|
@@ -119235,7 +119302,8 @@ class Control {
|
|
|
119235
119302
|
pickable: false,
|
|
119236
119303
|
collidable: true,
|
|
119237
119304
|
clippable: false,
|
|
119238
|
-
visible: false
|
|
119305
|
+
visible: false,
|
|
119306
|
+
isObject: false
|
|
119239
119307
|
}), NO_STATE_INHERIT)
|
|
119240
119308
|
};
|
|
119241
119309
|
}
|