@xeokit/xeokit-sdk 2.2.0 → 2.2.1-beta.1

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.
@@ -8793,7 +8793,7 @@ class PerformanceNode {
8793
8793
 
8794
8794
  }
8795
8795
 
8796
- const tempVec3a$10 = math.vec3();
8796
+ const tempVec3a$11 = math.vec3();
8797
8797
 
8798
8798
  /**
8799
8799
  * Given a view matrix and a relative-to-center (RTC) coordinate origin, returns a view matrix
@@ -8872,7 +8872,7 @@ function worldToRTCPos(worldPos, rtcCenter, rtcPos) {
8872
8872
  */
8873
8873
  function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize = 1000000) {
8874
8874
 
8875
- const center = math.getPositionsCenter(worldPositions, tempVec3a$10);
8875
+ const center = math.getPositionsCenter(worldPositions, tempVec3a$11);
8876
8876
 
8877
8877
  const rtcCenterX = Math.round(center[0] / cellSize) * cellSize;
8878
8878
  const rtcCenterY = Math.round(center[1] / cellSize) * cellSize;
@@ -8908,7 +8908,7 @@ function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize =
8908
8908
  */
8909
8909
  function getPlaneRTCPos(dist, dir, rtcCenter, rtcPlanePos) {
8910
8910
  const rtcCenterToPlaneDist = math.dotVec3(dir, rtcCenter) + dist;
8911
- const dirNormalized = math.normalizeVec3(dir, tempVec3a$10);
8911
+ const dirNormalized = math.normalizeVec3(dir, tempVec3a$11);
8912
8912
  math.mulVec3Scalar(dirNormalized, -rtcCenterToPlaneDist, rtcPlanePos);
8913
8913
  return rtcPlanePos;
8914
8914
  }
@@ -11002,9 +11002,9 @@ class Annotation extends Marker {
11002
11002
  }
11003
11003
  }
11004
11004
 
11005
- const tempVec3a$$ = math.vec3();
11006
- const tempVec3b$9 = math.vec3();
11007
- const tempVec3c$6 = math.vec3();
11005
+ const tempVec3a$10 = math.vec3();
11006
+ const tempVec3b$a = math.vec3();
11007
+ const tempVec3c$7 = math.vec3();
11008
11008
 
11009
11009
  /**
11010
11010
  * {@link Viewer} plugin that creates {@link Annotation}s.
@@ -11480,9 +11480,9 @@ class AnnotationsPlugin extends Plugin {
11480
11480
  if (!pickResult.worldPos || !pickResult.worldNormal) {
11481
11481
  this.error("Param 'pickResult' does not have both worldPos and worldNormal");
11482
11482
  } else {
11483
- const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$$);
11484
- const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$9);
11485
- const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$6);
11483
+ const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$10);
11484
+ const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$a);
11485
+ const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$7);
11486
11486
  worldPos = offsetWorldPos;
11487
11487
  entity = pickResult.entity;
11488
11488
  }
@@ -14139,7 +14139,7 @@ class OcclusionLayer {
14139
14139
  const MARKER_COLOR = math.vec3([1.0, 0.0, 0.0]);
14140
14140
  const POINT_SIZE = 20;
14141
14141
 
14142
- const tempVec3a$_ = math.vec3();
14142
+ const tempVec3a$$ = math.vec3();
14143
14143
 
14144
14144
  /**
14145
14145
  * Manages occlusion testing. Private member of a Renderer.
@@ -14486,7 +14486,7 @@ class OcclusionTester {
14486
14486
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
14487
14487
  if (active) {
14488
14488
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
14489
- gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$_));
14489
+ gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$$));
14490
14490
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
14491
14491
  }
14492
14492
  }
@@ -14940,7 +14940,7 @@ const sampleOffsetsVert = new Float32Array(createSampleOffsets(KERNEL_RADIUS + 1
14940
14940
  const sampleOffsetsHor = new Float32Array(createSampleOffsets(KERNEL_RADIUS + 1, [1, 0]));
14941
14941
  const sampleWeights = new Float32Array(createSampleWeights(KERNEL_RADIUS + 1, blurStdDev));
14942
14942
 
14943
- const tempVec2a = new Float32Array(2);
14943
+ const tempVec2a$1 = new Float32Array(2);
14944
14944
 
14945
14945
  /**
14946
14946
  * SAO implementation inspired from previous SAO work in THREE.js by ludobaka / ludobaka.github.io and bhouston
@@ -15193,10 +15193,10 @@ class SAODepthLimitedBlurRenderer {
15193
15193
 
15194
15194
  program.bind();
15195
15195
 
15196
- tempVec2a[0] = viewportWidth;
15197
- tempVec2a[1] = viewportHeight;
15196
+ tempVec2a$1[0] = viewportWidth;
15197
+ tempVec2a$1[1] = viewportHeight;
15198
15198
 
15199
- gl.uniform2fv(this._uViewport, tempVec2a);
15199
+ gl.uniform2fv(this._uViewport, tempVec2a$1);
15200
15200
  gl.uniform1f(this._uCameraNear, near);
15201
15201
  gl.uniform1f(this._uCameraFar, far);
15202
15202
 
@@ -19217,8 +19217,8 @@ class CustomProjection extends Component {
19217
19217
  }
19218
19218
 
19219
19219
  const tempVec3$5 = math.vec3();
19220
- const tempVec3b$8 = math.vec3();
19221
- const tempVec3c$5 = math.vec3();
19220
+ const tempVec3b$9 = math.vec3();
19221
+ const tempVec3c$6 = math.vec3();
19222
19222
  const tempVec3d$3 = math.vec3();
19223
19223
  const tempVec3e$2 = math.vec3();
19224
19224
  const tempVec3f$2 = math.vec3();
@@ -19527,8 +19527,8 @@ class Camera extends Component {
19527
19527
  orbitYaw(angleInc) {
19528
19528
  let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3$5);
19529
19529
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
19530
- lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$8);
19531
- this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$5); // Set eye position as 'look' plus 'eye' vector
19530
+ lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$9);
19531
+ this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$6); // Set eye position as 'look' plus 'eye' vector
19532
19532
  this.up = math.transformPoint3(tempMat, this._up, tempVec3d$3); // Rotate 'up' vector
19533
19533
  }
19534
19534
 
@@ -19545,7 +19545,7 @@ class Camera extends Component {
19545
19545
  }
19546
19546
  }
19547
19547
  let eye2 = math.subVec3(this._eye, this._look, tempVec3$5);
19548
- const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$8), math.normalizeVec3(this._up, tempVec3c$5));
19548
+ const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$9), math.normalizeVec3(this._up, tempVec3c$6));
19549
19549
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
19550
19550
  eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$3);
19551
19551
  this.up = math.transformPoint3(tempMat, this._up, tempVec3e$2);
@@ -19560,8 +19560,8 @@ class Camera extends Component {
19560
19560
  yaw(angleInc) {
19561
19561
  let look2 = math.subVec3(this._look, this._eye, tempVec3$5);
19562
19562
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
19563
- look2 = math.transformPoint3(tempMat, look2, tempVec3b$8);
19564
- this.look = math.addVec3(look2, this._eye, tempVec3c$5);
19563
+ look2 = math.transformPoint3(tempMat, look2, tempVec3b$9);
19564
+ this.look = math.addVec3(look2, this._eye, tempVec3c$6);
19565
19565
  if (this._gimbalLock) {
19566
19566
  this.up = math.transformPoint3(tempMat, this._up, tempVec3d$3);
19567
19567
  }
@@ -19580,7 +19580,7 @@ class Camera extends Component {
19580
19580
  }
19581
19581
  }
19582
19582
  let look2 = math.subVec3(this._look, this._eye, tempVec3$5);
19583
- const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$8), math.normalizeVec3(this._up, tempVec3c$5));
19583
+ const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$9), math.normalizeVec3(this._up, tempVec3c$6));
19584
19584
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
19585
19585
  this.up = math.transformPoint3(tempMat, this._up, tempVec3f$2);
19586
19586
  look2 = math.transformPoint3(tempMat, look2, tempVec3d$3);
@@ -19597,14 +19597,14 @@ class Camera extends Component {
19597
19597
  const vec = [0, 0, 0];
19598
19598
  let v;
19599
19599
  if (pan[0] !== 0) {
19600
- const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$8));
19600
+ const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$9));
19601
19601
  v = math.mulVec3Scalar(left, pan[0]);
19602
19602
  vec[0] += v[0];
19603
19603
  vec[1] += v[1];
19604
19604
  vec[2] += v[2];
19605
19605
  }
19606
19606
  if (pan[1] !== 0) {
19607
- v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$5), pan[1]);
19607
+ v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$6), pan[1]);
19608
19608
  vec[0] += v[0];
19609
19609
  vec[1] += v[1];
19610
19610
  vec[2] += v[2];
@@ -19626,12 +19626,12 @@ class Camera extends Component {
19626
19626
  */
19627
19627
  zoom(delta) {
19628
19628
  const vec = math.subVec3(this._eye, this._look, tempVec3$5);
19629
- const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$8));
19629
+ const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$9));
19630
19630
  const newLenLook = Math.abs(lenLook + delta);
19631
19631
  if (newLenLook < 0.5) {
19632
19632
  return;
19633
19633
  }
19634
- const dir = math.normalizeVec3(vec, tempVec3c$5);
19634
+ const dir = math.normalizeVec3(vec, tempVec3c$6);
19635
19635
  this.eye = math.addVec3(this._look, math.mulVec3Scalar(dir, newLenLook), tempVec3d$3);
19636
19636
  }
19637
19637
 
@@ -29218,7 +29218,7 @@ function buildFragmentDraw(mesh) {
29218
29218
  * @author xeolabs / https://github.com/xeolabs
29219
29219
  */
29220
29220
 
29221
- const tempVec3a$Z = math.vec3();
29221
+ const tempVec3a$_ = math.vec3();
29222
29222
 
29223
29223
  const ids$2 = new Map$1({});
29224
29224
 
@@ -29317,7 +29317,7 @@ DrawRenderer.prototype.drawMesh = function (frameCtx, mesh) {
29317
29317
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
29318
29318
  if (active) {
29319
29319
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
29320
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Z) : sectionPlane.pos);
29320
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$_) : sectionPlane.pos);
29321
29321
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
29322
29322
  }
29323
29323
  }
@@ -30469,7 +30469,7 @@ function buildFragment$5(mesh) {
30469
30469
 
30470
30470
  const ids$1 = new Map$1({});
30471
30471
 
30472
- const tempVec3a$Y = math.vec3();
30472
+ const tempVec3a$Z = math.vec3();
30473
30473
 
30474
30474
  /**
30475
30475
  * @private
@@ -30553,7 +30553,7 @@ EmphasisFillRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
30553
30553
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
30554
30554
  if (active) {
30555
30555
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
30556
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Y) : sectionPlane.pos);
30556
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Z) : sectionPlane.pos);
30557
30557
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
30558
30558
  }
30559
30559
  }
@@ -30900,7 +30900,7 @@ function buildFragment$4(mesh) {
30900
30900
 
30901
30901
  const ids = new Map$1({});
30902
30902
 
30903
- const tempVec3a$X = math.vec3();
30903
+ const tempVec3a$Y = math.vec3();
30904
30904
 
30905
30905
  /**
30906
30906
  * @private
@@ -30983,7 +30983,7 @@ EmphasisEdgesRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
30983
30983
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
30984
30984
  if (active) {
30985
30985
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
30986
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$X) : sectionPlane.pos);
30986
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Y) : sectionPlane.pos);
30987
30987
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
30988
30988
  }
30989
30989
  }
@@ -31288,7 +31288,7 @@ function buildFragment$3(mesh) {
31288
31288
  * @author xeolabs / https://github.com/xeolabs
31289
31289
  */
31290
31290
 
31291
- const tempVec3a$W = math.vec3();
31291
+ const tempVec3a$X = math.vec3();
31292
31292
 
31293
31293
  // No ID, because there is exactly one PickMeshRenderer per scene
31294
31294
 
@@ -31372,7 +31372,7 @@ PickMeshRenderer.prototype.drawMesh = function (frameCtx, mesh) {
31372
31372
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
31373
31373
  if (active) {
31374
31374
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
31375
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$W) : sectionPlane.pos);
31375
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$X) : sectionPlane.pos);
31376
31376
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
31377
31377
  }
31378
31378
  }
@@ -31615,7 +31615,7 @@ function buildFragment$2(mesh) {
31615
31615
  * @author xeolabs / https://github.com/xeolabs
31616
31616
  */
31617
31617
 
31618
- const tempVec3a$V = math.vec3();
31618
+ const tempVec3a$W = math.vec3();
31619
31619
 
31620
31620
  /**
31621
31621
  * @private
@@ -31707,7 +31707,7 @@ PickTriangleRenderer.prototype.drawMesh = function (frameCtx, mesh) {
31707
31707
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
31708
31708
  if (active) {
31709
31709
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
31710
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$V) : sectionPlane.pos);
31710
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$W) : sectionPlane.pos);
31711
31711
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
31712
31712
  }
31713
31713
  }
@@ -31950,7 +31950,7 @@ function buildFragment$1(mesh) {
31950
31950
  * @author xeolabs / https://github.com/xeolabs
31951
31951
  */
31952
31952
 
31953
- const tempVec3a$U = math.vec3();
31953
+ const tempVec3a$V = math.vec3();
31954
31954
 
31955
31955
  // No ID, because there is exactly one PickMeshRenderer per scene
31956
31956
 
@@ -32058,7 +32058,7 @@ OcclusionRenderer.prototype.drawMesh = function (frameCtx, mesh) {
32058
32058
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
32059
32059
  if (active) {
32060
32060
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
32061
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$U) : sectionPlane.pos);
32061
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$V) : sectionPlane.pos);
32062
32062
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
32063
32063
  }
32064
32064
  }
