@xeokit/xeokit-sdk 2.6.40 → 2.6.41
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 +147 -120
- package/dist/xeokit-sdk.es.js +143 -121
- package/dist/xeokit-sdk.es5.js +15 -9
- package/dist/xeokit-sdk.min.cjs.js +3 -3
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +4 -4
- package/package.json +1 -1
- package/src/plugins/TreeViewPlugin/TreeViewPlugin.js +2 -0
- package/src/plugins/ZonesPlugin/ZonesPlugin.js +0 -116
- package/src/plugins/index.js +1 -0
- package/src/plugins/lib/ui/index.js +116 -0
- package/src/viewer/scene/model/SceneModel.js +15 -1
|
Binary file
|
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -11353,6 +11353,122 @@ function activateDraggableDots(cfg) {
|
|
|
11353
11353
|
};
|
|
11354
11354
|
}
|
|
11355
11355
|
|
|
11356
|
+
const touchPointSelector$1 = function(viewer, pointerCircle, ray2WorldPos) {
|
|
11357
|
+
return function(onCancel, onChange, onCommit) {
|
|
11358
|
+
const scene = viewer.scene;
|
|
11359
|
+
const canvas = scene.canvas.canvas;
|
|
11360
|
+
const longTouchTimeoutMs = 300;
|
|
11361
|
+
const moveTolerance = 20;
|
|
11362
|
+
|
|
11363
|
+
const copyCanvasPos = (event, vec2) => {
|
|
11364
|
+
vec2[0] = event.clientX;
|
|
11365
|
+
vec2[1] = event.clientY;
|
|
11366
|
+
transformToNode(canvas.ownerDocument.documentElement, canvas, vec2);
|
|
11367
|
+
return vec2;
|
|
11368
|
+
};
|
|
11369
|
+
|
|
11370
|
+
const pickWorldPos = canvasPos => {
|
|
11371
|
+
const origin = math.vec3();
|
|
11372
|
+
const direction = math.vec3();
|
|
11373
|
+
math.canvasPosToWorldRay(canvas, scene.camera.viewMatrix, scene.camera.projMatrix, scene.camera.projection, canvasPos, origin, direction);
|
|
11374
|
+
return ray2WorldPos(origin, direction);
|
|
11375
|
+
};
|
|
11376
|
+
|
|
11377
|
+
let longTouchTimeout = null;
|
|
11378
|
+
const nop = () => { };
|
|
11379
|
+
let onSingleTouchMove = nop;
|
|
11380
|
+
let startTouchIdentifier;
|
|
11381
|
+
|
|
11382
|
+
const resetAction = function() {
|
|
11383
|
+
pointerCircle.stop();
|
|
11384
|
+
clearTimeout(longTouchTimeout);
|
|
11385
|
+
viewer.cameraControl.active = true;
|
|
11386
|
+
onSingleTouchMove = nop;
|
|
11387
|
+
startTouchIdentifier = null;
|
|
11388
|
+
};
|
|
11389
|
+
|
|
11390
|
+
const cleanup = function() {
|
|
11391
|
+
resetAction();
|
|
11392
|
+
canvas.removeEventListener("touchstart", onCanvasTouchStart);
|
|
11393
|
+
canvas.removeEventListener("touchmove", onCanvasTouchMove);
|
|
11394
|
+
canvas.removeEventListener("touchend", onCanvasTouchEnd);
|
|
11395
|
+
};
|
|
11396
|
+
|
|
11397
|
+
const onCanvasTouchStart = function(event) {
|
|
11398
|
+
const touches = event.touches;
|
|
11399
|
+
|
|
11400
|
+
if (touches.length !== 1)
|
|
11401
|
+
{
|
|
11402
|
+
resetAction();
|
|
11403
|
+
onCancel();
|
|
11404
|
+
}
|
|
11405
|
+
else
|
|
11406
|
+
{
|
|
11407
|
+
const startTouch = touches[0];
|
|
11408
|
+
const startCanvasPos = copyCanvasPos(startTouch, math.vec2());
|
|
11409
|
+
|
|
11410
|
+
const startWorldPos = pickWorldPos(startCanvasPos);
|
|
11411
|
+
if (startWorldPos)
|
|
11412
|
+
{
|
|
11413
|
+
startTouchIdentifier = startTouch.identifier;
|
|
11414
|
+
|
|
11415
|
+
onSingleTouchMove = canvasPos => {
|
|
11416
|
+
if (math.distVec2(startCanvasPos, canvasPos) > moveTolerance)
|
|
11417
|
+
{
|
|
11418
|
+
resetAction();
|
|
11419
|
+
}
|
|
11420
|
+
};
|
|
11421
|
+
|
|
11422
|
+
longTouchTimeout = setTimeout(
|
|
11423
|
+
function() {
|
|
11424
|
+
pointerCircle.start(startCanvasPos);
|
|
11425
|
+
|
|
11426
|
+
longTouchTimeout = setTimeout(
|
|
11427
|
+
function() {
|
|
11428
|
+
pointerCircle.stop();
|
|
11429
|
+
|
|
11430
|
+
viewer.cameraControl.active = false;
|
|
11431
|
+
|
|
11432
|
+
onSingleTouchMove = canvasPos => {
|
|
11433
|
+
onChange(canvasPos, pickWorldPos(canvasPos));
|
|
11434
|
+
};
|
|
11435
|
+
|
|
11436
|
+
onSingleTouchMove(startCanvasPos);
|
|
11437
|
+
},
|
|
11438
|
+
longTouchTimeoutMs);
|
|
11439
|
+
},
|
|
11440
|
+
250);
|
|
11441
|
+
}
|
|
11442
|
+
}
|
|
11443
|
+
};
|
|
11444
|
+
canvas.addEventListener("touchstart", onCanvasTouchStart, {passive: true});
|
|
11445
|
+
|
|
11446
|
+
// canvas.addEventListener("touchcancel", e => console.log("touchcancel", e), {passive: true});
|
|
11447
|
+
|
|
11448
|
+
const onCanvasTouchMove = function(event) {
|
|
11449
|
+
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
11450
|
+
if (touch)
|
|
11451
|
+
{
|
|
11452
|
+
onSingleTouchMove(copyCanvasPos(touch, math.vec2()));
|
|
11453
|
+
}
|
|
11454
|
+
};
|
|
11455
|
+
canvas.addEventListener("touchmove", onCanvasTouchMove, {passive: true});
|
|
11456
|
+
|
|
11457
|
+
const onCanvasTouchEnd = function(event) {
|
|
11458
|
+
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
11459
|
+
if (touch)
|
|
11460
|
+
{
|
|
11461
|
+
cleanup();
|
|
11462
|
+
const canvasPos = copyCanvasPos(touch, math.vec2());
|
|
11463
|
+
onCommit(canvasPos, pickWorldPos(canvasPos));
|
|
11464
|
+
}
|
|
11465
|
+
};
|
|
11466
|
+
canvas.addEventListener("touchend", onCanvasTouchEnd, {passive: true});
|
|
11467
|
+
|
|
11468
|
+
return cleanup;
|
|
11469
|
+
};
|
|
11470
|
+
};
|
|
11471
|
+
|
|
11356
11472
|
/** @private */
|
|
11357
11473
|
class Wire {
|
|
11358
11474
|
|
|
@@ -56018,9 +56134,9 @@ const configs$2 = new Configs();
|
|
|
56018
56134
|
*/
|
|
56019
56135
|
class VBOBatchingTrianglesBuffer {
|
|
56020
56136
|
|
|
56021
|
-
constructor() {
|
|
56022
|
-
this.maxVerts =
|
|
56023
|
-
this.maxIndices =
|
|
56137
|
+
constructor(maxBatchSize = configs$2.maxGeometryBatchSize) {
|
|
56138
|
+
this.maxVerts = maxBatchSize;
|
|
56139
|
+
this.maxIndices = maxBatchSize * 3; // Rough rule-of-thumb
|
|
56024
56140
|
this.positions = [];
|
|
56025
56141
|
this.colors = [];
|
|
56026
56142
|
this.uv = [];
|
|
@@ -85120,7 +85236,21 @@ class SceneModel extends Component {
|
|
|
85120
85236
|
if (cfg.image) { // Ignore transcoder for Images
|
|
85121
85237
|
const image = cfg.image;
|
|
85122
85238
|
image.crossOrigin = "Anonymous";
|
|
85123
|
-
|
|
85239
|
+
if (image.compressed) {
|
|
85240
|
+
// see `parsedImage` in @loaders.gl/gltf/src/lib/parsers/parse-gltf.ts
|
|
85241
|
+
// NOTE: @loaders.gl in its current version discards potential mipmaps, leaving only a single one
|
|
85242
|
+
const data = image.data;
|
|
85243
|
+
texture.setCompressedData({
|
|
85244
|
+
mipmaps: data,
|
|
85245
|
+
props: {
|
|
85246
|
+
format: data[0].format,
|
|
85247
|
+
minFilter: minFilter,
|
|
85248
|
+
magFilter: magFilter
|
|
85249
|
+
}
|
|
85250
|
+
});
|
|
85251
|
+
} else {
|
|
85252
|
+
texture.setImage(image, {minFilter, magFilter, wrapS, wrapT, wrapR, flipY: cfg.flipY, encoding});
|
|
85253
|
+
}
|
|
85124
85254
|
} else if (cfg.src) {
|
|
85125
85255
|
const ext = cfg.src.split('.').pop();
|
|
85126
85256
|
switch (ext) { // Don't transcode recognized image file types
|
|
@@ -91356,6 +91486,12 @@ class FastNavPlugin extends Plugin {
|
|
|
91356
91486
|
class GLTFDefaultDataSource {
|
|
91357
91487
|
|
|
91358
91488
|
constructor(cfg = {}) {
|
|
91489
|
+
|
|
91490
|
+
/**
|
|
91491
|
+
* Set `true` to enable cache busting for HTTP GETs.
|
|
91492
|
+
* This is `true` by default.
|
|
91493
|
+
* @type {boolean}
|
|
91494
|
+
*/
|
|
91359
91495
|
this.cacheBuster = (cfg.cacheBuster !== false);
|
|
91360
91496
|
}
|
|
91361
91497
|
|
|
@@ -126773,6 +126909,8 @@ class TreeViewPlugin extends Plugin {
|
|
|
126773
126909
|
return; // Node may not exist for the given object if (this._pruneEmptyNodes == true)
|
|
126774
126910
|
}
|
|
126775
126911
|
|
|
126912
|
+
this.collapse();
|
|
126913
|
+
|
|
126776
126914
|
const nodeId = node.nodeId;
|
|
126777
126915
|
|
|
126778
126916
|
const switchElement = this._renderService.getSwitchElement(nodeId);
|
|
@@ -140505,122 +140643,6 @@ const mousePointSelector = function(viewer, ray2WorldPos) {
|
|
|
140505
140643
|
};
|
|
140506
140644
|
};
|
|
140507
140645
|
|
|
140508
|
-
const touchPointSelector = function(viewer, pointerCircle, ray2WorldPos) {
|
|
140509
|
-
return function(onCancel, onChange, onCommit) {
|
|
140510
|
-
const scene = viewer.scene;
|
|
140511
|
-
const canvas = scene.canvas.canvas;
|
|
140512
|
-
const longTouchTimeoutMs = 300;
|
|
140513
|
-
const moveTolerance = 20;
|
|
140514
|
-
|
|
140515
|
-
const copyCanvasPos = (event, vec2) => {
|
|
140516
|
-
vec2[0] = event.clientX;
|
|
140517
|
-
vec2[1] = event.clientY;
|
|
140518
|
-
transformToNode(canvas.ownerDocument.documentElement, canvas, vec2);
|
|
140519
|
-
return vec2;
|
|
140520
|
-
};
|
|
140521
|
-
|
|
140522
|
-
const pickWorldPos = canvasPos => {
|
|
140523
|
-
const origin = math.vec3();
|
|
140524
|
-
const direction = math.vec3();
|
|
140525
|
-
math.canvasPosToWorldRay(canvas, scene.camera.viewMatrix, scene.camera.projMatrix, scene.camera.projection, canvasPos, origin, direction);
|
|
140526
|
-
return ray2WorldPos(origin, direction);
|
|
140527
|
-
};
|
|
140528
|
-
|
|
140529
|
-
let longTouchTimeout = null;
|
|
140530
|
-
const nop = () => { };
|
|
140531
|
-
let onSingleTouchMove = nop;
|
|
140532
|
-
let startTouchIdentifier;
|
|
140533
|
-
|
|
140534
|
-
const resetAction = function() {
|
|
140535
|
-
pointerCircle.stop();
|
|
140536
|
-
clearTimeout(longTouchTimeout);
|
|
140537
|
-
viewer.cameraControl.active = true;
|
|
140538
|
-
onSingleTouchMove = nop;
|
|
140539
|
-
startTouchIdentifier = null;
|
|
140540
|
-
};
|
|
140541
|
-
|
|
140542
|
-
const cleanup = function() {
|
|
140543
|
-
resetAction();
|
|
140544
|
-
canvas.removeEventListener("touchstart", onCanvasTouchStart);
|
|
140545
|
-
canvas.removeEventListener("touchmove", onCanvasTouchMove);
|
|
140546
|
-
canvas.removeEventListener("touchend", onCanvasTouchEnd);
|
|
140547
|
-
};
|
|
140548
|
-
|
|
140549
|
-
const onCanvasTouchStart = function(event) {
|
|
140550
|
-
const touches = event.touches;
|
|
140551
|
-
|
|
140552
|
-
if (touches.length !== 1)
|
|
140553
|
-
{
|
|
140554
|
-
resetAction();
|
|
140555
|
-
onCancel();
|
|
140556
|
-
}
|
|
140557
|
-
else
|
|
140558
|
-
{
|
|
140559
|
-
const startTouch = touches[0];
|
|
140560
|
-
const startCanvasPos = copyCanvasPos(startTouch, math.vec2());
|
|
140561
|
-
|
|
140562
|
-
const startWorldPos = pickWorldPos(startCanvasPos);
|
|
140563
|
-
if (startWorldPos)
|
|
140564
|
-
{
|
|
140565
|
-
startTouchIdentifier = startTouch.identifier;
|
|
140566
|
-
|
|
140567
|
-
onSingleTouchMove = canvasPos => {
|
|
140568
|
-
if (math.distVec2(startCanvasPos, canvasPos) > moveTolerance)
|
|
140569
|
-
{
|
|
140570
|
-
resetAction();
|
|
140571
|
-
}
|
|
140572
|
-
};
|
|
140573
|
-
|
|
140574
|
-
longTouchTimeout = setTimeout(
|
|
140575
|
-
function() {
|
|
140576
|
-
pointerCircle.start(startCanvasPos);
|
|
140577
|
-
|
|
140578
|
-
longTouchTimeout = setTimeout(
|
|
140579
|
-
function() {
|
|
140580
|
-
pointerCircle.stop();
|
|
140581
|
-
|
|
140582
|
-
viewer.cameraControl.active = false;
|
|
140583
|
-
|
|
140584
|
-
onSingleTouchMove = canvasPos => {
|
|
140585
|
-
onChange(canvasPos, pickWorldPos(canvasPos));
|
|
140586
|
-
};
|
|
140587
|
-
|
|
140588
|
-
onSingleTouchMove(startCanvasPos);
|
|
140589
|
-
},
|
|
140590
|
-
longTouchTimeoutMs);
|
|
140591
|
-
},
|
|
140592
|
-
250);
|
|
140593
|
-
}
|
|
140594
|
-
}
|
|
140595
|
-
};
|
|
140596
|
-
canvas.addEventListener("touchstart", onCanvasTouchStart, {passive: true});
|
|
140597
|
-
|
|
140598
|
-
// canvas.addEventListener("touchcancel", e => console.log("touchcancel", e), {passive: true});
|
|
140599
|
-
|
|
140600
|
-
const onCanvasTouchMove = function(event) {
|
|
140601
|
-
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
140602
|
-
if (touch)
|
|
140603
|
-
{
|
|
140604
|
-
onSingleTouchMove(copyCanvasPos(touch, math.vec2()));
|
|
140605
|
-
}
|
|
140606
|
-
};
|
|
140607
|
-
canvas.addEventListener("touchmove", onCanvasTouchMove, {passive: true});
|
|
140608
|
-
|
|
140609
|
-
const onCanvasTouchEnd = function(event) {
|
|
140610
|
-
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
140611
|
-
if (touch)
|
|
140612
|
-
{
|
|
140613
|
-
cleanup();
|
|
140614
|
-
const canvasPos = copyCanvasPos(touch, math.vec2());
|
|
140615
|
-
onCommit(canvasPos, pickWorldPos(canvasPos));
|
|
140616
|
-
}
|
|
140617
|
-
};
|
|
140618
|
-
canvas.addEventListener("touchend", onCanvasTouchEnd, {passive: true});
|
|
140619
|
-
|
|
140620
|
-
return cleanup;
|
|
140621
|
-
};
|
|
140622
|
-
};
|
|
140623
|
-
|
|
140624
140646
|
const planeIntersect = function(p0, n, origin, direction) {
|
|
140625
140647
|
const t = - (math.dotVec3(origin, n) - p0) / math.dotVec3(direction, n);
|
|
140626
140648
|
{
|
|
@@ -141996,6 +142018,7 @@ exports.DistanceMeasurementsControl = DistanceMeasurementsControl;
|
|
|
141996
142018
|
exports.DistanceMeasurementsMouseControl = DistanceMeasurementsMouseControl;
|
|
141997
142019
|
exports.DistanceMeasurementsPlugin = DistanceMeasurementsPlugin;
|
|
141998
142020
|
exports.DistanceMeasurementsTouchControl = DistanceMeasurementsTouchControl;
|
|
142021
|
+
exports.Dot3D = Dot3D;
|
|
141999
142022
|
exports.DotBIMDefaultDataSource = DotBIMDefaultDataSource;
|
|
142000
142023
|
exports.DotBIMLoaderPlugin = DotBIMLoaderPlugin;
|
|
142001
142024
|
exports.EdgeMaterial = EdgeMaterial;
|
|
@@ -142138,6 +142161,8 @@ exports.ZonesPlugin = ZonesPlugin;
|
|
|
142138
142161
|
exports.ZonesPolysurfaceMouseControl = ZonesPolysurfaceMouseControl;
|
|
142139
142162
|
exports.ZonesPolysurfaceTouchControl = ZonesPolysurfaceTouchControl;
|
|
142140
142163
|
exports.ZonesTouchControl = ZonesTouchControl;
|
|
142164
|
+
exports.activateDraggableDot = activateDraggableDot;
|
|
142165
|
+
exports.activateDraggableDots = activateDraggableDots;
|
|
142141
142166
|
exports.buildBoxGeometry = buildBoxGeometry;
|
|
142142
142167
|
exports.buildBoxLinesGeometry = buildBoxLinesGeometry;
|
|
142143
142168
|
exports.buildBoxLinesGeometryFromAABB = buildBoxLinesGeometryFromAABB;
|
|
@@ -142164,6 +142189,8 @@ exports.rtcToWorldPos = rtcToWorldPos;
|
|
|
142164
142189
|
exports.sRGBEncoding = sRGBEncoding;
|
|
142165
142190
|
exports.setFrustum = setFrustum;
|
|
142166
142191
|
exports.stats = stats;
|
|
142192
|
+
exports.touchPointSelector = touchPointSelector$1;
|
|
142193
|
+
exports.transformToNode = transformToNode;
|
|
142167
142194
|
exports.utils = utils;
|
|
142168
142195
|
exports.worldToRTCPos = worldToRTCPos;
|
|
142169
142196
|
exports.worldToRTCPositions = worldToRTCPositions;
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -11349,6 +11349,122 @@ function activateDraggableDots(cfg) {
|
|
|
11349
11349
|
};
|
|
11350
11350
|
}
|
|
11351
11351
|
|
|
11352
|
+
const touchPointSelector$1 = function(viewer, pointerCircle, ray2WorldPos) {
|
|
11353
|
+
return function(onCancel, onChange, onCommit) {
|
|
11354
|
+
const scene = viewer.scene;
|
|
11355
|
+
const canvas = scene.canvas.canvas;
|
|
11356
|
+
const longTouchTimeoutMs = 300;
|
|
11357
|
+
const moveTolerance = 20;
|
|
11358
|
+
|
|
11359
|
+
const copyCanvasPos = (event, vec2) => {
|
|
11360
|
+
vec2[0] = event.clientX;
|
|
11361
|
+
vec2[1] = event.clientY;
|
|
11362
|
+
transformToNode(canvas.ownerDocument.documentElement, canvas, vec2);
|
|
11363
|
+
return vec2;
|
|
11364
|
+
};
|
|
11365
|
+
|
|
11366
|
+
const pickWorldPos = canvasPos => {
|
|
11367
|
+
const origin = math.vec3();
|
|
11368
|
+
const direction = math.vec3();
|
|
11369
|
+
math.canvasPosToWorldRay(canvas, scene.camera.viewMatrix, scene.camera.projMatrix, scene.camera.projection, canvasPos, origin, direction);
|
|
11370
|
+
return ray2WorldPos(origin, direction);
|
|
11371
|
+
};
|
|
11372
|
+
|
|
11373
|
+
let longTouchTimeout = null;
|
|
11374
|
+
const nop = () => { };
|
|
11375
|
+
let onSingleTouchMove = nop;
|
|
11376
|
+
let startTouchIdentifier;
|
|
11377
|
+
|
|
11378
|
+
const resetAction = function() {
|
|
11379
|
+
pointerCircle.stop();
|
|
11380
|
+
clearTimeout(longTouchTimeout);
|
|
11381
|
+
viewer.cameraControl.active = true;
|
|
11382
|
+
onSingleTouchMove = nop;
|
|
11383
|
+
startTouchIdentifier = null;
|
|
11384
|
+
};
|
|
11385
|
+
|
|
11386
|
+
const cleanup = function() {
|
|
11387
|
+
resetAction();
|
|
11388
|
+
canvas.removeEventListener("touchstart", onCanvasTouchStart);
|
|
11389
|
+
canvas.removeEventListener("touchmove", onCanvasTouchMove);
|
|
11390
|
+
canvas.removeEventListener("touchend", onCanvasTouchEnd);
|
|
11391
|
+
};
|
|
11392
|
+
|
|
11393
|
+
const onCanvasTouchStart = function(event) {
|
|
11394
|
+
const touches = event.touches;
|
|
11395
|
+
|
|
11396
|
+
if (touches.length !== 1)
|
|
11397
|
+
{
|
|
11398
|
+
resetAction();
|
|
11399
|
+
onCancel();
|
|
11400
|
+
}
|
|
11401
|
+
else
|
|
11402
|
+
{
|
|
11403
|
+
const startTouch = touches[0];
|
|
11404
|
+
const startCanvasPos = copyCanvasPos(startTouch, math.vec2());
|
|
11405
|
+
|
|
11406
|
+
const startWorldPos = pickWorldPos(startCanvasPos);
|
|
11407
|
+
if (startWorldPos)
|
|
11408
|
+
{
|
|
11409
|
+
startTouchIdentifier = startTouch.identifier;
|
|
11410
|
+
|
|
11411
|
+
onSingleTouchMove = canvasPos => {
|
|
11412
|
+
if (math.distVec2(startCanvasPos, canvasPos) > moveTolerance)
|
|
11413
|
+
{
|
|
11414
|
+
resetAction();
|
|
11415
|
+
}
|
|
11416
|
+
};
|
|
11417
|
+
|
|
11418
|
+
longTouchTimeout = setTimeout(
|
|
11419
|
+
function() {
|
|
11420
|
+
pointerCircle.start(startCanvasPos);
|
|
11421
|
+
|
|
11422
|
+
longTouchTimeout = setTimeout(
|
|
11423
|
+
function() {
|
|
11424
|
+
pointerCircle.stop();
|
|
11425
|
+
|
|
11426
|
+
viewer.cameraControl.active = false;
|
|
11427
|
+
|
|
11428
|
+
onSingleTouchMove = canvasPos => {
|
|
11429
|
+
onChange(canvasPos, pickWorldPos(canvasPos));
|
|
11430
|
+
};
|
|
11431
|
+
|
|
11432
|
+
onSingleTouchMove(startCanvasPos);
|
|
11433
|
+
},
|
|
11434
|
+
longTouchTimeoutMs);
|
|
11435
|
+
},
|
|
11436
|
+
250);
|
|
11437
|
+
}
|
|
11438
|
+
}
|
|
11439
|
+
};
|
|
11440
|
+
canvas.addEventListener("touchstart", onCanvasTouchStart, {passive: true});
|
|
11441
|
+
|
|
11442
|
+
// canvas.addEventListener("touchcancel", e => console.log("touchcancel", e), {passive: true});
|
|
11443
|
+
|
|
11444
|
+
const onCanvasTouchMove = function(event) {
|
|
11445
|
+
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
11446
|
+
if (touch)
|
|
11447
|
+
{
|
|
11448
|
+
onSingleTouchMove(copyCanvasPos(touch, math.vec2()));
|
|
11449
|
+
}
|
|
11450
|
+
};
|
|
11451
|
+
canvas.addEventListener("touchmove", onCanvasTouchMove, {passive: true});
|
|
11452
|
+
|
|
11453
|
+
const onCanvasTouchEnd = function(event) {
|
|
11454
|
+
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
11455
|
+
if (touch)
|
|
11456
|
+
{
|
|
11457
|
+
cleanup();
|
|
11458
|
+
const canvasPos = copyCanvasPos(touch, math.vec2());
|
|
11459
|
+
onCommit(canvasPos, pickWorldPos(canvasPos));
|
|
11460
|
+
}
|
|
11461
|
+
};
|
|
11462
|
+
canvas.addEventListener("touchend", onCanvasTouchEnd, {passive: true});
|
|
11463
|
+
|
|
11464
|
+
return cleanup;
|
|
11465
|
+
};
|
|
11466
|
+
};
|
|
11467
|
+
|
|
11352
11468
|
/** @private */
|
|
11353
11469
|
class Wire {
|
|
11354
11470
|
|
|
@@ -56014,9 +56130,9 @@ const configs$2 = new Configs();
|
|
|
56014
56130
|
*/
|
|
56015
56131
|
class VBOBatchingTrianglesBuffer {
|
|
56016
56132
|
|
|
56017
|
-
constructor() {
|
|
56018
|
-
this.maxVerts =
|
|
56019
|
-
this.maxIndices =
|
|
56133
|
+
constructor(maxBatchSize = configs$2.maxGeometryBatchSize) {
|
|
56134
|
+
this.maxVerts = maxBatchSize;
|
|
56135
|
+
this.maxIndices = maxBatchSize * 3; // Rough rule-of-thumb
|
|
56020
56136
|
this.positions = [];
|
|
56021
56137
|
this.colors = [];
|
|
56022
56138
|
this.uv = [];
|
|
@@ -85116,7 +85232,21 @@ class SceneModel extends Component {
|
|
|
85116
85232
|
if (cfg.image) { // Ignore transcoder for Images
|
|
85117
85233
|
const image = cfg.image;
|
|
85118
85234
|
image.crossOrigin = "Anonymous";
|
|
85119
|
-
|
|
85235
|
+
if (image.compressed) {
|
|
85236
|
+
// see `parsedImage` in @loaders.gl/gltf/src/lib/parsers/parse-gltf.ts
|
|
85237
|
+
// NOTE: @loaders.gl in its current version discards potential mipmaps, leaving only a single one
|
|
85238
|
+
const data = image.data;
|
|
85239
|
+
texture.setCompressedData({
|
|
85240
|
+
mipmaps: data,
|
|
85241
|
+
props: {
|
|
85242
|
+
format: data[0].format,
|
|
85243
|
+
minFilter: minFilter,
|
|
85244
|
+
magFilter: magFilter
|
|
85245
|
+
}
|
|
85246
|
+
});
|
|
85247
|
+
} else {
|
|
85248
|
+
texture.setImage(image, {minFilter, magFilter, wrapS, wrapT, wrapR, flipY: cfg.flipY, encoding});
|
|
85249
|
+
}
|
|
85120
85250
|
} else if (cfg.src) {
|
|
85121
85251
|
const ext = cfg.src.split('.').pop();
|
|
85122
85252
|
switch (ext) { // Don't transcode recognized image file types
|
|
@@ -91352,6 +91482,12 @@ class FastNavPlugin extends Plugin {
|
|
|
91352
91482
|
class GLTFDefaultDataSource {
|
|
91353
91483
|
|
|
91354
91484
|
constructor(cfg = {}) {
|
|
91485
|
+
|
|
91486
|
+
/**
|
|
91487
|
+
* Set `true` to enable cache busting for HTTP GETs.
|
|
91488
|
+
* This is `true` by default.
|
|
91489
|
+
* @type {boolean}
|
|
91490
|
+
*/
|
|
91355
91491
|
this.cacheBuster = (cfg.cacheBuster !== false);
|
|
91356
91492
|
}
|
|
91357
91493
|
|
|
@@ -126769,6 +126905,8 @@ class TreeViewPlugin extends Plugin {
|
|
|
126769
126905
|
return; // Node may not exist for the given object if (this._pruneEmptyNodes == true)
|
|
126770
126906
|
}
|
|
126771
126907
|
|
|
126908
|
+
this.collapse();
|
|
126909
|
+
|
|
126772
126910
|
const nodeId = node.nodeId;
|
|
126773
126911
|
|
|
126774
126912
|
const switchElement = this._renderService.getSwitchElement(nodeId);
|
|
@@ -140501,122 +140639,6 @@ const mousePointSelector = function(viewer, ray2WorldPos) {
|
|
|
140501
140639
|
};
|
|
140502
140640
|
};
|
|
140503
140641
|
|
|
140504
|
-
const touchPointSelector = function(viewer, pointerCircle, ray2WorldPos) {
|
|
140505
|
-
return function(onCancel, onChange, onCommit) {
|
|
140506
|
-
const scene = viewer.scene;
|
|
140507
|
-
const canvas = scene.canvas.canvas;
|
|
140508
|
-
const longTouchTimeoutMs = 300;
|
|
140509
|
-
const moveTolerance = 20;
|
|
140510
|
-
|
|
140511
|
-
const copyCanvasPos = (event, vec2) => {
|
|
140512
|
-
vec2[0] = event.clientX;
|
|
140513
|
-
vec2[1] = event.clientY;
|
|
140514
|
-
transformToNode(canvas.ownerDocument.documentElement, canvas, vec2);
|
|
140515
|
-
return vec2;
|
|
140516
|
-
};
|
|
140517
|
-
|
|
140518
|
-
const pickWorldPos = canvasPos => {
|
|
140519
|
-
const origin = math.vec3();
|
|
140520
|
-
const direction = math.vec3();
|
|
140521
|
-
math.canvasPosToWorldRay(canvas, scene.camera.viewMatrix, scene.camera.projMatrix, scene.camera.projection, canvasPos, origin, direction);
|
|
140522
|
-
return ray2WorldPos(origin, direction);
|
|
140523
|
-
};
|
|
140524
|
-
|
|
140525
|
-
let longTouchTimeout = null;
|
|
140526
|
-
const nop = () => { };
|
|
140527
|
-
let onSingleTouchMove = nop;
|
|
140528
|
-
let startTouchIdentifier;
|
|
140529
|
-
|
|
140530
|
-
const resetAction = function() {
|
|
140531
|
-
pointerCircle.stop();
|
|
140532
|
-
clearTimeout(longTouchTimeout);
|
|
140533
|
-
viewer.cameraControl.active = true;
|
|
140534
|
-
onSingleTouchMove = nop;
|
|
140535
|
-
startTouchIdentifier = null;
|
|
140536
|
-
};
|
|
140537
|
-
|
|
140538
|
-
const cleanup = function() {
|
|
140539
|
-
resetAction();
|
|
140540
|
-
canvas.removeEventListener("touchstart", onCanvasTouchStart);
|
|
140541
|
-
canvas.removeEventListener("touchmove", onCanvasTouchMove);
|
|
140542
|
-
canvas.removeEventListener("touchend", onCanvasTouchEnd);
|
|
140543
|
-
};
|
|
140544
|
-
|
|
140545
|
-
const onCanvasTouchStart = function(event) {
|
|
140546
|
-
const touches = event.touches;
|
|
140547
|
-
|
|
140548
|
-
if (touches.length !== 1)
|
|
140549
|
-
{
|
|
140550
|
-
resetAction();
|
|
140551
|
-
onCancel();
|
|
140552
|
-
}
|
|
140553
|
-
else
|
|
140554
|
-
{
|
|
140555
|
-
const startTouch = touches[0];
|
|
140556
|
-
const startCanvasPos = copyCanvasPos(startTouch, math.vec2());
|
|
140557
|
-
|
|
140558
|
-
const startWorldPos = pickWorldPos(startCanvasPos);
|
|
140559
|
-
if (startWorldPos)
|
|
140560
|
-
{
|
|
140561
|
-
startTouchIdentifier = startTouch.identifier;
|
|
140562
|
-
|
|
140563
|
-
onSingleTouchMove = canvasPos => {
|
|
140564
|
-
if (math.distVec2(startCanvasPos, canvasPos) > moveTolerance)
|
|
140565
|
-
{
|
|
140566
|
-
resetAction();
|
|
140567
|
-
}
|
|
140568
|
-
};
|
|
140569
|
-
|
|
140570
|
-
longTouchTimeout = setTimeout(
|
|
140571
|
-
function() {
|
|
140572
|
-
pointerCircle.start(startCanvasPos);
|
|
140573
|
-
|
|
140574
|
-
longTouchTimeout = setTimeout(
|
|
140575
|
-
function() {
|
|
140576
|
-
pointerCircle.stop();
|
|
140577
|
-
|
|
140578
|
-
viewer.cameraControl.active = false;
|
|
140579
|
-
|
|
140580
|
-
onSingleTouchMove = canvasPos => {
|
|
140581
|
-
onChange(canvasPos, pickWorldPos(canvasPos));
|
|
140582
|
-
};
|
|
140583
|
-
|
|
140584
|
-
onSingleTouchMove(startCanvasPos);
|
|
140585
|
-
},
|
|
140586
|
-
longTouchTimeoutMs);
|
|
140587
|
-
},
|
|
140588
|
-
250);
|
|
140589
|
-
}
|
|
140590
|
-
}
|
|
140591
|
-
};
|
|
140592
|
-
canvas.addEventListener("touchstart", onCanvasTouchStart, {passive: true});
|
|
140593
|
-
|
|
140594
|
-
// canvas.addEventListener("touchcancel", e => console.log("touchcancel", e), {passive: true});
|
|
140595
|
-
|
|
140596
|
-
const onCanvasTouchMove = function(event) {
|
|
140597
|
-
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
140598
|
-
if (touch)
|
|
140599
|
-
{
|
|
140600
|
-
onSingleTouchMove(copyCanvasPos(touch, math.vec2()));
|
|
140601
|
-
}
|
|
140602
|
-
};
|
|
140603
|
-
canvas.addEventListener("touchmove", onCanvasTouchMove, {passive: true});
|
|
140604
|
-
|
|
140605
|
-
const onCanvasTouchEnd = function(event) {
|
|
140606
|
-
const touch = [...event.changedTouches].find(e => e.identifier === startTouchIdentifier);
|
|
140607
|
-
if (touch)
|
|
140608
|
-
{
|
|
140609
|
-
cleanup();
|
|
140610
|
-
const canvasPos = copyCanvasPos(touch, math.vec2());
|
|
140611
|
-
onCommit(canvasPos, pickWorldPos(canvasPos));
|
|
140612
|
-
}
|
|
140613
|
-
};
|
|
140614
|
-
canvas.addEventListener("touchend", onCanvasTouchEnd, {passive: true});
|
|
140615
|
-
|
|
140616
|
-
return cleanup;
|
|
140617
|
-
};
|
|
140618
|
-
};
|
|
140619
|
-
|
|
140620
140642
|
const planeIntersect = function(p0, n, origin, direction) {
|
|
140621
140643
|
const t = - (math.dotVec3(origin, n) - p0) / math.dotVec3(direction, n);
|
|
140622
140644
|
{
|
|
@@ -141957,4 +141979,4 @@ class ZoneTranslateTouchControl extends ZoneTranslateControl {
|
|
|
141957
141979
|
}
|
|
141958
141980
|
}
|
|
141959
141981
|
|
|
141960
|
-
export { AlphaFormat, AmbientLight, AngleMeasurementEditMouseControl, AngleMeasurementEditTouchControl, AngleMeasurementsControl, AngleMeasurementsMouseControl, AngleMeasurementsPlugin, AngleMeasurementsTouchControl, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, Bitmap, ByteType, CameraMemento, CameraPath, CameraPathAnimation, CityJSONLoaderPlugin, ClampToEdgeWrapping, Component, CompressedMediaType, Configs, ContextMenu, CubicBezierCurve, Curve, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DirLight, DistanceMeasurementEditControl, DistanceMeasurementEditMouseControl, DistanceMeasurementEditTouchControl, DistanceMeasurementsControl, DistanceMeasurementsMouseControl, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl, DotBIMDefaultDataSource, DotBIMLoaderPlugin, 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, MeshSurfaceArea, MeshVolume, 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, ZoneEditControl, ZoneEditMouseControl, ZoneEditTouchControl, ZoneTranslateControl, ZoneTranslateMouseControl, ZoneTranslateTouchControl, ZonesMouseControl, ZonesPlugin, ZonesPolysurfaceMouseControl, ZonesPolysurfaceTouchControl, ZonesTouchControl, buildBoxGeometry, buildBoxLinesGeometry, buildBoxLinesGeometryFromAABB, buildCylinderGeometry, buildGridGeometry, buildLineGeometry, buildPlaneGeometry, buildPolylineGeometry, buildPolylineGeometryFromCurve, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, createRTCViewMat, frustumIntersectsAABB3, getKTX2TextureTranscoder, getPlaneRTCPos, isTriangleMeshSolid, load3DSGeometry, loadOBJGeometry, math, meshSurfaceArea, meshVolume, rtcToWorldPos, sRGBEncoding, setFrustum, stats, utils, worldToRTCPos, worldToRTCPositions };
|
|
141982
|
+
export { AlphaFormat, AmbientLight, AngleMeasurementEditMouseControl, AngleMeasurementEditTouchControl, AngleMeasurementsControl, AngleMeasurementsMouseControl, AngleMeasurementsPlugin, AngleMeasurementsTouchControl, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, Bitmap, ByteType, CameraMemento, CameraPath, CameraPathAnimation, CityJSONLoaderPlugin, ClampToEdgeWrapping, Component, CompressedMediaType, Configs, ContextMenu, CubicBezierCurve, Curve, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DirLight, DistanceMeasurementEditControl, DistanceMeasurementEditMouseControl, DistanceMeasurementEditTouchControl, DistanceMeasurementsControl, DistanceMeasurementsMouseControl, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl, Dot3D, DotBIMDefaultDataSource, DotBIMLoaderPlugin, 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, MeshSurfaceArea, MeshVolume, 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, ZoneEditControl, ZoneEditMouseControl, ZoneEditTouchControl, ZoneTranslateControl, ZoneTranslateMouseControl, ZoneTranslateTouchControl, ZonesMouseControl, ZonesPlugin, ZonesPolysurfaceMouseControl, ZonesPolysurfaceTouchControl, ZonesTouchControl, activateDraggableDot, activateDraggableDots, buildBoxGeometry, buildBoxLinesGeometry, buildBoxLinesGeometryFromAABB, buildCylinderGeometry, buildGridGeometry, buildLineGeometry, buildPlaneGeometry, buildPolylineGeometry, buildPolylineGeometryFromCurve, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, createRTCViewMat, frustumIntersectsAABB3, getKTX2TextureTranscoder, getPlaneRTCPos, isTriangleMeshSolid, load3DSGeometry, loadOBJGeometry, math, meshSurfaceArea, meshVolume, rtcToWorldPos, sRGBEncoding, setFrustum, stats, touchPointSelector$1 as touchPointSelector, transformToNode, utils, worldToRTCPos, worldToRTCPositions };
|