@xeokit/xeokit-sdk 2.6.0-beta-14 → 2.6.0-beta-16
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/xeokit-sdk.cjs.js +81 -47
- package/dist/xeokit-sdk.es.js +81 -48
- package/dist/xeokit-sdk.es5.js +24 -24
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +4 -4
- 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/viewer/scene/CameraControl/lib/controllers/PickController.js +1 -0
- package/src/viewer/scene/CameraControl/lib/handlers/MousePanRotateDollyHandler.js +12 -12
- package/src/viewer/scene/index.js +2 -1
- package/src/viewer/scene/model/SceneModel.js +1 -1
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -12399,13 +12399,16 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
|
|
|
12399
12399
|
this._currentAngleMeasurement = this.angleMeasurementsPlugin.createMeasurement({
|
|
12400
12400
|
id: math.createUUID(),
|
|
12401
12401
|
origin: {
|
|
12402
|
-
worldPos: mouseWorldPos
|
|
12402
|
+
worldPos: mouseWorldPos,
|
|
12403
|
+
entity: hoveredEntity
|
|
12403
12404
|
},
|
|
12404
12405
|
corner: {
|
|
12405
|
-
worldPos: mouseWorldPos
|
|
12406
|
+
worldPos: mouseWorldPos,
|
|
12407
|
+
entity: hoveredEntity
|
|
12406
12408
|
},
|
|
12407
12409
|
target: {
|
|
12408
|
-
worldPos: mouseWorldPos
|
|
12410
|
+
worldPos: mouseWorldPos,
|
|
12411
|
+
entity: hoveredEntity
|
|
12409
12412
|
},
|
|
12410
12413
|
approximate: true
|
|
12411
12414
|
});
|
|
@@ -13241,13 +13244,16 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13241
13244
|
this._currentAngleMeasurement = plugin.createMeasurement({
|
|
13242
13245
|
id: math.createUUID(),
|
|
13243
13246
|
origin: {
|
|
13244
|
-
worldPos: snapPickResult.worldPos
|
|
13247
|
+
worldPos: snapPickResult.worldPos,
|
|
13248
|
+
entity: snapPickResult.entity
|
|
13245
13249
|
},
|
|
13246
13250
|
corner: {
|
|
13247
|
-
worldPos: snapPickResult.worldPos
|
|
13251
|
+
worldPos: snapPickResult.worldPos,
|
|
13252
|
+
entity: snapPickResult.entity
|
|
13248
13253
|
},
|
|
13249
13254
|
target: {
|
|
13250
|
-
worldPos: snapPickResult.worldPos
|
|
13255
|
+
worldPos: snapPickResult.worldPos,
|
|
13256
|
+
entity: snapPickResult.entity
|
|
13251
13257
|
}
|
|
13252
13258
|
});
|
|
13253
13259
|
this._currentAngleMeasurement.clickable = false;
|
|
@@ -13316,6 +13322,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13316
13322
|
this.pointerCircle.start(snapPickResult.snappedCanvasPos);
|
|
13317
13323
|
pointerWorldPos.set(snapPickResult.worldPos);
|
|
13318
13324
|
this._currentAngleMeasurement.corner.worldPos = snapPickResult.worldPos;
|
|
13325
|
+
this._currentAngleMeasurement.corner.entity = snapPickResult.entity;
|
|
13319
13326
|
this._currentAngleMeasurement.originVisible = true;
|
|
13320
13327
|
this._currentAngleMeasurement.originWireVisible = true;
|
|
13321
13328
|
this._currentAngleMeasurement.cornerVisible = true;
|
|
@@ -13337,6 +13344,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13337
13344
|
this.pointerCircle.start(pickResult.canvasPos);
|
|
13338
13345
|
pointerWorldPos.set(pickResult.worldPos);
|
|
13339
13346
|
this._currentAngleMeasurement.corner.worldPos = pickResult.worldPos;
|
|
13347
|
+
this._currentAngleMeasurement.corner.entity = pickResult.entity;
|
|
13340
13348
|
this._currentAngleMeasurement.originVisible = true;
|
|
13341
13349
|
this._currentAngleMeasurement.originWireVisible = true;
|
|
13342
13350
|
this._currentAngleMeasurement.cornerVisible = true;
|
|
@@ -13407,6 +13415,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13407
13415
|
this.pointerCircle.start(snapPickResult.snappedCanvasPos);
|
|
13408
13416
|
pointerWorldPos.set(snapPickResult.worldPos);
|
|
13409
13417
|
this._currentAngleMeasurement.target.worldPos = snapPickResult.worldPos;
|
|
13418
|
+
this._currentAngleMeasurement.target.entity = snapPickResult.entity;
|
|
13410
13419
|
this._currentAngleMeasurement.originVisible = true;
|
|
13411
13420
|
this._currentAngleMeasurement.originWireVisible = true;
|
|
13412
13421
|
this._currentAngleMeasurement.cornerVisible = true;
|
|
@@ -13428,6 +13437,7 @@ class AngleMeasurementsTouchControl extends AngleMeasurementsControl {
|
|
|
13428
13437
|
this.pointerCircle.start(pickResult.canvasPos);
|
|
13429
13438
|
pointerWorldPos.set(pickResult.worldPos);
|
|
13430
13439
|
this._currentAngleMeasurement.target.worldPos = pickResult.worldPos;
|
|
13440
|
+
this._currentAngleMeasurement.target.entity = pickResult.entity;
|
|
13431
13441
|
this._currentAngleMeasurement.originVisible = true;
|
|
13432
13442
|
this._currentAngleMeasurement.originWireVisible = true;
|
|
13433
13443
|
this._currentAngleMeasurement.cornerVisible = true;
|
|
@@ -83345,7 +83355,7 @@ class SceneModel extends Component {
|
|
|
83345
83355
|
return;
|
|
83346
83356
|
}
|
|
83347
83357
|
let parentTransform;
|
|
83348
|
-
if (
|
|
83358
|
+
if (cfg.parentTransformId) {
|
|
83349
83359
|
parentTransform = this._transforms[cfg.parentTransformId];
|
|
83350
83360
|
if (!parentTransform) {
|
|
83351
83361
|
this.error("[createTransform] SceneModel.createTransform() config missing: id");
|
|
@@ -87188,10 +87198,12 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
87188
87198
|
this._currentDistanceMeasurement = distanceMeasurementsPlugin.createMeasurement({
|
|
87189
87199
|
id: math.createUUID(),
|
|
87190
87200
|
origin: {
|
|
87191
|
-
worldPos: pointerWorldPos.slice()
|
|
87201
|
+
worldPos: pointerWorldPos.slice(),
|
|
87202
|
+
entity: hoveredEntity
|
|
87192
87203
|
},
|
|
87193
87204
|
target: {
|
|
87194
|
-
worldPos: pointerWorldPos.slice()
|
|
87205
|
+
worldPos: pointerWorldPos.slice(),
|
|
87206
|
+
entity: hoveredEntity
|
|
87195
87207
|
},
|
|
87196
87208
|
approximate: true
|
|
87197
87209
|
});
|
|
@@ -87204,7 +87216,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
|
|
|
87204
87216
|
this._currentDistanceMeasurement.clickable = false;
|
|
87205
87217
|
this._currentDistanceMeasurement.origin.entity = hoveredEntity;
|
|
87206
87218
|
hoveredEntity = null;
|
|
87207
|
-
this.fire("measurementStart", this._currentDistanceMeasurement);
|
|
87219
|
+
this.distanceMeasurementsPlugin.fire("measurementStart", this._currentDistanceMeasurement);
|
|
87208
87220
|
}
|
|
87209
87221
|
}
|
|
87210
87222
|
});
|
|
@@ -88089,10 +88101,12 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88089
88101
|
this._currentDistanceMeasurement = plugin.createMeasurement({
|
|
88090
88102
|
id: math.createUUID(),
|
|
88091
88103
|
origin: {
|
|
88092
|
-
worldPos: pointerWorldPos
|
|
88104
|
+
worldPos: pointerWorldPos,
|
|
88105
|
+
entity: snapPickResult.entity
|
|
88093
88106
|
},
|
|
88094
88107
|
target: {
|
|
88095
|
-
worldPos: pointerWorldPos
|
|
88108
|
+
worldPos: pointerWorldPos,
|
|
88109
|
+
entity: snapPickResult.entity
|
|
88096
88110
|
}
|
|
88097
88111
|
});
|
|
88098
88112
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
@@ -88162,6 +88176,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88162
88176
|
this.pointerCircle.start(snapPickResult.snappedCanvasPos);
|
|
88163
88177
|
pointerWorldPos.set(snapPickResult.worldPos);
|
|
88164
88178
|
this._currentDistanceMeasurement.target.worldPos = snapPickResult.worldPos;
|
|
88179
|
+
this._currentDistanceMeasurement.target.entity = snapPickResult.entity;
|
|
88165
88180
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88166
88181
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88167
88182
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -88179,6 +88194,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88179
88194
|
this.pointerCircle.start(pickResult.canvasPos);
|
|
88180
88195
|
pointerWorldPos.set(pickResult.worldPos);
|
|
88181
88196
|
this._currentDistanceMeasurement.target.worldPos = pickResult.worldPos;
|
|
88197
|
+
this._currentDistanceMeasurement.target.entity = pickResult.entity;
|
|
88182
88198
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88183
88199
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88184
88200
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -88269,10 +88285,12 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88269
88285
|
this._currentDistanceMeasurement = plugin.createMeasurement({
|
|
88270
88286
|
id: math.createUUID(),
|
|
88271
88287
|
origin: {
|
|
88272
|
-
worldPos: snapPickResult.worldPos
|
|
88288
|
+
worldPos: snapPickResult.worldPos,
|
|
88289
|
+
entity: snapPickResult.entity
|
|
88273
88290
|
},
|
|
88274
88291
|
target: {
|
|
88275
|
-
worldPos: snapPickResult.worldPos
|
|
88292
|
+
worldPos: snapPickResult.worldPos,
|
|
88293
|
+
entity: snapPickResult.entity
|
|
88276
88294
|
}
|
|
88277
88295
|
});
|
|
88278
88296
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
@@ -88303,10 +88321,12 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88303
88321
|
this._currentDistanceMeasurement = plugin.createMeasurement({
|
|
88304
88322
|
id: math.createUUID(),
|
|
88305
88323
|
origin: {
|
|
88306
|
-
worldPos: pickResult.worldPos
|
|
88324
|
+
worldPos: pickResult.worldPos,
|
|
88325
|
+
entity: pickResult.entity
|
|
88307
88326
|
},
|
|
88308
88327
|
target: {
|
|
88309
|
-
worldPos: pickResult.worldPos
|
|
88328
|
+
worldPos: pickResult.worldPos,
|
|
88329
|
+
entity: pickResult.entity
|
|
88310
88330
|
}
|
|
88311
88331
|
});
|
|
88312
88332
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
@@ -88363,6 +88383,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88363
88383
|
this.pointerLens.snapped = true;
|
|
88364
88384
|
}
|
|
88365
88385
|
this._currentDistanceMeasurement.target.worldPos = snapPickResult.worldPos;
|
|
88386
|
+
this._currentDistanceMeasurement.target.entity = snapPickResult.entity;
|
|
88366
88387
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88367
88388
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88368
88389
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -88377,6 +88398,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88377
88398
|
this.pointerLens.snapped = false;
|
|
88378
88399
|
}
|
|
88379
88400
|
this._currentDistanceMeasurement.target.worldPos = pickResult.worldPos;
|
|
88401
|
+
this._currentDistanceMeasurement.target.entity = pickResult.entity;
|
|
88380
88402
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88381
88403
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88382
88404
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -88432,10 +88454,12 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88432
88454
|
this._currentDistanceMeasurement = plugin.createMeasurement({
|
|
88433
88455
|
id: math.createUUID(),
|
|
88434
88456
|
origin: {
|
|
88435
|
-
worldPos: pickResult.worldPos
|
|
88457
|
+
worldPos: pickResult.worldPos,
|
|
88458
|
+
entity: pickResult.entity
|
|
88436
88459
|
},
|
|
88437
88460
|
target: {
|
|
88438
|
-
worldPos: pickResult.worldPos
|
|
88461
|
+
worldPos: pickResult.worldPos,
|
|
88462
|
+
entity: pickResult.entity
|
|
88439
88463
|
}
|
|
88440
88464
|
});
|
|
88441
88465
|
this._currentDistanceMeasurement.labelsVisible = false;
|
|
@@ -88447,6 +88471,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88447
88471
|
this._currentDistanceMeasurement.targetVisible = false;
|
|
88448
88472
|
this._currentDistanceMeasurement.clickable = false;
|
|
88449
88473
|
this._touchState = WAITING_FOR_TARGET_TOUCH_START;
|
|
88474
|
+
this.distanceMeasurementsPlugin.fire("measurementStart", this._currentDistanceMeasurement);
|
|
88450
88475
|
// console.log("touchend: this._touchState= WAITING_FOR_ORIGIN_QUICK_TOUCH_END -> WAITING_FOR_ORIGIN_TOUCH_START")
|
|
88451
88476
|
} else {
|
|
88452
88477
|
if (this._currentDistanceMeasurement) {
|
|
@@ -88492,6 +88517,7 @@ class DistanceMeasurementsTouchControl extends DistanceMeasurementsControl {
|
|
|
88492
88517
|
});
|
|
88493
88518
|
if (pickResult && pickResult.worldPos) {
|
|
88494
88519
|
this._currentDistanceMeasurement.target.worldPos = pickResult.worldPos;
|
|
88520
|
+
this._currentDistanceMeasurement.target.entity = pickResult.entity;
|
|
88495
88521
|
this._currentDistanceMeasurement.targetVisible = true;
|
|
88496
88522
|
this._currentDistanceMeasurement.wireVisible = true;
|
|
88497
88523
|
this._currentDistanceMeasurement.labelsVisible = true;
|
|
@@ -94869,6 +94895,7 @@ class PickController {
|
|
|
94869
94895
|
if (this.snappedOrPicked) {
|
|
94870
94896
|
if (this.snapPickResult) {
|
|
94871
94897
|
const pickResult = new PickResult();
|
|
94898
|
+
pickResult.entity = this.snapPickResult.entity;
|
|
94872
94899
|
pickResult.snappedToVertex = this.snapPickResult.snappedToVertex;
|
|
94873
94900
|
pickResult.snappedToEdge = this.snapPickResult.snappedToEdge;
|
|
94874
94901
|
pickResult.worldPos = this.snapPickResult.worldPos;
|
|
@@ -95077,7 +95104,7 @@ class MousePanRotateDollyHandler {
|
|
|
95077
95104
|
}
|
|
95078
95105
|
});
|
|
95079
95106
|
|
|
95080
|
-
document.addEventListener("mousemove", this._documentMouseMoveHandler = () => {
|
|
95107
|
+
document.addEventListener("mousemove", this._documentMouseMoveHandler = (e) => {
|
|
95081
95108
|
|
|
95082
95109
|
if (!(configs.active && configs.pointerEnabled)) {
|
|
95083
95110
|
return;
|
|
@@ -95098,10 +95125,10 @@ class MousePanRotateDollyHandler {
|
|
|
95098
95125
|
|
|
95099
95126
|
const panning = keyDown[scene.input.KEY_SHIFT] || configs.planView || (!configs.panRightClick && mouseDownMiddle) || (configs.panRightClick && mouseDownRight);
|
|
95100
95127
|
|
|
95101
|
-
|
|
95128
|
+
const xDelta = document.pointerLockElement ? e.movementX : (x - lastX);
|
|
95129
|
+
const yDelta = document.pointerLockElement ? e.movementY : (y - lastY);
|
|
95102
95130
|
|
|
95103
|
-
|
|
95104
|
-
const yPanDelta = (y - lastY);
|
|
95131
|
+
if (panning) {
|
|
95105
95132
|
|
|
95106
95133
|
const camera = scene.camera;
|
|
95107
95134
|
|
|
@@ -95112,13 +95139,13 @@ class MousePanRotateDollyHandler {
|
|
|
95112
95139
|
const depth = Math.abs(mouseDownPicked ? math.lenVec3(math.subVec3(pickedWorldPos, scene.camera.eye, [])) : scene.camera.eyeLookDist);
|
|
95113
95140
|
const targetDistance = depth * Math.tan((camera.perspective.fov / 2) * Math.PI / 180.0);
|
|
95114
95141
|
|
|
95115
|
-
updates.panDeltaX += (1.5 *
|
|
95116
|
-
updates.panDeltaY += (1.5 *
|
|
95142
|
+
updates.panDeltaX += (1.5 * xDelta * targetDistance / canvasHeight);
|
|
95143
|
+
updates.panDeltaY += (1.5 * yDelta * targetDistance / canvasHeight);
|
|
95117
95144
|
|
|
95118
95145
|
} else {
|
|
95119
95146
|
|
|
95120
|
-
updates.panDeltaX += 0.5 * camera.ortho.scale * (
|
|
95121
|
-
updates.panDeltaY += 0.5 * camera.ortho.scale * (
|
|
95147
|
+
updates.panDeltaX += 0.5 * camera.ortho.scale * (xDelta / canvasHeight);
|
|
95148
|
+
updates.panDeltaY += 0.5 * camera.ortho.scale * (yDelta / canvasHeight);
|
|
95122
95149
|
}
|
|
95123
95150
|
|
|
95124
95151
|
} else if (mouseDownLeft && !mouseDownMiddle && !mouseDownRight) {
|
|
@@ -95126,12 +95153,12 @@ class MousePanRotateDollyHandler {
|
|
|
95126
95153
|
if (!configs.planView) { // No rotating in plan-view mode
|
|
95127
95154
|
|
|
95128
95155
|
if (configs.firstPerson) {
|
|
95129
|
-
updates.rotateDeltaY -= (
|
|
95130
|
-
updates.rotateDeltaX += (
|
|
95156
|
+
updates.rotateDeltaY -= (xDelta / canvasWidth) * configs.dragRotationRate / 2;
|
|
95157
|
+
updates.rotateDeltaX += (yDelta / canvasHeight) * (configs.dragRotationRate / 4);
|
|
95131
95158
|
|
|
95132
95159
|
} else {
|
|
95133
|
-
updates.rotateDeltaY -= (
|
|
95134
|
-
updates.rotateDeltaX += (
|
|
95160
|
+
updates.rotateDeltaY -= (xDelta / canvasWidth) * (configs.dragRotationRate * 1.5);
|
|
95161
|
+
updates.rotateDeltaX += (yDelta / canvasHeight) * (configs.dragRotationRate * 1.5);
|
|
95135
95162
|
}
|
|
95136
95163
|
}
|
|
95137
95164
|
}
|
|
@@ -115499,6 +115526,7 @@ function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok) {
|
|
|
115499
115526
|
loadBuffer: options.loadBuffer,
|
|
115500
115527
|
basePath: options.basePath,
|
|
115501
115528
|
handlenode: options.handlenode,
|
|
115529
|
+
backfaces: !!options.backfaces,
|
|
115502
115530
|
gltfData: gltfData,
|
|
115503
115531
|
scene: sceneModel.scene,
|
|
115504
115532
|
plugin: plugin,
|
|
@@ -115704,7 +115732,8 @@ function loadMaterialAttributes(ctx, material) { // Substitute RGBA for material
|
|
|
115704
115732
|
color: new Float32Array([1, 1, 1, 1]),
|
|
115705
115733
|
opacity: 1,
|
|
115706
115734
|
metallic: 0,
|
|
115707
|
-
roughness: 1
|
|
115735
|
+
roughness: 1,
|
|
115736
|
+
doubleSided : true
|
|
115708
115737
|
};
|
|
115709
115738
|
if (extensions) {
|
|
115710
115739
|
const specularPBR = extensions["KHR_materials_pbrSpecularGlossiness"];
|
|
@@ -115755,6 +115784,7 @@ function loadMaterialAttributes(ctx, material) { // Substitute RGBA for material
|
|
|
115755
115784
|
materialAttributes.roughness = roughnessFactor;
|
|
115756
115785
|
}
|
|
115757
115786
|
}
|
|
115787
|
+
materialAttributes.doubleSided = (material.doubleSided !== false);
|
|
115758
115788
|
return materialAttributes;
|
|
115759
115789
|
}
|
|
115760
115790
|
|
|
@@ -115865,6 +115895,20 @@ function loadNode(ctx, node, depth, matrix) {
|
|
|
115865
115895
|
id: sceneModel.id + "." + ctx.numObjects++
|
|
115866
115896
|
};
|
|
115867
115897
|
|
|
115898
|
+
const material = primitive.material;
|
|
115899
|
+
if (material) {
|
|
115900
|
+
meshCfg.textureSetId = material._textureSetId;
|
|
115901
|
+
meshCfg.color = material._attributes.color;
|
|
115902
|
+
meshCfg.opacity = material._attributes.opacity;
|
|
115903
|
+
meshCfg.metallic = material._attributes.metallic;
|
|
115904
|
+
meshCfg.roughness = material._attributes.roughness;
|
|
115905
|
+
} else {
|
|
115906
|
+
meshCfg.color = new Float32Array([1.0, 1.0, 1.0]);
|
|
115907
|
+
meshCfg.opacity = 1.0;
|
|
115908
|
+
}
|
|
115909
|
+
|
|
115910
|
+
const backfaces = ((ctx.backfaces !== false) || (material.doubleSided !== false));
|
|
115911
|
+
|
|
115868
115912
|
switch (primitive.mode) {
|
|
115869
115913
|
case 0: // POINTS
|
|
115870
115914
|
meshCfg.primitive = "points";
|
|
@@ -115879,16 +115923,16 @@ function loadNode(ctx, node, depth, matrix) {
|
|
|
115879
115923
|
meshCfg.primitive = "lines";
|
|
115880
115924
|
break;
|
|
115881
115925
|
case 4: // TRIANGLES
|
|
115882
|
-
meshCfg.primitive = "triangles";
|
|
115926
|
+
meshCfg.primitive = backfaces ? "triangles" : "solid";
|
|
115883
115927
|
break;
|
|
115884
115928
|
case 5: // TRIANGLE_STRIP
|
|
115885
|
-
meshCfg.primitive = "triangles";
|
|
115929
|
+
meshCfg.primitive = backfaces ? "triangles" : "solid";
|
|
115886
115930
|
break;
|
|
115887
115931
|
case 6: // TRIANGLE_FAN
|
|
115888
|
-
meshCfg.primitive = "triangles";
|
|
115932
|
+
meshCfg.primitive = backfaces ? "triangles" : "solid";
|
|
115889
115933
|
break;
|
|
115890
115934
|
default:
|
|
115891
|
-
meshCfg.primitive = "triangles";
|
|
115935
|
+
meshCfg.primitive = backfaces ? "triangles" : "solid";
|
|
115892
115936
|
}
|
|
115893
115937
|
|
|
115894
115938
|
const POSITION = primitive.attributes.POSITION;
|
|
@@ -115917,17 +115961,6 @@ function loadNode(ctx, node, depth, matrix) {
|
|
|
115917
115961
|
meshCfg.origin = origin;
|
|
115918
115962
|
}
|
|
115919
115963
|
|
|
115920
|
-
const material = primitive.material;
|
|
115921
|
-
if (material) {
|
|
115922
|
-
meshCfg.textureSetId = material._textureSetId;
|
|
115923
|
-
meshCfg.color = material._attributes.color;
|
|
115924
|
-
meshCfg.opacity = material._attributes.opacity;
|
|
115925
|
-
meshCfg.metallic = material._attributes.metallic;
|
|
115926
|
-
meshCfg.roughness = material._attributes.roughness;
|
|
115927
|
-
} else {
|
|
115928
|
-
meshCfg.color = new Float32Array([1.0, 1.0, 1.0]);
|
|
115929
|
-
meshCfg.opacity = 1.0;
|
|
115930
|
-
}
|
|
115931
115964
|
// if (createEntity) {
|
|
115932
115965
|
// if (createEntity.colorize) {
|
|
115933
115966
|
// meshCfg.color = createEntity.colorize;
|
|
@@ -116270,7 +116303,7 @@ class GLTFLoaderPlugin extends Plugin {
|
|
|
116270
116303
|
* @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````
|
|
116271
116304
|
* @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````.
|
|
116272
116305
|
* @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````.
|
|
116273
|
-
* @param {Boolean} [params.backfaces=
|
|
116306
|
+
* @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.
|
|
116274
116307
|
* @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.
|
|
116275
116308
|
* @param {Boolean} [params.dtxEnabled=true] When ````true```` (default) use data textures (DTX), where appropriate, to
|
|
116276
116309
|
* represent the returned model. Set false to always use vertex buffer objects (VBOs). Note that DTX is only applicable
|
|
@@ -136314,4 +136347,4 @@ class CityJSONLoaderPlugin extends Plugin {
|
|
|
136314
136347
|
}
|
|
136315
136348
|
}
|
|
136316
136349
|
|
|
136317
|
-
export { AlphaFormat, AmbientLight, AngleMeasurementsControl, AngleMeasurementsMouseControl, AngleMeasurementsPlugin, AngleMeasurementsTouchControl, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, Bitmap, ByteType, CameraMemento, CameraPath, CameraPathAnimation, CityJSONLoaderPlugin, ClampToEdgeWrapping, Component, CompressedMediaType, Configs, ContextMenu, CubicBezierCurve, Curve, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DirLight, DistanceMeasurementsControl, DistanceMeasurementsMouseControl, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl, EdgeMaterial, EmphasisMaterial, FaceAlignedSectionPlanesPlugin, FastNavPlugin, FloatType, Fresnel, Frustum$1 as Frustum, FrustumPlane, GIFMediaType, GLTFDefaultDataSource, GLTFLoaderPlugin, HalfFloatType, ImagePlane, IntType, JPEGMediaType, KTX2TextureTranscoder, LASLoaderPlugin, LambertMaterial, LightMap, LineSet, LinearEncoding, LinearFilter, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, Loader, LoadingManager, LocaleService, LuminanceAlphaFormat, LuminanceFormat, Map$1 as Map, Marker, MarqueePicker, MarqueePickerMouseControl, Mesh, MetallicMaterial, MirroredRepeatWrapping, ModelMemento, NavCubePlugin, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, Node$2 as Node, OBJLoaderPlugin, ObjectsKdTree3, ObjectsMemento, PNGMediaType, Path, PerformanceModel, PhongMaterial, Plugin, PointLight, PointerCircle, PointerLens, QuadraticBezierCurve, Queue, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBFormat, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, ReadableGeometry, RedFormat, RedIntegerFormat, ReflectionMap, RepeatWrapping, STLDefaultDataSource, STLLoaderPlugin, SceneModel, SceneModelMesh, SceneModelTransform, SectionPlane, SectionPlanesPlugin, ShortType, Skybox, SkyboxesPlugin, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TextureTranscoder, TreeViewPlugin, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VBOGeometry, ViewCullPlugin, Viewer, WebIFCLoaderPlugin, WorkerPool$1 as WorkerPool, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, buildBoxGeometry, buildBoxLinesGeometry, buildBoxLinesGeometryFromAABB, buildCylinderGeometry, buildGridGeometry, buildPlaneGeometry, buildPolylineGeometry, buildPolylineGeometryFromCurve, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, createRTCViewMat, frustumIntersectsAABB3, getKTX2TextureTranscoder, getPlaneRTCPos, load3DSGeometry, loadOBJGeometry, math, rtcToWorldPos, sRGBEncoding, setFrustum, stats, utils, worldToRTCPos, worldToRTCPositions };
|
|
136350
|
+
export { AlphaFormat, AmbientLight, AngleMeasurementsControl, AngleMeasurementsMouseControl, AngleMeasurementsPlugin, AngleMeasurementsTouchControl, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, Bitmap, ByteType, CameraMemento, CameraPath, CameraPathAnimation, CityJSONLoaderPlugin, ClampToEdgeWrapping, Component, CompressedMediaType, Configs, ContextMenu, CubicBezierCurve, Curve, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DirLight, DistanceMeasurementsControl, DistanceMeasurementsMouseControl, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl, EdgeMaterial, EmphasisMaterial, FaceAlignedSectionPlanesPlugin, FastNavPlugin, FloatType, Fresnel, Frustum$1 as Frustum, FrustumPlane, GIFMediaType, GLTFDefaultDataSource, GLTFLoaderPlugin, HalfFloatType, ImagePlane, IntType, JPEGMediaType, KTX2TextureTranscoder, LASLoaderPlugin, LambertMaterial, LightMap, LineSet, LinearEncoding, LinearFilter, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, Loader, LoadingManager, LocaleService, LuminanceAlphaFormat, LuminanceFormat, Map$1 as Map, Marker, MarqueePicker, MarqueePickerMouseControl, Mesh, MetallicMaterial, MirroredRepeatWrapping, ModelMemento, NavCubePlugin, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, Node$2 as Node, OBJLoaderPlugin, ObjectsKdTree3, ObjectsMemento, PNGMediaType, Path, PerformanceModel, PhongMaterial, PickResult, Plugin, PointLight, PointerCircle, PointerLens, QuadraticBezierCurve, Queue, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGBFormat, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, ReadableGeometry, RedFormat, RedIntegerFormat, ReflectionMap, RepeatWrapping, STLDefaultDataSource, STLLoaderPlugin, SceneModel, SceneModelMesh, SceneModelTransform, SectionPlane, SectionPlanesPlugin, ShortType, Skybox, SkyboxesPlugin, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TextureTranscoder, TreeViewPlugin, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VBOGeometry, ViewCullPlugin, Viewer, WebIFCLoaderPlugin, WorkerPool$1 as WorkerPool, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, buildBoxGeometry, buildBoxLinesGeometry, buildBoxLinesGeometryFromAABB, buildCylinderGeometry, buildGridGeometry, buildPlaneGeometry, buildPolylineGeometry, buildPolylineGeometryFromCurve, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, createRTCViewMat, frustumIntersectsAABB3, getKTX2TextureTranscoder, getPlaneRTCPos, load3DSGeometry, loadOBJGeometry, math, rtcToWorldPos, sRGBEncoding, setFrustum, stats, utils, worldToRTCPos, worldToRTCPositions };
|