@@ -39402,8 +39402,8 @@ class DistanceMeasurementsPlugin extends Plugin {
39402
39402
  * * hide physically-based materials (switching to non-PBR),
39403
39403
  * * hide transparent objects, and
39404
39404
  * * scale the canvas resolution by 0.5, causing the GPU to render 75% less pixels.
39405
+ * <br>
39405
39406
  *
39406
- * <br><br>
39407
39407
  * We'll also configure a 0.5 second delay before we transition back to high-quality each time we stop ineracting, so that we're
39408
39408
  * not continually flipping between low and high quality as we interact. Since we're only rendering ambient shadows when not interacting, we'll also treat ourselves
39409
39409
  * to expensive, high-quality SAO settings, that we wouldn't normally configure for an interactive SAO effect.
@@ -40253,7 +40253,7 @@ const RENDER_PASSES = {
40253
40253
  };
40254
40254
 
40255
40255
  const tempVec4$5 = math.vec4();
40256
- const tempVec3a$T = math.vec3();
40256
+ const tempVec3a$U = math.vec3();
40257
40257
 
40258
40258
  /**
40259
40259
  * @private
@@ -40318,7 +40318,7 @@ class TrianglesBatchingColorRenderer {
40318
40318
  if (active) {
40319
40319
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
40320
40320
  if (origin) {
40321
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$T);
40321
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$U);
40322
40322
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
40323
40323
  } else {
40324
40324
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -40759,7 +40759,7 @@ class TrianglesBatchingColorRenderer {
40759
40759
  }
40760
40760
 
40761
40761
  const tempVec4$4 = math.vec4();
40762
- const tempVec3a$S = math.vec3();
40762
+ const tempVec3a$T = math.vec3();
40763
40763
 
40764
40764
  /**
40765
40765
  * @private
@@ -40821,7 +40821,7 @@ class TrianglesBatchingFlatColorRenderer {
40821
40821
  if (active) {
40822
40822
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
40823
40823
  if (origin) {
40824
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$S);
40824
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$T);
40825
40825
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
40826
40826
  } else {
40827
40827
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -41250,7 +41250,7 @@ class TrianglesBatchingFlatColorRenderer {
41250
41250
  }
41251
41251
 
41252
41252
  const defaultColor$4 = new Float32Array([1, 1, 1]);
41253
- const tempVec3a$R = math.vec3();
41253
+ const tempVec3a$S = math.vec3();
41254
41254
 
41255
41255
  /**
41256
41256
  * @private
@@ -41334,7 +41334,7 @@ class TrianglesBatchingSilhouetteRenderer {
41334
41334
  if (active) {
41335
41335
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
41336
41336
  if (origin) {
41337
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$R);
41337
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$S);
41338
41338
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
41339
41339
  } else {
41340
41340
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -41571,7 +41571,7 @@ class TrianglesBatchingSilhouetteRenderer {
41571
41571
  }
41572
41572
  }
41573
41573
 
41574
- const tempVec3a$Q = math.vec3();
41574
+ const tempVec3a$R = math.vec3();
41575
41575
  const defaultColor$3 = new Float32Array([0,0,0,1]);
41576
41576
 
41577
41577
  /**
@@ -41654,7 +41654,7 @@ class TrianglesBatchingEdgesRenderer {
41654
41654
  if (active) {
41655
41655
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
41656
41656
  if (origin) {
41657
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Q);
41657
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$R);
41658
41658
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
41659
41659
  } else {
41660
41660
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -41892,7 +41892,7 @@ class TrianglesBatchingEdgesRenderer {
41892
41892
  }
41893
41893
  }
41894
41894
 
41895
- const tempVec3a$P = math.vec3();
41895
+ const tempVec3a$Q = math.vec3();
41896
41896
 
41897
41897
  /**
41898
41898
  * @private
@@ -41952,7 +41952,7 @@ class TrianglesBatchingEdgesColorRenderer {
41952
41952
  if (active) {
41953
41953
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
41954
41954
  if (origin) {
41955
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$P);
41955
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Q);
41956
41956
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
41957
41957
  } else {
41958
41958
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -42192,7 +42192,7 @@ class TrianglesBatchingEdgesColorRenderer {
42192
42192
  }
42193
42193
  }
42194
42194
 
42195
- const tempVec3a$O = math.vec3();
42195
+ const tempVec3a$P = math.vec3();
42196
42196
 
42197
42197
  /**
42198
42198
  * @private
@@ -42258,7 +42258,7 @@ class TrianglesBatchingPickMeshRenderer {
42258
42258
  if (active) {
42259
42259
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
42260
42260
  if (origin) {
42261
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$O);
42261
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$P);
42262
42262
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
42263
42263
  } else {
42264
42264
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -42497,7 +42497,7 @@ class TrianglesBatchingPickMeshRenderer {
42497
42497
  }
42498
42498
  }
42499
42499
 
42500
- const tempVec3a$N = math.vec3();
42500
+ const tempVec3a$O = math.vec3();
42501
42501
 
42502
42502
  /**
42503
42503
  * @private
@@ -42568,7 +42568,7 @@ class TrianglesBatchingPickDepthRenderer {
42568
42568
  if (active) {
42569
42569
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
42570
42570
  if (origin) {
42571
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$N);
42571
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$O);
42572
42572
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
42573
42573
  } else {
42574
42574
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -42816,7 +42816,7 @@ class TrianglesBatchingPickDepthRenderer {
42816
42816
  }
42817
42817
  }
42818
42818
 
42819
- const tempVec3a$M = math.vec3();
42819
+ const tempVec3a$N = math.vec3();
42820
42820
 
42821
42821
  /**
42822
42822
  * @private
@@ -42884,7 +42884,7 @@ class TrianglesBatchingPickNormalsRenderer {
42884
42884
  if (active) {
42885
42885
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
42886
42886
  if (origin) {
42887
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$M);
42887
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$N);
42888
42888
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
42889
42889
  } else {
42890
42890
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -43116,7 +43116,7 @@ class TrianglesBatchingPickNormalsRenderer {
43116
43116
  }
43117
43117
  }
43118
43118
 
43119
- const tempVec3a$L = math.vec3();
43119
+ const tempVec3a$M = math.vec3();
43120
43120
 
43121
43121
  /**
43122
43122
  * @private
@@ -43176,7 +43176,7 @@ class TrianglesBatchingOcclusionRenderer {
43176
43176
  if (active) {
43177
43177
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
43178
43178
  if (origin) {
43179
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$L);
43179
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$M);
43180
43180
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
43181
43181
  } else {
43182
43182
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -43407,7 +43407,7 @@ class TrianglesBatchingOcclusionRenderer {
43407
43407
  }
43408
43408
  }
43409
43409
 
43410
- const tempVec3a$K = math.vec3();
43410
+ const tempVec3a$L = math.vec3();
43411
43411
 
43412
43412
  /**
43413
43413
  * @private
@@ -43467,7 +43467,7 @@ class TrianglesBatchingDepthRenderer {
43467
43467
  if (active) {
43468
43468
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
43469
43469
  if (origin) {
43470
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$K);
43470
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$L);
43471
43471
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
43472
43472
  } else {
43473
43473
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -43703,7 +43703,7 @@ class TrianglesBatchingDepthRenderer {
43703
43703
  }
43704
43704
  }
43705
43705
 
43706
- const tempVec3a$J = math.vec3();
43706
+ const tempVec3a$K = math.vec3();
43707
43707
 
43708
43708
  /**
43709
43709
  * @private
@@ -43766,7 +43766,7 @@ class TrianglesBatchingNormalsRenderer {
43766
43766
  if (active) {
43767
43767
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
43768
43768
  if (origin) {
43769
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$J);
43769
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$K);
43770
43770
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
43771
43771
  } else {
43772
43772
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -44014,7 +44014,7 @@ class TrianglesBatchingNormalsRenderer {
44014
44014
  }
44015
44015
  }
44016
44016
 
44017
- const tempVec3a$I = math.vec3();
44017
+ const tempVec3a$J = math.vec3();
44018
44018
 
44019
44019
  /**
44020
44020
  * Renders BatchingLayer fragment depths to a shadow map.
@@ -44083,7 +44083,7 @@ class TrianglesBatchingShadowRenderer {
44083
44083
  if (active) {
44084
44084
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
44085
44085
  if (origin) {
44086
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$I);
44086
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$J);
44087
44087
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
44088
44088
  } else {
44089
44089
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -44252,7 +44252,7 @@ class TrianglesBatchingShadowRenderer {
44252
44252
  }
44253
44253
 
44254
44254
  const tempVec4$3 = math.vec4();
44255
- const tempVec3a$H = math.vec3();
44255
+ const tempVec3a$I = math.vec3();
44256
44256
 
44257
44257
  const TEXTURE_DECODE_FUNCS$1 = {
44258
44258
  "linear": "linearToLinear",
@@ -44323,7 +44323,7 @@ class TrianglesBatchingColorQualityRenderer {
44323
44323
  if (active) {
44324
44324
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
44325
44325
  if (origin) {
44326
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$H);
44326
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$I);
44327
44327
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
44328
44328
  } else {
44329
44329
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -45062,7 +45062,7 @@ class TrianglesBatchingColorQualityRenderer {
45062
45062
  }
45063
45063
  }
45064
45064
 
45065
- const tempVec3a$G = math.vec3();
45065
+ const tempVec3a$H = math.vec3();
45066
45066
 
45067
45067
  /**
45068
45068
  * @private
@@ -45129,7 +45129,7 @@ class TrianglesBatchingPickNormalsFlatRenderer {
45129
45129
  if (active) {
45130
45130
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
45131
45131
  if (origin) {
45132
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$G);
45132
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$H);
45133
45133
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
45134
45134
  } else {
45135
45135
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -45854,9 +45854,9 @@ const tempVec4b$9 = math.vec4([0, 0, 0, 1]);
45854
45854
  const tempVec4c$7 = math.vec4([0, 0, 0, 1]);
45855
45855
  const tempOBB3$2 = math.OBB3();
45856
45856
 
45857
- const tempVec3a$F = math.vec3();
45858
- const tempVec3b$7 = math.vec3();
45859
- const tempVec3c$4 = math.vec3();
45857
+ const tempVec3a$G = math.vec3();
45858
+ const tempVec3b$8 = math.vec3();
45859
+ const tempVec3c$5 = math.vec3();
45860
45860
  const tempVec3d$2 = math.vec3();
45861
45861
  const tempVec3e$1 = math.vec3();
45862
45862
  const tempVec3f$1 = math.vec3();
@@ -46943,10 +46943,10 @@ class TrianglesBatchingLayer {
46943
46943
  const origin = state.origin;
46944
46944
  const offset = portion.offset;
46945
46945
 
46946
- const rtcRayOrigin = tempVec3a$F;
46947
- const rtcRayDir = tempVec3b$7;
46946
+ const rtcRayOrigin = tempVec3a$G;
46947
+ const rtcRayDir = tempVec3b$8;
46948
46948
 
46949
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$4) : worldRayOrigin); // World -> RTC
46949
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$5) : worldRayOrigin); // World -> RTC
46950
46950
  rtcRayDir.set(worldRayDir);
46951
46951
 
46952
46952
  if (offset) {
@@ -47067,7 +47067,7 @@ class TrianglesBatchingLayer {
47067
47067
  }
47068
47068
 
47069
47069
  const tempVec4$2 = math.vec4();
47070
- const tempVec3a$E = math.vec3();
47070
+ const tempVec3a$F = math.vec3();
47071
47071
 
47072
47072
  /**
47073
47073
  * @private
@@ -47133,7 +47133,7 @@ class TrianglesInstancingColorRenderer {
47133
47133
  if (active) {
47134
47134
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
47135
47135
  if (origin) {
47136
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$E);
47136
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$F);
47137
47137
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
47138
47138
  } else {
47139
47139
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -47624,7 +47624,7 @@ class TrianglesInstancingColorRenderer {
47624
47624
  }
47625
47625
 
47626
47626
  const tempVec4$1 = math.vec4();
47627
- const tempVec3a$D = math.vec3();
47627
+ const tempVec3a$E = math.vec3();
47628
47628
 
47629
47629
  /**
47630
47630
  * @private
@@ -47686,7 +47686,7 @@ class TrianglesInstancingFlatColorRenderer {
47686
47686
  if (active) {
47687
47687
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
47688
47688
  if (origin) {
47689
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$D);
47689
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$E);
47690
47690
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
47691
47691
  } else {
47692
47692
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -48149,7 +48149,7 @@ class TrianglesInstancingFlatColorRenderer {
48149
48149
  }
48150
48150
  }
48151
48151
 
48152
- const tempVec3a$C = math.vec3();
48152
+ const tempVec3a$D = math.vec3();
48153
48153
 
48154
48154
  /**
48155
48155
  * @private
@@ -48232,7 +48232,7 @@ class TrianglesInstancingSilhouetteRenderer {
48232
48232
  if (active) {
48233
48233
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
48234
48234
  if (origin) {
48235
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C);
48235
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$D);
48236
48236
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
48237
48237
  } else {
48238
48238
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -48502,7 +48502,7 @@ class TrianglesInstancingSilhouetteRenderer {
48502
48502
  }
48503
48503
  }
48504
48504
 
48505
- const tempVec3a$B = math.vec3();
48505
+ const tempVec3a$C = math.vec3();
48506
48506
  const defaultColor$2 = new Float32Array([0,0,0,1]);
48507
48507
 
48508
48508
  /**
@@ -48586,7 +48586,7 @@ class TrianglesInstancingEdgesRenderer {
48586
48586
  if (active) {
48587
48587
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
48588
48588
  if (origin) {
48589
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$B);
48589
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C);
48590
48590
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
48591
48591
  } else {
48592
48592
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -48857,7 +48857,7 @@ class TrianglesInstancingEdgesRenderer {
48857
48857
  }
48858
48858
  }
48859
48859
 
48860
- const tempVec3a$A = math.vec3();
48860
+ const tempVec3a$B = math.vec3();
48861
48861
 
48862
48862
  /**
48863
48863
  * @private
@@ -48918,7 +48918,7 @@ class TrianglesInstancingEdgesColorRenderer {
48918
48918
  if (active) {
48919
48919
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
48920
48920
  if (origin) {
48921
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$A);
48921
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$B);
48922
48922
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
48923
48923
  } else {
48924
48924
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -49194,7 +49194,7 @@ class TrianglesInstancingEdgesColorRenderer {
49194
49194
  }
49195
49195
  }
49196
49196
 
49197
- const tempVec3a$z = math.vec3();
49197
+ const tempVec3a$A = math.vec3();
49198
49198
 
49199
49199
  /**
49200
49200
  * @private
@@ -49297,7 +49297,7 @@ class TrianglesInstancingPickMeshRenderer {
49297
49297
  if (active) {
49298
49298
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
49299
49299
  if (origin) {
49300
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$z);
49300
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$A);
49301
49301
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
49302
49302
  } else {
49303
49303
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -49543,7 +49543,7 @@ class TrianglesInstancingPickMeshRenderer {
49543
49543
  }
49544
49544
  }
49545
49545
 
49546
- const tempVec3a$y = math.vec3();
49546
+ const tempVec3a$z = math.vec3();
49547
49547
 
49548
49548
  /**
49549
49549
  * @private
@@ -49620,7 +49620,7 @@ class TrianglesInstancingPickDepthRenderer {
49620
49620
  if (active) {
49621
49621
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
49622
49622
  if (origin) {
49623
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$y);
49623
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$z);
49624
49624
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
49625
49625
  } else {
49626
49626
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -49901,7 +49901,7 @@ class TrianglesInstancingPickDepthRenderer {
49901
49901
  }
49902
49902
  }
49903
49903
 
49904
- const tempVec3a$x = math.vec3();
49904
+ const tempVec3a$y = math.vec3();
49905
49905
 
49906
49906
  /**
49907
49907
  * @private
@@ -49978,7 +49978,7 @@ class TrianglesInstancingPickNormalsRenderer {
49978
49978
  if (active) {
49979
49979
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
49980
49980
  if (origin) {
49981
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$x);
49981
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$y);
49982
49982
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
49983
49983
  } else {
49984
49984
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -50264,7 +50264,7 @@ class TrianglesInstancingPickNormalsRenderer {
50264
50264
  }
50265
50265
  }
50266
50266
 
50267
- const tempVec3a$w = math.vec3();
50267
+ const tempVec3a$x = math.vec3();
50268
50268
 
50269
50269
  /**
50270
50270
  * @private
@@ -50325,7 +50325,7 @@ class TrianglesInstancingOcclusionRenderer {
50325
50325
  if (active) {
50326
50326
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
50327
50327
  if (origin) {
50328
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$w);
50328
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$x);
50329
50329
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
50330
50330
  } else {
50331
50331
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -50593,7 +50593,7 @@ class TrianglesInstancingOcclusionRenderer {
50593
50593
  }
50594
50594
  }
50595
50595
 
50596
- const tempVec3a$v = math.vec3();
50596
+ const tempVec3a$w = math.vec3();
50597
50597
 
50598
50598
  /**
50599
50599
  * @private
@@ -50654,7 +50654,7 @@ class TrianglesInstancingDepthRenderer {
50654
50654
  if (active) {
50655
50655
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
50656
50656
  if (origin) {
50657
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$v);
50657
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$w);
50658
50658
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
50659
50659
  } else {
50660
50660
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -50934,7 +50934,7 @@ class TrianglesInstancingDepthRenderer {
50934
50934
  }
50935
50935
  }
50936
50936
 
50937
- const tempVec3a$u = math.vec3();
50937
+ const tempVec3a$v = math.vec3();
50938
50938
 
50939
50939
  /**
50940
50940
  * @private
@@ -50998,7 +50998,7 @@ class TrianglesInstancingNormalsRenderer {
50998
50998
  if (active) {
50999
50999
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
51000
51000
  if (origin) {
51001
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$u);
51001
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$v);
51002
51002
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
51003
51003
  } else {
51004
51004
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -51288,7 +51288,7 @@ class TrianglesInstancingNormalsRenderer {
51288
51288
  }
51289
51289
  }
51290
51290
 
51291
- const tempVec3a$t = math.vec3();
51291
+ const tempVec3a$u = math.vec3();
51292
51292
 
51293
51293
  /**
51294
51294
  * Renders InstancingLayer fragment depths to a shadow map.
@@ -51375,7 +51375,7 @@ class TrianglesInstancingShadowRenderer {
51375
51375
  if (active) {
51376
51376
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
51377
51377
  if (origin) {
51378
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$t);
51378
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$u);
51379
51379
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
51380
51380
  } else {
51381
51381
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -51568,7 +51568,7 @@ class TrianglesInstancingShadowRenderer {
51568
51568
  }
51569
51569
 
51570
51570
  const tempVec4 = math.vec4();
51571
- const tempVec3a$s = math.vec3();
51571
+ const tempVec3a$t = math.vec3();
51572
51572
 
51573
51573
  const TEXTURE_DECODE_FUNCS = {
51574
51574
  "linear": "linearToLinear",
@@ -51640,7 +51640,7 @@ class TrianglesInstancingColorQualityRenderer {
51640
51640
  if (active) {
51641
51641
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
51642
51642
  if (origin) {
51643
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$s);
51643
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$t);
51644
51644
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
51645
51645
  } else {
51646
51646
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -52428,7 +52428,7 @@ class TrianglesInstancingColorQualityRenderer {
52428
52428
  }
52429
52429
  }
52430
52430
 
52431
- const tempVec3a$r = math.vec3();
52431
+ const tempVec3a$s = math.vec3();
52432
52432
 
52433
52433
  /**
52434
52434
  * @private
@@ -52503,7 +52503,7 @@ class TrianglesInstancingPickNormalsFlatRenderer {
52503
52503
  if (active) {
52504
52504
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
52505
52505
  if (origin) {
52506
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$r);
52506
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$s);
52507
52507
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
52508
52508
  } else {
52509
52509
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -53037,9 +53037,9 @@ const tempVec4b$8 = math.vec4([0, 0, 0, 1]);
53037
53037
  const tempVec4c$6 = math.vec4([0, 0, 0, 1]);
53038
53038
  const tempVec3fa$2 = new Float32Array(3);
53039
53039
 
53040
- const tempVec3a$q = math.vec3();
53041
- const tempVec3b$6 = math.vec3();
53042
- const tempVec3c$3 = math.vec3();
53040
+ const tempVec3a$r = math.vec3();
53041
+ const tempVec3b$7 = math.vec3();
53042
+ const tempVec3c$4 = math.vec3();
53043
53043
  const tempVec3d$1 = math.vec3();
53044
53044
  const tempVec3e = math.vec3();
53045
53045
  const tempVec3f = math.vec3();
@@ -54003,10 +54003,10 @@ class TrianglesInstancingLayer {
54003
54003
  const origin = state.origin;
54004
54004
  const offset = portion.offset;
54005
54005
 
54006
- const rtcRayOrigin = tempVec3a$q;
54007
- const rtcRayDir = tempVec3b$6;
54006
+ const rtcRayOrigin = tempVec3a$r;
54007
+ const rtcRayDir = tempVec3b$7;
54008
54008
 
54009
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$3) : worldRayOrigin); // World -> RTC
54009
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$4) : worldRayOrigin); // World -> RTC
54010
54010
  rtcRayDir.set(worldRayDir);
54011
54011
 
54012
54012
  if (offset) {
@@ -54153,7 +54153,7 @@ class TrianglesInstancingLayer {
54153
54153
  }
54154
54154
  }
54155
54155
 
54156
- const tempVec3a$p = math.vec3();
54156
+ const tempVec3a$q = math.vec3();
54157
54157
 
54158
54158
  /**
54159
54159
  * @private
@@ -54215,7 +54215,7 @@ class LinesBatchingColorRenderer {
54215
54215
  if (active) {
54216
54216
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
54217
54217
  if (origin) {
54218
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$p);
54218
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$q);
54219
54219
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
54220
54220
  } else {
54221
54221
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -54445,7 +54445,7 @@ class LinesBatchingColorRenderer {
54445
54445
  }
54446
54446
 
54447
54447
  const defaultColor$1 = new Float32Array([1, 1, 1]);
54448
- const tempVec3a$o = math.vec3();
54448
+ const tempVec3a$p = math.vec3();
54449
54449
 
54450
54450
  /**
54451
54451
  * @private
@@ -54531,7 +54531,7 @@ class LinesBatchingSilhouetteRenderer {
54531
54531
  if (active) {
54532
54532
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
54533
54533
  if (origin) {
54534
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$o);
54534
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$p);
54535
54535
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
54536
54536
  } else {
54537
54537
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -55627,7 +55627,7 @@ class LinesBatchingLayer {
55627
55627
  }
55628
55628
  }
55629
55629
 
55630
- const tempVec3a$n = math.vec3();
55630
+ const tempVec3a$o = math.vec3();
55631
55631
 
55632
55632
  /**
55633
55633
  * @private
@@ -55690,7 +55690,7 @@ class LinesInstancingColorRenderer {
55690
55690
  if (active) {
55691
55691
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
55692
55692
  if (origin) {
55693
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n);
55693
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$o);
55694
55694
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
55695
55695
  } else {
55696
55696
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -55987,7 +55987,7 @@ class LinesInstancingColorRenderer {
55987
55987
  }
55988
55988
  }
55989
55989
 
55990
- const tempVec3a$m = math.vec3();
55990
+ const tempVec3a$n = math.vec3();
55991
55991
 
55992
55992
  /**
55993
55993
  * @private
@@ -56072,7 +56072,7 @@ class LinesInstancingSilhouetteRenderer {
56072
56072
  if (active) {
56073
56073
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
56074
56074
  if (origin) {
56075
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m);
56075
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n);
56076
56076
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
56077
56077
  } else {
56078
56078
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -57089,7 +57089,7 @@ class LinesInstancingLayer {
57089
57089
  }
57090
57090
  }
57091
57091
 
57092
- const tempVec3a$l = math.vec3();
57092
+ const tempVec3a$m = math.vec3();
57093
57093
 
57094
57094
  /**
57095
57095
  * @private
@@ -57150,7 +57150,7 @@ class PointsBatchingColorRenderer {
57150
57150
  if (active) {
57151
57151
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
57152
57152
  if (origin) {
57153
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l);
57153
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m);
57154
57154
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
57155
57155
  } else {
57156
57156
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -57449,7 +57449,7 @@ class PointsBatchingColorRenderer {
57449
57449
  }
57450
57450
 
57451
57451
  const defaultColor = new Float32Array([1, 1, 1]);
57452
- const tempVec3a$k = math.vec3();
57452
+ const tempVec3a$l = math.vec3();
57453
57453
 
57454
57454
  /**
57455
57455
  * @private
@@ -57534,7 +57534,7 @@ class PointsBatchingSilhouetteRenderer {
57534
57534
  if (active) {
57535
57535
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
57536
57536
  if (origin) {
57537
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k);
57537
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l);
57538
57538
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
57539
57539
  } else {
57540
57540
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -57789,7 +57789,7 @@ class PointsBatchingSilhouetteRenderer {
57789
57789
  }
57790
57790
  }
57791
57791
 
57792
- const tempVec3a$j = math.vec3();
57792
+ const tempVec3a$k = math.vec3();
57793
57793
 
57794
57794
  /**
57795
57795
  * @private
@@ -57856,7 +57856,7 @@ class PointsBatchingPickMeshRenderer {
57856
57856
  if (active) {
57857
57857
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
57858
57858
  if (origin) {
57859
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j);
57859
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k);
57860
57860
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
57861
57861
  } else {
57862
57862
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -58114,7 +58114,7 @@ class PointsBatchingPickMeshRenderer {
58114
58114
  }
58115
58115
  }
58116
58116
 
58117
- const tempVec3a$i = math.vec3();
58117
+ const tempVec3a$j = math.vec3();
58118
58118
 
58119
58119
  /**
58120
58120
  * @private
@@ -58186,7 +58186,7 @@ class PointsBatchingPickDepthRenderer {
58186
58186
  if (active) {
58187
58187
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
58188
58188
  if (origin) {
58189
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i);
58189
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j);
58190
58190
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
58191
58191
  } else {
58192
58192
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -58451,7 +58451,7 @@ class PointsBatchingPickDepthRenderer {
58451
58451
  }
58452
58452
  }
58453
58453
 
58454
- const tempVec3a$h = math.vec3();
58454
+ const tempVec3a$i = math.vec3();
58455
58455
 
58456
58456
  /**
58457
58457
  * @private
@@ -58512,7 +58512,7 @@ class PointsBatchingOcclusionRenderer {
58512
58512
  if (active) {
58513
58513
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
58514
58514
  if (origin) {
58515
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
58515
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i);
58516
58516
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
58517
58517
  } else {
58518
58518
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -58897,8 +58897,8 @@ class PointsBatchingBuffer {
58897
58897
  }
58898
58898
  }
58899
58899
 
58900
- const tempVec3a$g = math.vec4();
58901
- const tempVec3b$5 = math.vec4();
58900
+ const tempVec3a$h = math.vec4();
58901
+ const tempVec3b$6 = math.vec4();
58902
58902
  const tempVec4a$5 = math.vec4([0, 0, 0, 1]);
58903
58903
  const tempVec4b$5 = math.vec4([0, 0, 0, 1]);
58904
58904
  const tempVec4c$3 = math.vec4([0, 0, 0, 1]);
@@ -59034,8 +59034,8 @@ class PointsBatchingLayer {
59034
59034
 
59035
59035
  const bounds = geometryCompressionUtils.getPositionsBounds(positions);
59036
59036
 
59037
- const min = geometryCompressionUtils.decompressPosition(bounds.min, this._positionsDecodeMatrix, tempVec3a$g);
59038
- const max = geometryCompressionUtils.decompressPosition(bounds.max, this._positionsDecodeMatrix, tempVec3b$5);
59037
+ const min = geometryCompressionUtils.decompressPosition(bounds.min, this._positionsDecodeMatrix, tempVec3a$h);
59038
+ const max = geometryCompressionUtils.decompressPosition(bounds.max, this._positionsDecodeMatrix, tempVec3b$6);
59039
59039
 
59040
59040
  worldAABB[0] = min[0];
59041
59041
  worldAABB[1] = min[1];
@@ -59661,7 +59661,7 @@ class PointsBatchingLayer {
59661
59661
  }
59662
59662
  }
59663
59663
 
59664
- const tempVec3a$f = math.vec3();
59664
+ const tempVec3a$g = math.vec3();
59665
59665
 
59666
59666
  /**
59667
59667
  * @private
@@ -59730,7 +59730,7 @@ class PointsInstancingColorRenderer {
59730
59730
  if (active) {
59731
59731
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
59732
59732
  if (origin) {
59733
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f);
59733
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g);
59734
59734
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
59735
59735
  } else {
59736
59736
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -60053,7 +60053,7 @@ class PointsInstancingColorRenderer {
60053
60053
  }
60054
60054
  }
60055
60055
 
60056
- const tempVec3a$e = math.vec3();
60056
+ const tempVec3a$f = math.vec3();
60057
60057
 
60058
60058
  /**
60059
60059
  * @private
@@ -60137,7 +60137,7 @@ class PointsInstancingSilhouetteRenderer {
60137
60137
  if (active) {
60138
60138
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
60139
60139
  if (origin) {
60140
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e);
60140
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f);
60141
60141
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
60142
60142
  } else {
60143
60143
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -60428,7 +60428,7 @@ class PointsInstancingSilhouetteRenderer {
60428
60428
  }
60429
60429
  }
60430
60430
 
60431
- const tempVec3a$d = math.vec3();
60431
+ const tempVec3a$e = math.vec3();
60432
60432
 
60433
60433
  /**
60434
60434
  * @private
@@ -60534,7 +60534,7 @@ class PointsInstancingPickMeshRenderer {
60534
60534
  if (active) {
60535
60535
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
60536
60536
  if (origin) {
60537
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
60537
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e);
60538
60538
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
60539
60539
  } else {
60540
60540
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -60798,7 +60798,7 @@ class PointsInstancingPickMeshRenderer {
60798
60798
  }
60799
60799
  }
60800
60800
 
60801
- const tempVec3a$c = math.vec3();
60801
+ const tempVec3a$d = math.vec3();
60802
60802
 
60803
60803
  /**
60804
60804
  * @private
@@ -60876,7 +60876,7 @@ class PointsInstancingPickDepthRenderer {
60876
60876
  if (active) {
60877
60877
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
60878
60878
  if (origin) {
60879
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c);
60879
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
60880
60880
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
60881
60881
  } else {
60882
60882
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -61178,7 +61178,7 @@ class PointsInstancingPickDepthRenderer {
61178
61178
  }
61179
61179
  }
61180
61180
 
61181
- const tempVec3a$b = math.vec3();
61181
+ const tempVec3a$c = math.vec3();
61182
61182
 
61183
61183
  /**
61184
61184
  * @private
@@ -61240,7 +61240,7 @@ class PointsInstancingOcclusionRenderer {
61240
61240
  if (active) {
61241
61241
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
61242
61242
  if (origin) {
61243
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b);
61243
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c);
61244
61244
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
61245
61245
  } else {
61246
61246
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -61542,7 +61542,7 @@ class PointsInstancingOcclusionRenderer {
61542
61542
  }
61543
61543
  }
61544
61544
 
61545
- const tempVec3a$a = math.vec3();
61545
+ const tempVec3a$b = math.vec3();
61546
61546
 
61547
61547
  /**
61548
61548
  * @private
@@ -61604,7 +61604,7 @@ class PointsInstancingDepthRenderer {
61604
61604
  if (active) {
61605
61605
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
61606
61606
  if (origin) {
61607
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$a);
61607
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b);
61608
61608
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
61609
61609
  } else {
61610
61610
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -61902,7 +61902,7 @@ class PointsInstancingDepthRenderer {
61902
61902
  }
61903
61903
  }
61904
61904
 
61905
- const tempVec3a$9 = math.vec3();
61905
+ const tempVec3a$a = math.vec3();
61906
61906
 
61907
61907
  /**
61908
61908
  * Renders InstancingLayer fragment depths to a shadow map.
@@ -61990,7 +61990,7 @@ class PointsInstancingShadowRenderer {
61990
61990
  if (active) {
61991
61991
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
61992
61992
  if (origin) {
61993
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$9);
61993
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$a);
61994
61994
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
61995
61995
  } else {
61996
61996
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -63067,7 +63067,7 @@ class PointsInstancingLayer {
63067
63067
 
63068
63068
  const instancedArraysSupported = WEBGL_INFO$1.SUPPORTED_EXTENSIONS["ANGLE_instanced_arrays"];
63069
63069
 
63070
- const tempVec3a$8 = math.vec3();
63070
+ const tempVec3a$9 = math.vec3();
63071
63071
  const tempMat4$1 = math.mat4();
63072
63072
 
63073
63073
  const defaultScale = math.vec3([1, 1, 1]);
@@ -63091,7 +63091,7 @@ const defaultQuaternion = math.identityQuaternion();
63091
63091
  *
63092
63092
  * For huge models, we have the ````PerformanceModel```` representation, which is optimized to pack large amounts of geometry into memory and render it efficiently using WebGL.
63093
63093
  *
63094
- * ````PerformanceModel```` is the default model representation loaded by {@link GLTFLoaderPlugin} and {@link XKTLoaderPlugin}.
63094
+ * ````PerformanceModel```` is the default model representation loaded by (at least) {@link GLTFLoaderPlugin}, {@link XKTLoaderPlugin} and {@link WebIFCLoaderPlugin}.
63095
63095
  *
63096
63096
  * In this tutorial you'll learn how to use ````PerformanceModel```` to create high-detail content programmatically. Ordinarily you'd be learning about ````PerformanceModel```` if you were writing your own model loader plugins.
63097
63097
  *
@@ -63107,7 +63107,7 @@ const defaultQuaternion = math.identityQuaternion();
63107
63107
  * - [Classifying with Metadata](#classifying-with-metadata)
63108
63108
  * - [Querying Metadata](#querying-metadata)
63109
63109
  * - [Metadata Structure](#metadata-structure)
63110
- * - [RTC Coordinates](#rtc-coordinates)
63110
+ * - [RTC Coordinates](#rtc-coordinates-for-double-precision)
63111
63111
  * - [Example 3: RTC Coordinates with Geometry Instancing](#example-2--rtc-coordinates-with-geometry-instancing)
63112
63112
  * - [Example 4: RTC Coordinates with Geometry Batching](#example-2--rtc-coordinates-with-geometry-batching)
63113
63113
  *
@@ -63636,7 +63636,7 @@ const defaultQuaternion = math.identityQuaternion();
63636
63636
  * Note also that a {@link MetaObject} does not need to have a corresponding
63637
63637
  * {@link Entity} and vice-versa.
63638
63638
  *
63639
- * # RTC Coordinates for 64-Bit Precision
63639
+ * # RTC Coordinates for Double Precision
63640
63640
  *
63641
63641
  * ````PerformanceModel```` can emulate 64-bit precision on GPUs using relative-to-center (RTC) coordinates.
63642
63642
  *
@@ -63654,7 +63654,7 @@ const defaultQuaternion = math.identityQuaternion();
63654
63654
  *
63655
63655
  * ## RTC Coordinates with Geometry Instancing
63656
63656
  *
63657
- * To use RTC with ````PerformanceModel```` geometry instancing, we specify an RTC center for the geometry. Then ````PerformanceModel```` assumes that all meshes that instance that geometry are within the same RTC coordinate system, ie. the meshes ````position```` and ````rotation```` properties are assumed to be relative to the geometry's ````origin````.
63657
+ * To use RTC with ````PerformanceModel```` geometry instancing, we specify an RTC center for the geometry via its ````origin```` parameter. Then ````PerformanceModel```` assumes that all meshes that instance that geometry are within the same RTC coordinate system, ie. the meshes ````position```` and ````rotation```` properties are assumed to be relative to the geometry's ````origin````.
63658
63658
  *
63659
63659
  * For simplicity, our example's meshes all instance the same geometry. Therefore, our example model has only one RTC center.
63660
63660
  *
@@ -63851,7 +63851,106 @@ const defaultQuaternion = math.identityQuaternion();
63851
63851
  * meshIds: ["top"],
63852
63852
  * isObject: true
63853
63853
  * });
63854
- ````
63854
+ * ````
63855
+ *
63856
+ * ## Positioning at World-space coordinates
63857
+ *
63858
+ * To position a PerformanceModel at given double-precision World coordinates, we can
63859
+ * configure the ````origin```` of the PerformanceModel itself. The ````origin```` is a double-precision
63860
+ * 3D World-space position at which the PerformanceModel will be located.
63861
+ *
63862
+ * Note that ````position```` is a single-precision offset relative to ````origin````.
63863
+ *
63864
+ * ````javascript
63865
+ * const origin = [100000000, 0, 100000000];
63866
+ *
63867
+ * const performanceModel = new PerformanceModel(viewer.scene, {
63868
+ * id: "table",
63869
+ * isModel: true,
63870
+ * origin: origin, // Everything in this PerformanceModel is relative to this RTC center
63871
+ * position: [0, 0, 0],
63872
+ * scale: [1, 1, 1],
63873
+ * rotation: [0, 0, 0]
63874
+ * });
63875
+ *
63876
+ * performanceModel.createGeometry({
63877
+ * id: "box",
63878
+ * primitive: "triangles",
63879
+ * positions: [ 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1 ... ],
63880
+ * normals: [ 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, ... ],
63881
+ * indices: [ 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, ... ],
63882
+ * });
63883
+ *
63884
+ * performanceModel.createMesh({
63885
+ * id: "leg1",
63886
+ * geometryId: "box",
63887
+ * position: [-4, -6, -4],
63888
+ * scale: [1, 3, 1],
63889
+ * rotation: [0, 0, 0],
63890
+ * color: [1, 0.3, 0.3]
63891
+ * });
63892
+ *
63893
+ * performanceModel.createEntity({
63894
+ * meshIds: ["leg1"],
63895
+ * isObject: true
63896
+ * });
63897
+ *
63898
+ * performanceModel.createMesh({
63899
+ * id: "leg2",
63900
+ * geometryId: "box",
63901
+ * position: [4, -6, -4],
63902
+ * scale: [1, 3, 1],
63903
+ * rotation: [0, 0, 0],
63904
+ * color: [0.3, 1.0, 0.3]
63905
+ * });
63906
+ *
63907
+ * performanceModel.createEntity({
63908
+ * meshIds: ["leg2"],
63909
+ * isObject: true
63910
+ * });
63911
+ *
63912
+ * performanceModel.createMesh({
63913
+ * id: "leg3",
63914
+ * geometryId: "box",
63915
+ * position: [4, -6, 4],
63916
+ * scale: [1, 3, 1],
63917
+ * rotation: [0, 0, 0],
63918
+ * color: [0.3, 0.3, 1.0]
63919
+ * });
63920
+ *
63921
+ * performanceModel.createEntity({
63922
+ * meshIds: ["leg3"],
63923
+ * isObject: true
63924
+ * });
63925
+ *
63926
+ * performanceModel.createMesh({
63927
+ * id: "leg4",
63928
+ * geometryId: "box",
63929
+ * position: [-4, -6, 4],
63930
+ * scale: [1, 3, 1],
63931
+ * rotation: [0, 0, 0],
63932
+ * color: [1.0, 1.0, 0.0]
63933
+ * });
63934
+ *
63935
+ * performanceModel.createEntity({
63936
+ * meshIds: ["leg4"],
63937
+ * isObject: true
63938
+ * });
63939
+ *
63940
+ * performanceModel.createMesh({
63941
+ * id: "top",
63942
+ * geometryId: "box",
63943
+ * position: [0, -3, 0],
63944
+ * scale: [6, 0.5, 6],
63945
+ * rotation: [0, 0, 0],
63946
+ * color: [1.0, 0.3, 1.0]
63947
+ * });
63948
+ *
63949
+ * performanceModel.createEntity({
63950
+ * meshIds: ["top"],
63951
+ * isObject: true
63952
+ * });
63953
+ * ````
63855
63954
  *
63856
63955
  * @implements {Drawable}
63857
63956
  * @implements {Entity}
@@ -63864,8 +63963,8 @@ class PerformanceModel extends Component {
63864
63963
  * @param {*} [cfg] Configs
63865
63964
  * @param {String} [cfg.id] Optional ID, unique among all components in the parent scene, generated automatically when omitted.
63866
63965
  * @param {Boolean} [cfg.isModel] Specify ````true```` if this PerformanceModel represents a model, in which case the PerformanceModel will be registered by {@link PerformanceModel#id} in {@link Scene#models} and may also have a corresponding {@link MetaModel} with matching {@link MetaModel#id}, registered by that ID in {@link MetaScene#metaModels}.
63867
- * @param {Number[]} [cfg.origin=[0,0,0]] World-space 3D origin.
63868
- * @param {Number[]} [cfg.position=[0,0,0]] Local 3D position.
63966
+ * @param {Number[]} [cfg.origin=[0,0,0]] World-space double-precision 3D origin.
63967
+ * @param {Number[]} [cfg.position=[0,0,0]] Local, single-precision 3D position, relative to the origin parameter.
63869
63968
  * @param {Number[]} [cfg.scale=[1,1,1]] Local scale.
63870
63969
  * @param {Number[]} [cfg.rotation=[0,0,0]] Local rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
63871
63970
  * @param {Number[]} [cfg.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1] Local modelling transform matrix. Overrides the position, scale and rotation parameters.
@@ -64006,14 +64105,14 @@ class PerformanceModel extends Component {
64006
64105
 
64007
64106
  // Build static matrix
64008
64107
 
64009
- this._origin = new Float64Array(cfg.origin || [0, 0, 0]);
64010
- this._position = new Float32Array(cfg.position || [0, 0, 0]);
64011
- this._rotation = new Float32Array(cfg.rotation || [0, 0, 0]);
64012
- this._quaternion = new Float32Array(cfg.quaternion || [0, 0, 0, 1]);
64108
+ this._origin = math.vec3(cfg.origin || [0, 0, 0]);
64109
+ this._position = math.vec3(cfg.position || [0, 0, 0]);
64110
+ this._rotation = math.vec3(cfg.rotation || [0, 0, 0]);
64111
+ this._quaternion = math.vec4(cfg.quaternion || [0, 0, 0, 1]);
64013
64112
  if (cfg.rotation) {
64014
64113
  math.eulerToQuaternion(this._rotation, "XYZ", this._quaternion);
64015
64114
  }
64016
- this._scale = new Float32Array(cfg.scale || [1, 1, 1]);
64115
+ this._scale = math.vec3(cfg.scale || [1, 1, 1]);
64017
64116
  this._worldMatrix = math.mat4();
64018
64117
  math.composeMat4(this._position, this._quaternion, this._scale, this._worldMatrix);
64019
64118
  this._worldNormalMatrix = math.mat4();
@@ -64771,7 +64870,10 @@ class PerformanceModel extends Component {
64771
64870
  this.error("Config missing: primitive");
64772
64871
  return;
64773
64872
  }
64774
- const origin = (cfg.origin || cfg.rtcCenter) ? math.addVec3(this._origin, cfg.origin || cfg.rtcCenter, tempVec3a$8) : null;
64873
+
64874
+ const cfgOrigin = cfg.origin || cfg.rtcCenter;
64875
+ const origin = (cfgOrigin) ? math.addVec3(this._origin, cfgOrigin, tempVec3a$9) : this._origin;
64876
+
64775
64877
  switch (primitive) {
64776
64878
  case "triangles":
64777
64879
  instancingLayer = new TrianglesInstancingLayer(this, utils.apply({
@@ -64977,22 +65079,29 @@ class PerformanceModel extends Component {
64977
65079
 
64978
65080
  let needNewBatchingLayers = false;
64979
65081
 
64980
- const cellSize = 100000;
64981
-
64982
65082
  let origin = null;
64983
65083
 
64984
- if (cfg.origin || cfg.rtcCenter) {
64985
- origin = math.addVec3(this._origin, cfg.origin || cfg.rtcCenter, tempVec3a$8);
64986
- } else if (!cfg.positionsDecodeMatrix) { // TODO: Assumes we never quantize double-precision coordinates
65084
+ if (!cfg.positionsDecodeMatrix) { // TODO: Assumes we never quantize double-precision coordinates
64987
65085
  const rtcCenter = math.vec3();
64988
65086
  const rtcPositions = [];
64989
- const rtcNeeded = worldToRTCPositions(positions, rtcPositions, rtcCenter, cellSize);
65087
+ const rtcNeeded = worldToRTCPositions(positions, rtcPositions, rtcCenter);
64990
65088
  if (rtcNeeded) {
64991
65089
  positions = rtcPositions;
64992
65090
  origin = math.addVec3(this._origin, rtcCenter, rtcCenter);
64993
65091
  }
64994
65092
  }
64995
65093
 
65094
+ const cfgOrigin = cfg.origin || cfg.rtcCenter;
65095
+ if (cfgOrigin) {
65096
+ if (!origin) {
65097
+ origin = cfgOrigin;
65098
+ } else {
65099
+ origin = math.addVec3(this._origin, cfgOrigin, tempVec3a$9);
65100
+ }
65101
+ } else {
65102
+ origin = this._origin;
65103
+ }
65104
+
64996
65105
  if (origin) {
64997
65106
  if (!this._lastOrigin) {
64998
65107
  needNewBatchingLayers = true;
@@ -65866,7 +65975,7 @@ const identityMat = math.identityMat4();
65866
65975
  *
65867
65976
  * @implements {Entity}
65868
65977
  */
65869
- class Node extends Component {
65978
+ class Node$1 extends Component {
65870
65979
 
65871
65980
  /**
65872
65981
  * @constructor
@@ -66058,6 +66167,7 @@ class Node extends Component {
66058
66167
  for (let i = 0, len = this._children.length; i < len; i++) {
66059
66168
  this._children[i].origin = origin;
66060
66169
  }
66170
+ this.glRedraw();
66061
66171
  }
66062
66172
 
66063
66173
  /**
@@ -70500,7 +70610,7 @@ var parseGLTF$1 = (function () {
70500
70610
  };
70501
70611
  utils.apply(ctx.modelNodeProps, nodeCfg);
70502
70612
  utils.apply(createEntity, nodeCfg);
70503
- let childNode = new Node(modelNode, nodeCfg);
70613
+ let childNode = new Node$1(modelNode, nodeCfg);
70504
70614
  parent.addChild(childNode, false);
70505
70615
  for (let i = 0, len = numMeshes; i < len; i++) {
70506
70616
  meshesInfoMesh = meshesInfo[i];
@@ -70525,7 +70635,7 @@ var parseGLTF$1 = (function () {
70525
70635
  matrix: matrix
70526
70636
  };
70527
70637
  utils.apply(ctx.modelNodeProps, nodeCfg);
70528
- let childNode = new Node(modelNode, nodeCfg);
70638
+ let childNode = new Node$1(modelNode, nodeCfg);
70529
70639
  parent.addChild(childNode, false);
70530
70640
  for (let i = 0, len = numMeshes; i < len; i++) {
70531
70641
  meshesInfoMesh = meshesInfo[i];
@@ -70553,7 +70663,7 @@ var parseGLTF$1 = (function () {
70553
70663
  utils.apply(ctx.modelNodeProps, nodeCfg);
70554
70664
  utils.apply(createEntity, nodeCfg);
70555
70665
  createEntity.matrix = matrix;
70556
- let childNode = new Node(modelNode, nodeCfg);
70666
+ let childNode = new Node$1(modelNode, nodeCfg);
70557
70667
  parent.addChild(childNode, false); // Don't automatically inherit properties
70558
70668
  matrix = null;
70559
70669
  parent = childNode;
@@ -70570,7 +70680,7 @@ var parseGLTF$1 = (function () {
70570
70680
  if (createEntity) {
70571
70681
  utils.apply(createEntity, nodeCfg);
70572
70682
  }
70573
- let childNode = new Node(modelNode, nodeCfg);
70683
+ let childNode = new Node$1(modelNode, nodeCfg);
70574
70684
  parent.addChild(childNode, false); // Don't automatically inherit properties
70575
70685
  for (let i = 0, len = numMeshes; i < len; i++) {
70576
70686
  meshesInfoMesh = meshesInfo[i];
@@ -71010,7 +71120,7 @@ const parseGLTF = (function () {
71010
71120
  loadPrimitiveGeometry(ctx, primitiveInfo, meshCfg);
71011
71121
  math.transformPositions3(worldMatrix, meshCfg.localPositions, meshCfg.positions);
71012
71122
  const origin = math.vec3();
71013
- const rtcNeeded = worldToRTCPositions(meshCfg.positions, meshCfg.positions, origin, 10000); // Small cellsize guarantees better accuracy
71123
+ const rtcNeeded = worldToRTCPositions(meshCfg.positions, meshCfg.positions, origin); // Small cellsize guarantees better accuracy
71014
71124
  if (rtcNeeded) {
71015
71125
  meshCfg.origin = origin;
71016
71126
  }
@@ -71390,11 +71500,11 @@ class GLTFLoaderPlugin extends Plugin {
71390
71500
  * @params {String[]} [params.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
71391
71501
  * @params {String[]} [params.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
71392
71502
  * @param {Boolean} [params.edges=false] Whether or not xeokit renders the model with edges emphasized.
71393
- * @param {Number[]} [params.origin=[0,0,0]] The World-space origin of the model's coordinates.
71394
- * @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
71395
- * @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
71396
- * @param {Number[]} [params.rotation=[0,0,0]] The model's World-space rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
71397
- * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters.
71503
+ * @param {Number[]} [params.origin=[0,0,0]] The double-precision World-space origin of the model's coordinates.
71504
+ * @param {Number[]} [params.position=[0,0,0]] The single-precision position, relative to ````origin````.
71505
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
71506
+ * @param {Number[]} [params.rotation=[0,0,0]] The model's orientation, as Euler angles given in degrees, for each of the X, Y and Z axis.
71507
+ * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````.
71398
71508
  * @param {Boolean} [params.backfaces=false] When true, allows visible backfaces, wherever specified in the glTF. When false, ignores backfaces.
71399
71509
  * @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.
71400
71510
  * @params {Boolean} [params.performance=true] Set ````false```` to load all the materials and textures provided by the glTF file, otherwise leave ````true```` to load the default high-performance representation optimized for low memory usage and efficient rendering.
@@ -71420,7 +71530,7 @@ class GLTFLoaderPlugin extends Plugin {
71420
71530
 
71421
71531
  // Scene Node graph supports original glTF materials
71422
71532
 
71423
- : new Node(this.viewer.scene, utils.apply(params, {
71533
+ : new Node$1(this.viewer.scene, utils.apply(params, {
71424
71534
  isModel: true
71425
71535
  }));
71426
71536
 
@@ -72520,7 +72630,7 @@ class NavCubePlugin extends Plugin {
72520
72630
  }
72521
72631
  }
72522
72632
 
72523
- const tempVec3a$7 = math.vec3();
72633
+ const tempVec3a$8 = math.vec3();
72524
72634
 
72525
72635
  /**
72526
72636
  * @private
@@ -73218,7 +73328,7 @@ function createMeshes(modelNode, state) {
73218
73328
  }
73219
73329
  geometryCfg.indices = indices;
73220
73330
 
73221
- const origin = tempVec3a$7;
73331
+ const origin = tempVec3a$8;
73222
73332
 
73223
73333
  worldToRTCPositions(geometry.positions, geometry.positions, origin);
73224
73334
 
@@ -73384,7 +73494,7 @@ class OBJLoaderPlugin extends Plugin {
73384
73494
  delete params.id;
73385
73495
  }
73386
73496
 
73387
- var modelNode = new Node(this.viewer.scene, utils.apply(params, {
73497
+ var modelNode = new Node$1(this.viewer.scene, utils.apply(params, {
73388
73498
  isModel: true
73389
73499
  }));
73390
73500
 
@@ -73767,7 +73877,7 @@ class Control {
73767
73877
  const tubeRadius = 0.01;
73768
73878
  const arrowRadius = 0.07;
73769
73879
 
73770
- this._rootNode = new Node(scene, {
73880
+ this._rootNode = new Node$1(scene, {
73771
73881
  position: [0, 0, 0],
73772
73882
  scale: [5, 5, 5]
73773
73883
  });
@@ -75960,7 +76070,7 @@ class STLDefaultDataSource {
75960
76070
  }
75961
76071
  }
75962
76072
 
75963
- const tempVec3a$6 = math.vec3();
76073
+ const tempVec3a$7 = math.vec3();
75964
76074
 
75965
76075
  /**
75966
76076
  * @private
@@ -76212,7 +76322,7 @@ function addMesh(modelNode, positions, normals, colors, material, options) {
76212
76322
  math.faceToVertexNormals(positions, normals, options);
76213
76323
  }
76214
76324
 
76215
- const origin = tempVec3a$6;
76325
+ const origin = tempVec3a$7;
76216
76326
 
76217
76327
  worldToRTCPositions(positions, positions, origin);
76218
76328
 
@@ -76489,10 +76599,11 @@ class STLLoaderPlugin extends Plugin {
76489
76599
  * @param {String} [params.src] Path to an STL file. Overrides the ````stl```` parameter.
76490
76600
  * @param {String} [params.stl] Contents of an STL file, either binary of ASCII. Overridden by the ````src```` parameter.
76491
76601
  * @param {Boolean} [params.edges=false] Whether or not to renders the model with edges emphasized.
76492
- * @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
76493
- * @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
76494
- * @param {Number[]} [params.rotation=[0,0,0]] The model's World-space rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
76495
- * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters.
76602
+ * @param {Number[]} [params.origin=[0,0,0]] The model's World-space double-precision 3D origin. Use this to position the model within xeokit's World coordinate system, using double-precision coordinates.
76603
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
76604
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
76605
+ * @param {Number[]} [params.rotation=[0,0,0]] The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis.
76606
+ * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````.
76496
76607
  * @param {Boolean} [params.backfaces=false] When true, allows visible backfaces, wherever specified in the STL. When false, ignores backfaces.
76497
76608
  * @param {Boolean} [params.smoothNormals=true] When true, automatically converts face-oriented normals to vertex normals for a smooth appearance.
76498
76609
  * @param {Number} [params.smoothNormalsAngleThreshold=20] 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.
@@ -76507,7 +76618,7 @@ class STLLoaderPlugin extends Plugin {
76507
76618
  delete params.id;
76508
76619
  }
76509
76620
 
76510
- const modelNode = new Node(this.viewer.scene, utils.apply(params, {
76621
+ const modelNode = new Node$1(this.viewer.scene, utils.apply(params, {
76511
76622
  isModel: true
76512
76623
  }));
76513
76624
 
@@ -77173,7 +77284,7 @@ class StoreyMap {
77173
77284
  }
77174
77285
  }
77175
77286
 
77176
- const tempVec3a$5 = math.vec3();
77287
+ const tempVec3a$6 = math.vec3();
77177
77288
  const tempMat4 = math.mat4();
77178
77289
 
77179
77290
  const EMPTY_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";
@@ -77593,7 +77704,7 @@ class StoreyViewsPlugin extends Plugin {
77593
77704
 
77594
77705
  const orthoScale2 = diag * 1.3;
77595
77706
 
77596
- const eye2 = tempVec3a$5;
77707
+ const eye2 = tempVec3a$6;
77597
77708
 
77598
77709
  eye2[0] = look2[0] + (camera.worldUp[0] * sca);
77599
77710
  eye2[1] = look2[1] + (camera.worldUp[1] * sca);
@@ -77804,7 +77915,7 @@ class StoreyViewsPlugin extends Plugin {
77804
77915
  const aabb = storey.aabb;
77805
77916
  const look = math.getAABB3Center(aabb);
77806
77917
  const sca = 0.5;
77807
- const eye = tempVec3a$5;
77918
+ const eye = tempVec3a$6;
77808
77919
  eye[0] = look[0] + (camera.worldUp[0] * sca);
77809
77920
  eye[1] = look[1] + (camera.worldUp[1] * sca);
77810
77921
  eye[2] = look[2] + (camera.worldUp[2] * sca);
@@ -77860,7 +77971,7 @@ class StoreyViewsPlugin extends Plugin {
77860
77971
 
77861
77972
  const origin = math.vec3([xmin + (xWorldSize * normX), ymin + (yWorldSize * 0.5), zmin + (zWorldSize * normZ)]);
77862
77973
  const direction = math.vec3([0, -1, 0]);
77863
- const look = math.addVec3(origin, direction, tempVec3a$5);
77974
+ const look = math.addVec3(origin, direction, tempVec3a$6);
77864
77975
  const worldForward = this.viewer.camera.worldForward;
77865
77976
  const matrix = math.lookAtMat4v(origin, look, worldForward, tempMat4);
77866
77977
 
@@ -77958,7 +78069,7 @@ class StoreyViewsPlugin extends Plugin {
77958
78069
  const camera = this.viewer.camera;
77959
78070
  const eye = camera.eye;
77960
78071
  const look = camera.look;
77961
- const eyeLookDir = math.subVec3(look, eye, tempVec3a$5);
78072
+ const eyeLookDir = math.subVec3(look, eye, tempVec3a$6);
77962
78073
  const worldUp = camera.worldUp;
77963
78074
  const xUp = worldUp[0] > worldUp[1] && worldUp[0] > worldUp[2];
77964
78075
  const yUp = !xUp && worldUp[1] > worldUp[0] && worldUp[1] > worldUp[2];
@@ -79531,8 +79642,8 @@ class TreeViewPlugin extends Plugin {
79531
79642
  }
79532
79643
  }
79533
79644
 
79534
- const tempVec3a$4 = math.vec3();
79535
- const tempVec3b$4 = math.vec3();
79645
+ const tempVec3a$5 = math.vec3();
79646
+ const tempVec3b$5 = math.vec3();
79536
79647
  const tempMat4a = math.mat4();
79537
79648
 
79538
79649
  /**
@@ -79609,8 +79720,8 @@ function frustumIntersectsAABB3(frustum, aabb) {
79609
79720
 
79610
79721
  let ret = Frustum.INSIDE;
79611
79722
 
79612
- const min = tempVec3a$4;
79613
- const max = tempVec3b$4;
79723
+ const min = tempVec3a$5;
79724
+ const max = tempVec3b$5;
79614
79725
 
79615
79726
  min[0] = aabb[0];
79616
79727
  min[1] = aabb[1];
@@ -89957,7 +90068,10 @@ parsers[ParserV9.version] = ParserV9;
89957
90068
  *
89958
90069
  * ## Creating *````.XKT````* Files and Metadata
89959
90070
  *
89960
- * See [Creating Files for Offline BIM](https://github.com/xeokit/xeokit-sdk/wiki/Creating-Files-for-Offline-BIM).
90071
+ * We have several sways to convert your files into XKT. See these tutorials for more info:
90072
+ *
90073
+ * * [Converting Models to XKT with convert2xkt](https://www.notion.so/xeokit/Converting-Models-to-XKT-with-convert2xkt-fa567843313f4db8a7d6535e76da9380) - how to convert various file formats (glTF, IFC, CityJSON, LAS/LAZ...) to XKT using our nodejs-based converter.
90074
+ * * [Converting IFC Models to XKT using 3rd-Party Open Source Tools](https://www.notion.so/xeokit/Converting-IFC-Models-to-XKT-using-3rd-Party-Open-Source-Tools-c373e48bc4094ff5b6e5c5700ff580ee) - how to convert IFC files to XKT using 3rd-party open source CLI tools.
89961
90075
  *
89962
90076
  * ## Scene representation
89963
90077
  *
@@ -90544,11 +90658,11 @@ class XKTLoaderPlugin extends Plugin {
90544
90658
  * @param {String[]} [params.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
90545
90659
  * @param {String[]} [params.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
90546
90660
  * @param {Boolean} [params.edges=false] Whether or not xeokit renders the model with edges emphasized.
90547
- * @param {Number[]} [params.origin=[0,0,0]] The World-space origin of the model's coordinates.
90548
- * @param {Number[]} [params.position=[0,0,0]] The model's position, relative to the model's origin.
90661
+ * @param {Number[]} [params.origin=[0,0,0]] The model's World-space double-precision 3D origin. Use this to position the model within xeokit's World coordinate system, using double-precision coordinates.
90662
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
90549
90663
  * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
90550
- * @param {Number[]} [params.rotation=[0,0,0]] The model's rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
90551
- * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters.
90664
+ * @param {Number[]} [params.rotation=[0,0,0]] The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis.
90665
+ * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````.
90552
90666
  * @param {Boolean} [params.edges=false] Indicates if the model's edges are initially emphasized.
90553
90667
  * @param {Boolean} [params.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to the model. SAO is configured by the Scene's {@link SAO} component. Only works when {@link SAO#enabled} is also ````true````
90554
90668
  * @param {Boolean} [params.pbrEnabled=false] Indicates if physically-based rendering (PBR) will apply to the model. Only works when {@link Scene#pbrEnabled} is also ````true````.
@@ -92816,7 +92930,7 @@ var parse3DXML = (function () {
92816
92930
  var translate = [matrix[9], matrix[10], matrix[11]];
92817
92931
  var mat3 = matrix.slice(0, 9); // Rotation matrix
92818
92932
  var mat4 = math.mat3ToMat4(mat3, math.identityMat4()); // Convert rotation matrix to 4x4
92819
- var childGroup = new Node(ctx.modelNode, {
92933
+ var childGroup = new Node$1(ctx.modelNode, {
92820
92934
  position: translate
92821
92935
  });
92822
92936
  if (ctx.metaModelData) {
@@ -92833,7 +92947,7 @@ var parse3DXML = (function () {
92833
92947
  ctx.modelNode.addChild(childGroup, true);
92834
92948
  }
92835
92949
  group = childGroup;
92836
- childGroup = new Node(ctx.modelNode, {
92950
+ childGroup = new Node$1(ctx.modelNode, {
92837
92951
  matrix: mat4
92838
92952
  });
92839
92953
  if (ctx.metaModelData) {
@@ -92847,7 +92961,7 @@ var parse3DXML = (function () {
92847
92961
  group.addChild(childGroup, true);
92848
92962
  group = childGroup;
92849
92963
  } else {
92850
- var childGroup = new Node(ctx.modelNode, {});
92964
+ var childGroup = new Node$1(ctx.modelNode, {});
92851
92965
  if (ctx.metaModelData) {
92852
92966
  ctx.metaModelData.metaObjects.push({
92853
92967
  id: childGroup.id,
@@ -93845,7 +93959,7 @@ class XML3DLoaderPlugin extends Plugin {
93845
93959
  delete params.id;
93846
93960
  }
93847
93961
 
93848
- const modelNode = new Node(this.viewer.scene, utils.apply(params, {
93962
+ const modelNode = new Node$1(this.viewer.scene, utils.apply(params, {
93849
93963
  isModel: true
93850
93964
  }));
93851
93965
 
@@ -94541,7 +94655,7 @@ var require_web_ifc_mt = __commonJS({
94541
94655
  function receiveInstance(instance, module2) {
94542
94656
  var exports3 = instance.exports;
94543
94657
  Module["asm"] = exports3;
94544
- wasmTable = Module["asm"]["qa"];
94658
+ wasmTable = Module["asm"]["pa"];
94545
94659
  wasmModule = module2;
94546
94660
  if (!ENVIRONMENT_IS_PTHREAD) {
94547
94661
  var numWorkersToLoad = PThread.unusedWorkers.length;
@@ -94595,11 +94709,11 @@ var require_web_ifc_mt = __commonJS({
94595
94709
  }
94596
94710
  var tempDouble;
94597
94711
  var tempI64;
94598
- var ASM_CONSTS = { 41585: function($0, $1) {
94712
+ var ASM_CONSTS = { 41793: function($0, $1) {
94599
94713
  setTimeout(function() {
94600
94714
  _do_emscripten_dispatch_to_thread($0, $1);
94601
94715
  }, 0);
94602
- }, 41663: function() {
94716
+ }, 41871: function() {
94603
94717
  throw "Canceled!";
94604
94718
  } };
94605
94719
  function initPthreadsJS() {
@@ -97075,60 +97189,9 @@ var require_web_ifc_mt = __commonJS({
97075
97189
  }, get64: function(low, high) {
97076
97190
  return low;
97077
97191
  } };
97078
- function ___sys_fcntl64(fd, cmd, varargs) {
97079
- if (ENVIRONMENT_IS_PTHREAD)
97080
- return _emscripten_proxy_to_main_thread_js(2, 1, fd, cmd, varargs);
97081
- SYSCALLS.varargs = varargs;
97082
- try {
97083
- var stream = SYSCALLS.getStreamFromFD(fd);
97084
- switch (cmd) {
97085
- case 0: {
97086
- var arg = SYSCALLS.get();
97087
- if (arg < 0) {
97088
- return -28;
97089
- }
97090
- var newStream;
97091
- newStream = FS.open(stream.path, stream.flags, 0, arg);
97092
- return newStream.fd;
97093
- }
97094
- case 1:
97095
- case 2:
97096
- return 0;
97097
- case 3:
97098
- return stream.flags;
97099
- case 4: {
97100
- var arg = SYSCALLS.get();
97101
- stream.flags |= arg;
97102
- return 0;
97103
- }
97104
- case 12: {
97105
- var arg = SYSCALLS.get();
97106
- var offset = 0;
97107
- GROWABLE_HEAP_I16()[arg + offset >> 1] = 2;
97108
- return 0;
97109
- }
97110
- case 13:
97111
- case 14:
97112
- return 0;
97113
- case 16:
97114
- case 8:
97115
- return -28;
97116
- case 9:
97117
- setErrNo(28);
97118
- return -1;
97119
- default: {
97120
- return -28;
97121
- }
97122
- }
97123
- } catch (e) {
97124
- if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError))
97125
- abort(e);
97126
- return -e.errno;
97127
- }
97128
- }
97129
97192
  function ___sys_ioctl(fd, op, varargs) {
97130
97193
  if (ENVIRONMENT_IS_PTHREAD)
97131
- return _emscripten_proxy_to_main_thread_js(3, 1, fd, op, varargs);
97194
+ return _emscripten_proxy_to_main_thread_js(2, 1, fd, op, varargs);
97132
97195
  SYSCALLS.varargs = varargs;
97133
97196
  try {
97134
97197
  var stream = SYSCALLS.getStreamFromFD(fd);
@@ -97186,7 +97249,7 @@ var require_web_ifc_mt = __commonJS({
97186
97249
  }
97187
97250
  function ___sys_open(path, flags, varargs) {
97188
97251
  if (ENVIRONMENT_IS_PTHREAD)
97189
- return _emscripten_proxy_to_main_thread_js(4, 1, path, flags, varargs);
97252
+ return _emscripten_proxy_to_main_thread_js(3, 1, path, flags, varargs);
97190
97253
  SYSCALLS.varargs = varargs;
97191
97254
  try {
97192
97255
  var pathname = SYSCALLS.getStr(path);
@@ -98988,7 +99051,7 @@ var require_web_ifc_mt = __commonJS({
98988
99051
  }
98989
99052
  function _emscripten_set_canvas_element_size_main_thread(target, width, height) {
98990
99053
  if (ENVIRONMENT_IS_PTHREAD)
98991
- return _emscripten_proxy_to_main_thread_js(5, 1, target, width, height);
99054
+ return _emscripten_proxy_to_main_thread_js(4, 1, target, width, height);
98992
99055
  return _emscripten_set_canvas_element_size_calling_thread(target, width, height);
98993
99056
  }
98994
99057
  function _emscripten_set_canvas_element_size(target, width, height) {
@@ -99179,7 +99242,7 @@ var require_web_ifc_mt = __commonJS({
99179
99242
  }
99180
99243
  function _environ_get(__environ, environ_buf) {
99181
99244
  if (ENVIRONMENT_IS_PTHREAD)
99182
- return _emscripten_proxy_to_main_thread_js(6, 1, __environ, environ_buf);
99245
+ return _emscripten_proxy_to_main_thread_js(5, 1, __environ, environ_buf);
99183
99246
  try {
99184
99247
  var bufSize = 0;
99185
99248
  getEnvStrings().forEach(function(string, i) {
@@ -99197,7 +99260,7 @@ var require_web_ifc_mt = __commonJS({
99197
99260
  }
99198
99261
  function _environ_sizes_get(penviron_count, penviron_buf_size) {
99199
99262
  if (ENVIRONMENT_IS_PTHREAD)
99200
- return _emscripten_proxy_to_main_thread_js(7, 1, penviron_count, penviron_buf_size);
99263
+ return _emscripten_proxy_to_main_thread_js(6, 1, penviron_count, penviron_buf_size);
99201
99264
  try {
99202
99265
  var strings = getEnvStrings();
99203
99266
  GROWABLE_HEAP_I32()[penviron_count >> 2] = strings.length;
@@ -99215,7 +99278,7 @@ var require_web_ifc_mt = __commonJS({
99215
99278
  }
99216
99279
  function _fd_close(fd) {
99217
99280
  if (ENVIRONMENT_IS_PTHREAD)
99218
- return _emscripten_proxy_to_main_thread_js(8, 1, fd);
99281
+ return _emscripten_proxy_to_main_thread_js(7, 1, fd);
99219
99282
  try {
99220
99283
  var stream = SYSCALLS.getStreamFromFD(fd);
99221
99284
  FS.close(stream);
@@ -99228,7 +99291,7 @@ var require_web_ifc_mt = __commonJS({
99228
99291
  }
99229
99292
  function _fd_read(fd, iov, iovcnt, pnum) {
99230
99293
  if (ENVIRONMENT_IS_PTHREAD)
99231
- return _emscripten_proxy_to_main_thread_js(9, 1, fd, iov, iovcnt, pnum);
99294
+ return _emscripten_proxy_to_main_thread_js(8, 1, fd, iov, iovcnt, pnum);
99232
99295
  try {
99233
99296
  var stream = SYSCALLS.getStreamFromFD(fd);
99234
99297
  var num = SYSCALLS.doReadv(stream, iov, iovcnt);
@@ -99242,7 +99305,7 @@ var require_web_ifc_mt = __commonJS({
99242
99305
  }
99243
99306
  function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {
99244
99307
  if (ENVIRONMENT_IS_PTHREAD)
99245
- return _emscripten_proxy_to_main_thread_js(10, 1, fd, offset_low, offset_high, whence, newOffset);
99308
+ return _emscripten_proxy_to_main_thread_js(9, 1, fd, offset_low, offset_high, whence, newOffset);
99246
99309
  try {
99247
99310
  var stream = SYSCALLS.getStreamFromFD(fd);
99248
99311
  var HIGH_OFFSET = 4294967296;
@@ -99264,7 +99327,7 @@ var require_web_ifc_mt = __commonJS({
99264
99327
  }
99265
99328
  function _fd_write(fd, iov, iovcnt, pnum) {
99266
99329
  if (ENVIRONMENT_IS_PTHREAD)
99267
- return _emscripten_proxy_to_main_thread_js(11, 1, fd, iov, iovcnt, pnum);
99330
+ return _emscripten_proxy_to_main_thread_js(10, 1, fd, iov, iovcnt, pnum);
99268
99331
  try {
99269
99332
  var stream = SYSCALLS.getStreamFromFD(fd);
99270
99333
  var num = SYSCALLS.doWritev(stream, iov, iovcnt);
@@ -99684,7 +99747,7 @@ var require_web_ifc_mt = __commonJS({
99684
99747
  UnboundTypeError = Module["UnboundTypeError"] = extendError(Error, "UnboundTypeError");
99685
99748
  init_emval();
99686
99749
  var GLctx;
99687
- var proxiedFunctionTable = [null, _atexit, ___sys_fcntl64, ___sys_ioctl, ___sys_open, _emscripten_set_canvas_element_size_main_thread, _environ_get, _environ_sizes_get, _fd_close, _fd_read, _fd_seek, _fd_write];
99750
+ var proxiedFunctionTable = [null, _atexit, ___sys_ioctl, ___sys_open, _emscripten_set_canvas_element_size_main_thread, _environ_get, _environ_sizes_get, _fd_close, _fd_read, _fd_seek, _fd_write];
99688
99751
  function intArrayFromString(stringy, dontAddNull, length) {
99689
99752
  var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
99690
99753
  var u8array = new Array(len);
@@ -99697,126 +99760,126 @@ var require_web_ifc_mt = __commonJS({
99697
99760
  __ATINIT__.push({ func: function() {
99698
99761
  ___wasm_call_ctors();
99699
99762
  } });
99700
- var asmLibraryArg = { "p": ___assert_fail, "P": ___cxa_allocate_exception, "O": ___cxa_throw, "K": ___sys_fcntl64, "ha": ___sys_ioctl, "ia": ___sys_open, "na": __embind_finalize_value_array, "w": __embind_finalize_value_object, "ka": __embind_register_bool, "z": __embind_register_class, "y": __embind_register_class_constructor, "e": __embind_register_class_function, "ja": __embind_register_emval, "ma": __embind_register_enum, "E": __embind_register_enum_value, "M": __embind_register_float, "i": __embind_register_function, "s": __embind_register_integer, "q": __embind_register_memory_view, "N": __embind_register_std_string, "F": __embind_register_std_wstring, "oa": __embind_register_value_array, "l": __embind_register_value_array_element, "x": __embind_register_value_object, "h": __embind_register_value_object_field, "la": __embind_register_void, "$": __emscripten_notify_thread_queue, "u": __emval_as, "pa": __emval_call, "b": __emval_decref, "_": __emval_get_global, "r": __emval_get_property, "o": __emval_incref, "ba": __emval_instanceof, "Q": __emval_is_number, "G": __emval_new_array, "j": __emval_new_cstring, "A": __emval_new_object, "t": __emval_run_destructors, "m": __emval_set_property, "g": __emval_take_value, "I": _abort, "fa": _clock_gettime, "B": _emscripten_asm_const_int, "aa": _emscripten_check_blocking_allowed, "H": _emscripten_conditional_set_current_thread_status, "k": _emscripten_futex_wait, "n": _emscripten_futex_wake, "d": _emscripten_get_now, "D": _emscripten_is_main_browser_thread, "C": _emscripten_is_main_runtime_thread, "U": _emscripten_memcpy_big, "W": _emscripten_receive_on_main_thread_js, "v": _emscripten_resize_heap, "X": _emscripten_set_canvas_element_size, "f": _emscripten_set_current_thread_status, "Y": _emscripten_webgl_create_context, "da": _environ_get, "ea": _environ_sizes_get, "L": _fd_close, "ga": _fd_read, "R": _fd_seek, "J": _fd_write, "T": initPthreadsJS, "a": wasmMemory || Module["wasmMemory"], "V": _pthread_cleanup_push, "Z": _pthread_create, "c": _pthread_self, "S": _setTempRet0, "ca": _strftime_l };
99763
+ var asmLibraryArg = { "p": ___assert_fail, "H": ___cxa_allocate_exception, "G": ___cxa_throw, "ha": ___sys_ioctl, "ia": ___sys_open, "na": __embind_finalize_value_array, "w": __embind_finalize_value_object, "ka": __embind_register_bool, "z": __embind_register_class, "y": __embind_register_class_constructor, "e": __embind_register_class_function, "ja": __embind_register_emval, "ma": __embind_register_enum, "E": __embind_register_enum_value, "N": __embind_register_float, "i": __embind_register_function, "u": __embind_register_integer, "q": __embind_register_memory_view, "O": __embind_register_std_string, "F": __embind_register_std_wstring, "oa": __embind_register_value_array, "l": __embind_register_value_array_element, "x": __embind_register_value_object, "h": __embind_register_value_object_field, "la": __embind_register_void, "$": __emscripten_notify_thread_queue, "s": __emval_as, "P": __emval_call, "b": __emval_decref, "Z": __emval_get_global, "t": __emval_get_property, "o": __emval_incref, "ba": __emval_instanceof, "Q": __emval_is_number, "I": __emval_new_array, "j": __emval_new_cstring, "A": __emval_new_object, "r": __emval_run_destructors, "m": __emval_set_property, "g": __emval_take_value, "K": _abort, "fa": _clock_gettime, "B": _emscripten_asm_const_int, "aa": _emscripten_check_blocking_allowed, "J": _emscripten_conditional_set_current_thread_status, "k": _emscripten_futex_wait, "n": _emscripten_futex_wake, "d": _emscripten_get_now, "D": _emscripten_is_main_browser_thread, "C": _emscripten_is_main_runtime_thread, "U": _emscripten_memcpy_big, "W": _emscripten_receive_on_main_thread_js, "v": _emscripten_resize_heap, "X": _emscripten_set_canvas_element_size, "f": _emscripten_set_current_thread_status, "Y": _emscripten_webgl_create_context, "da": _environ_get, "ea": _environ_sizes_get, "M": _fd_close, "ga": _fd_read, "R": _fd_seek, "L": _fd_write, "T": initPthreadsJS, "a": wasmMemory || Module["wasmMemory"], "V": _pthread_cleanup_push, "_": _pthread_create, "c": _pthread_self, "S": _setTempRet0, "ca": _strftime_l };
99701
99764
  createWasm();
99702
99765
  var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() {
99703
- return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["ra"]).apply(null, arguments);
99766
+ return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["qa"]).apply(null, arguments);
99704
99767
  };
99705
99768
  Module["_main"] = function() {
99706
- return (Module["_main"] = Module["asm"]["sa"]).apply(null, arguments);
99769
+ return (Module["_main"] = Module["asm"]["ra"]).apply(null, arguments);
99707
99770
  };
99708
99771
  var _malloc = Module["_malloc"] = function() {
99709
- return (_malloc = Module["_malloc"] = Module["asm"]["ta"]).apply(null, arguments);
99772
+ return (_malloc = Module["_malloc"] = Module["asm"]["sa"]).apply(null, arguments);
99710
99773
  };
99711
99774
  var _free = Module["_free"] = function() {
99712
- return (_free = Module["_free"] = Module["asm"]["ua"]).apply(null, arguments);
99775
+ return (_free = Module["_free"] = Module["asm"]["ta"]).apply(null, arguments);
99713
99776
  };
99714
99777
  var ___getTypeName = Module["___getTypeName"] = function() {
99715
- return (___getTypeName = Module["___getTypeName"] = Module["asm"]["va"]).apply(null, arguments);
99778
+ return (___getTypeName = Module["___getTypeName"] = Module["asm"]["ua"]).apply(null, arguments);
99716
99779
  };
99717
99780
  Module["___embind_register_native_and_builtin_types"] = function() {
99718
- return (Module["___embind_register_native_and_builtin_types"] = Module["asm"]["wa"]).apply(null, arguments);
99781
+ return (Module["___embind_register_native_and_builtin_types"] = Module["asm"]["va"]).apply(null, arguments);
99719
99782
  };
99720
99783
  var ___errno_location = Module["___errno_location"] = function() {
99721
- return (___errno_location = Module["___errno_location"] = Module["asm"]["xa"]).apply(null, arguments);
99784
+ return (___errno_location = Module["___errno_location"] = Module["asm"]["wa"]).apply(null, arguments);
99722
99785
  };
99723
99786
  var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function() {
99724
- return (_emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = Module["asm"]["ya"]).apply(null, arguments);
99787
+ return (_emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = Module["asm"]["xa"]).apply(null, arguments);
99725
99788
  };
99726
99789
  Module["___em_js__initPthreadsJS"] = function() {
99727
- return (Module["___em_js__initPthreadsJS"] = Module["asm"]["za"]).apply(null, arguments);
99790
+ return (Module["___em_js__initPthreadsJS"] = Module["asm"]["ya"]).apply(null, arguments);
99728
99791
  };
99729
99792
  var stackSave = Module["stackSave"] = function() {
99730
- return (stackSave = Module["stackSave"] = Module["asm"]["Aa"]).apply(null, arguments);
99793
+ return (stackSave = Module["stackSave"] = Module["asm"]["za"]).apply(null, arguments);
99731
99794
  };
99732
99795
  var stackRestore = Module["stackRestore"] = function() {
99733
- return (stackRestore = Module["stackRestore"] = Module["asm"]["Ba"]).apply(null, arguments);
99796
+ return (stackRestore = Module["stackRestore"] = Module["asm"]["Aa"]).apply(null, arguments);
99734
99797
  };
99735
99798
  var stackAlloc = Module["stackAlloc"] = function() {
99736
- return (stackAlloc = Module["stackAlloc"] = Module["asm"]["Ca"]).apply(null, arguments);
99799
+ return (stackAlloc = Module["stackAlloc"] = Module["asm"]["Ba"]).apply(null, arguments);
99737
99800
  };
99738
99801
  var _emscripten_stack_set_limits = Module["_emscripten_stack_set_limits"] = function() {
99739
- return (_emscripten_stack_set_limits = Module["_emscripten_stack_set_limits"] = Module["asm"]["Da"]).apply(null, arguments);
99802
+ return (_emscripten_stack_set_limits = Module["_emscripten_stack_set_limits"] = Module["asm"]["Ca"]).apply(null, arguments);
99740
99803
  };
99741
99804
  var _memalign = Module["_memalign"] = function() {
99742
- return (_memalign = Module["_memalign"] = Module["asm"]["Ea"]).apply(null, arguments);
99805
+ return (_memalign = Module["_memalign"] = Module["asm"]["Da"]).apply(null, arguments);
99743
99806
  };
99744
99807
  Module["_emscripten_main_browser_thread_id"] = function() {
99745
- return (Module["_emscripten_main_browser_thread_id"] = Module["asm"]["Fa"]).apply(null, arguments);
99808
+ return (Module["_emscripten_main_browser_thread_id"] = Module["asm"]["Ea"]).apply(null, arguments);
99746
99809
  };
99747
99810
  var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function() {
99748
- return (___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = Module["asm"]["Ga"]).apply(null, arguments);
99811
+ return (___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = Module["asm"]["Fa"]).apply(null, arguments);
99749
99812
  };
99750
99813
  var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function() {
99751
- return (_emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = Module["asm"]["Ha"]).apply(null, arguments);
99814
+ return (_emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = Module["asm"]["Ga"]).apply(null, arguments);
99752
99815
  };
99753
99816
  Module["_emscripten_current_thread_process_queued_calls"] = function() {
99754
- return (Module["_emscripten_current_thread_process_queued_calls"] = Module["asm"]["Ia"]).apply(null, arguments);
99817
+ return (Module["_emscripten_current_thread_process_queued_calls"] = Module["asm"]["Ha"]).apply(null, arguments);
99755
99818
  };
99756
99819
  var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function() {
99757
- return (_emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = Module["asm"]["Ja"]).apply(null, arguments);
99820
+ return (_emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = Module["asm"]["Ia"]).apply(null, arguments);
99758
99821
  };
99759
99822
  var _do_emscripten_dispatch_to_thread = Module["_do_emscripten_dispatch_to_thread"] = function() {
99760
- return (_do_emscripten_dispatch_to_thread = Module["_do_emscripten_dispatch_to_thread"] = Module["asm"]["Ka"]).apply(null, arguments);
99823
+ return (_do_emscripten_dispatch_to_thread = Module["_do_emscripten_dispatch_to_thread"] = Module["asm"]["Ja"]).apply(null, arguments);
99761
99824
  };
99762
99825
  Module["_emscripten_async_run_in_main_thread"] = function() {
99763
- return (Module["_emscripten_async_run_in_main_thread"] = Module["asm"]["La"]).apply(null, arguments);
99826
+ return (Module["_emscripten_async_run_in_main_thread"] = Module["asm"]["Ka"]).apply(null, arguments);
99764
99827
  };
99765
99828
  Module["_emscripten_sync_run_in_main_thread"] = function() {
99766
- return (Module["_emscripten_sync_run_in_main_thread"] = Module["asm"]["Ma"]).apply(null, arguments);
99829
+ return (Module["_emscripten_sync_run_in_main_thread"] = Module["asm"]["La"]).apply(null, arguments);
99767
99830
  };
99768
99831
  Module["_emscripten_sync_run_in_main_thread_0"] = function() {
99769
- return (Module["_emscripten_sync_run_in_main_thread_0"] = Module["asm"]["Na"]).apply(null, arguments);
99832
+ return (Module["_emscripten_sync_run_in_main_thread_0"] = Module["asm"]["Ma"]).apply(null, arguments);
99770
99833
  };
99771
99834
  Module["_emscripten_sync_run_in_main_thread_1"] = function() {
99772
- return (Module["_emscripten_sync_run_in_main_thread_1"] = Module["asm"]["Oa"]).apply(null, arguments);
99835
+ return (Module["_emscripten_sync_run_in_main_thread_1"] = Module["asm"]["Na"]).apply(null, arguments);
99773
99836
  };
99774
99837
  Module["_emscripten_sync_run_in_main_thread_2"] = function() {
99775
- return (Module["_emscripten_sync_run_in_main_thread_2"] = Module["asm"]["Pa"]).apply(null, arguments);
99838
+ return (Module["_emscripten_sync_run_in_main_thread_2"] = Module["asm"]["Oa"]).apply(null, arguments);
99776
99839
  };
99777
99840
  Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function() {
99778
- return (Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = Module["asm"]["Qa"]).apply(null, arguments);
99841
+ return (Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = Module["asm"]["Pa"]).apply(null, arguments);
99779
99842
  };
99780
99843
  Module["_emscripten_sync_run_in_main_thread_3"] = function() {
99781
- return (Module["_emscripten_sync_run_in_main_thread_3"] = Module["asm"]["Ra"]).apply(null, arguments);
99844
+ return (Module["_emscripten_sync_run_in_main_thread_3"] = Module["asm"]["Qa"]).apply(null, arguments);
99782
99845
  };
99783
99846
  var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function() {
99784
- return (_emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = Module["asm"]["Sa"]).apply(null, arguments);
99847
+ return (_emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = Module["asm"]["Ra"]).apply(null, arguments);
99785
99848
  };
99786
99849
  Module["_emscripten_sync_run_in_main_thread_5"] = function() {
99787
- return (Module["_emscripten_sync_run_in_main_thread_5"] = Module["asm"]["Ta"]).apply(null, arguments);
99850
+ return (Module["_emscripten_sync_run_in_main_thread_5"] = Module["asm"]["Sa"]).apply(null, arguments);
99788
99851
  };
99789
99852
  Module["_emscripten_sync_run_in_main_thread_6"] = function() {
99790
- return (Module["_emscripten_sync_run_in_main_thread_6"] = Module["asm"]["Ua"]).apply(null, arguments);
99853
+ return (Module["_emscripten_sync_run_in_main_thread_6"] = Module["asm"]["Ta"]).apply(null, arguments);
99791
99854
  };
99792
99855
  Module["_emscripten_sync_run_in_main_thread_7"] = function() {
99793
- return (Module["_emscripten_sync_run_in_main_thread_7"] = Module["asm"]["Va"]).apply(null, arguments);
99856
+ return (Module["_emscripten_sync_run_in_main_thread_7"] = Module["asm"]["Ua"]).apply(null, arguments);
99794
99857
  };
99795
99858
  var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function() {
99796
- return (_emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = Module["asm"]["Wa"]).apply(null, arguments);
99859
+ return (_emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = Module["asm"]["Va"]).apply(null, arguments);
99797
99860
  };
99798
99861
  var __emscripten_call_on_thread = Module["__emscripten_call_on_thread"] = function() {
99799
- return (__emscripten_call_on_thread = Module["__emscripten_call_on_thread"] = Module["asm"]["Xa"]).apply(null, arguments);
99862
+ return (__emscripten_call_on_thread = Module["__emscripten_call_on_thread"] = Module["asm"]["Wa"]).apply(null, arguments);
99800
99863
  };
99801
99864
  Module["_emscripten_tls_init"] = function() {
99802
- return (Module["_emscripten_tls_init"] = Module["asm"]["Ya"]).apply(null, arguments);
99865
+ return (Module["_emscripten_tls_init"] = Module["asm"]["Xa"]).apply(null, arguments);
99803
99866
  };
99804
99867
  Module["dynCall_jiji"] = function() {
99805
- return (Module["dynCall_jiji"] = Module["asm"]["Za"]).apply(null, arguments);
99868
+ return (Module["dynCall_jiji"] = Module["asm"]["Ya"]).apply(null, arguments);
99806
99869
  };
99807
99870
  Module["dynCall_viijii"] = function() {
99808
- return (Module["dynCall_viijii"] = Module["asm"]["_a"]).apply(null, arguments);
99871
+ return (Module["dynCall_viijii"] = Module["asm"]["Za"]).apply(null, arguments);
99809
99872
  };
99810
99873
  Module["dynCall_iiiiiijj"] = function() {
99811
- return (Module["dynCall_iiiiiijj"] = Module["asm"]["$a"]).apply(null, arguments);
99874
+ return (Module["dynCall_iiiiiijj"] = Module["asm"]["_a"]).apply(null, arguments);
99812
99875
  };
99813
99876
  Module["dynCall_iiiiij"] = function() {
99814
- return (Module["dynCall_iiiiij"] = Module["asm"]["ab"]).apply(null, arguments);
99877
+ return (Module["dynCall_iiiiij"] = Module["asm"]["$a"]).apply(null, arguments);
99815
99878
  };
99816
99879
  Module["dynCall_iiiiijj"] = function() {
99817
- return (Module["dynCall_iiiiijj"] = Module["asm"]["bb"]).apply(null, arguments);
99880
+ return (Module["dynCall_iiiiijj"] = Module["asm"]["ab"]).apply(null, arguments);
99818
99881
  };
99819
- var _main_thread_futex = Module["_main_thread_futex"] = 51720;
99882
+ var _main_thread_futex = Module["_main_thread_futex"] = 51928;
99820
99883
  Module["addRunDependency"] = addRunDependency;
99821
99884
  Module["removeRunDependency"] = removeRunDependency;
99822
99885
  Module["FS_createPath"] = FS.createPath;
@@ -100478,7 +100541,7 @@ var require_web_ifc = __commonJS({
100478
100541
  function receiveInstance(instance, module2) {
100479
100542
  var exports3 = instance.exports;
100480
100543
  Module["asm"] = exports3;
100481
- wasmTable = Module["asm"]["ca"];
100544
+ wasmTable = Module["asm"]["ba"];
100482
100545
  removeRunDependency();
100483
100546
  }
100484
100547
  addRunDependency();
@@ -100613,10 +100676,6 @@ var require_web_ifc = __commonJS({
100613
100676
  info.init(type, destructor);
100614
100677
  throw ptr;
100615
100678
  }
100616
- function setErrNo(value) {
100617
- HEAP32[___errno_location() >>> 2] = value;
100618
- return value;
100619
- }
100620
100679
  var PATH = { splitPath: function(filename) {
100621
100680
  var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
100622
100681
  return splitPathRe.exec(filename).slice(1);
@@ -102694,55 +102753,6 @@ var require_web_ifc = __commonJS({
102694
102753
  }, get64: function(low, high) {
102695
102754
  return low;
102696
102755
  } };
102697
- function ___sys_fcntl64(fd, cmd, varargs) {
102698
- SYSCALLS.varargs = varargs;
102699
- try {
102700
- var stream = SYSCALLS.getStreamFromFD(fd);
102701
- switch (cmd) {
102702
- case 0: {
102703
- var arg = SYSCALLS.get();
102704
- if (arg < 0) {
102705
- return -28;
102706
- }
102707
- var newStream;
102708
- newStream = FS.open(stream.path, stream.flags, 0, arg);
102709
- return newStream.fd;
102710
- }
102711
- case 1:
102712
- case 2:
102713
- return 0;
102714
- case 3:
102715
- return stream.flags;
102716
- case 4: {
102717
- var arg = SYSCALLS.get();
102718
- stream.flags |= arg;
102719
- return 0;
102720
- }
102721
- case 12: {
102722
- var arg = SYSCALLS.get();
102723
- var offset = 0;
102724
- HEAP16[arg + offset >>> 1] = 2;
102725
- return 0;
102726
- }
102727
- case 13:
102728
- case 14:
102729
- return 0;
102730
- case 16:
102731
- case 8:
102732
- return -28;
102733
- case 9:
102734
- setErrNo(28);
102735
- return -1;
102736
- default: {
102737
- return -28;
102738
- }
102739
- }
102740
- } catch (e) {
102741
- if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError))
102742
- abort(e);
102743
- return -e.errno;
102744
- }
102745
- }
102746
102756
  function ___sys_ioctl(fd, op, varargs) {
102747
102757
  SYSCALLS.varargs = varargs;
102748
102758
  try {
@@ -104294,6 +104304,10 @@ var require_web_ifc = __commonJS({
104294
104304
  return performance.now();
104295
104305
  };
104296
104306
  var _emscripten_get_now_is_monotonic = true;
104307
+ function setErrNo(value) {
104308
+ HEAP32[___errno_location() >>> 2] = value;
104309
+ return value;
104310
+ }
104297
104311
  function _clock_gettime(clk_id, tp) {
104298
104312
  var now;
104299
104313
  if (clk_id === 0) {
@@ -104731,43 +104745,43 @@ var require_web_ifc = __commonJS({
104731
104745
  __ATINIT__.push({ func: function() {
104732
104746
  ___wasm_call_ctors();
104733
104747
  } });
104734
- var asmLibraryArg = { "x": ___assert_fail, "H": ___cxa_allocate_exception, "G": ___cxa_throw, "C": ___sys_fcntl64, "V": ___sys_ioctl, "W": ___sys_open, "$": __embind_finalize_value_array, "q": __embind_finalize_value_object, "Y": __embind_register_bool, "t": __embind_register_class, "s": __embind_register_class_constructor, "c": __embind_register_class_function, "X": __embind_register_emval, "_": __embind_register_enum, "v": __embind_register_enum_value, "E": __embind_register_float, "f": __embind_register_function, "m": __embind_register_integer, "k": __embind_register_memory_view, "F": __embind_register_std_string, "w": __embind_register_std_wstring, "aa": __embind_register_value_array, "h": __embind_register_value_array_element, "r": __embind_register_value_object, "e": __embind_register_value_object_field, "Z": __embind_register_void, "o": __emval_as, "ba": __emval_call, "b": __emval_decref, "J": __emval_get_global, "l": __emval_get_property, "j": __emval_incref, "N": __emval_instanceof, "I": __emval_is_number, "y": __emval_new_array, "g": __emval_new_cstring, "u": __emval_new_object, "n": __emval_run_destructors, "i": __emval_set_property, "d": __emval_take_value, "A": _abort, "T": _clock_gettime, "M": _emscripten_memcpy_big, "p": _emscripten_resize_heap, "R": _environ_get, "S": _environ_sizes_get, "D": _fd_close, "U": _fd_read, "K": _fd_seek, "B": _fd_write, "a": wasmMemory, "z": _pthread_mutexattr_destroy, "P": _pthread_mutexattr_init, "O": _pthread_mutexattr_settype, "L": _setTempRet0, "Q": _strftime_l };
104748
+ var asmLibraryArg = { "z": ___assert_fail, "y": ___cxa_allocate_exception, "x": ___cxa_throw, "V": ___sys_ioctl, "W": ___sys_open, "$": __embind_finalize_value_array, "q": __embind_finalize_value_object, "Y": __embind_register_bool, "t": __embind_register_class, "s": __embind_register_class_constructor, "c": __embind_register_class_function, "X": __embind_register_emval, "_": __embind_register_enum, "v": __embind_register_enum_value, "F": __embind_register_float, "f": __embind_register_function, "o": __embind_register_integer, "k": __embind_register_memory_view, "G": __embind_register_std_string, "w": __embind_register_std_wstring, "aa": __embind_register_value_array, "h": __embind_register_value_array_element, "r": __embind_register_value_object, "e": __embind_register_value_object_field, "Z": __embind_register_void, "m": __emval_as, "H": __emval_call, "b": __emval_decref, "J": __emval_get_global, "n": __emval_get_property, "j": __emval_incref, "N": __emval_instanceof, "I": __emval_is_number, "A": __emval_new_array, "g": __emval_new_cstring, "u": __emval_new_object, "l": __emval_run_destructors, "i": __emval_set_property, "d": __emval_take_value, "C": _abort, "T": _clock_gettime, "M": _emscripten_memcpy_big, "p": _emscripten_resize_heap, "R": _environ_get, "S": _environ_sizes_get, "E": _fd_close, "U": _fd_read, "K": _fd_seek, "D": _fd_write, "a": wasmMemory, "B": _pthread_mutexattr_destroy, "P": _pthread_mutexattr_init, "O": _pthread_mutexattr_settype, "L": _setTempRet0, "Q": _strftime_l };
104735
104749
  createWasm();
104736
104750
  var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() {
104737
- return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["da"]).apply(null, arguments);
104751
+ return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["ca"]).apply(null, arguments);
104738
104752
  };
104739
104753
  Module["_main"] = function() {
104740
- return (Module["_main"] = Module["asm"]["ea"]).apply(null, arguments);
104754
+ return (Module["_main"] = Module["asm"]["da"]).apply(null, arguments);
104741
104755
  };
104742
104756
  var _malloc = Module["_malloc"] = function() {
104743
- return (_malloc = Module["_malloc"] = Module["asm"]["fa"]).apply(null, arguments);
104757
+ return (_malloc = Module["_malloc"] = Module["asm"]["ea"]).apply(null, arguments);
104744
104758
  };
104745
104759
  var _free = Module["_free"] = function() {
104746
- return (_free = Module["_free"] = Module["asm"]["ga"]).apply(null, arguments);
104760
+ return (_free = Module["_free"] = Module["asm"]["fa"]).apply(null, arguments);
104747
104761
  };
104748
104762
  var ___getTypeName = Module["___getTypeName"] = function() {
104749
- return (___getTypeName = Module["___getTypeName"] = Module["asm"]["ha"]).apply(null, arguments);
104763
+ return (___getTypeName = Module["___getTypeName"] = Module["asm"]["ga"]).apply(null, arguments);
104750
104764
  };
104751
104765
  Module["___embind_register_native_and_builtin_types"] = function() {
104752
- return (Module["___embind_register_native_and_builtin_types"] = Module["asm"]["ia"]).apply(null, arguments);
104766
+ return (Module["___embind_register_native_and_builtin_types"] = Module["asm"]["ha"]).apply(null, arguments);
104753
104767
  };
104754
104768
  var ___errno_location = Module["___errno_location"] = function() {
104755
- return (___errno_location = Module["___errno_location"] = Module["asm"]["ja"]).apply(null, arguments);
104769
+ return (___errno_location = Module["___errno_location"] = Module["asm"]["ia"]).apply(null, arguments);
104756
104770
  };
104757
104771
  Module["dynCall_jiji"] = function() {
104758
- return (Module["dynCall_jiji"] = Module["asm"]["ka"]).apply(null, arguments);
104772
+ return (Module["dynCall_jiji"] = Module["asm"]["ja"]).apply(null, arguments);
104759
104773
  };
104760
104774
  Module["dynCall_viijii"] = function() {
104761
- return (Module["dynCall_viijii"] = Module["asm"]["la"]).apply(null, arguments);
104775
+ return (Module["dynCall_viijii"] = Module["asm"]["ka"]).apply(null, arguments);
104762
104776
  };
104763
104777
  Module["dynCall_iiiiiijj"] = function() {
104764
- return (Module["dynCall_iiiiiijj"] = Module["asm"]["ma"]).apply(null, arguments);
104778
+ return (Module["dynCall_iiiiiijj"] = Module["asm"]["la"]).apply(null, arguments);
104765
104779
  };
104766
104780
  Module["dynCall_iiiiij"] = function() {
104767
- return (Module["dynCall_iiiiij"] = Module["asm"]["na"]).apply(null, arguments);
104781
+ return (Module["dynCall_iiiiij"] = Module["asm"]["ma"]).apply(null, arguments);
104768
104782
  };
104769
104783
  Module["dynCall_iiiiijj"] = function() {
104770
- return (Module["dynCall_iiiiijj"] = Module["asm"]["oa"]).apply(null, arguments);
104784
+ return (Module["dynCall_iiiiijj"] = Module["asm"]["na"]).apply(null, arguments);
104771
104785
  };
104772
104786
  Module["addRunDependency"] = addRunDependency;
104773
104787
  Module["removeRunDependency"] = removeRunDependency;
@@ -117580,19 +117594,19 @@ var IfcEventType = class {
117580
117594
  }
117581
117595
  };
117582
117596
  var IfcExtendedProperties = class {
117583
- constructor(expressID, type, Name, Description, Properties) {
117597
+ constructor(expressID, type, Name, Description, Properties2) {
117584
117598
  this.expressID = expressID;
117585
117599
  this.type = type;
117586
117600
  this.Name = Name;
117587
117601
  this.Description = Description;
117588
- this.Properties = Properties;
117602
+ this.Properties = Properties2;
117589
117603
  }
117590
117604
  static FromTape(expressID, type, tape) {
117591
117605
  let ptr = 0;
117592
117606
  let Name = tape[ptr++];
117593
117607
  let Description = tape[ptr++];
117594
- let Properties = tape[ptr++];
117595
- return new IfcExtendedProperties(expressID, type, Name, Description, Properties);
117608
+ let Properties2 = tape[ptr++];
117609
+ return new IfcExtendedProperties(expressID, type, Name, Description, Properties2);
117596
117610
  }
117597
117611
  ToTape() {
117598
117612
  let args = [];
@@ -121992,21 +122006,21 @@ var IfcMaterialProfileWithOffsets = class {
121992
122006
  }
121993
122007
  };
121994
122008
  var IfcMaterialProperties = class {
121995
- constructor(expressID, type, Name, Description, Properties, Material) {
122009
+ constructor(expressID, type, Name, Description, Properties2, Material) {
121996
122010
  this.expressID = expressID;
121997
122011
  this.type = type;
121998
122012
  this.Name = Name;
121999
122013
  this.Description = Description;
122000
- this.Properties = Properties;
122014
+ this.Properties = Properties2;
122001
122015
  this.Material = Material;
122002
122016
  }
122003
122017
  static FromTape(expressID, type, tape) {
122004
122018
  let ptr = 0;
122005
122019
  let Name = tape[ptr++];
122006
122020
  let Description = tape[ptr++];
122007
- let Properties = tape[ptr++];
122021
+ let Properties2 = tape[ptr++];
122008
122022
  let Material = tape[ptr++];
122009
- return new IfcMaterialProperties(expressID, type, Name, Description, Properties, Material);
122023
+ return new IfcMaterialProperties(expressID, type, Name, Description, Properties2, Material);
122010
122024
  }
122011
122025
  ToTape() {
122012
122026
  let args = [];
@@ -124682,21 +124696,21 @@ var IfcProfileDef = class {
124682
124696
  }
124683
124697
  };
124684
124698
  var IfcProfileProperties = class {
124685
- constructor(expressID, type, Name, Description, Properties, ProfileDefinition) {
124699
+ constructor(expressID, type, Name, Description, Properties2, ProfileDefinition) {
124686
124700
  this.expressID = expressID;
124687
124701
  this.type = type;
124688
124702
  this.Name = Name;
124689
124703
  this.Description = Description;
124690
- this.Properties = Properties;
124704
+ this.Properties = Properties2;
124691
124705
  this.ProfileDefinition = ProfileDefinition;
124692
124706
  }
124693
124707
  static FromTape(expressID, type, tape) {
124694
124708
  let ptr = 0;
124695
124709
  let Name = tape[ptr++];
124696
124710
  let Description = tape[ptr++];
124697
- let Properties = tape[ptr++];
124711
+ let Properties2 = tape[ptr++];
124698
124712
  let ProfileDefinition = tape[ptr++];
124699
- return new IfcProfileProperties(expressID, type, Name, Description, Properties, ProfileDefinition);
124713
+ return new IfcProfileProperties(expressID, type, Name, Description, Properties2, ProfileDefinition);
124700
124714
  }
124701
124715
  ToTape() {
124702
124716
  let args = [];
@@ -136340,19 +136354,373 @@ var IfcZone = class {
136340
136354
  }
136341
136355
  };
136342
136356
 
136357
+ // dist/helpers/ifc-elements.ts
136358
+ var IfcElements2 = {
136359
+ 103090709: "IFCPROJECT",
136360
+ 4097777520: "IFCSITE",
136361
+ 4031249490: "IFCBUILDING",
136362
+ 3124254112: "IFCBUILDINGSTOREY",
136363
+ 3856911033: "IFCSPACE",
136364
+ 1674181508: "IFCANNOTATION",
136365
+ 25142252: "IFCCONTROLLER",
136366
+ 32344328: "IFCBOILER",
136367
+ 76236018: "IFCLAMP",
136368
+ 90941305: "IFCPUMP",
136369
+ 177149247: "IFCAIRTERMINALBOX",
136370
+ 182646315: "IFCFLOWINSTRUMENT",
136371
+ 263784265: "IFCFURNISHINGELEMENT",
136372
+ 264262732: "IFCELECTRICGENERATOR",
136373
+ 277319702: "IFCAUDIOVISUALAPPLIANCE",
136374
+ 310824031: "IFCPIPEFITTING",
136375
+ 331165859: "IFCSTAIR",
136376
+ 342316401: "IFCDUCTFITTING",
136377
+ 377706215: "IFCMECHANICALFASTENER",
136378
+ 395920057: "IFCDOOR",
136379
+ 402227799: "IFCELECTRICMOTOR",
136380
+ 413509423: "IFCSYSTEMFURNITUREELEMENT",
136381
+ 484807127: "IFCEVAPORATOR",
136382
+ 486154966: "IFCWINDOWSTANDARDCASE",
136383
+ 629592764: "IFCLIGHTFIXTURE",
136384
+ 630975310: "IFCUNITARYCONTROLELEMENT",
136385
+ 635142910: "IFCCABLECARRIERFITTING",
136386
+ 639361253: "IFCCOIL",
136387
+ 647756555: "IFCFASTENER",
136388
+ 707683696: "IFCFLOWSTORAGEDEVICE",
136389
+ 738039164: "IFCPROTECTIVEDEVICE",
136390
+ 753842376: "IFCBEAM",
136391
+ 812556717: "IFCTANK",
136392
+ 819412036: "IFCFILTER",
136393
+ 843113511: "IFCCOLUMN",
136394
+ 862014818: "IFCELECTRICDISTRIBUTIONBOARD",
136395
+ 900683007: "IFCFOOTING",
136396
+ 905975707: "IFCCOLUMNSTANDARDCASE",
136397
+ 926996030: "IFCVOIDINGFEATURE",
136398
+ 979691226: "IFCREINFORCINGBAR",
136399
+ 987401354: "IFCFLOWSEGMENT",
136400
+ 1003880860: "IFCELECTRICTIMECONTROL",
136401
+ 1051757585: "IFCCABLEFITTING",
136402
+ 1052013943: "IFCDISTRIBUTIONCHAMBERELEMENT",
136403
+ 1062813311: "IFCDISTRIBUTIONCONTROLELEMENT",
136404
+ 1073191201: "IFCMEMBER",
136405
+ 1095909175: "IFCBUILDINGELEMENTPROXY",
136406
+ 1156407060: "IFCPLATESTANDARDCASE",
136407
+ 1162798199: "IFCSWITCHINGDEVICE",
136408
+ 1329646415: "IFCSHADINGDEVICE",
136409
+ 1335981549: "IFCDISCRETEACCESSORY",
136410
+ 1360408905: "IFCDUCTSILENCER",
136411
+ 1404847402: "IFCSTACKTERMINAL",
136412
+ 1426591983: "IFCFIRESUPPRESSIONTERMINAL",
136413
+ 1437502449: "IFCMEDICALDEVICE",
136414
+ 1509553395: "IFCFURNITURE",
136415
+ 1529196076: "IFCSLAB",
136416
+ 1620046519: "IFCTRANSPORTELEMENT",
136417
+ 1634111441: "IFCAIRTERMINAL",
136418
+ 1658829314: "IFCENERGYCONVERSIONDEVICE",
136419
+ 1677625105: "IFCCIVILELEMENT",
136420
+ 1687234759: "IFCPILE",
136421
+ 1904799276: "IFCELECTRICAPPLIANCE",
136422
+ 1911478936: "IFCMEMBERSTANDARDCASE",
136423
+ 1945004755: "IFCDISTRIBUTIONELEMENT",
136424
+ 1973544240: "IFCCOVERING",
136425
+ 1999602285: "IFCSPACEHEATER",
136426
+ 2016517767: "IFCROOF",
136427
+ 2056796094: "IFCAIRTOAIRHEATRECOVERY",
136428
+ 2058353004: "IFCFLOWCONTROLLER",
136429
+ 2068733104: "IFCHUMIDIFIER",
136430
+ 2176052936: "IFCJUNCTIONBOX",
136431
+ 2188021234: "IFCFLOWMETER",
136432
+ 2223149337: "IFCFLOWTERMINAL",
136433
+ 2262370178: "IFCRAILING",
136434
+ 2272882330: "IFCCONDENSER",
136435
+ 2295281155: "IFCPROTECTIVEDEVICETRIPPINGUNIT",
136436
+ 2320036040: "IFCREINFORCINGMESH",
136437
+ 2347447852: "IFCTENDONANCHOR",
136438
+ 2391383451: "IFCVIBRATIONISOLATOR",
136439
+ 2391406946: "IFCWALL",
136440
+ 2474470126: "IFCMOTORCONNECTION",
136441
+ 2769231204: "IFCVIRTUALELEMENT",
136442
+ 2814081492: "IFCENGINE",
136443
+ 2906023776: "IFCBEAMSTANDARDCASE",
136444
+ 2938176219: "IFCBURNER",
136445
+ 2979338954: "IFCBUILDINGELEMENTPART",
136446
+ 3024970846: "IFCRAMP",
136447
+ 3026737570: "IFCTUBEBUNDLE",
136448
+ 3027962421: "IFCSLABSTANDARDCASE",
136449
+ 3040386961: "IFCDISTRIBUTIONFLOWELEMENT",
136450
+ 3053780830: "IFCSANITARYTERMINAL",
136451
+ 3079942009: "IFCOPENINGSTANDARDCASE",
136452
+ 3087945054: "IFCALARM",
136453
+ 3101698114: "IFCSURFACEFEATURE",
136454
+ 3127900445: "IFCSLABELEMENTEDCASE",
136455
+ 3132237377: "IFCFLOWMOVINGDEVICE",
136456
+ 3171933400: "IFCPLATE",
136457
+ 3221913625: "IFCCOMMUNICATIONSAPPLIANCE",
136458
+ 3242481149: "IFCDOORSTANDARDCASE",
136459
+ 3283111854: "IFCRAMPFLIGHT",
136460
+ 3296154744: "IFCCHIMNEY",
136461
+ 3304561284: "IFCWINDOW",
136462
+ 3310460725: "IFCELECTRICFLOWSTORAGEDEVICE",
136463
+ 3319311131: "IFCHEATEXCHANGER",
136464
+ 3415622556: "IFCFAN",
136465
+ 3420628829: "IFCSOLARDEVICE",
136466
+ 3493046030: "IFCGEOGRAPHICELEMENT",
136467
+ 3495092785: "IFCCURTAINWALL",
136468
+ 3508470533: "IFCFLOWTREATMENTDEVICE",
136469
+ 3512223829: "IFCWALLSTANDARDCASE",
136470
+ 3518393246: "IFCDUCTSEGMENT",
136471
+ 3571504051: "IFCCOMPRESSOR",
136472
+ 3588315303: "IFCOPENINGELEMENT",
136473
+ 3612865200: "IFCPIPESEGMENT",
136474
+ 3640358203: "IFCCOOLINGTOWER",
136475
+ 3651124850: "IFCPROJECTIONELEMENT",
136476
+ 3694346114: "IFCOUTLET",
136477
+ 3747195512: "IFCEVAPORATIVECOOLER",
136478
+ 3758799889: "IFCCABLECARRIERSEGMENT",
136479
+ 3824725483: "IFCTENDON",
136480
+ 3825984169: "IFCTRANSFORMER",
136481
+ 3902619387: "IFCCHILLER",
136482
+ 4074379575: "IFCDAMPER",
136483
+ 4086658281: "IFCSENSOR",
136484
+ 4123344466: "IFCELEMENTASSEMBLY",
136485
+ 4136498852: "IFCCOOLEDBEAM",
136486
+ 4156078855: "IFCWALLELEMENTEDCASE",
136487
+ 4175244083: "IFCINTERCEPTOR",
136488
+ 4207607924: "IFCVALVE",
136489
+ 4217484030: "IFCCABLESEGMENT",
136490
+ 4237592921: "IFCWASTETERMINAL",
136491
+ 4252922144: "IFCSTAIRFLIGHT",
136492
+ 4278956645: "IFCFLOWFITTING",
136493
+ 4288193352: "IFCACTUATOR",
136494
+ 4292641817: "IFCUNITARYEQUIPMENT",
136495
+ 3009204131: "IFCGRID"
136496
+ };
136497
+
136498
+ // dist/helpers/properties.ts
136499
+ var PropsNames = {
136500
+ aggregates: {
136501
+ name: IFCRELAGGREGATES,
136502
+ relating: "RelatingObject",
136503
+ related: "RelatedObjects",
136504
+ key: "children"
136505
+ },
136506
+ spatial: {
136507
+ name: IFCRELCONTAINEDINSPATIALSTRUCTURE,
136508
+ relating: "RelatingStructure",
136509
+ related: "RelatedElements",
136510
+ key: "children"
136511
+ },
136512
+ psets: {
136513
+ name: IFCRELDEFINESBYPROPERTIES,
136514
+ relating: "RelatingPropertyDefinition",
136515
+ related: "RelatedObjects",
136516
+ key: "hasPsets"
136517
+ },
136518
+ materials: {
136519
+ name: IFCRELASSOCIATESMATERIAL,
136520
+ relating: "RelatingMaterial",
136521
+ related: "RelatedObjects",
136522
+ key: "hasMaterial"
136523
+ },
136524
+ type: {
136525
+ name: IFCRELDEFINESBYTYPE,
136526
+ relating: "RelatingType",
136527
+ related: "RelatedObjects",
136528
+ key: "hasType"
136529
+ }
136530
+ };
136531
+ var Properties = class {
136532
+ constructor(api) {
136533
+ this.api = api;
136534
+ }
136535
+ getItemProperties(modelID, id, recursive = false) {
136536
+ return __async(this, null, function* () {
136537
+ return this.api.GetLine(modelID, id, recursive);
136538
+ });
136539
+ }
136540
+ getPropertySets(modelID, elementID, recursive = false) {
136541
+ return __async(this, null, function* () {
136542
+ return yield this.getProperty(modelID, elementID, recursive, PropsNames.psets);
136543
+ });
136544
+ }
136545
+ getTypeProperties(modelID, elementID, recursive = false) {
136546
+ return __async(this, null, function* () {
136547
+ return yield this.getProperty(modelID, elementID, recursive, PropsNames.type);
136548
+ });
136549
+ }
136550
+ getMaterialsProperties(modelID, elementID, recursive = false) {
136551
+ return __async(this, null, function* () {
136552
+ return yield this.getProperty(modelID, elementID, recursive, PropsNames.materials);
136553
+ });
136554
+ }
136555
+ getSpatialStructure(modelID, includeProperties) {
136556
+ return __async(this, null, function* () {
136557
+ yield this.getAllTypesOfModel(modelID);
136558
+ const chunks = yield this.getSpatialTreeChunks(modelID);
136559
+ const allLines = yield this.api.GetLineIDsWithType(modelID, IFCPROJECT);
136560
+ const projectID = allLines.get(0);
136561
+ const project = Properties.newIfcProject(projectID);
136562
+ yield this.getSpatialNode(modelID, project, chunks, includeProperties);
136563
+ this.cleanupTypes();
136564
+ return project;
136565
+ });
136566
+ }
136567
+ getAllItemsOfType(modelID, type, verbose) {
136568
+ return __async(this, null, function* () {
136569
+ let items = [];
136570
+ const lines = yield this.api.GetLineIDsWithType(modelID, type);
136571
+ for (let i = 0; i < lines.size(); i++)
136572
+ items.push(lines.get(i));
136573
+ if (!verbose)
136574
+ return items;
136575
+ const result = [];
136576
+ for (let i = 0; i < items.length; i++) {
136577
+ result.push(yield this.api.GetLine(modelID, items[i]));
136578
+ }
136579
+ return result;
136580
+ });
136581
+ }
136582
+ getProperty(modelID, elementID, recursive = false, propName) {
136583
+ return __async(this, null, function* () {
136584
+ const propSetIds = yield this.getAllRelatedItemsOfType(modelID, elementID, propName);
136585
+ const result = [];
136586
+ for (let i = 0; i < propSetIds.length; i++) {
136587
+ result.push(yield this.api.GetLine(modelID, propSetIds[i], recursive));
136588
+ }
136589
+ return result;
136590
+ });
136591
+ }
136592
+ getChunks(modelID, chunks, propNames) {
136593
+ return __async(this, null, function* () {
136594
+ const relation = yield this.api.GetLineIDsWithType(modelID, propNames.name);
136595
+ for (let i = 0; i < relation.size(); i++) {
136596
+ const rel = yield this.api.GetLine(modelID, relation.get(i), false);
136597
+ this.saveChunk(chunks, propNames, rel);
136598
+ }
136599
+ });
136600
+ }
136601
+ static isRelated(id, rel, propNames) {
136602
+ const relatedItems = rel[propNames.related];
136603
+ if (Array.isArray(relatedItems)) {
136604
+ const values = relatedItems.map((item) => item.value);
136605
+ return values.includes(id);
136606
+ }
136607
+ return relatedItems.value === id;
136608
+ }
136609
+ static newIfcProject(id) {
136610
+ return {
136611
+ expressID: id,
136612
+ type: "IFCPROJECT",
136613
+ children: []
136614
+ };
136615
+ }
136616
+ getSpatialNode(modelID, node, treeChunks, includeProperties) {
136617
+ return __async(this, null, function* () {
136618
+ yield this.getChildren(modelID, node, treeChunks, PropsNames.aggregates, includeProperties);
136619
+ yield this.getChildren(modelID, node, treeChunks, PropsNames.spatial, includeProperties);
136620
+ });
136621
+ }
136622
+ getChildren(modelID, node, treeChunks, propNames, includeProperties) {
136623
+ return __async(this, null, function* () {
136624
+ const children = treeChunks[node.expressID];
136625
+ if (children == void 0)
136626
+ return;
136627
+ const prop = propNames.key;
136628
+ const nodes = [];
136629
+ for (let i = 0; i < children.length; i++) {
136630
+ const child = children[i];
136631
+ let node2 = this.newNode(child);
136632
+ if (includeProperties) {
136633
+ const properties = yield this.getItemProperties(modelID, node2.expressID);
136634
+ node2 = __spreadValues(__spreadValues({}, properties), node2);
136635
+ }
136636
+ yield this.getSpatialNode(modelID, node2, treeChunks, includeProperties);
136637
+ nodes.push(node2);
136638
+ }
136639
+ node[prop] = nodes;
136640
+ });
136641
+ }
136642
+ newNode(id) {
136643
+ const typeName = this.getNodeType(id);
136644
+ return {
136645
+ expressID: id,
136646
+ type: typeName,
136647
+ children: []
136648
+ };
136649
+ }
136650
+ getNodeType(id) {
136651
+ const typeID = this.types[id];
136652
+ return IfcElements2[typeID];
136653
+ }
136654
+ getSpatialTreeChunks(modelID) {
136655
+ return __async(this, null, function* () {
136656
+ const treeChunks = {};
136657
+ yield this.getChunks(modelID, treeChunks, PropsNames.aggregates);
136658
+ yield this.getChunks(modelID, treeChunks, PropsNames.spatial);
136659
+ return treeChunks;
136660
+ });
136661
+ }
136662
+ saveChunk(chunks, propNames, rel) {
136663
+ const relating = rel[propNames.relating].value;
136664
+ const related = rel[propNames.related].map((r) => r.value);
136665
+ if (chunks[relating] == void 0) {
136666
+ chunks[relating] = related;
136667
+ } else {
136668
+ chunks[relating] = chunks[relating].concat(related);
136669
+ }
136670
+ }
136671
+ getRelated(rel, propNames, IDs) {
136672
+ const element = rel[propNames.relating];
136673
+ if (!Array.isArray(element))
136674
+ IDs.push(element.value);
136675
+ else
136676
+ element.forEach((ele) => IDs.push(ele.value));
136677
+ }
136678
+ getAllRelatedItemsOfType(modelID, id, propNames) {
136679
+ return __async(this, null, function* () {
136680
+ const lines = yield this.api.GetLineIDsWithType(modelID, propNames.name);
136681
+ const IDs = [];
136682
+ for (let i = 0; i < lines.size(); i++) {
136683
+ const rel = yield this.api.GetLine(modelID, lines.get(i));
136684
+ const isRelated = Properties.isRelated(id, rel, propNames);
136685
+ if (isRelated)
136686
+ this.getRelated(rel, propNames, IDs);
136687
+ }
136688
+ return IDs;
136689
+ });
136690
+ }
136691
+ cleanupTypes() {
136692
+ this.types = {};
136693
+ }
136694
+ getAllTypesOfModel(modelID) {
136695
+ return __async(this, null, function* () {
136696
+ const result = {};
136697
+ const elements = Object.keys(IfcElements2).map((e) => parseInt(e));
136698
+ for (let i = 0; i < elements.length; i++) {
136699
+ const element = elements[i];
136700
+ const lines = yield this.api.GetLineIDsWithType(modelID, element);
136701
+ const size = lines.size();
136702
+ for (let i2 = 0; i2 < size; i2++)
136703
+ result[lines.get(i2)] = element;
136704
+ }
136705
+ this.types = result;
136706
+ });
136707
+ }
136708
+ };
136709
+
136343
136710
  // dist/web-ifc-api.ts
136344
136711
  var WebIFCWasm;
136345
- if (self.crossOriginIsolated) {
136712
+ if (typeof self !== "undefined" && self.crossOriginIsolated) {
136346
136713
  WebIFCWasm = require_web_ifc_mt();
136347
136714
  } else {
136348
136715
  WebIFCWasm = require_web_ifc();
136349
136716
  }
136350
- var IfcAPI = class {
136717
+ var IfcAPI2 = class {
136351
136718
  constructor() {
136352
136719
  this.wasmModule = void 0;
136353
136720
  this.fs = void 0;
136354
136721
  this.wasmPath = "";
136355
136722
  this.ifcGuidMap = new Map();
136723
+ this.properties = new Properties(this);
136356
136724
  }
136357
136725
  Init(customLocateFileHandler) {
136358
136726
  return __async(this, null, function* () {
@@ -136371,7 +136739,6 @@ var IfcAPI = class {
136371
136739
  });
136372
136740
  }
136373
136741
  OpenModel(data, settings) {
136374
- this.wasmModule["FS_createDataFile"]("/", "filename", data, true, true, true);
136375
136742
  let s = __spreadValues({
136376
136743
  COORDINATE_TO_ORIGIN: false,
136377
136744
  USE_FAST_BOOLS: false,
@@ -136380,8 +136747,15 @@ var IfcAPI = class {
136380
136747
  CIRCLE_SEGMENTS_HIGH: 12,
136381
136748
  BOOL_ABORT_THRESHOLD: 1e4
136382
136749
  }, settings);
136383
- let result = this.wasmModule.OpenModel(s);
136384
- this.wasmModule["FS_unlink"]("/filename");
136750
+ let offsetInSrc = 0;
136751
+ let result = this.wasmModule.OpenModel(s, (destPtr, destSize) => {
136752
+ let srcSize = Math.min(data.byteLength - offsetInSrc, destSize);
136753
+ let dest = this.wasmModule.HEAPU8.subarray(destPtr, destPtr + destSize);
136754
+ let src = data.subarray(offsetInSrc, offsetInSrc + srcSize);
136755
+ dest.set(src);
136756
+ offsetInSrc += srcSize;
136757
+ return srcSize;
136758
+ });
136385
136759
  return result;
136386
136760
  }
136387
136761
  CreateModel(settings) {
@@ -136528,9 +136902,9 @@ var IfcAPI = class {
136528
136902
  };
136529
136903
 
136530
136904
  /**
136531
- * Default data access strategy for {@link IFCLoaderPlugin}.
136905
+ * Default data access strategy for {@link WebIFCLoaderPlugin}.
136532
136906
  */
136533
- class IFCDefaultDataSource {
136907
+ class WebIFCDefaultDataSource {
136534
136908
 
136535
136909
  constructor() {
136536
136910
  }
@@ -137364,7 +137738,7 @@ class SplineCurve extends Curve {
137364
137738
  }
137365
137739
  }
137366
137740
 
137367
- const tempVec3a$3 = math.vec3();
137741
+ const tempVec3a$4 = math.vec3();
137368
137742
 
137369
137743
  /**
137370
137744
  * @desc Defines a sequence of frames along which a {@link CameraPathAnimation} can animate a {@link Camera}.
@@ -137496,9 +137870,9 @@ class CameraPath extends Component {
137496
137870
  t = t / (this._frames[this._frames.length - 1].t - this._frames[0].t);
137497
137871
  t = t < 0.0 ? 0.0 : (t > 1.0 ? 1.0 : t);
137498
137872
 
137499
- camera.eye = this._eyeCurve.getPoint(t, tempVec3a$3);
137500
- camera.look = this._lookCurve.getPoint(t, tempVec3a$3);
137501
- camera.up = this._upCurve.getPoint(t, tempVec3a$3);
137873
+ camera.eye = this._eyeCurve.getPoint(t, tempVec3a$4);
137874
+ camera.look = this._lookCurve.getPoint(t, tempVec3a$4);
137875
+ camera.up = this._upCurve.getPoint(t, tempVec3a$4);
137502
137876
  }
137503
137877
 
137504
137878
  /**
@@ -140156,7 +140530,7 @@ function buildPlaneGeometry(cfg = {}) {
140156
140530
  }
140157
140531
 
140158
140532
  const tempVec3$1 = math.vec3();
140159
- const tempVec3b$3 = math.vec3();
140533
+ const tempVec3b$4 = math.vec3();
140160
140534
  math.vec3();
140161
140535
  const zeroVec = math.vec3([0, -1, 0]);
140162
140536
  const tempQuat = math.vec4([0, 0, 0, 1]);
@@ -140348,7 +140722,7 @@ class ImagePlane extends Component {
140348
140722
  clippable: cfg.clippable
140349
140723
  });
140350
140724
 
140351
- this._node = new Node(this, {
140725
+ this._node = new Node$1(this, {
140352
140726
  rotation: [0, 0, 0],
140353
140727
  position: [0, 0, 0],
140354
140728
  scale: [1, 1, 1],
@@ -140584,7 +140958,7 @@ class ImagePlane extends Component {
140584
140958
  const dist = -math.dotVec3(negDir, tempVec3$1);
140585
140959
 
140586
140960
  math.normalizeVec3(negDir);
140587
- math.mulVec3Scalar(negDir, dist, tempVec3b$3);
140961
+ math.mulVec3Scalar(negDir, dist, tempVec3b$4);
140588
140962
  math.vec3PairToQuaternion(zeroVec, dir, tempQuat);
140589
140963
 
140590
140964
  this._node.quaternion = tempQuat;
@@ -142820,9 +143194,9 @@ class QuadraticBezierCurve extends Curve {
142820
143194
  const screenPos = math.vec4();
142821
143195
  const viewPos = math.vec4();
142822
143196
 
142823
- const tempVec3a$2 = math.vec3();
142824
- const tempVec3b$2 = math.vec3();
142825
- const tempVec3c$2 = math.vec3();
143197
+ const tempVec3a$3 = math.vec3();
143198
+ const tempVec3b$3 = math.vec3();
143199
+ const tempVec3c$3 = math.vec3();
142826
143200
 
142827
143201
  const tempVec4a$1 = math.vec4();
142828
143202
  const tempVec4b$1 = math.vec4();
@@ -142855,7 +143229,7 @@ class PanController {
142855
143229
  const camera = this._scene.camera;
142856
143230
 
142857
143231
  if (optionalTargetWorldPos) {
142858
- const eyeToWorldPosVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$2);
143232
+ const eyeToWorldPosVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$3);
142859
143233
  const eyeWorldPosDist = math.lenVec3(eyeToWorldPosVec);
142860
143234
  dolliedThroughSurface = (eyeWorldPosDist < dollyDelta);
142861
143235
  }
@@ -142879,9 +143253,9 @@ class PanController {
142879
143253
  // suddenly a lot closer than the point we pivoted about on the surface of the last object
142880
143254
  // that we click-drag-pivoted on.
142881
143255
 
142882
- const eyeTargetVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$2);
143256
+ const eyeTargetVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$3);
142883
143257
  const lenEyeTargetVec = math.lenVec3(eyeTargetVec);
142884
- const eyeLookVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3b$2)), lenEyeTargetVec);
143258
+ const eyeLookVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3b$3)), lenEyeTargetVec);
142885
143259
  camera.look = [camera.eye[0] + eyeLookVec[0], camera.eye[1] + eyeLookVec[1], camera.eye[2] + eyeLookVec[2]];
142886
143260
  }
142887
143261
 
@@ -142898,8 +143272,8 @@ class PanController {
142898
143272
 
142899
143273
  const worldPos2 = this._unproject(targetCanvasPos, tempVec4b$1);
142900
143274
  const offset = math.subVec3(worldPos2, worldPos1, tempVec4c$1);
142901
- const eyeLookMoveVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$2)), -dollyDelta, tempVec3b$2);
142902
- const moveVec = math.addVec3(offset, eyeLookMoveVec, tempVec3c$2);
143275
+ const eyeLookMoveVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$3)), -dollyDelta, tempVec3b$3);
143276
+ const moveVec = math.addVec3(offset, eyeLookMoveVec, tempVec3c$3);
142903
143277
 
142904
143278
  camera.eye = [camera.eye[0] - moveVec[0], camera.eye[1] - moveVec[1], camera.eye[2] - moveVec[2]];
142905
143279
  camera.look = [camera.look[0] - moveVec[0], camera.look[1] - moveVec[1], camera.look[2] - moveVec[2]];
@@ -142926,9 +143300,9 @@ class PanController {
142926
143300
  }
142927
143301
  }
142928
143302
 
142929
- const tempVec3a$1 = math.vec3();
142930
- const tempVec3b$1 = math.vec3();
142931
- const tempVec3c$1 = math.vec3();
143303
+ const tempVec3a$2 = math.vec3();
143304
+ const tempVec3b$2 = math.vec3();
143305
+ const tempVec3c$2 = math.vec3();
142932
143306
 
142933
143307
  const tempVec4a = math.vec4();
142934
143308
  const tempVec4b = math.vec4();
@@ -143052,8 +143426,8 @@ class PivotController {
143052
143426
 
143053
143427
  _cameraLookingDownwards() { // Returns true if angle between camera viewing direction and World-space "up" axis is too small
143054
143428
  const camera = this._scene.camera;
143055
- const forwardAxis = math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$1));
143056
- const rightAxis = math.cross3Vec3(forwardAxis, camera.worldUp, tempVec3b$1);
143429
+ const forwardAxis = math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$2));
143430
+ const rightAxis = math.cross3Vec3(forwardAxis, camera.worldUp, tempVec3b$2);
143057
143431
  let rightAxisLen = math.sqLenVec3(rightAxis);
143058
143432
  return (rightAxisLen <= 0.0001);
143059
143433
  }
@@ -143093,8 +143467,8 @@ class PivotController {
143093
143467
  const screenZ = math.dotVec4(D, Pt3) / math.dotVec4(D, Pt4);
143094
143468
  const worldPos = tempVec4a;
143095
143469
  camera.project.unproject(canvasPos, screenZ, tempVec4b, tempVec4c, worldPos);
143096
- const eyeWorldPosVec = math.normalizeVec3(math.subVec3(worldPos, camera.eye, tempVec3a$1));
143097
- const posOnSphere = math.addVec3(camera.eye, math.mulVec3Scalar(eyeWorldPosVec, pivotShereRadius, tempVec3b$1), tempVec3c$1);
143470
+ const eyeWorldPosVec = math.normalizeVec3(math.subVec3(worldPos, camera.eye, tempVec3a$2));
143471
+ const posOnSphere = math.addVec3(camera.eye, math.mulVec3Scalar(eyeWorldPosVec, pivotShereRadius, tempVec3b$2), tempVec3c$2);
143098
143472
  this.setPivotPos(posOnSphere);
143099
143473
  }
143100
143474
 
@@ -143701,7 +144075,6 @@ class MousePanRotateDollyHandler {
143701
144075
  mouseMovedOnCanvasSinceLastWheel = false;
143702
144076
  }
143703
144077
 
143704
- e.preventDefault();
143705
144078
  }, {passive: true});
143706
144079
  }
143707
144080
 
@@ -143725,9 +144098,9 @@ class MousePanRotateDollyHandler {
143725
144098
  }
143726
144099
 
143727
144100
  const center = math.vec3();
143728
- const tempVec3a = math.vec3();
143729
- const tempVec3b = math.vec3();
143730
- const tempVec3c = math.vec3();
144101
+ const tempVec3a$1 = math.vec3();
144102
+ const tempVec3b$1 = math.vec3();
144103
+ const tempVec3c$1 = math.vec3();
143731
144104
  const tempVec3d = math.vec3();
143732
144105
 
143733
144106
  const tempCameraTarget = {
@@ -143780,39 +144153,39 @@ class KeyboardAxisViewHandler {
143780
144153
 
143781
144154
  if (axisViewRight) {
143782
144155
 
143783
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, perspectiveDist, tempVec3a), tempVec3d));
144156
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, perspectiveDist, tempVec3a$1), tempVec3d));
143784
144157
  tempCameraTarget.look.set(center);
143785
144158
  tempCameraTarget.up.set(camera.worldUp);
143786
144159
 
143787
144160
  } else if (axisViewBack) {
143788
144161
 
143789
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, perspectiveDist, tempVec3a), tempVec3d));
144162
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, perspectiveDist, tempVec3a$1), tempVec3d));
143790
144163
  tempCameraTarget.look.set(center);
143791
144164
  tempCameraTarget.up.set(camera.worldUp);
143792
144165
 
143793
144166
  } else if (axisViewLeft) {
143794
144167
 
143795
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, -perspectiveDist, tempVec3a), tempVec3d));
144168
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, -perspectiveDist, tempVec3a$1), tempVec3d));
143796
144169
  tempCameraTarget.look.set(center);
143797
144170
  tempCameraTarget.up.set(camera.worldUp);
143798
144171
 
143799
144172
  } else if (axisViewFront) {
143800
144173
 
143801
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, -perspectiveDist, tempVec3a), tempVec3d));
144174
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, -perspectiveDist, tempVec3a$1), tempVec3d));
143802
144175
  tempCameraTarget.look.set(center);
143803
144176
  tempCameraTarget.up.set(camera.worldUp);
143804
144177
 
143805
144178
  } else if (axisViewTop) {
143806
144179
 
143807
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, perspectiveDist, tempVec3a), tempVec3d));
144180
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, perspectiveDist, tempVec3a$1), tempVec3d));
143808
144181
  tempCameraTarget.look.set(center);
143809
- tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, 1, tempVec3b), tempVec3c));
144182
+ tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, 1, tempVec3b$1), tempVec3c$1));
143810
144183
 
143811
144184
  } else if (axisViewBottom) {
143812
144185
 
143813
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, -perspectiveDist, tempVec3a), tempVec3d));
144186
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, -perspectiveDist, tempVec3a$1), tempVec3d));
143814
144187
  tempCameraTarget.look.set(center);
143815
- tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, -1, tempVec3b)));
144188
+ tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, -1, tempVec3b$1)));
143816
144189
  }
143817
144190
 
143818
144191
  if ((!configs.firstPerson) && configs.followPointer) {
@@ -148164,14 +148537,12 @@ class Configs {
148164
148537
  }
148165
148538
  }
148166
148539
 
148167
- const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - smaller size for increasing distance
148168
-
148169
148540
  /**
148170
- * Experimental {@link Viewer} plugin that loads BIM models directly from IFC files.
148541
+ * Experimental {@link Viewer} plugin that uses [web-ifc](https://github.com/tomvandig/web-ifc) to load BIM models directly from IFC files.
148171
148542
  *
148172
- * <a href="https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_IFC_Duplex"><img src="https://xeokit.io/img/docs/IFCLoaderPlugin/IFCLoaderPlugin.png"></a>
148543
+ * <a href="https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_WebIFCLoaderPlugin_Duplex"><img src="https://xeokit.io/img/docs/WebIFCLoaderPlugin/WebIFCLoaderPlugin.png"></a>
148173
148544
  *
148174
- * [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_IFC_Duplex)]
148545
+ * [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_WebIFCLoaderPlugin_Duplex)]
148175
148546
  *
148176
148547
  * ## Overview
148177
148548
  *
@@ -148188,42 +148559,37 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148188
148559
  *
148189
148560
  * ## Limitations
148190
148561
  *
148191
- * IFCLoaderPlugin has certain limitations:
148192
- *
148193
- * * Downloads IFC files over the network, which can be large.
148194
- * * Parsing large IFC files can crash the browser (suspect overrunning browser memory limits).
148195
- * * No IFC geometry reuse yet.
148196
- * <br><br>
148197
- * Despite these limitations, IFCLoaderPlugin may still be perfect for small-scale IFC model viewing
148198
- * applications, and for getting started with xeokit and IFC in general.
148562
+ * Loading and parsing huge IFC STEP files can be slow, and can overwhelm the browser, however. To view your
148563
+ * largest IFC models, we recommend instead pre-converting those to xeokit's compressed native .XKT format, then
148564
+ * loading them with {@link XKTLoaderPlugin} instead.</p>
148199
148565
  *
148200
148566
  * ## Scene representation
148201
148567
  *
148202
- * When loading a model, IFCLoaderPlugin creates an {@link Entity} that represents the model, which
148568
+ * When loading a model, WebIFCLoaderPlugin creates an {@link Entity} that represents the model, which
148203
148569
  * will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id}
148204
- * in {@link Scene#models}. The IFCLoaderPlugin also creates an {@link Entity} for each object within the
148570
+ * in {@link Scene#models}. The WebIFCLoaderPlugin also creates an {@link Entity} for each object within the
148205
148571
  * model. Those Entities will have {@link Entity#isObject} set ````true```` and will be registered
148206
148572
  * by {@link Entity#id} in {@link Scene#objects}.
148207
148573
  *
148208
148574
  * ## Metadata
148209
148575
  *
148210
- * When loading a model, IFCLoaderPlugin also creates a {@link MetaModel} that represents the model, which contains
148576
+ * When loading a model, WebIFCLoaderPlugin also creates a {@link MetaModel} that represents the model, which contains
148211
148577
  * a {@link MetaObject} for each IFC element, plus a {@link PropertySet} for each IFC property set. Loading metadata can be very slow, so we can also optionally disable it if we
148212
148578
  * don't need it.
148213
148579
  *
148214
148580
  * ## Usage
148215
148581
  *
148216
148582
  * In the example below we'll load the Duplex BIM model from
148217
- * an [IFC file](https://github.com/xeokit/xeokit-sdk/tree/master/examples/models/ifc/Duplex.ifc). Within our {@link Viewer}, this will create a bunch of {@link Entity}s that represents the model and its objects, along with a {@link MetaModel}, {@link MetaObject}s and {@link PropertySet}s
148583
+ * an [IFC file](https://github.com/xeokit/xeokit-sdk/tree/master/assets/models/ifc). Within our {@link Viewer}, this will create a bunch of {@link Entity}s that represents the model and its objects, along with a {@link MetaModel}, {@link MetaObject}s and {@link PropertySet}s
148218
148584
  * that hold their metadata.
148219
148585
  *
148220
- * Since this model contains IFC types, the IFCLoaderPlugin will set the initial appearance of each object
148221
- * {@link Entity} according to its IFC type in {@link IFCLoaderPlugin#objectDefaults}.
148586
+ * Since this model contains IFC types, the WebIFCLoaderPlugin will set the initial appearance of each object
148587
+ * {@link Entity} according to its IFC type in {@link WebIFCLoaderPlugin#objectDefaults}.
148222
148588
  *
148223
- * * [[Run example](https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_IFC_isolateStorey)]
148589
+ * * [[Run example](https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_WebIFCLoaderPlugin_isolateStorey)]
148224
148590
  *
148225
148591
  * ````javascript
148226
- * import {Viewer, IFCLoaderPlugin} from "xeokit-sdk.es.js";
148592
+ * import {Viewer, WebIFCLoaderPlugin} from "xeokit-sdk.es.js";
148227
148593
  *
148228
148594
  * //------------------------------------------------------------------------------------------------------------------
148229
148595
  * // 1. Create a Viewer,
@@ -148242,12 +148608,12 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148242
148608
  * viewer.camera.up = [0.10, 0.98, -0.14];
148243
148609
  *
148244
148610
  * //------------------------------------------------------------------------------------------------------------------
148245
- * // 1. Create a IFCLoaderPlugin, configured with a path to the bundled third-party web-ifc.wasm module
148611
+ * // 1. Create a WebIFCLoaderPlugin, configured with a path to the bundled third-party web-ifc.wasm module
148246
148612
  * // 2. Load a BIM model fom an IFC file, excluding its IfcSpace elements, and highlighting edges
148247
148613
  * //------------------------------------------------------------------------------------------------------------------
148248
148614
  *
148249
148615
  * // 1
148250
- * const ifcLoader = new IFCLoaderPlugin(viewer, {
148616
+ * const ifcLoader = new WebIFCLoaderPlugin(viewer, {
148251
148617
  * wasmPath: "../dist/" // <<------- Path to web-ifc.wasm, which does the IFC parsing for us
148252
148618
  * });
148253
148619
  *
@@ -148383,7 +148749,7 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148383
148749
  * It's often helpful to make IfcSpaces transparent and unpickable, like this:
148384
148750
  *
148385
148751
  * ````javascript
148386
- * const ifcLoader = new IFCLoaderPlugin(viewer, {
148752
+ * const ifcLoader = new WebIFCLoaderPlugin(viewer, {
148387
148753
  * wasmPath: "../dist/",
148388
148754
  * objectDefaults: {
148389
148755
  * IfcSpace: {
@@ -148397,7 +148763,7 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148397
148763
  * Alternatively, we could just make IfcSpaces invisible, which also makes them unpickable:
148398
148764
  *
148399
148765
  * ````javascript
148400
- * const ifcLoader = new IFCLoaderPlugin(viewer, {
148766
+ * const ifcLoader = new WebIFCLoaderPlugin(viewer, {
148401
148767
  * wasmPath: "../dist/",
148402
148768
  * objectDefaults: {
148403
148769
  * IfcSpace: {
@@ -148409,9 +148775,9 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148409
148775
  *
148410
148776
  * ## Configuring a custom data source
148411
148777
  *
148412
- * By default, IFCLoaderPlugin will load IFC files over HTTP.
148778
+ * By default, WebIFCLoaderPlugin will load IFC files over HTTP.
148413
148779
  *
148414
- * In the example below, we'll customize the way IFCLoaderPlugin loads the files by configuring it with our own data source
148780
+ * In the example below, we'll customize the way WebIFCLoaderPlugin loads the files by configuring it with our own data source
148415
148781
  * object. For simplicity, our custom data source example also uses HTTP, using a couple of xeokit utility functions.
148416
148782
  *
148417
148783
  * ````javascript
@@ -148435,7 +148801,7 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148435
148801
  * }
148436
148802
  * }
148437
148803
  *
148438
- * const ifcLoader2 = new IFCLoaderPlugin(viewer, {
148804
+ * const ifcLoader2 = new WebIFCLoaderPlugin(viewer, {
148439
148805
  * dataSource: new MyDataSource()
148440
148806
  * });
148441
148807
  *
@@ -148450,7 +148816,7 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148450
148816
  * Sometimes we need to load two or more instances of the same model, without having clashes
148451
148817
  * between the IDs of the equivalent objects in the model instances.
148452
148818
  *
148453
- * As shown in the example below, we do this by setting {@link IFCLoaderPlugin#globalizeObjectIds} ````true```` before we load our models.
148819
+ * As shown in the example below, we do this by setting {@link WebIFCLoaderPlugin#globalizeObjectIds} ````true```` before we load our models.
148454
148820
  *
148455
148821
  * ````javascript
148456
148822
  * ifcLoader.globalizeObjectIds = true;
@@ -148497,10 +148863,10 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148497
148863
  * myViewer.scene.setObjectVisibilities("myModel1#0BTBFw6f90Nfh9rP1dlXrb", true);
148498
148864
  *````
148499
148865
  *
148500
- * @class IFCLoaderPlugin
148866
+ * @class WebIFCLoaderPlugin
148501
148867
  * @since 2.0.13
148502
148868
  */
148503
- class IFCLoaderPlugin extends Plugin {
148869
+ class WebIFCLoaderPlugin extends Plugin {
148504
148870
 
148505
148871
  /**
148506
148872
  * @constructor
@@ -148508,31 +148874,24 @@ class IFCLoaderPlugin extends Plugin {
148508
148874
  * @param {Viewer} viewer The Viewer.
148509
148875
  * @param {Object} cfg Plugin configuration.
148510
148876
  * @param {String} [cfg.id="ifcLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
148511
- * @param {String} cfg.wasmPath Path to ````web-ifc.wasm````, required by IFCLoaderlugin.
148877
+ * @param {String} cfg.wasmPath Path to ````web-ifc.wasm````, required by WebIFCLoaderPlugin.
148512
148878
  * @param {Object} [cfg.objectDefaults] Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.
148513
- * @param {Object} [cfg.dataSource] A custom data source through which the IFCLoaderPlugin can load model and metadata files. Defaults to an instance of {@link IFCDefaultDataSource}, which loads uover HTTP.
148879
+ * @param {Object} [cfg.dataSource] A custom data source through which the WebIFCLoaderPlugin can load model and metadata files. Defaults to an instance of {@link WebIFCDefaultDataSource}, which loads over HTTP.
148514
148880
  * @param {String[]} [cfg.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
148515
148881
  * @param {String[]} [cfg.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
148516
148882
  * @param {Boolean} [cfg.excludeUnclassifiedObjects=false] When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}.
148517
- * @param {Number} [cfg.maxGeometryBatchSize=50000000] Maximum geometry batch size, as number of vertices. This is optionally supplied
148518
- * to limit the size of the batched geometry arrays that {@link PerformanceModel} internally creates for batched geometries.
148519
- * A low value means less heap allocation/de-allocation while loading batched geometries, but more draw calls and
148520
- * slower rendering speed. A high value means larger heap allocation/de-allocation while loading, but less draw calls
148521
- * and faster rendering speed. It's recommended to keep this somewhere roughly between ````50000```` and ````50000000```.
148522
148883
  */
148523
148884
  constructor(viewer, cfg = {}) {
148524
148885
 
148525
148886
  super("ifcLoader", viewer, cfg);
148526
148887
 
148527
- this._maxGeometryBatchSize = cfg.maxGeometryBatchSize;
148528
-
148529
148888
  this.dataSource = cfg.dataSource;
148530
148889
  this.objectDefaults = cfg.objectDefaults;
148531
148890
  this.includeTypes = cfg.includeTypes;
148532
148891
  this.excludeTypes = cfg.excludeTypes;
148533
148892
  this.excludeUnclassifiedObjects = cfg.excludeUnclassifiedObjects;
148534
148893
 
148535
- this._ifcAPI = new IfcAPI();
148894
+ this._ifcAPI = new IfcAPI2();
148536
148895
 
148537
148896
  if (cfg.wasmPath) {
148538
148897
  this._ifcAPI.SetWasmPath(cfg.wasmPath);
@@ -148546,7 +148905,7 @@ class IFCLoaderPlugin extends Plugin {
148546
148905
  }
148547
148906
 
148548
148907
  /**
148549
- * Gets the ````IFC```` format versions supported by this IFCLoaderPlugin.
148908
+ * Gets the ````IFC```` format versions supported by this WebIFCLoaderPlugin.
148550
148909
  * @returns {string[]}
148551
148910
  */
148552
148911
  get supportedVersions() {
@@ -148554,9 +148913,9 @@ class IFCLoaderPlugin extends Plugin {
148554
148913
  }
148555
148914
 
148556
148915
  /**
148557
- * Gets the custom data source through which the IFCLoaderPlugin can load IFC files.
148916
+ * Gets the custom data source through which the WebIFCLoaderPlugin can load IFC files.
148558
148917
  *
148559
- * Default value is {@link IFCDefaultDataSource}, which loads via HTTP.
148918
+ * Default value is {@link WebIFCDefaultDataSource}, which loads via HTTP.
148560
148919
  *
148561
148920
  * @type {Object}
148562
148921
  */
@@ -148565,14 +148924,14 @@ class IFCLoaderPlugin extends Plugin {
148565
148924
  }
148566
148925
 
148567
148926
  /**
148568
- * Sets a custom data source through which the IFCLoaderPlugin can load IFC files.
148927
+ * Sets a custom data source through which the WebIFCLoaderPlugin can load IFC files.
148569
148928
  *
148570
- * Default value is {@link IFCDefaultDataSource}, which loads via HTTP.
148929
+ * Default value is {@link WebIFCDefaultDataSource}, which loads via HTTP.
148571
148930
  *
148572
148931
  * @type {Object}
148573
148932
  */
148574
148933
  set dataSource(value) {
148575
- this._dataSource = value || new IFCDefaultDataSource();
148934
+ this._dataSource = value || new WebIFCDefaultDataSource();
148576
148935
  }
148577
148936
 
148578
148937
  /**
@@ -148598,9 +148957,9 @@ class IFCLoaderPlugin extends Plugin {
148598
148957
  }
148599
148958
 
148600
148959
  /**
148601
- * Gets the whitelist of the IFC types loaded by this IFCLoaderPlugin.
148960
+ * Gets the whitelist of the IFC types loaded by this WebIFCLoaderPlugin.
148602
148961
  *
148603
- * When loading IFC models, causes this IFCLoaderPlugin to only load objects whose types are in this
148962
+ * When loading IFC models, causes this WebIFCLoaderPlugin to only load objects whose types are in this
148604
148963
  * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
148605
148964
  *
148606
148965
  * Default value is ````undefined````.
@@ -148612,9 +148971,9 @@ class IFCLoaderPlugin extends Plugin {
148612
148971
  }
148613
148972
 
148614
148973
  /**
148615
- * Sets the whitelist of the IFC types loaded by this IFCLoaderPlugin.
148974
+ * Sets the whitelist of the IFC types loaded by this WebIFCLoaderPlugin.
148616
148975
  *
148617
- * When loading IFC models, causes this IFCLoaderPlugin to only load objects whose types are in this
148976
+ * When loading IFC models, causes this WebIFCLoaderPlugin to only load objects whose types are in this
148618
148977
  * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
148619
148978
  *
148620
148979
  * Default value is ````undefined````.
@@ -148626,9 +148985,9 @@ class IFCLoaderPlugin extends Plugin {
148626
148985
  }
148627
148986
 
148628
148987
  /**
148629
- * Gets the blacklist of IFC types that are never loaded by this IFCLoaderPlugin.
148988
+ * Gets the blacklist of IFC types that are never loaded by this WebIFCLoaderPlugin.
148630
148989
  *
148631
- * When loading IFC models, causes this IFCLoaderPlugin to **not** load objects whose types are in this
148990
+ * When loading IFC models, causes this WebIFCLoaderPlugin to **not** load objects whose types are in this
148632
148991
  * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
148633
148992
  *
148634
148993
  * Default value is ````undefined````.
@@ -148640,9 +148999,9 @@ class IFCLoaderPlugin extends Plugin {
148640
148999
  }
148641
149000
 
148642
149001
  /**
148643
- * Sets the blacklist of IFC types that are never loaded by this IFCLoaderPlugin.
149002
+ * Sets the blacklist of IFC types that are never loaded by this WebIFCLoaderPlugin.
148644
149003
  *
148645
- * When IFC models, causes this IFCLoaderPlugin to **not** load objects whose types are in this
149004
+ * When IFC models, causes this WebIFCLoaderPlugin to **not** load objects whose types are in this
148646
149005
  * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
148647
149006
  *
148648
149007
  * Default value is ````undefined````.
@@ -148656,7 +149015,7 @@ class IFCLoaderPlugin extends Plugin {
148656
149015
  /**
148657
149016
  * Gets whether we load objects that don't have IFC types.
148658
149017
  *
148659
- * When loading IFC models and this is ````true````, IFCLoaderPlugin will not load objects
149018
+ * When loading IFC models and this is ````true````, WebIFCLoaderPlugin will not load objects
148660
149019
  * that don't have IFC types.
148661
149020
  *
148662
149021
  * Default value is ````false````.
@@ -148670,7 +149029,7 @@ class IFCLoaderPlugin extends Plugin {
148670
149029
  /**
148671
149030
  * Sets whether we load objects that don't have IFC types.
148672
149031
  *
148673
- * When loading IFC models and this is ````true````, IFCLoaderPlugin will not load objects
149032
+ * When loading IFC models and this is ````true````, WebIFCLoaderPlugin will not load objects
148674
149033
  * that don't have IFC types.
148675
149034
  *
148676
149035
  * Default value is ````false````.
@@ -148682,7 +149041,7 @@ class IFCLoaderPlugin extends Plugin {
148682
149041
  }
148683
149042
 
148684
149043
  /**
148685
- * Gets whether IFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
149044
+ * Gets whether WebIFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
148686
149045
  *
148687
149046
  * Default value is ````false````.
148688
149047
  *
@@ -148693,7 +149052,7 @@ class IFCLoaderPlugin extends Plugin {
148693
149052
  }
148694
149053
 
148695
149054
  /**
148696
- * Sets whether IFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
149055
+ * Sets whether WebIFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
148697
149056
  *
148698
149057
  * Set this ````true```` when you need to load multiple instances of the same model, to avoid ID clashes
148699
149058
  * between the objects in the different instances.
@@ -148705,7 +149064,7 @@ class IFCLoaderPlugin extends Plugin {
148705
149064
  *
148706
149065
  * Default value is ````false````.
148707
149066
  *
148708
- * See the main {@link IFCLoaderPlugin} class documentation for usage info.
149067
+ * See the main {@link WebIFCLoaderPlugin} class documentation for usage info.
148709
149068
  *
148710
149069
  * @type {Boolean}
148711
149070
  */
@@ -148714,27 +149073,28 @@ class IFCLoaderPlugin extends Plugin {
148714
149073
  }
148715
149074
 
148716
149075
  /**
148717
- * Loads an ````IFC```` model into this IFCLoaderPlugin's {@link Viewer}.
149076
+ * Loads an ````IFC```` model into this WebIFCLoaderPlugin's {@link Viewer}.
148718
149077
  *
148719
149078
  * @param {*} params Loading parameters.
148720
149079
  * @param {String} [params.id] ID to assign to the root {@link Entity#id}, unique among all components in the Viewer's {@link Scene}, generated automatically by default.
148721
149080
  * @param {String} [params.src] Path to a IFC file, as an alternative to the ````ifc```` parameter.
148722
149081
  * @param {ArrayBuffer} [params.ifc] The IFC file data, as an alternative to the ````src```` parameter.
148723
- * @param {ArrayBuffer} [params.loadMetadata=true] Whether to load IFC metadata (metaobjects and property sets).
149082
+ * @param {Boolean} [params.loadMetadata=true] Whether to load IFC metadata (metaobjects and property sets).
148724
149083
  * @param {{String:Object}} [params.objectDefaults] Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.
148725
149084
  * @param {String[]} [params.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
148726
149085
  * @param {String[]} [params.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
148727
149086
  * @param {Boolean} [params.edges=false] Whether or not xeokit renders the model with edges emphasized.
148728
- * @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
148729
- * @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
148730
- * @param {Number[]} [params.rotation=[0,0,0]] The model's World-space rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
148731
- * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters.
149087
+ * @param {Number[]} [params.origin=[0,0,0]] The model's World-space double-precision 3D origin. Use this to position the model within xeokit's World coordinate system, using double-precision coordinates.
149088
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
149089
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
149090
+ * @param {Number[]} [params.rotation=[0,0,0]] The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis.
149091
+ * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````.
148732
149092
  * @param {Boolean} [params.edges=false] Indicates if the model's edges are initially emphasized.
148733
149093
  * @param {Boolean} [params.saoEnabled=true] Indicates if Scalable Ambient Obscurance (SAO) will apply to the model. SAO is configured by the Scene's {@link SAO} component. Only works when {@link SAO#enabled} is also ````true````
148734
149094
  * @param {Boolean} [params.pbrEnabled=false] Indicates if physically-based rendering (PBR) will apply to the model. Only works when {@link Scene#pbrEnabled} is also ````true````.
148735
149095
  * @param {Number} [params.backfaces=false] When we set this ````true````, then we force rendering of backfaces for the model. When we leave this ````false````, then we allow the Viewer to decide when to render backfaces. In that case, the Viewer will hide backfaces on watertight meshes, show backfaces on open meshes, and always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
148736
149096
  * @param {Boolean} [params.excludeUnclassifiedObjects=false] When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}.
148737
- * @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models. See {@link IFCLoaderPlugin#globalizeObjectIds} for more info.
149097
+ * @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models. See {@link WebIFCLoaderPlugin#globalizeObjectIds} for more info.
148738
149098
  * @param {Object} [params.stats] Collects model statistics.
148739
149099
  * @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
148740
149100
  */
@@ -148746,8 +149106,7 @@ class IFCLoaderPlugin extends Plugin {
148746
149106
  }
148747
149107
 
148748
149108
  const performanceModel = new PerformanceModel(this.viewer.scene, utils.apply(params, {
148749
- isModel: true,
148750
- maxGeometryBatchSize: this._maxGeometryBatchSize
149109
+ isModel: true
148751
149110
  }));
148752
149111
 
148753
149112
  if (!params.src && !params.ifc) {
@@ -148840,13 +149199,14 @@ class IFCLoaderPlugin extends Plugin {
148840
149199
  const ifcProjectId = lines.get(0);
148841
149200
 
148842
149201
  const loadMetadata = (params.loadMetadata !== false);
148843
- const metaData = loadMetadata ? {
148844
- id: "1601",
149202
+
149203
+ const metadata = loadMetadata ? {
149204
+ id: "",
148845
149205
  projectId: "" + ifcProjectId,
148846
149206
  author: "",
148847
- createdAt: "2017-01-19T01:36:20",
148848
- schema: "IFC2X3",
148849
- creatingApplication: "20161117_1200(x64) - Exporter 17.2.0.0 - Interface alternative d'export 17.2.0.0",
149207
+ createdAt: "",
149208
+ schema: "",
149209
+ creatingApplication: "",
148850
149210
  metaObjects: [],
148851
149211
  propertySets: []
148852
149212
  } : null;
@@ -148855,7 +149215,7 @@ class IFCLoaderPlugin extends Plugin {
148855
149215
  modelID,
148856
149216
  performanceModel,
148857
149217
  loadMetadata,
148858
- metaData,
149218
+ metadata,
148859
149219
  metaObjects: {},
148860
149220
  options,
148861
149221
  log: function (msg) {
@@ -148890,7 +149250,7 @@ class IFCLoaderPlugin extends Plugin {
148890
149250
 
148891
149251
  if (loadMetadata) {
148892
149252
  const metaModelId = performanceModel.id;
148893
- this.viewer.metaScene.createMetaModel(metaModelId, ctx.metaData, options);
149253
+ this.viewer.metaScene.createMetaModel(metaModelId, ctx.metadata, options);
148894
149254
  }
148895
149255
 
148896
149256
  performanceModel.scene.once("tick", () => {
@@ -148933,7 +149293,7 @@ class IFCLoaderPlugin extends Plugin {
148933
149293
  type: metaObjectName,
148934
149294
  parent: parentMetaObjectId
148935
149295
  };
148936
- ctx.metaData.metaObjects.push(metaObject);
149296
+ ctx.metadata.metaObjects.push(metaObject);
148937
149297
  ctx.metaObjects[id] = metaObject;
148938
149298
  ctx.stats.numMetaObjects++;
148939
149299
  }
@@ -149007,7 +149367,7 @@ class IFCLoaderPlugin extends Plugin {
149007
149367
  name: propertySetName,
149008
149368
  properties: properties
149009
149369
  };
149010
- ctx.metaData.propertySets.push(propertySet);
149370
+ ctx.metadata.propertySets.push(propertySet);
149011
149371
  ctx.stats.numPropertySets++;
149012
149372
  const relatedObjects = rel.RelatedObjects;
149013
149373
  if (!relatedObjects || relatedObjects.length === 0) {
@@ -149054,21 +149414,21 @@ class IFCLoaderPlugin extends Plugin {
149054
149414
  const vertexData = this._ifcAPI.GetVertexArray(geometry.GetVertexData(), geometry.GetVertexDataSize());
149055
149415
  const indices = this._ifcAPI.GetIndexArray(geometry.GetIndexData(), geometry.GetIndexDataSize());
149056
149416
  // De-interleave vertex arrays
149057
- const positions = [];
149058
- const normals = [];
149059
- for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {
149060
- positions.push(vertexData[k * 6 + 0]);
149061
- positions.push(vertexData[k * 6 + 1]);
149062
- positions.push(vertexData[k * 6 + 2]);
149417
+ const positions = new Float64Array(vertexData.length / 2);
149418
+ const normals = new Float32Array(vertexData.length / 2);
149419
+ for (let k = 0, l = 0, lenk = vertexData.length / 6; k < lenk; k++, l += 3) {
149420
+ positions[l + 0] = vertexData[k * 6 + 0];
149421
+ positions[l + 1] = vertexData[k * 6 + 1];
149422
+ positions[l + 2] = vertexData[k * 6 + 2];
149063
149423
  }
149064
149424
  matrix.set(placedGeometry.flatTransformation);
149065
149425
  math.transformPositions3(matrix, positions);
149066
- const rtcNeeded = worldToRTCPositions(positions, positions, origin, RTC_TILE_SIZE);
149426
+ const rtcNeeded = worldToRTCPositions(positions, positions, origin);
149067
149427
  if (!ctx.options.autoNormals) {
149068
- for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {
149069
- normals.push(vertexData[k * 6 + 3]);
149070
- normals.push(vertexData[k * 6 + 4]);
149071
- normals.push(vertexData[k * 6 + 5]);
149428
+ for (let k = 0, l = 0, lenk = vertexData.length / 6; k < lenk; k++, l += 3) {
149429
+ normals[l + 0] = vertexData[k * 6 + 3];
149430
+ normals[l + 1] = vertexData[k * 6 + 4];
149431
+ normals[l + 2] = vertexData[k * 6 + 5];
149072
149432
  }
149073
149433
  }
149074
149434
  ctx.stats.numGeometries++;
@@ -151617,7 +151977,7 @@ class LASLoaderPlugin extends Plugin {
151617
151977
  * @param {Viewer} viewer The Viewer.
151618
151978
  * @param {Object} cfg Plugin configuration.
151619
151979
  * @param {String} [cfg.id="lasLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
151620
- * @param {Object} [cfg.dataSource] A custom data source through which the LASLoaderPlugin can load model and metadata files. Defaults to an instance of {@link LASDefaultDataSource}, which loads uover HTTP.
151980
+ * @param {Object} [cfg.dataSource] A custom data source through which the LASLoaderPlugin can load model and metadata files. Defaults to an instance of {@link LASDefaultDataSource}, which loads over HTTP.
151621
151981
  * @param {Number} [cfg.skip=1] Configures LASLoaderPlugin to load every **n** points.
151622
151982
  * @param {Number} [cfg.fp64=false] Configures if LASLoaderPlugin assumes that LAS positions are stored in 64-bit floats instead of 32-bit.
151623
151983
  * @param {Number} [cfg.colorDepth=8] Configures whether LASLoaderPlugin assumes that LAS colors are encoded using 8 or 16 bits. Accepted values are 8, 16 an "auto".
@@ -151731,10 +152091,12 @@ class LASLoaderPlugin extends Plugin {
151731
152091
  * @param {String} [params.id] ID to assign to the root {@link Entity#id}, unique among all components in the Viewer's {@link Scene}, generated automatically by default.
151732
152092
  * @param {String} [params.src] Path to a LAS file, as an alternative to the ````las```` parameter.
151733
152093
  * @param {ArrayBuffer} [params.las] The LAS file data, as an alternative to the ````src```` parameter.
151734
- * @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
151735
- * @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
151736
- * @param {Number[]} [params.rotation=[0,0,0]] The model's World-space rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
151737
- * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters.
152094
+ * @param {Boolean} [params.loadMetadata=true] Whether to load metadata for the LAS model.
152095
+ * @param {Number[]} [params.origin=[0,0,0]] The model's World-space double-precision 3D origin. Use this to position the model within xeokit's World coordinate system, using double-precision coordinates.
152096
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
152097
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
152098
+ * @param {Number[]} [params.rotation=[0,0,0]] The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis.
152099
+ * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````.
151738
152100
  * @param {Object} [params.stats] Collects model statistics.
151739
152101
  * @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
151740
152102
  */
@@ -151747,7 +152109,11 @@ class LASLoaderPlugin extends Plugin {
151747
152109
 
151748
152110
  const performanceModel = new PerformanceModel(this.viewer.scene, utils.apply(params, {
151749
152111
  isModel: true,
151750
- maxGeometryBatchSize: this._maxGeometryBatchSize
152112
+ origin: params.origin,
152113
+ position: params.position,
152114
+ scale: params.scale,
152115
+ rotation: params.rotation,
152116
+ matrix: params.matrix
151751
152117
  }));
151752
152118
 
151753
152119
  if (!params.src && !params.las) {
@@ -151920,15 +152286,39 @@ class LASLoaderPlugin extends Plugin {
151920
152286
  colorsCompressed: colorsCompressed
151921
152287
  });
151922
152288
 
152289
+ const pointsObjectId = math.createUUID();
152290
+
151923
152291
  performanceModel.createEntity({
151924
- id: math.createUUID(),
152292
+ id: pointsObjectId,
151925
152293
  meshIds: ["pointsMesh"],
151926
152294
  isObject: true
151927
152295
  });
151928
152296
 
151929
152297
  performanceModel.finalize();
151930
152298
 
151931
- // TODO: Create metamodel
152299
+ if (params.loadMetadata !== false) {
152300
+ const rootMetaObjectId = math.createUUID();
152301
+ const metadata = {
152302
+ projectId: "",
152303
+ author: "",
152304
+ createdAt: "",
152305
+ schema: "",
152306
+ creatingApplication: "",
152307
+ metaObjects: [{
152308
+ id: rootMetaObjectId,
152309
+ name: "Model",
152310
+ type: "Model"
152311
+ }, {
152312
+ id: pointsObjectId,
152313
+ name: "PointCloud (LAS)",
152314
+ type: "PointCloud",
152315
+ parent: rootMetaObjectId
152316
+ }],
152317
+ propertySets: []
152318
+ };
152319
+ const metaModelId = performanceModel.id;
152320
+ this.viewer.metaScene.createMetaModel(metaModelId, metadata, options);
152321
+ }
151932
152322
 
151933
152323
  performanceModel.scene.once("tick", () => {
151934
152324
  if (performanceModel.destroyed) {
@@ -151948,6 +152338,1440 @@ class LASLoaderPlugin extends Plugin {
151948
152338
  }
151949
152339
  }
151950
152340
 
152341
+ /**
152342
+ * Default data access strategy for {@link CityJSONLoaderPlugin}.
152343
+ */
152344
+ class CityJSONDefaultDataSource {
152345
+
152346
+ constructor() {
152347
+ }
152348
+
152349
+ /**
152350
+ * Gets the contents of the given CityJSON file.
152351
+ *
152352
+ * @param {String|Number} src Path or ID of an CityJSON file.
152353
+ * @param {Function} ok Callback fired on success, argument is the CityJSON JSON.
152354
+ * @param {Function} error Callback fired on error.
152355
+ */
152356
+ getCityJSON(src, ok, error) {
152357
+ utils.loadJSON(src,
152358
+ (json) => {
152359
+ ok(json);
152360
+ },
152361
+ function (errMsg) {
152362
+ error(errMsg);
152363
+ });
152364
+ }
152365
+ }
152366
+
152367
+ /** @private */
152368
+ function earcut(data, holeIndices, dim) {
152369
+
152370
+ dim = dim || 2;
152371
+
152372
+ var hasHoles = holeIndices && holeIndices.length,
152373
+ outerLen = hasHoles ? holeIndices[0] * dim : data.length,
152374
+ outerNode = linkedList(data, 0, outerLen, dim, true),
152375
+ triangles = [];
152376
+
152377
+ if (!outerNode || outerNode.next === outerNode.prev) return triangles;
152378
+
152379
+ var minX, minY, maxX, maxY, x, y, invSize;
152380
+
152381
+ if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);
152382
+
152383
+ // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
152384
+ if (data.length > 80 * dim) {
152385
+ minX = maxX = data[0];
152386
+ minY = maxY = data[1];
152387
+
152388
+ for (var i = dim; i < outerLen; i += dim) {
152389
+ x = data[i];
152390
+ y = data[i + 1];
152391
+ if (x < minX) minX = x;
152392
+ if (y < minY) minY = y;
152393
+ if (x > maxX) maxX = x;
152394
+ if (y > maxY) maxY = y;
152395
+ }
152396
+
152397
+ // minX, minY and invSize are later used to transform coords into integers for z-order calculation
152398
+ invSize = Math.max(maxX - minX, maxY - minY);
152399
+ invSize = invSize !== 0 ? 1 / invSize : 0;
152400
+ }
152401
+
152402
+ earcutLinked(outerNode, triangles, dim, minX, minY, invSize);
152403
+
152404
+ return triangles;
152405
+ }
152406
+
152407
+ // create a circular doubly linked list from polygon points in the specified winding order
152408
+ function linkedList(data, start, end, dim, clockwise) {
152409
+ var i, last;
152410
+
152411
+ if (clockwise === (signedArea(data, start, end, dim) > 0)) {
152412
+ for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);
152413
+ } else {
152414
+ for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);
152415
+ }
152416
+
152417
+ if (last && equals(last, last.next)) {
152418
+ removeNode(last);
152419
+ last = last.next;
152420
+ }
152421
+
152422
+ return last;
152423
+ }
152424
+
152425
+ // eliminate colinear or duplicate points
152426
+ function filterPoints(start, end) {
152427
+ if (!start) return start;
152428
+ if (!end) end = start;
152429
+
152430
+ var p = start,
152431
+ again;
152432
+ do {
152433
+ again = false;
152434
+
152435
+ if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
152436
+ removeNode(p);
152437
+ p = end = p.prev;
152438
+ if (p === p.next) break;
152439
+ again = true;
152440
+
152441
+ } else {
152442
+ p = p.next;
152443
+ }
152444
+ } while (again || p !== end);
152445
+
152446
+ return end;
152447
+ }
152448
+
152449
+ // main ear slicing loop which triangulates a polygon (given as a linked list)
152450
+ function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {
152451
+ if (!ear) return;
152452
+
152453
+ // interlink polygon nodes in z-order
152454
+ if (!pass && invSize) indexCurve(ear, minX, minY, invSize);
152455
+
152456
+ var stop = ear,
152457
+ prev, next;
152458
+
152459
+ // iterate through ears, slicing them one by one
152460
+ while (ear.prev !== ear.next) {
152461
+ prev = ear.prev;
152462
+ next = ear.next;
152463
+
152464
+ if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
152465
+ // cut off the triangle
152466
+ triangles.push(prev.i / dim);
152467
+ triangles.push(ear.i / dim);
152468
+ triangles.push(next.i / dim);
152469
+
152470
+ removeNode(ear);
152471
+
152472
+ // skipping the next vertex leads to less sliver triangles
152473
+ ear = next.next;
152474
+ stop = next.next;
152475
+
152476
+ continue;
152477
+ }
152478
+
152479
+ ear = next;
152480
+
152481
+ // if we looped through the whole remaining polygon and can't find any more ears
152482
+ if (ear === stop) {
152483
+ // try filtering points and slicing again
152484
+ if (!pass) {
152485
+ earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);
152486
+
152487
+ // if this didn't work, try curing all small self-intersections locally
152488
+ } else if (pass === 1) {
152489
+ ear = cureLocalIntersections(filterPoints(ear), triangles, dim);
152490
+ earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);
152491
+
152492
+ // as a last resort, try splitting the remaining polygon into two
152493
+ } else if (pass === 2) {
152494
+ splitEarcut(ear, triangles, dim, minX, minY, invSize);
152495
+ }
152496
+
152497
+ break;
152498
+ }
152499
+ }
152500
+ }
152501
+
152502
+ // check whether a polygon node forms a valid ear with adjacent nodes
152503
+ function isEar(ear) {
152504
+ var a = ear.prev,
152505
+ b = ear,
152506
+ c = ear.next;
152507
+
152508
+ if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
152509
+
152510
+ // now make sure we don't have other points inside the potential ear
152511
+ var p = ear.next.next;
152512
+
152513
+ while (p !== ear.prev) {
152514
+ if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
152515
+ area(p.prev, p, p.next) >= 0) return false;
152516
+ p = p.next;
152517
+ }
152518
+
152519
+ return true;
152520
+ }
152521
+
152522
+ function isEarHashed(ear, minX, minY, invSize) {
152523
+ var a = ear.prev,
152524
+ b = ear,
152525
+ c = ear.next;
152526
+
152527
+ if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
152528
+
152529
+ // triangle bbox; min & max are calculated like this for speed
152530
+ var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),
152531
+ minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),
152532
+ maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),
152533
+ maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);
152534
+
152535
+ // z-order range for the current triangle bbox;
152536
+ var minZ = zOrder(minTX, minTY, minX, minY, invSize),
152537
+ maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);
152538
+
152539
+ var p = ear.prevZ,
152540
+ n = ear.nextZ;
152541
+
152542
+ // look for points inside the triangle in both directions
152543
+ while (p && p.z >= minZ && n && n.z <= maxZ) {
152544
+ if (p !== ear.prev && p !== ear.next &&
152545
+ pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
152546
+ area(p.prev, p, p.next) >= 0) return false;
152547
+ p = p.prevZ;
152548
+
152549
+ if (n !== ear.prev && n !== ear.next &&
152550
+ pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
152551
+ area(n.prev, n, n.next) >= 0) return false;
152552
+ n = n.nextZ;
152553
+ }
152554
+
152555
+ // look for remaining points in decreasing z-order
152556
+ while (p && p.z >= minZ) {
152557
+ if (p !== ear.prev && p !== ear.next &&
152558
+ pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
152559
+ area(p.prev, p, p.next) >= 0) return false;
152560
+ p = p.prevZ;
152561
+ }
152562
+
152563
+ // look for remaining points in increasing z-order
152564
+ while (n && n.z <= maxZ) {
152565
+ if (n !== ear.prev && n !== ear.next &&
152566
+ pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
152567
+ area(n.prev, n, n.next) >= 0) return false;
152568
+ n = n.nextZ;
152569
+ }
152570
+
152571
+ return true;
152572
+ }
152573
+
152574
+ // go through all polygon nodes and cure small local self-intersections
152575
+ function cureLocalIntersections(start, triangles, dim) {
152576
+ var p = start;
152577
+ do {
152578
+ var a = p.prev,
152579
+ b = p.next.next;
152580
+
152581
+ if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
152582
+
152583
+ triangles.push(a.i / dim);
152584
+ triangles.push(p.i / dim);
152585
+ triangles.push(b.i / dim);
152586
+
152587
+ // remove two nodes involved
152588
+ removeNode(p);
152589
+ removeNode(p.next);
152590
+
152591
+ p = start = b;
152592
+ }
152593
+ p = p.next;
152594
+ } while (p !== start);
152595
+
152596
+ return filterPoints(p);
152597
+ }
152598
+
152599
+ // try splitting polygon into two and triangulate them independently
152600
+ function splitEarcut(start, triangles, dim, minX, minY, invSize) {
152601
+ // look for a valid diagonal that divides the polygon into two
152602
+ var a = start;
152603
+ do {
152604
+ var b = a.next.next;
152605
+ while (b !== a.prev) {
152606
+ if (a.i !== b.i && isValidDiagonal(a, b)) {
152607
+ // split the polygon in two by the diagonal
152608
+ var c = splitPolygon(a, b);
152609
+
152610
+ // filter colinear points around the cuts
152611
+ a = filterPoints(a, a.next);
152612
+ c = filterPoints(c, c.next);
152613
+
152614
+ // run earcut on each half
152615
+ earcutLinked(a, triangles, dim, minX, minY, invSize);
152616
+ earcutLinked(c, triangles, dim, minX, minY, invSize);
152617
+ return;
152618
+ }
152619
+ b = b.next;
152620
+ }
152621
+ a = a.next;
152622
+ } while (a !== start);
152623
+ }
152624
+
152625
+ // link every hole into the outer loop, producing a single-ring polygon without holes
152626
+ function eliminateHoles(data, holeIndices, outerNode, dim) {
152627
+ var queue = [],
152628
+ i, len, start, end, list;
152629
+
152630
+ for (i = 0, len = holeIndices.length; i < len; i++) {
152631
+ start = holeIndices[i] * dim;
152632
+ end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
152633
+ list = linkedList(data, start, end, dim, false);
152634
+ if (list === list.next) list.steiner = true;
152635
+ queue.push(getLeftmost(list));
152636
+ }
152637
+
152638
+ queue.sort(compareX);
152639
+
152640
+ // process holes from left to right
152641
+ for (i = 0; i < queue.length; i++) {
152642
+ eliminateHole(queue[i], outerNode);
152643
+ outerNode = filterPoints(outerNode, outerNode.next);
152644
+ }
152645
+
152646
+ return outerNode;
152647
+ }
152648
+
152649
+ function compareX(a, b) {
152650
+ return a.x - b.x;
152651
+ }
152652
+
152653
+ // find a bridge between vertices that connects hole with an outer ring and and link it
152654
+ function eliminateHole(hole, outerNode) {
152655
+ outerNode = findHoleBridge(hole, outerNode);
152656
+ if (outerNode) {
152657
+ var b = splitPolygon(outerNode, hole);
152658
+
152659
+ // filter collinear points around the cuts
152660
+ filterPoints(outerNode, outerNode.next);
152661
+ filterPoints(b, b.next);
152662
+ }
152663
+ }
152664
+
152665
+ // David Eberly's algorithm for finding a bridge between hole and outer polygon
152666
+ function findHoleBridge(hole, outerNode) {
152667
+ var p = outerNode,
152668
+ hx = hole.x,
152669
+ hy = hole.y,
152670
+ qx = -Infinity,
152671
+ m;
152672
+
152673
+ // find a segment intersected by a ray from the hole's leftmost point to the left;
152674
+ // segment's endpoint with lesser x will be potential connection point
152675
+ do {
152676
+ if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {
152677
+ var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
152678
+ if (x <= hx && x > qx) {
152679
+ qx = x;
152680
+ if (x === hx) {
152681
+ if (hy === p.y) return p;
152682
+ if (hy === p.next.y) return p.next;
152683
+ }
152684
+ m = p.x < p.next.x ? p : p.next;
152685
+ }
152686
+ }
152687
+ p = p.next;
152688
+ } while (p !== outerNode);
152689
+
152690
+ if (!m) return null;
152691
+
152692
+ if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint
152693
+
152694
+ // look for points inside the triangle of hole point, segment intersection and endpoint;
152695
+ // if there are no points found, we have a valid connection;
152696
+ // otherwise choose the point of the minimum angle with the ray as connection point
152697
+
152698
+ var stop = m,
152699
+ mx = m.x,
152700
+ my = m.y,
152701
+ tanMin = Infinity,
152702
+ tan;
152703
+
152704
+ p = m;
152705
+
152706
+ do {
152707
+ if (hx >= p.x && p.x >= mx && hx !== p.x &&
152708
+ pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {
152709
+
152710
+ tan = Math.abs(hy - p.y) / (hx - p.x); // tangential
152711
+
152712
+ if (locallyInside(p, hole) &&
152713
+ (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {
152714
+ m = p;
152715
+ tanMin = tan;
152716
+ }
152717
+ }
152718
+
152719
+ p = p.next;
152720
+ } while (p !== stop);
152721
+
152722
+ return m;
152723
+ }
152724
+
152725
+ // whether sector in vertex m contains sector in vertex p in the same coordinates
152726
+ function sectorContainsSector(m, p) {
152727
+ return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;
152728
+ }
152729
+
152730
+ // interlink polygon nodes in z-order
152731
+ function indexCurve(start, minX, minY, invSize) {
152732
+ var p = start;
152733
+ do {
152734
+ if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);
152735
+ p.prevZ = p.prev;
152736
+ p.nextZ = p.next;
152737
+ p = p.next;
152738
+ } while (p !== start);
152739
+
152740
+ p.prevZ.nextZ = null;
152741
+ p.prevZ = null;
152742
+
152743
+ sortLinked(p);
152744
+ }
152745
+
152746
+ // Simon Tatham's linked list merge sort algorithm
152747
+ // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
152748
+ function sortLinked(list) {
152749
+ var i, p, q, e, tail, numMerges, pSize, qSize,
152750
+ inSize = 1;
152751
+
152752
+ do {
152753
+ p = list;
152754
+ list = null;
152755
+ tail = null;
152756
+ numMerges = 0;
152757
+
152758
+ while (p) {
152759
+ numMerges++;
152760
+ q = p;
152761
+ pSize = 0;
152762
+ for (i = 0; i < inSize; i++) {
152763
+ pSize++;
152764
+ q = q.nextZ;
152765
+ if (!q) break;
152766
+ }
152767
+ qSize = inSize;
152768
+
152769
+ while (pSize > 0 || (qSize > 0 && q)) {
152770
+
152771
+ if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {
152772
+ e = p;
152773
+ p = p.nextZ;
152774
+ pSize--;
152775
+ } else {
152776
+ e = q;
152777
+ q = q.nextZ;
152778
+ qSize--;
152779
+ }
152780
+
152781
+ if (tail) tail.nextZ = e;
152782
+ else list = e;
152783
+
152784
+ e.prevZ = tail;
152785
+ tail = e;
152786
+ }
152787
+
152788
+ p = q;
152789
+ }
152790
+
152791
+ tail.nextZ = null;
152792
+ inSize *= 2;
152793
+
152794
+ } while (numMerges > 1);
152795
+
152796
+ return list;
152797
+ }
152798
+
152799
+ // z-order of a point given coords and inverse of the longer side of data bbox
152800
+ function zOrder(x, y, minX, minY, invSize) {
152801
+ // coords are transformed into non-negative 15-bit integer range
152802
+ x = 32767 * (x - minX) * invSize;
152803
+ y = 32767 * (y - minY) * invSize;
152804
+
152805
+ x = (x | (x << 8)) & 0x00FF00FF;
152806
+ x = (x | (x << 4)) & 0x0F0F0F0F;
152807
+ x = (x | (x << 2)) & 0x33333333;
152808
+ x = (x | (x << 1)) & 0x55555555;
152809
+
152810
+ y = (y | (y << 8)) & 0x00FF00FF;
152811
+ y = (y | (y << 4)) & 0x0F0F0F0F;
152812
+ y = (y | (y << 2)) & 0x33333333;
152813
+ y = (y | (y << 1)) & 0x55555555;
152814
+
152815
+ return x | (y << 1);
152816
+ }
152817
+
152818
+ // find the leftmost node of a polygon ring
152819
+ function getLeftmost(start) {
152820
+ var p = start,
152821
+ leftmost = start;
152822
+ do {
152823
+ if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;
152824
+ p = p.next;
152825
+ } while (p !== start);
152826
+
152827
+ return leftmost;
152828
+ }
152829
+
152830
+ // check if a point lies within a convex triangle
152831
+ function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
152832
+ return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&
152833
+ (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&
152834
+ (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;
152835
+ }
152836
+
152837
+ // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
152838
+ function isValidDiagonal(a, b) {
152839
+ return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
152840
+ (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
152841
+ (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
152842
+ equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case
152843
+ }
152844
+
152845
+ // signed area of a triangle
152846
+ function area(p, q, r) {
152847
+ return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
152848
+ }
152849
+
152850
+ // check if two points are equal
152851
+ function equals(p1, p2) {
152852
+ return p1.x === p2.x && p1.y === p2.y;
152853
+ }
152854
+
152855
+ // check if two segments intersect
152856
+ function intersects(p1, q1, p2, q2) {
152857
+ var o1 = sign(area(p1, q1, p2));
152858
+ var o2 = sign(area(p1, q1, q2));
152859
+ var o3 = sign(area(p2, q2, p1));
152860
+ var o4 = sign(area(p2, q2, q1));
152861
+
152862
+ if (o1 !== o2 && o3 !== o4) return true; // general case
152863
+
152864
+ if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1
152865
+ if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1
152866
+ if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2
152867
+ if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2
152868
+
152869
+ return false;
152870
+ }
152871
+
152872
+ // for collinear points p, q, r, check if point q lies on segment pr
152873
+ function onSegment(p, q, r) {
152874
+ return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);
152875
+ }
152876
+
152877
+ function sign(num) {
152878
+ return num > 0 ? 1 : num < 0 ? -1 : 0;
152879
+ }
152880
+
152881
+ // check if a polygon diagonal intersects any polygon segments
152882
+ function intersectsPolygon(a, b) {
152883
+ var p = a;
152884
+ do {
152885
+ if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&
152886
+ intersects(p, p.next, a, b)) return true;
152887
+ p = p.next;
152888
+ } while (p !== a);
152889
+
152890
+ return false;
152891
+ }
152892
+
152893
+ // check if a polygon diagonal is locally inside the polygon
152894
+ function locallyInside(a, b) {
152895
+ return area(a.prev, a, a.next) < 0 ?
152896
+ area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :
152897
+ area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
152898
+ }
152899
+
152900
+ // check if the middle point of a polygon diagonal is inside the polygon
152901
+ function middleInside(a, b) {
152902
+ var p = a,
152903
+ inside = false,
152904
+ px = (a.x + b.x) / 2,
152905
+ py = (a.y + b.y) / 2;
152906
+ do {
152907
+ if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&
152908
+ (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))
152909
+ inside = !inside;
152910
+ p = p.next;
152911
+ } while (p !== a);
152912
+
152913
+ return inside;
152914
+ }
152915
+
152916
+ // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;
152917
+ // if one belongs to the outer ring and another to a hole, it merges it into a single ring
152918
+ function splitPolygon(a, b) {
152919
+ var a2 = new Node(a.i, a.x, a.y),
152920
+ b2 = new Node(b.i, b.x, b.y),
152921
+ an = a.next,
152922
+ bp = b.prev;
152923
+
152924
+ a.next = b;
152925
+ b.prev = a;
152926
+
152927
+ a2.next = an;
152928
+ an.prev = a2;
152929
+
152930
+ b2.next = a2;
152931
+ a2.prev = b2;
152932
+
152933
+ bp.next = b2;
152934
+ b2.prev = bp;
152935
+
152936
+ return b2;
152937
+ }
152938
+
152939
+ // create a node and optionally link it with previous one (in a circular doubly linked list)
152940
+ function insertNode(i, x, y, last) {
152941
+ var p = new Node(i, x, y);
152942
+
152943
+ if (!last) {
152944
+ p.prev = p;
152945
+ p.next = p;
152946
+
152947
+ } else {
152948
+ p.next = last.next;
152949
+ p.prev = last;
152950
+ last.next.prev = p;
152951
+ last.next = p;
152952
+ }
152953
+ return p;
152954
+ }
152955
+
152956
+ function removeNode(p) {
152957
+ p.next.prev = p.prev;
152958
+ p.prev.next = p.next;
152959
+
152960
+ if (p.prevZ) p.prevZ.nextZ = p.nextZ;
152961
+ if (p.nextZ) p.nextZ.prevZ = p.prevZ;
152962
+ }
152963
+
152964
+ function Node(i, x, y) {
152965
+ // vertex index in coordinates array
152966
+ this.i = i;
152967
+
152968
+ // vertex coordinates
152969
+ this.x = x;
152970
+ this.y = y;
152971
+
152972
+ // previous and next vertex nodes in a polygon ring
152973
+ this.prev = null;
152974
+ this.next = null;
152975
+
152976
+ // z-order curve value
152977
+ this.z = null;
152978
+
152979
+ // previous and next nodes in z-order
152980
+ this.prevZ = null;
152981
+ this.nextZ = null;
152982
+
152983
+ // indicates whether this is a steiner point
152984
+ this.steiner = false;
152985
+ }
152986
+
152987
+ // return a percentage difference between the polygon area and its triangulation area;
152988
+ // used to verify correctness of triangulation
152989
+ earcut.deviation = function (data, holeIndices, dim, triangles) {
152990
+ var hasHoles = holeIndices && holeIndices.length;
152991
+ var outerLen = hasHoles ? holeIndices[0] * dim : data.length;
152992
+
152993
+ var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));
152994
+ if (hasHoles) {
152995
+ for (var i = 0, len = holeIndices.length; i < len; i++) {
152996
+ var start = holeIndices[i] * dim;
152997
+ var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
152998
+ polygonArea -= Math.abs(signedArea(data, start, end, dim));
152999
+ }
153000
+ }
153001
+
153002
+ var trianglesArea = 0;
153003
+ for (i = 0; i < triangles.length; i += 3) {
153004
+ var a = triangles[i] * dim;
153005
+ var b = triangles[i + 1] * dim;
153006
+ var c = triangles[i + 2] * dim;
153007
+ trianglesArea += Math.abs(
153008
+ (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -
153009
+ (data[a] - data[b]) * (data[c + 1] - data[a + 1]));
153010
+ }
153011
+
153012
+ return polygonArea === 0 && trianglesArea === 0 ? 0 :
153013
+ Math.abs((trianglesArea - polygonArea) / polygonArea);
153014
+ };
153015
+
153016
+ function signedArea(data, start, end, dim) {
153017
+ var sum = 0;
153018
+ for (var i = start, j = end - dim; i < end; i += dim) {
153019
+ sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
153020
+ j = i;
153021
+ }
153022
+ return sum;
153023
+ }
153024
+
153025
+ // turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts
153026
+ earcut.flatten = function (data) {
153027
+ var dim = data[0][0].length,
153028
+ result = {vertices: [], holes: [], dimensions: dim},
153029
+ holeIndex = 0;
153030
+
153031
+ for (var i = 0; i < data.length; i++) {
153032
+ for (var j = 0; j < data[i].length; j++) {
153033
+ for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);
153034
+ }
153035
+ if (i > 0) {
153036
+ holeIndex += data[i - 1].length;
153037
+ result.holes.push(holeIndex);
153038
+ }
153039
+ }
153040
+ return result;
153041
+ };
153042
+
153043
+ const tempVec2a = math.vec2();
153044
+ const tempVec3a = math.vec3();
153045
+ const tempVec3b = math.vec3();
153046
+ const tempVec3c = math.vec3();
153047
+
153048
+ /**
153049
+ * {@link Viewer} plugin that loads models from CityJSON files.
153050
+ *
153051
+ * <a href="https://xeokit.github.io/xeokit-sdk/examples/#loading_CityJSONLoaderPlugin_Railway"><img src="https://xeokit.io/img/docs/CityJSONLoaderPlugin/CityJSONLoaderPlugin.png"></a>
153052
+ *
153053
+ * [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#loading_CityJSONLoaderPlugin_Railway)]
153054
+ *
153055
+ * ## Overview
153056
+ *
153057
+ * * Loads small-to-medium sized models directly from [CityJSON 1.0.0](https://www.cityjson.org/specs/1.0.0/) files.
153058
+ * * Not recommended for large models. For best performance with large CityJSON datasets, we recommend using {@link XKTLoaderPlugin}.
153059
+ * * Loads double-precision coordinates, enabling models to be viewed at global coordinates without accuracy loss.
153060
+ * * Allows to set the position, scale and rotation of each model as you load it.
153061
+ *
153062
+ * ## Limitations
153063
+ *
153064
+ * Loading and parsing huge CityJSON files can be slow, and can overwhelm the browser, however. To view your
153065
+ * largest CityJSON models, we recommend instead pre-converting those to xeokit's compressed native .XKT format, then
153066
+ * loading them with {@link XKTLoaderPlugin} instead.</p>
153067
+ *
153068
+ * ## Scene representation
153069
+ *
153070
+ * When loading a model, CityJSONLoaderPlugin creates an {@link Entity} that represents the model, which
153071
+ * will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id}
153072
+ * in {@link Scene#models}. The CityJSONLoaderPlugin also creates an {@link Entity} for each object within the
153073
+ * model. Those Entities will have {@link Entity#isObject} set ````true```` and will be registered
153074
+ * by {@link Entity#id} in {@link Scene#objects}.
153075
+ *
153076
+ * ## Metadata
153077
+ *
153078
+ * When loading a model, CityJSONLoaderPlugin also creates a {@link MetaModel} that represents the model, which contains
153079
+ * a tree of {@link MetaObject}s that represent the CityJSON objects. .
153080
+ *
153081
+ * ## Usage
153082
+ *
153083
+ * In the example below we'll load the LOD 3 Railway model from
153084
+ * a [CityJSON file](https://github.com/xeokit/xeokit-sdk/tree/master/assets/models/cityjson/LoD3_Railway.json). Within
153085
+ * our {@link Viewer}, this will create a bunch of {@link Entity}s that represents the model and its objects, along with
153086
+ * a {@link MetaModel} and {@link MetaObject}s that hold their metadata.
153087
+ *
153088
+ * We'll also scale our model to half its size, rotate it 90 degrees about its local X-axis, then
153089
+ * translate it 100 units along its X axis.
153090
+ *
153091
+ * * [[Run example](https://xeokit.github.io/xeokit-sdk/examples/#loading_CityJSONLoaderPlugin_Railway)]
153092
+ *
153093
+ * ````javascript
153094
+ * import {Viewer, CityJSONLoaderPlugin} from "xeokit-sdk.es.js";
153095
+ *
153096
+ * const viewer = new Viewer({
153097
+ * canvasId: "myCanvas",
153098
+ * transparent: true
153099
+ * });
153100
+ *
153101
+ * viewer.scene.camera.eye = [14.915582703146043, 14.396781491179095, 5.431098754133695];
153102
+ * viewer.scene.camera.look = [6.599999999999998, 8.34099990051474, -4.159999575600315];
153103
+ * viewer.scene.camera.up = [-0.2820584034861215, 0.9025563895259413, -0.3253229483893775];
153104
+ *
153105
+ * const cityJSONLoader = new CityJSONLoaderPlugin(viewer);
153106
+ *
153107
+ * const model = cityJSONLoader.load({ // Returns an Entity that represents the model
153108
+ * id: "myModel1",
153109
+ * src: "../assets/models/cityjson/LoD3_Railway.json",
153110
+ * saoEnabled: true,
153111
+ * edges: false,
153112
+ * rotation: [-90,0,0],
153113
+ * scale: [0.5, 0.5, 0.5],
153114
+ * origin: [100, 0, 0]
153115
+ * });
153116
+ * ````
153117
+ *
153118
+ * ## Configuring a custom data source
153119
+ *
153120
+ * By default, CityJSONLoaderPlugin will load CityJSON files over HTTP.
153121
+ *
153122
+ * In the example below, we'll customize the way CityJSONLoaderPlugin loads the files by configuring it with our own data source
153123
+ * object. For simplicity, our custom data source example also uses HTTP, using a couple of xeokit utility functions.
153124
+ *
153125
+ * ````javascript
153126
+ * import {utils} from "xeokit-sdk.es.js";
153127
+ *
153128
+ * class MyDataSource {
153129
+ *
153130
+ * constructor() {
153131
+ * }
153132
+ *
153133
+ * getCityJSON(src, ok, error) {
153134
+ * console.log("MyDataSource#getCityJSON(" + CityJSONSrc + ", ... )");
153135
+ * utils.loadJSON(src,
153136
+ * (cityJSON) => {
153137
+ * ok(cityJSON);
153138
+ * },
153139
+ * function (errMsg) {
153140
+ * error(errMsg);
153141
+ * });
153142
+ * }
153143
+ * }
153144
+ * ````
153145
+ *
153146
+ * @class CityJSONLoaderPlugin
153147
+ * @since 2.0.13
153148
+ */
153149
+ class CityJSONLoaderPlugin extends Plugin {
153150
+
153151
+ /**
153152
+ * @constructor
153153
+ *
153154
+ * @param {Viewer} viewer The Viewer.
153155
+ * @param {Object} cfg Plugin configuration.
153156
+ * @param {String} [cfg.id="cityJSONLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
153157
+ * @param {Object} [cfg.dataSource] A custom data source through which the CityJSONLoaderPlugin can load model and
153158
+ * metadata files. Defaults to an instance of {@link CityJSONDefaultDataSource}, which loads over HTTP.
153159
+ */
153160
+ constructor(viewer, cfg = {}) {
153161
+
153162
+ super("cityJSONLoader", viewer, cfg);
153163
+
153164
+ this.dataSource = cfg.dataSource;
153165
+ }
153166
+
153167
+ /**
153168
+ * Gets the custom data source through which the CityJSONLoaderPlugin can load CityJSON files.
153169
+ *
153170
+ * Default value is {@link CityJSONDefaultDataSource}, which loads via HTTP.
153171
+ *
153172
+ * @type {Object}
153173
+ */
153174
+ get dataSource() {
153175
+ return this._dataSource;
153176
+ }
153177
+
153178
+ /**
153179
+ * Sets a custom data source through which the CityJSONLoaderPlugin can load CityJSON files.
153180
+ *
153181
+ * Default value is {@link CityJSONDefaultDataSource}, which loads via HTTP.
153182
+ *
153183
+ * @type {Object}
153184
+ */
153185
+ set dataSource(value) {
153186
+ this._dataSource = value || new CityJSONDefaultDataSource();
153187
+ }
153188
+
153189
+ /**
153190
+ * Loads an ````CityJSON```` model into this CityJSONLoaderPlugin's {@link Viewer}.
153191
+ *
153192
+ * @param {*} params Loading parameters.
153193
+ * @param {String} [params.id] ID to assign to the root {@link Entity#id}, unique among all components in the Viewer's {@link Scene}, generated automatically by default.
153194
+ * @param {String} [params.src] Path to a CityJSON file, as an alternative to the ````cityJSON```` parameter.
153195
+ * @param {ArrayBuffer} [params.cityJSON] The CityJSON file data, as an alternative to the ````src```` parameter.
153196
+ * @param {Boolean} [params.loadMetadata=true] Whether to load metadata on CityJSON objects.
153197
+ * @param {Number[]} [params.origin=[0,0,0]] The model's World-space double-precision 3D origin. Use this to position the model within xeokit's World coordinate system, using double-precision coordinates.
153198
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
153199
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
153200
+ * @param {Number[]} [params.rotation=[0,0,0]] The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis.
153201
+ * @param {Number[]} [params.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] The model's world transform matrix. Overrides the position, scale and rotation parameters. Relative to ````origin````.
153202
+ * @param {Object} [params.stats] Collects model statistics.
153203
+ * @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}.
153204
+ */
153205
+ load(params = {}) {
153206
+
153207
+ if (params.id && this.viewer.scene.components[params.id]) {
153208
+ this.error("Component with this ID already exists in viewer: " + params.id + " - will autogenerate this ID");
153209
+ delete params.id;
153210
+ }
153211
+
153212
+ const performanceModel = new PerformanceModel(this.viewer.scene, utils.apply(params, {
153213
+ isModel: true
153214
+ }));
153215
+
153216
+ if (!params.src && !params.cityJSON) {
153217
+ this.error("load() param expected: src or cityJSON");
153218
+ return performanceModel; // Return new empty model
153219
+ }
153220
+
153221
+ const options = {};
153222
+
153223
+ if (params.src) {
153224
+ this._loadModel(params.src, params, options, performanceModel);
153225
+ } else {
153226
+ const spinner = this.viewer.scene.canvas.spinner;
153227
+ spinner.processes++;
153228
+ this._parseModel(params.cityJSON, params, options, performanceModel);
153229
+ spinner.processes--;
153230
+ }
153231
+
153232
+ return performanceModel;
153233
+ }
153234
+
153235
+ _loadModel(src, params, options, performanceModel) {
153236
+ const spinner = this.viewer.scene.canvas.spinner;
153237
+ spinner.processes++;
153238
+ this._dataSource.getCityJSON(params.src, (data) => {
153239
+ this._parseModel(data, params, options, performanceModel);
153240
+ spinner.processes--;
153241
+ },
153242
+ (errMsg) => {
153243
+ spinner.processes--;
153244
+ this.error(errMsg);
153245
+ performanceModel.fire("error", errMsg);
153246
+ });
153247
+ }
153248
+
153249
+ _parseModel(data, params, options, performanceModel) {
153250
+
153251
+ if (performanceModel.destroyed) {
153252
+ return;
153253
+ }
153254
+
153255
+ const vertices = data.transform ? this._transformVertices(data.vertices, data.transform, options.rotateX) : data.vertices;
153256
+
153257
+ const stats = params.stats || {};
153258
+ stats.sourceFormat = data.type || "CityJSON";
153259
+ stats.schemaVersion = data.version || "";
153260
+ stats.title = "";
153261
+ stats.author = "";
153262
+ stats.created = "";
153263
+ stats.numMetaObjects = 0;
153264
+ stats.numPropertySets = 0;
153265
+ stats.numObjects = 0;
153266
+ stats.numGeometries = 0;
153267
+ stats.numTriangles = 0;
153268
+ stats.numVertices = 0;
153269
+
153270
+ const loadMetadata = (params.loadMetadata !== false);
153271
+
153272
+ const rootMetaObject = loadMetadata ? {
153273
+ id: math.createUUID(),
153274
+ name: "Model",
153275
+ type: "Model"
153276
+ } : null;
153277
+
153278
+ const metadata = loadMetadata ? {
153279
+ id: "",
153280
+ projectId: "",
153281
+ author: "",
153282
+ createdAt: "",
153283
+ schema: data.version || "",
153284
+ creatingApplication: "",
153285
+ metaObjects: [rootMetaObject],
153286
+ propertySets: []
153287
+ } : null;
153288
+
153289
+ const ctx = {
153290
+ data,
153291
+ vertices,
153292
+ performanceModel,
153293
+ loadMetadata,
153294
+ metadata,
153295
+ rootMetaObject,
153296
+ nextId: 0,
153297
+ stats
153298
+ };
153299
+
153300
+ this._parseCityJSON(ctx);
153301
+
153302
+ performanceModel.finalize();
153303
+
153304
+ if (loadMetadata) {
153305
+ const metaModelId = performanceModel.id;
153306
+ this.viewer.metaScene.createMetaModel(metaModelId, ctx.metadata, options);
153307
+ }
153308
+
153309
+ performanceModel.scene.once("tick", () => {
153310
+ if (performanceModel.destroyed) {
153311
+ return;
153312
+ }
153313
+ performanceModel.scene.fire("modelLoaded", performanceModel.id); // FIXME: Assumes listeners know order of these two events
153314
+ performanceModel.fire("loaded", true, false); // Don't forget the event, for late subscribers
153315
+ });
153316
+ }
153317
+
153318
+ _transformVertices(vertices, transform, rotateX) {
153319
+ const transformedVertices = [];
153320
+ const scale = transform.scale || math.vec3([1, 1, 1]);
153321
+ const translate = transform.translate || math.vec3([0, 0, 0]);
153322
+ for (let i = 0, j = 0; i < vertices.length; i++, j += 3) {
153323
+ const x = (vertices[i][0] * scale[0]) + translate[0];
153324
+ const y = (vertices[i][1] * scale[1]) + translate[1];
153325
+ const z = (vertices[i][2] * scale[2]) + translate[2];
153326
+ if (rotateX) {
153327
+ transformedVertices.push([x, z, y]);
153328
+ } else {
153329
+ transformedVertices.push([x, y, z]);
153330
+ }
153331
+ }
153332
+ return transformedVertices;
153333
+ }
153334
+
153335
+ _parseCityJSON(ctx) {
153336
+ const data = ctx.data;
153337
+ const cityObjects = data.CityObjects;
153338
+ for (const objectId in cityObjects) {
153339
+ if (cityObjects.hasOwnProperty(objectId)) {
153340
+ const cityObject = cityObjects[objectId];
153341
+ this._parseCityObject(ctx, cityObject, objectId);
153342
+ }
153343
+ }
153344
+ }
153345
+
153346
+ _parseCityObject(ctx, cityObject, objectId) {
153347
+
153348
+ const performanceModel = ctx.performanceModel;
153349
+ const data = ctx.data;
153350
+
153351
+ if (ctx.loadMetadata) {
153352
+
153353
+ const metaObjectId = objectId;
153354
+ const metaObjectType = cityObject.type;
153355
+ const metaObjectName = metaObjectType + " : " + objectId;
153356
+ const parentMetaObjectId = cityObject.parents ? cityObject.parents[0] : ctx.rootMetaObject.id;
153357
+
153358
+ ctx.metadata.metaObjects.push({
153359
+ id: metaObjectId,
153360
+ name: metaObjectName,
153361
+ type: metaObjectType,
153362
+ parent: parentMetaObjectId
153363
+ });
153364
+ }
153365
+
153366
+ ctx.stats.numMetaObjects++;
153367
+
153368
+ if (!(cityObject.geometry && cityObject.geometry.length > 0)) {
153369
+ return;
153370
+ }
153371
+
153372
+ const meshIds = [];
153373
+
153374
+ for (let i = 0, len = cityObject.geometry.length; i < len; i++) {
153375
+
153376
+ const geometry = cityObject.geometry[i];
153377
+
153378
+ let objectMaterial;
153379
+ let surfaceMaterials;
153380
+
153381
+ const appearance = data.appearance;
153382
+ if (appearance) {
153383
+ const materials = appearance.materials;
153384
+ if (materials) {
153385
+ const geometryMaterial = geometry.material;
153386
+ if (geometryMaterial) {
153387
+ const themeIds = Object.keys(geometryMaterial);
153388
+ if (themeIds.length > 0) {
153389
+ const themeId = themeIds[0];
153390
+ const theme = geometryMaterial[themeId];
153391
+ if (theme.value !== undefined) {
153392
+ objectMaterial = materials[theme.value];
153393
+ } else {
153394
+ const values = theme.values;
153395
+ if (values) {
153396
+ surfaceMaterials = [];
153397
+ for (let j = 0, lenj = values.length; j < lenj; j++) {
153398
+ const value = values[i];
153399
+ const surfaceMaterial = materials[value];
153400
+ surfaceMaterials.push(surfaceMaterial);
153401
+ }
153402
+ }
153403
+ }
153404
+ }
153405
+ }
153406
+ }
153407
+ }
153408
+
153409
+ if (surfaceMaterials) {
153410
+ this._parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds);
153411
+
153412
+ } else {
153413
+ this._parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds);
153414
+ }
153415
+ }
153416
+
153417
+ if (meshIds.length > 0) {
153418
+ performanceModel.createEntity({
153419
+ id: objectId,
153420
+ meshIds: meshIds,
153421
+ isObject: true
153422
+ });
153423
+
153424
+ ctx.stats.numObjects++;
153425
+ }
153426
+ }
153427
+
153428
+ _parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds) {
153429
+
153430
+ const geomType = geometry.type;
153431
+
153432
+ switch (geomType) {
153433
+
153434
+ case "MultiPoint":
153435
+ break;
153436
+
153437
+ case "MultiLineString":
153438
+ break;
153439
+
153440
+ case "MultiSurface":
153441
+
153442
+ case "CompositeSurface":
153443
+ const surfaces = geometry.boundaries;
153444
+ this._parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);
153445
+ break;
153446
+
153447
+ case "Solid":
153448
+ const shells = geometry.boundaries;
153449
+ for (let j = 0; j < shells.length; j++) {
153450
+ const surfaces = shells[j];
153451
+ this._parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);
153452
+ }
153453
+ break;
153454
+
153455
+ case "MultiSolid":
153456
+
153457
+ case "CompositeSolid":
153458
+ const solids = geometry.boundaries;
153459
+ for (let j = 0; j < solids.length; j++) {
153460
+ for (let k = 0; k < solids[j].length; k++) {
153461
+ const surfaces = solids[j][k];
153462
+ this._parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);
153463
+ }
153464
+ }
153465
+ break;
153466
+ }
153467
+ }
153468
+
153469
+ _parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds) {
153470
+
153471
+ const vertices = ctx.vertices;
153472
+ const performanceModel = ctx.performanceModel;
153473
+
153474
+ for (let i = 0; i < surfaces.length; i++) {
153475
+
153476
+ const surface = surfaces[i];
153477
+ const surfaceMaterial = surfaceMaterials[i] || {diffuseColor: [0.8, 0.8, 0.8], transparency: 1.0};
153478
+
153479
+ const face = [];
153480
+ const holes = [];
153481
+
153482
+ const sharedIndices = [];
153483
+
153484
+ const geometryCfg = {
153485
+ positions: [],
153486
+ indices: []
153487
+ };
153488
+
153489
+ for (let j = 0; j < surface.length; j++) {
153490
+
153491
+ if (face.length > 0) {
153492
+ holes.push(face.length);
153493
+ }
153494
+
153495
+ const newFace = this._extractLocalIndices(ctx, surface[j], sharedIndices, geometryCfg);
153496
+
153497
+ face.push(...newFace);
153498
+ }
153499
+
153500
+ if (face.length === 3) { // Triangle
153501
+
153502
+ geometryCfg.indices.push(face[0]);
153503
+ geometryCfg.indices.push(face[1]);
153504
+ geometryCfg.indices.push(face[2]);
153505
+
153506
+ } else if (face.length > 3) { // Polygon
153507
+
153508
+ // Prepare to triangulate
153509
+
153510
+ const pList = [];
153511
+
153512
+ for (let k = 0; k < face.length; k++) {
153513
+ pList.push({
153514
+ x: vertices[sharedIndices[face[k]]][0],
153515
+ y: vertices[sharedIndices[face[k]]][1],
153516
+ z: vertices[sharedIndices[face[k]]][2]
153517
+ });
153518
+ }
153519
+
153520
+ const normal = this._getNormalOfPositions(pList, math.vec3());
153521
+
153522
+ // Convert to 2D
153523
+
153524
+ let pv = [];
153525
+
153526
+ for (let k = 0; k < pList.length; k++) {
153527
+
153528
+ this._to2D(pList[k], normal, tempVec2a);
153529
+
153530
+ pv.unshift(tempVec2a[0]);
153531
+ pv.unshift(tempVec2a[1]);
153532
+ }
153533
+
153534
+ // Triangulate
153535
+
153536
+ const tr = earcut(pv, holes, 2);
153537
+
153538
+ // Create triangles
153539
+
153540
+ for (let k = 0; k < tr.length; k += 3) {
153541
+ geometryCfg.indices.unshift(face[tr[k]]);
153542
+ geometryCfg.indices.unshift(face[tr[k + 1]]);
153543
+ geometryCfg.indices.unshift(face[tr[k + 2]]);
153544
+ }
153545
+ }
153546
+
153547
+ const meshId = "" + ctx.nextId++;
153548
+
153549
+ performanceModel.createMesh({
153550
+ id: meshId,
153551
+ primitive: "triangles",
153552
+ positions: geometryCfg.positions,
153553
+ indices: geometryCfg.indices,
153554
+ color: (surfaceMaterial && surfaceMaterial.diffuseColor) ? surfaceMaterial.diffuseColor : [0.8, 0.8, 0.8],
153555
+ opacity: (surfaceMaterial && surfaceMaterial.transparency !== undefined) ? (1.0 - surfaceMaterial.transparency) : 1.0
153556
+ });
153557
+
153558
+ meshIds.push(meshId);
153559
+
153560
+ ctx.stats.numGeometries++;
153561
+ ctx.stats.numVertices += geometryCfg.positions.length / 3;
153562
+ ctx.stats.numTriangles += geometryCfg.indices.length / 3;
153563
+ }
153564
+ }
153565
+
153566
+ _parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds) {
153567
+
153568
+ const performanceModel = ctx.performanceModel;
153569
+ const sharedIndices = [];
153570
+ const geometryCfg = {
153571
+ positions: [],
153572
+ indices: []
153573
+ };
153574
+
153575
+ const geomType = geometry.type;
153576
+
153577
+ switch (geomType) {
153578
+ case "MultiPoint":
153579
+ break;
153580
+
153581
+ case "MultiLineString":
153582
+ break;
153583
+
153584
+ case "MultiSurface":
153585
+ case "CompositeSurface":
153586
+ const surfaces = geometry.boundaries;
153587
+ this._parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);
153588
+ break;
153589
+
153590
+ case "Solid":
153591
+ const shells = geometry.boundaries;
153592
+ for (let j = 0; j < shells.length; j++) {
153593
+ const surfaces = shells[j];
153594
+ this._parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);
153595
+ }
153596
+ break;
153597
+
153598
+ case "MultiSolid":
153599
+ case "CompositeSolid":
153600
+ const solids = geometry.boundaries;
153601
+ for (let j = 0; j < solids.length; j++) {
153602
+ for (let k = 0; k < solids[j].length; k++) {
153603
+ const surfaces = solids[j][k];
153604
+ this._parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);
153605
+ }
153606
+ }
153607
+ break;
153608
+ }
153609
+
153610
+ if (geometryCfg.positions.length > 0 && geometryCfg.indices.length > 0) {
153611
+
153612
+ const meshId = "" + ctx.nextId++;
153613
+
153614
+ performanceModel.createMesh({
153615
+ id: meshId,
153616
+ primitive: "triangles",
153617
+ positions: geometryCfg.positions,
153618
+ indices: geometryCfg.indices,
153619
+ color: (objectMaterial && objectMaterial.diffuseColor) ? objectMaterial.diffuseColor : [0.8, 0.8, 0.8],
153620
+ opacity: 1.0
153621
+ //opacity: (objectMaterial && objectMaterial.transparency !== undefined) ? (1.0 - objectMaterial.transparency) : 1.0
153622
+ });
153623
+
153624
+ meshIds.push(meshId);
153625
+
153626
+ ctx.stats.numGeometries++;
153627
+ ctx.stats.numVertices += geometryCfg.positions.length / 3;
153628
+ ctx.stats.numTriangles += geometryCfg.indices.length / 3;
153629
+ }
153630
+ }
153631
+
153632
+ _parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, primitiveCfg) {
153633
+
153634
+ const vertices = ctx.vertices;
153635
+
153636
+ for (let i = 0; i < surfaces.length; i++) {
153637
+
153638
+ let boundary = [];
153639
+ let holes = [];
153640
+
153641
+ for (let j = 0; j < surfaces[i].length; j++) {
153642
+ if (boundary.length > 0) {
153643
+ holes.push(boundary.length);
153644
+ }
153645
+ const newBoundary = this._extractLocalIndices(ctx, surfaces[i][j], sharedIndices, primitiveCfg);
153646
+ boundary.push(...newBoundary);
153647
+ }
153648
+
153649
+ if (boundary.length === 3) { // Triangle
153650
+
153651
+ primitiveCfg.indices.push(boundary[0]);
153652
+ primitiveCfg.indices.push(boundary[1]);
153653
+ primitiveCfg.indices.push(boundary[2]);
153654
+
153655
+ } else if (boundary.length > 3) { // Polygon
153656
+
153657
+ let pList = [];
153658
+
153659
+ for (let k = 0; k < boundary.length; k++) {
153660
+ pList.push({
153661
+ x: vertices[sharedIndices[boundary[k]]][0],
153662
+ y: vertices[sharedIndices[boundary[k]]][1],
153663
+ z: vertices[sharedIndices[boundary[k]]][2]
153664
+ });
153665
+ }
153666
+
153667
+ const normal = this._getNormalOfPositions(pList, math.vec3());
153668
+ let pv = [];
153669
+
153670
+ for (let k = 0; k < pList.length; k++) {
153671
+ this._to2D(pList[k], normal, tempVec2a);
153672
+ pv.unshift(tempVec2a[0]);
153673
+ pv.unshift(tempVec2a[1]);
153674
+ }
153675
+
153676
+ const tr = earcut(pv, holes, 2);
153677
+
153678
+ for (let k = 0; k < tr.length; k += 3) {
153679
+ primitiveCfg.indices.unshift(boundary[tr[k]]);
153680
+ primitiveCfg.indices.unshift(boundary[tr[k + 1]]);
153681
+ primitiveCfg.indices.unshift(boundary[tr[k + 2]]);
153682
+ }
153683
+ }
153684
+ }
153685
+ }
153686
+
153687
+ _extractLocalIndices(ctx, boundary, sharedIndices, geometryCfg) {
153688
+
153689
+ const vertices = ctx.vertices;
153690
+ const newBoundary = [];
153691
+
153692
+ for (let i = 0, len = boundary.length; i < len; i++) {
153693
+
153694
+ const index = boundary[i];
153695
+
153696
+ if (sharedIndices.includes(index)) {
153697
+ const vertexIndex = sharedIndices.indexOf(index);
153698
+ newBoundary.push(vertexIndex);
153699
+
153700
+ } else {
153701
+ geometryCfg.positions.push(vertices[index][0]);
153702
+ geometryCfg.positions.push(vertices[index][1]);
153703
+ geometryCfg.positions.push(vertices[index][2]);
153704
+
153705
+ newBoundary.push(sharedIndices.length);
153706
+
153707
+ sharedIndices.push(index);
153708
+ }
153709
+ }
153710
+
153711
+ return newBoundary
153712
+ }
153713
+
153714
+ _getNormalOfPositions(positions, normal) {
153715
+
153716
+ for (let i = 0; i < positions.length; i++) {
153717
+
153718
+ let nexti = i + 1;
153719
+ if (nexti === positions.length) {
153720
+ nexti = 0;
153721
+ }
153722
+
153723
+ normal[0] += ((positions[i].y - positions[nexti].y) * (positions[i].z + positions[nexti].z));
153724
+ normal[1] += ((positions[i].z - positions[nexti].z) * (positions[i].x + positions[nexti].x));
153725
+ normal[2] += ((positions[i].x - positions[nexti].x) * (positions[i].y + positions[nexti].y));
153726
+ }
153727
+
153728
+ return math.normalizeVec3(normal);
153729
+ }
153730
+
153731
+ _to2D(_p, _n, re) {
153732
+
153733
+ const p = tempVec3a;
153734
+ const n = tempVec3b;
153735
+ const x3 = tempVec3c;
153736
+
153737
+ p[0] = _p.x;
153738
+ p[1] = _p.y;
153739
+ p[2] = _p.z;
153740
+
153741
+ n[0] = _n.x;
153742
+ n[1] = _n.y;
153743
+ n[2] = _n.z;
153744
+
153745
+ x3[0] = 1.1;
153746
+ x3[1] = 1.1;
153747
+ x3[2] = 1.1;
153748
+
153749
+ const dist = math.lenVec3(math.subVec3(x3, n));
153750
+
153751
+ if (dist < 0.01) {
153752
+ x3[0] += 1.0;
153753
+ x3[1] += 2.0;
153754
+ x3[2] += 3.0;
153755
+ }
153756
+
153757
+ const dot = math.dotVec3(x3, n);
153758
+ const tmp2 = math.mulVec3Scalar(n, dot, math.vec3());
153759
+
153760
+ x3[0] -= tmp2[0];
153761
+ x3[1] -= tmp2[1];
153762
+ x3[2] -= tmp2[2];
153763
+
153764
+ math.normalizeVec3(x3);
153765
+
153766
+ const y3 = math.cross3Vec3(n, x3, math.vec3());
153767
+ const x = math.dotVec3(p, x3);
153768
+ const y = math.dotVec3(p, y3);
153769
+
153770
+ re[0] = x;
153771
+ re[1] = y;
153772
+ }
153773
+ }
153774
+
151951
153775
  exports.AmbientLight = AmbientLight;
151952
153776
  exports.AngleMeasurementsPlugin = AngleMeasurementsPlugin;
151953
153777
  exports.AnnotationsPlugin = AnnotationsPlugin;
@@ -151956,6 +153780,7 @@ exports.BCFViewpointsPlugin = BCFViewpointsPlugin;
151956
153780
  exports.CameraMemento = CameraMemento;
151957
153781
  exports.CameraPath = CameraPath;
151958
153782
  exports.CameraPathAnimation = CameraPathAnimation;
153783
+ exports.CityJSONLoaderPlugin = CityJSONLoaderPlugin;
151959
153784
  exports.Component = Component;
151960
153785
  exports.Configs = Configs;
151961
153786
  exports.ContextMenu = ContextMenu;
@@ -151969,7 +153794,6 @@ exports.FastNavPlugin = FastNavPlugin;
151969
153794
  exports.Fresnel = Fresnel;
151970
153795
  exports.GLTFDefaultDataSource = GLTFDefaultDataSource;
151971
153796
  exports.GLTFLoaderPlugin = GLTFLoaderPlugin;
151972
- exports.IFCLoaderPlugin = IFCLoaderPlugin;
151973
153797
  exports.ImagePlane = ImagePlane;
151974
153798
  exports.LASLoaderPlugin = LASLoaderPlugin;
151975
153799
  exports.LambertMaterial = LambertMaterial;
@@ -151981,7 +153805,7 @@ exports.Mesh = Mesh;
151981
153805
  exports.MetallicMaterial = MetallicMaterial;
151982
153806
  exports.ModelMemento = ModelMemento;
151983
153807
  exports.NavCubePlugin = NavCubePlugin;
151984
- exports.Node = Node;
153808
+ exports.Node = Node$1;
151985
153809
  exports.OBJLoaderPlugin = OBJLoaderPlugin;
151986
153810
  exports.ObjectsMemento = ObjectsMemento;
151987
153811
  exports.Path = Path;
@@ -152008,6 +153832,7 @@ exports.TreeViewPlugin = TreeViewPlugin;
152008
153832
  exports.VBOGeometry = VBOGeometry;
152009
153833
  exports.ViewCullPlugin = ViewCullPlugin;
152010
153834
  exports.Viewer = Viewer;
153835
+ exports.WebIFCLoaderPlugin = WebIFCLoaderPlugin;
152011
153836
  exports.XKTDefaultDataSource = XKTDefaultDataSource;
152012
153837
  exports.XKTLoaderPlugin = XKTLoaderPlugin;
152013
153838
  exports.XML3DLoaderPlugin = XML3DLoaderPlugin;