@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.
@@ -8789,7 +8789,7 @@ class PerformanceNode {
8789
8789
 
8790
8790
  }
8791
8791
 
8792
- const tempVec3a$10 = math.vec3();
8792
+ const tempVec3a$11 = math.vec3();
8793
8793
 
8794
8794
  /**
8795
8795
  * Given a view matrix and a relative-to-center (RTC) coordinate origin, returns a view matrix
@@ -8868,7 +8868,7 @@ function worldToRTCPos(worldPos, rtcCenter, rtcPos) {
8868
8868
  */
8869
8869
  function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize = 1000000) {
8870
8870
 
8871
- const center = math.getPositionsCenter(worldPositions, tempVec3a$10);
8871
+ const center = math.getPositionsCenter(worldPositions, tempVec3a$11);
8872
8872
 
8873
8873
  const rtcCenterX = Math.round(center[0] / cellSize) * cellSize;
8874
8874
  const rtcCenterY = Math.round(center[1] / cellSize) * cellSize;
@@ -8904,7 +8904,7 @@ function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize =
8904
8904
  */
8905
8905
  function getPlaneRTCPos(dist, dir, rtcCenter, rtcPlanePos) {
8906
8906
  const rtcCenterToPlaneDist = math.dotVec3(dir, rtcCenter) + dist;
8907
- const dirNormalized = math.normalizeVec3(dir, tempVec3a$10);
8907
+ const dirNormalized = math.normalizeVec3(dir, tempVec3a$11);
8908
8908
  math.mulVec3Scalar(dirNormalized, -rtcCenterToPlaneDist, rtcPlanePos);
8909
8909
  return rtcPlanePos;
8910
8910
  }
@@ -10998,9 +10998,9 @@ class Annotation extends Marker {
10998
10998
  }
10999
10999
  }
11000
11000
 
11001
- const tempVec3a$$ = math.vec3();
11002
- const tempVec3b$9 = math.vec3();
11003
- const tempVec3c$6 = math.vec3();
11001
+ const tempVec3a$10 = math.vec3();
11002
+ const tempVec3b$a = math.vec3();
11003
+ const tempVec3c$7 = math.vec3();
11004
11004
 
11005
11005
  /**
11006
11006
  * {@link Viewer} plugin that creates {@link Annotation}s.
@@ -11476,9 +11476,9 @@ class AnnotationsPlugin extends Plugin {
11476
11476
  if (!pickResult.worldPos || !pickResult.worldNormal) {
11477
11477
  this.error("Param 'pickResult' does not have both worldPos and worldNormal");
11478
11478
  } else {
11479
- const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$$);
11480
- const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$9);
11481
- const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$6);
11479
+ const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$10);
11480
+ const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$a);
11481
+ const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$7);
11482
11482
  worldPos = offsetWorldPos;
11483
11483
  entity = pickResult.entity;
11484
11484
  }
@@ -14135,7 +14135,7 @@ class OcclusionLayer {
14135
14135
  const MARKER_COLOR = math.vec3([1.0, 0.0, 0.0]);
14136
14136
  const POINT_SIZE = 20;
14137
14137
 
14138
- const tempVec3a$_ = math.vec3();
14138
+ const tempVec3a$$ = math.vec3();
14139
14139
 
14140
14140
  /**
14141
14141
  * Manages occlusion testing. Private member of a Renderer.
@@ -14482,7 +14482,7 @@ class OcclusionTester {
14482
14482
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
14483
14483
  if (active) {
14484
14484
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
14485
- gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$_));
14485
+ gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$$));
14486
14486
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
14487
14487
  }
14488
14488
  }
@@ -14936,7 +14936,7 @@ const sampleOffsetsVert = new Float32Array(createSampleOffsets(KERNEL_RADIUS + 1
14936
14936
  const sampleOffsetsHor = new Float32Array(createSampleOffsets(KERNEL_RADIUS + 1, [1, 0]));
14937
14937
  const sampleWeights = new Float32Array(createSampleWeights(KERNEL_RADIUS + 1, blurStdDev));
14938
14938
 
14939
- const tempVec2a = new Float32Array(2);
14939
+ const tempVec2a$1 = new Float32Array(2);
14940
14940
 
14941
14941
  /**
14942
14942
  * SAO implementation inspired from previous SAO work in THREE.js by ludobaka / ludobaka.github.io and bhouston
@@ -15189,10 +15189,10 @@ class SAODepthLimitedBlurRenderer {
15189
15189
 
15190
15190
  program.bind();
15191
15191
 
15192
- tempVec2a[0] = viewportWidth;
15193
- tempVec2a[1] = viewportHeight;
15192
+ tempVec2a$1[0] = viewportWidth;
15193
+ tempVec2a$1[1] = viewportHeight;
15194
15194
 
15195
- gl.uniform2fv(this._uViewport, tempVec2a);
15195
+ gl.uniform2fv(this._uViewport, tempVec2a$1);
15196
15196
  gl.uniform1f(this._uCameraNear, near);
15197
15197
  gl.uniform1f(this._uCameraFar, far);
15198
15198
 
@@ -19213,8 +19213,8 @@ class CustomProjection extends Component {
19213
19213
  }
19214
19214
 
19215
19215
  const tempVec3$5 = math.vec3();
19216
- const tempVec3b$8 = math.vec3();
19217
- const tempVec3c$5 = math.vec3();
19216
+ const tempVec3b$9 = math.vec3();
19217
+ const tempVec3c$6 = math.vec3();
19218
19218
  const tempVec3d$3 = math.vec3();
19219
19219
  const tempVec3e$2 = math.vec3();
19220
19220
  const tempVec3f$2 = math.vec3();
@@ -19523,8 +19523,8 @@ class Camera extends Component {
19523
19523
  orbitYaw(angleInc) {
19524
19524
  let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3$5);
19525
19525
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
19526
- lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$8);
19527
- this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$5); // Set eye position as 'look' plus 'eye' vector
19526
+ lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$9);
19527
+ this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$6); // Set eye position as 'look' plus 'eye' vector
19528
19528
  this.up = math.transformPoint3(tempMat, this._up, tempVec3d$3); // Rotate 'up' vector
19529
19529
  }
19530
19530
 
@@ -19541,7 +19541,7 @@ class Camera extends Component {
19541
19541
  }
19542
19542
  }
19543
19543
  let eye2 = math.subVec3(this._eye, this._look, tempVec3$5);
19544
- const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$8), math.normalizeVec3(this._up, tempVec3c$5));
19544
+ const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$9), math.normalizeVec3(this._up, tempVec3c$6));
19545
19545
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
19546
19546
  eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$3);
19547
19547
  this.up = math.transformPoint3(tempMat, this._up, tempVec3e$2);
@@ -19556,8 +19556,8 @@ class Camera extends Component {
19556
19556
  yaw(angleInc) {
19557
19557
  let look2 = math.subVec3(this._look, this._eye, tempVec3$5);
19558
19558
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
19559
- look2 = math.transformPoint3(tempMat, look2, tempVec3b$8);
19560
- this.look = math.addVec3(look2, this._eye, tempVec3c$5);
19559
+ look2 = math.transformPoint3(tempMat, look2, tempVec3b$9);
19560
+ this.look = math.addVec3(look2, this._eye, tempVec3c$6);
19561
19561
  if (this._gimbalLock) {
19562
19562
  this.up = math.transformPoint3(tempMat, this._up, tempVec3d$3);
19563
19563
  }
@@ -19576,7 +19576,7 @@ class Camera extends Component {
19576
19576
  }
19577
19577
  }
19578
19578
  let look2 = math.subVec3(this._look, this._eye, tempVec3$5);
19579
- const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$8), math.normalizeVec3(this._up, tempVec3c$5));
19579
+ const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$9), math.normalizeVec3(this._up, tempVec3c$6));
19580
19580
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
19581
19581
  this.up = math.transformPoint3(tempMat, this._up, tempVec3f$2);
19582
19582
  look2 = math.transformPoint3(tempMat, look2, tempVec3d$3);
@@ -19593,14 +19593,14 @@ class Camera extends Component {
19593
19593
  const vec = [0, 0, 0];
19594
19594
  let v;
19595
19595
  if (pan[0] !== 0) {
19596
- const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$8));
19596
+ const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$9));
19597
19597
  v = math.mulVec3Scalar(left, pan[0]);
19598
19598
  vec[0] += v[0];
19599
19599
  vec[1] += v[1];
19600
19600
  vec[2] += v[2];
19601
19601
  }
19602
19602
  if (pan[1] !== 0) {
19603
- v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$5), pan[1]);
19603
+ v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$6), pan[1]);
19604
19604
  vec[0] += v[0];
19605
19605
  vec[1] += v[1];
19606
19606
  vec[2] += v[2];
@@ -19622,12 +19622,12 @@ class Camera extends Component {
19622
19622
  */
19623
19623
  zoom(delta) {
19624
19624
  const vec = math.subVec3(this._eye, this._look, tempVec3$5);
19625
- const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$8));
19625
+ const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$9));
19626
19626
  const newLenLook = Math.abs(lenLook + delta);
19627
19627
  if (newLenLook < 0.5) {
19628
19628
  return;
19629
19629
  }
19630
- const dir = math.normalizeVec3(vec, tempVec3c$5);
19630
+ const dir = math.normalizeVec3(vec, tempVec3c$6);
19631
19631
  this.eye = math.addVec3(this._look, math.mulVec3Scalar(dir, newLenLook), tempVec3d$3);
19632
19632
  }
19633
19633
 
@@ -29214,7 +29214,7 @@ function buildFragmentDraw(mesh) {
29214
29214
  * @author xeolabs / https://github.com/xeolabs
29215
29215
  */
29216
29216
 
29217
- const tempVec3a$Z = math.vec3();
29217
+ const tempVec3a$_ = math.vec3();
29218
29218
 
29219
29219
  const ids$2 = new Map$1({});
29220
29220
 
@@ -29313,7 +29313,7 @@ DrawRenderer.prototype.drawMesh = function (frameCtx, mesh) {
29313
29313
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
29314
29314
  if (active) {
29315
29315
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
29316
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Z) : sectionPlane.pos);
29316
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$_) : sectionPlane.pos);
29317
29317
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
29318
29318
  }
29319
29319
  }
@@ -30465,7 +30465,7 @@ function buildFragment$5(mesh) {
30465
30465
 
30466
30466
  const ids$1 = new Map$1({});
30467
30467
 
30468
- const tempVec3a$Y = math.vec3();
30468
+ const tempVec3a$Z = math.vec3();
30469
30469
 
30470
30470
  /**
30471
30471
  * @private
@@ -30549,7 +30549,7 @@ EmphasisFillRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
30549
30549
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
30550
30550
  if (active) {
30551
30551
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
30552
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Y) : sectionPlane.pos);
30552
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Z) : sectionPlane.pos);
30553
30553
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
30554
30554
  }
30555
30555
  }
@@ -30896,7 +30896,7 @@ function buildFragment$4(mesh) {
30896
30896
 
30897
30897
  const ids = new Map$1({});
30898
30898
 
30899
- const tempVec3a$X = math.vec3();
30899
+ const tempVec3a$Y = math.vec3();
30900
30900
 
30901
30901
  /**
30902
30902
  * @private
@@ -30979,7 +30979,7 @@ EmphasisEdgesRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
30979
30979
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
30980
30980
  if (active) {
30981
30981
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
30982
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$X) : sectionPlane.pos);
30982
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Y) : sectionPlane.pos);
30983
30983
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
30984
30984
  }
30985
30985
  }
@@ -31284,7 +31284,7 @@ function buildFragment$3(mesh) {
31284
31284
  * @author xeolabs / https://github.com/xeolabs
31285
31285
  */
31286
31286
 
31287
- const tempVec3a$W = math.vec3();
31287
+ const tempVec3a$X = math.vec3();
31288
31288
 
31289
31289
  // No ID, because there is exactly one PickMeshRenderer per scene
31290
31290
 
@@ -31368,7 +31368,7 @@ PickMeshRenderer.prototype.drawMesh = function (frameCtx, mesh) {
31368
31368
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
31369
31369
  if (active) {
31370
31370
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
31371
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$W) : sectionPlane.pos);
31371
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$X) : sectionPlane.pos);
31372
31372
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
31373
31373
  }
31374
31374
  }
@@ -31611,7 +31611,7 @@ function buildFragment$2(mesh) {
31611
31611
  * @author xeolabs / https://github.com/xeolabs
31612
31612
  */
31613
31613
 
31614
- const tempVec3a$V = math.vec3();
31614
+ const tempVec3a$W = math.vec3();
31615
31615
 
31616
31616
  /**
31617
31617
  * @private
@@ -31703,7 +31703,7 @@ PickTriangleRenderer.prototype.drawMesh = function (frameCtx, mesh) {
31703
31703
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
31704
31704
  if (active) {
31705
31705
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
31706
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$V) : sectionPlane.pos);
31706
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$W) : sectionPlane.pos);
31707
31707
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
31708
31708
  }
31709
31709
  }
@@ -31946,7 +31946,7 @@ function buildFragment$1(mesh) {
31946
31946
  * @author xeolabs / https://github.com/xeolabs
31947
31947
  */
31948
31948
 
31949
- const tempVec3a$U = math.vec3();
31949
+ const tempVec3a$V = math.vec3();
31950
31950
 
31951
31951
  // No ID, because there is exactly one PickMeshRenderer per scene
31952
31952
 
@@ -32054,7 +32054,7 @@ OcclusionRenderer.prototype.drawMesh = function (frameCtx, mesh) {
32054
32054
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
32055
32055
  if (active) {
32056
32056
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
32057
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$U) : sectionPlane.pos);
32057
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$V) : sectionPlane.pos);
32058
32058
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
32059
32059
  }
32060
32060
  }
@@ -39398,8 +39398,8 @@ class DistanceMeasurementsPlugin extends Plugin {
39398
39398
  * * hide physically-based materials (switching to non-PBR),
39399
39399
  * * hide transparent objects, and
39400
39400
  * * scale the canvas resolution by 0.5, causing the GPU to render 75% less pixels.
39401
+ * <br>
39401
39402
  *
39402
- * <br><br>
39403
39403
  * 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
39404
39404
  * 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
39405
39405
  * to expensive, high-quality SAO settings, that we wouldn't normally configure for an interactive SAO effect.
@@ -40249,7 +40249,7 @@ const RENDER_PASSES = {
40249
40249
  };
40250
40250
 
40251
40251
  const tempVec4$5 = math.vec4();
40252
- const tempVec3a$T = math.vec3();
40252
+ const tempVec3a$U = math.vec3();
40253
40253
 
40254
40254
  /**
40255
40255
  * @private
@@ -40314,7 +40314,7 @@ class TrianglesBatchingColorRenderer {
40314
40314
  if (active) {
40315
40315
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
40316
40316
  if (origin) {
40317
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$T);
40317
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$U);
40318
40318
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
40319
40319
  } else {
40320
40320
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -40755,7 +40755,7 @@ class TrianglesBatchingColorRenderer {
40755
40755
  }
40756
40756
 
40757
40757
  const tempVec4$4 = math.vec4();
40758
- const tempVec3a$S = math.vec3();
40758
+ const tempVec3a$T = math.vec3();
40759
40759
 
40760
40760
  /**
40761
40761
  * @private
@@ -40817,7 +40817,7 @@ class TrianglesBatchingFlatColorRenderer {
40817
40817
  if (active) {
40818
40818
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
40819
40819
  if (origin) {
40820
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$S);
40820
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$T);
40821
40821
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
40822
40822
  } else {
40823
40823
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -41246,7 +41246,7 @@ class TrianglesBatchingFlatColorRenderer {
41246
41246
  }
41247
41247
 
41248
41248
  const defaultColor$4 = new Float32Array([1, 1, 1]);
41249
- const tempVec3a$R = math.vec3();
41249
+ const tempVec3a$S = math.vec3();
41250
41250
 
41251
41251
  /**
41252
41252
  * @private
@@ -41330,7 +41330,7 @@ class TrianglesBatchingSilhouetteRenderer {
41330
41330
  if (active) {
41331
41331
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
41332
41332
  if (origin) {
41333
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$R);
41333
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$S);
41334
41334
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
41335
41335
  } else {
41336
41336
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -41567,7 +41567,7 @@ class TrianglesBatchingSilhouetteRenderer {
41567
41567
  }
41568
41568
  }
41569
41569
 
41570
- const tempVec3a$Q = math.vec3();
41570
+ const tempVec3a$R = math.vec3();
41571
41571
  const defaultColor$3 = new Float32Array([0,0,0,1]);
41572
41572
 
41573
41573
  /**
@@ -41650,7 +41650,7 @@ class TrianglesBatchingEdgesRenderer {
41650
41650
  if (active) {
41651
41651
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
41652
41652
  if (origin) {
41653
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Q);
41653
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$R);
41654
41654
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
41655
41655
  } else {
41656
41656
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -41888,7 +41888,7 @@ class TrianglesBatchingEdgesRenderer {
41888
41888
  }
41889
41889
  }
41890
41890
 
41891
- const tempVec3a$P = math.vec3();
41891
+ const tempVec3a$Q = math.vec3();
41892
41892
 
41893
41893
  /**
41894
41894
  * @private
@@ -41948,7 +41948,7 @@ class TrianglesBatchingEdgesColorRenderer {
41948
41948
  if (active) {
41949
41949
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
41950
41950
  if (origin) {
41951
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$P);
41951
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Q);
41952
41952
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
41953
41953
  } else {
41954
41954
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -42188,7 +42188,7 @@ class TrianglesBatchingEdgesColorRenderer {
42188
42188
  }
42189
42189
  }
42190
42190
 
42191
- const tempVec3a$O = math.vec3();
42191
+ const tempVec3a$P = math.vec3();
42192
42192
 
42193
42193
  /**
42194
42194
  * @private
@@ -42254,7 +42254,7 @@ class TrianglesBatchingPickMeshRenderer {
42254
42254
  if (active) {
42255
42255
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
42256
42256
  if (origin) {
42257
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$O);
42257
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$P);
42258
42258
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
42259
42259
  } else {
42260
42260
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -42493,7 +42493,7 @@ class TrianglesBatchingPickMeshRenderer {
42493
42493
  }
42494
42494
  }
42495
42495
 
42496
- const tempVec3a$N = math.vec3();
42496
+ const tempVec3a$O = math.vec3();
42497
42497
 
42498
42498
  /**
42499
42499
  * @private
@@ -42564,7 +42564,7 @@ class TrianglesBatchingPickDepthRenderer {
42564
42564
  if (active) {
42565
42565
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
42566
42566
  if (origin) {
42567
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$N);
42567
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$O);
42568
42568
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
42569
42569
  } else {
42570
42570
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -42812,7 +42812,7 @@ class TrianglesBatchingPickDepthRenderer {
42812
42812
  }
42813
42813
  }
42814
42814
 
42815
- const tempVec3a$M = math.vec3();
42815
+ const tempVec3a$N = math.vec3();
42816
42816
 
42817
42817
  /**
42818
42818
  * @private
@@ -42880,7 +42880,7 @@ class TrianglesBatchingPickNormalsRenderer {
42880
42880
  if (active) {
42881
42881
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
42882
42882
  if (origin) {
42883
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$M);
42883
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$N);
42884
42884
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
42885
42885
  } else {
42886
42886
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -43112,7 +43112,7 @@ class TrianglesBatchingPickNormalsRenderer {
43112
43112
  }
43113
43113
  }
43114
43114
 
43115
- const tempVec3a$L = math.vec3();
43115
+ const tempVec3a$M = math.vec3();
43116
43116
 
43117
43117
  /**
43118
43118
  * @private
@@ -43172,7 +43172,7 @@ class TrianglesBatchingOcclusionRenderer {
43172
43172
  if (active) {
43173
43173
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
43174
43174
  if (origin) {
43175
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$L);
43175
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$M);
43176
43176
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
43177
43177
  } else {
43178
43178
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -43403,7 +43403,7 @@ class TrianglesBatchingOcclusionRenderer {
43403
43403
  }
43404
43404
  }
43405
43405
 
43406
- const tempVec3a$K = math.vec3();
43406
+ const tempVec3a$L = math.vec3();
43407
43407
 
43408
43408
  /**
43409
43409
  * @private
@@ -43463,7 +43463,7 @@ class TrianglesBatchingDepthRenderer {
43463
43463
  if (active) {
43464
43464
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
43465
43465
  if (origin) {
43466
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$K);
43466
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$L);
43467
43467
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
43468
43468
  } else {
43469
43469
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -43699,7 +43699,7 @@ class TrianglesBatchingDepthRenderer {
43699
43699
  }
43700
43700
  }
43701
43701
 
43702
- const tempVec3a$J = math.vec3();
43702
+ const tempVec3a$K = math.vec3();
43703
43703
 
43704
43704
  /**
43705
43705
  * @private
@@ -43762,7 +43762,7 @@ class TrianglesBatchingNormalsRenderer {
43762
43762
  if (active) {
43763
43763
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
43764
43764
  if (origin) {
43765
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$J);
43765
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$K);
43766
43766
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
43767
43767
  } else {
43768
43768
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -44010,7 +44010,7 @@ class TrianglesBatchingNormalsRenderer {
44010
44010
  }
44011
44011
  }
44012
44012
 
44013
- const tempVec3a$I = math.vec3();
44013
+ const tempVec3a$J = math.vec3();
44014
44014
 
44015
44015
  /**
44016
44016
  * Renders BatchingLayer fragment depths to a shadow map.
@@ -44079,7 +44079,7 @@ class TrianglesBatchingShadowRenderer {
44079
44079
  if (active) {
44080
44080
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
44081
44081
  if (origin) {
44082
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$I);
44082
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$J);
44083
44083
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
44084
44084
  } else {
44085
44085
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -44248,7 +44248,7 @@ class TrianglesBatchingShadowRenderer {
44248
44248
  }
44249
44249
 
44250
44250
  const tempVec4$3 = math.vec4();
44251
- const tempVec3a$H = math.vec3();
44251
+ const tempVec3a$I = math.vec3();
44252
44252
 
44253
44253
  const TEXTURE_DECODE_FUNCS$1 = {
44254
44254
  "linear": "linearToLinear",
@@ -44319,7 +44319,7 @@ class TrianglesBatchingColorQualityRenderer {
44319
44319
  if (active) {
44320
44320
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
44321
44321
  if (origin) {
44322
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$H);
44322
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$I);
44323
44323
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
44324
44324
  } else {
44325
44325
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -45058,7 +45058,7 @@ class TrianglesBatchingColorQualityRenderer {
45058
45058
  }
45059
45059
  }
45060
45060
 
45061
- const tempVec3a$G = math.vec3();
45061
+ const tempVec3a$H = math.vec3();
45062
45062
 
45063
45063
  /**
45064
45064
  * @private
@@ -45125,7 +45125,7 @@ class TrianglesBatchingPickNormalsFlatRenderer {
45125
45125
  if (active) {
45126
45126
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
45127
45127
  if (origin) {
45128
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$G);
45128
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$H);
45129
45129
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
45130
45130
  } else {
45131
45131
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -45850,9 +45850,9 @@ const tempVec4b$9 = math.vec4([0, 0, 0, 1]);
45850
45850
  const tempVec4c$7 = math.vec4([0, 0, 0, 1]);
45851
45851
  const tempOBB3$2 = math.OBB3();
45852
45852
 
45853
- const tempVec3a$F = math.vec3();
45854
- const tempVec3b$7 = math.vec3();
45855
- const tempVec3c$4 = math.vec3();
45853
+ const tempVec3a$G = math.vec3();
45854
+ const tempVec3b$8 = math.vec3();
45855
+ const tempVec3c$5 = math.vec3();
45856
45856
  const tempVec3d$2 = math.vec3();
45857
45857
  const tempVec3e$1 = math.vec3();
45858
45858
  const tempVec3f$1 = math.vec3();
@@ -46939,10 +46939,10 @@ class TrianglesBatchingLayer {
46939
46939
  const origin = state.origin;
46940
46940
  const offset = portion.offset;
46941
46941
 
46942
- const rtcRayOrigin = tempVec3a$F;
46943
- const rtcRayDir = tempVec3b$7;
46942
+ const rtcRayOrigin = tempVec3a$G;
46943
+ const rtcRayDir = tempVec3b$8;
46944
46944
 
46945
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$4) : worldRayOrigin); // World -> RTC
46945
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$5) : worldRayOrigin); // World -> RTC
46946
46946
  rtcRayDir.set(worldRayDir);
46947
46947
 
46948
46948
  if (offset) {
@@ -47063,7 +47063,7 @@ class TrianglesBatchingLayer {
47063
47063
  }
47064
47064
 
47065
47065
  const tempVec4$2 = math.vec4();
47066
- const tempVec3a$E = math.vec3();
47066
+ const tempVec3a$F = math.vec3();
47067
47067
 
47068
47068
  /**
47069
47069
  * @private
@@ -47129,7 +47129,7 @@ class TrianglesInstancingColorRenderer {
47129
47129
  if (active) {
47130
47130
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
47131
47131
  if (origin) {
47132
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$E);
47132
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$F);
47133
47133
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
47134
47134
  } else {
47135
47135
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -47620,7 +47620,7 @@ class TrianglesInstancingColorRenderer {
47620
47620
  }
47621
47621
 
47622
47622
  const tempVec4$1 = math.vec4();
47623
- const tempVec3a$D = math.vec3();
47623
+ const tempVec3a$E = math.vec3();
47624
47624
 
47625
47625
  /**
47626
47626
  * @private
@@ -47682,7 +47682,7 @@ class TrianglesInstancingFlatColorRenderer {
47682
47682
  if (active) {
47683
47683
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
47684
47684
  if (origin) {
47685
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$D);
47685
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$E);
47686
47686
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
47687
47687
  } else {
47688
47688
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -48145,7 +48145,7 @@ class TrianglesInstancingFlatColorRenderer {
48145
48145
  }
48146
48146
  }
48147
48147
 
48148
- const tempVec3a$C = math.vec3();
48148
+ const tempVec3a$D = math.vec3();
48149
48149
 
48150
48150
  /**
48151
48151
  * @private
@@ -48228,7 +48228,7 @@ class TrianglesInstancingSilhouetteRenderer {
48228
48228
  if (active) {
48229
48229
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
48230
48230
  if (origin) {
48231
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C);
48231
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$D);
48232
48232
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
48233
48233
  } else {
48234
48234
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -48498,7 +48498,7 @@ class TrianglesInstancingSilhouetteRenderer {
48498
48498
  }
48499
48499
  }
48500
48500
 
48501
- const tempVec3a$B = math.vec3();
48501
+ const tempVec3a$C = math.vec3();
48502
48502
  const defaultColor$2 = new Float32Array([0,0,0,1]);
48503
48503
 
48504
48504
  /**
@@ -48582,7 +48582,7 @@ class TrianglesInstancingEdgesRenderer {
48582
48582
  if (active) {
48583
48583
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
48584
48584
  if (origin) {
48585
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$B);
48585
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C);
48586
48586
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
48587
48587
  } else {
48588
48588
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -48853,7 +48853,7 @@ class TrianglesInstancingEdgesRenderer {
48853
48853
  }
48854
48854
  }
48855
48855
 
48856
- const tempVec3a$A = math.vec3();
48856
+ const tempVec3a$B = math.vec3();
48857
48857
 
48858
48858
  /**
48859
48859
  * @private
@@ -48914,7 +48914,7 @@ class TrianglesInstancingEdgesColorRenderer {
48914
48914
  if (active) {
48915
48915
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
48916
48916
  if (origin) {
48917
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$A);
48917
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$B);
48918
48918
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
48919
48919
  } else {
48920
48920
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -49190,7 +49190,7 @@ class TrianglesInstancingEdgesColorRenderer {
49190
49190
  }
49191
49191
  }
49192
49192
 
49193
- const tempVec3a$z = math.vec3();
49193
+ const tempVec3a$A = math.vec3();
49194
49194
 
49195
49195
  /**
49196
49196
  * @private
@@ -49293,7 +49293,7 @@ class TrianglesInstancingPickMeshRenderer {
49293
49293
  if (active) {
49294
49294
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
49295
49295
  if (origin) {
49296
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$z);
49296
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$A);
49297
49297
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
49298
49298
  } else {
49299
49299
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -49539,7 +49539,7 @@ class TrianglesInstancingPickMeshRenderer {
49539
49539
  }
49540
49540
  }
49541
49541
 
49542
- const tempVec3a$y = math.vec3();
49542
+ const tempVec3a$z = math.vec3();
49543
49543
 
49544
49544
  /**
49545
49545
  * @private
@@ -49616,7 +49616,7 @@ class TrianglesInstancingPickDepthRenderer {
49616
49616
  if (active) {
49617
49617
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
49618
49618
  if (origin) {
49619
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$y);
49619
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$z);
49620
49620
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
49621
49621
  } else {
49622
49622
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -49897,7 +49897,7 @@ class TrianglesInstancingPickDepthRenderer {
49897
49897
  }
49898
49898
  }
49899
49899
 
49900
- const tempVec3a$x = math.vec3();
49900
+ const tempVec3a$y = math.vec3();
49901
49901
 
49902
49902
  /**
49903
49903
  * @private
@@ -49974,7 +49974,7 @@ class TrianglesInstancingPickNormalsRenderer {
49974
49974
  if (active) {
49975
49975
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
49976
49976
  if (origin) {
49977
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$x);
49977
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$y);
49978
49978
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
49979
49979
  } else {
49980
49980
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -50260,7 +50260,7 @@ class TrianglesInstancingPickNormalsRenderer {
50260
50260
  }
50261
50261
  }
50262
50262
 
50263
- const tempVec3a$w = math.vec3();
50263
+ const tempVec3a$x = math.vec3();
50264
50264
 
50265
50265
  /**
50266
50266
  * @private
@@ -50321,7 +50321,7 @@ class TrianglesInstancingOcclusionRenderer {
50321
50321
  if (active) {
50322
50322
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
50323
50323
  if (origin) {
50324
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$w);
50324
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$x);
50325
50325
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
50326
50326
  } else {
50327
50327
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -50589,7 +50589,7 @@ class TrianglesInstancingOcclusionRenderer {
50589
50589
  }
50590
50590
  }
50591
50591
 
50592
- const tempVec3a$v = math.vec3();
50592
+ const tempVec3a$w = math.vec3();
50593
50593
 
50594
50594
  /**
50595
50595
  * @private
@@ -50650,7 +50650,7 @@ class TrianglesInstancingDepthRenderer {
50650
50650
  if (active) {
50651
50651
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
50652
50652
  if (origin) {
50653
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$v);
50653
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$w);
50654
50654
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
50655
50655
  } else {
50656
50656
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -50930,7 +50930,7 @@ class TrianglesInstancingDepthRenderer {
50930
50930
  }
50931
50931
  }
50932
50932
 
50933
- const tempVec3a$u = math.vec3();
50933
+ const tempVec3a$v = math.vec3();
50934
50934
 
50935
50935
  /**
50936
50936
  * @private
@@ -50994,7 +50994,7 @@ class TrianglesInstancingNormalsRenderer {
50994
50994
  if (active) {
50995
50995
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
50996
50996
  if (origin) {
50997
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$u);
50997
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$v);
50998
50998
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
50999
50999
  } else {
51000
51000
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -51284,7 +51284,7 @@ class TrianglesInstancingNormalsRenderer {
51284
51284
  }
51285
51285
  }
51286
51286
 
51287
- const tempVec3a$t = math.vec3();
51287
+ const tempVec3a$u = math.vec3();
51288
51288
 
51289
51289
  /**
51290
51290
  * Renders InstancingLayer fragment depths to a shadow map.
@@ -51371,7 +51371,7 @@ class TrianglesInstancingShadowRenderer {
51371
51371
  if (active) {
51372
51372
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
51373
51373
  if (origin) {
51374
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$t);
51374
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$u);
51375
51375
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
51376
51376
  } else {
51377
51377
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -51564,7 +51564,7 @@ class TrianglesInstancingShadowRenderer {
51564
51564
  }
51565
51565
 
51566
51566
  const tempVec4 = math.vec4();
51567
- const tempVec3a$s = math.vec3();
51567
+ const tempVec3a$t = math.vec3();
51568
51568
 
51569
51569
  const TEXTURE_DECODE_FUNCS = {
51570
51570
  "linear": "linearToLinear",
@@ -51636,7 +51636,7 @@ class TrianglesInstancingColorQualityRenderer {
51636
51636
  if (active) {
51637
51637
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
51638
51638
  if (origin) {
51639
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$s);
51639
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$t);
51640
51640
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
51641
51641
  } else {
51642
51642
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -52424,7 +52424,7 @@ class TrianglesInstancingColorQualityRenderer {
52424
52424
  }
52425
52425
  }
52426
52426
 
52427
- const tempVec3a$r = math.vec3();
52427
+ const tempVec3a$s = math.vec3();
52428
52428
 
52429
52429
  /**
52430
52430
  * @private
@@ -52499,7 +52499,7 @@ class TrianglesInstancingPickNormalsFlatRenderer {
52499
52499
  if (active) {
52500
52500
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
52501
52501
  if (origin) {
52502
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$r);
52502
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$s);
52503
52503
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
52504
52504
  } else {
52505
52505
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -53033,9 +53033,9 @@ const tempVec4b$8 = math.vec4([0, 0, 0, 1]);
53033
53033
  const tempVec4c$6 = math.vec4([0, 0, 0, 1]);
53034
53034
  const tempVec3fa$2 = new Float32Array(3);
53035
53035
 
53036
- const tempVec3a$q = math.vec3();
53037
- const tempVec3b$6 = math.vec3();
53038
- const tempVec3c$3 = math.vec3();
53036
+ const tempVec3a$r = math.vec3();
53037
+ const tempVec3b$7 = math.vec3();
53038
+ const tempVec3c$4 = math.vec3();
53039
53039
  const tempVec3d$1 = math.vec3();
53040
53040
  const tempVec3e = math.vec3();
53041
53041
  const tempVec3f = math.vec3();
@@ -53999,10 +53999,10 @@ class TrianglesInstancingLayer {
53999
53999
  const origin = state.origin;
54000
54000
  const offset = portion.offset;
54001
54001
 
54002
- const rtcRayOrigin = tempVec3a$q;
54003
- const rtcRayDir = tempVec3b$6;
54002
+ const rtcRayOrigin = tempVec3a$r;
54003
+ const rtcRayDir = tempVec3b$7;
54004
54004
 
54005
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$3) : worldRayOrigin); // World -> RTC
54005
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$4) : worldRayOrigin); // World -> RTC
54006
54006
  rtcRayDir.set(worldRayDir);
54007
54007
 
54008
54008
  if (offset) {
@@ -54149,7 +54149,7 @@ class TrianglesInstancingLayer {
54149
54149
  }
54150
54150
  }
54151
54151
 
54152
- const tempVec3a$p = math.vec3();
54152
+ const tempVec3a$q = math.vec3();
54153
54153
 
54154
54154
  /**
54155
54155
  * @private
@@ -54211,7 +54211,7 @@ class LinesBatchingColorRenderer {
54211
54211
  if (active) {
54212
54212
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
54213
54213
  if (origin) {
54214
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$p);
54214
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$q);
54215
54215
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
54216
54216
  } else {
54217
54217
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -54441,7 +54441,7 @@ class LinesBatchingColorRenderer {
54441
54441
  }
54442
54442
 
54443
54443
  const defaultColor$1 = new Float32Array([1, 1, 1]);
54444
- const tempVec3a$o = math.vec3();
54444
+ const tempVec3a$p = math.vec3();
54445
54445
 
54446
54446
  /**
54447
54447
  * @private
@@ -54527,7 +54527,7 @@ class LinesBatchingSilhouetteRenderer {
54527
54527
  if (active) {
54528
54528
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
54529
54529
  if (origin) {
54530
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$o);
54530
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$p);
54531
54531
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
54532
54532
  } else {
54533
54533
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -55623,7 +55623,7 @@ class LinesBatchingLayer {
55623
55623
  }
55624
55624
  }
55625
55625
 
55626
- const tempVec3a$n = math.vec3();
55626
+ const tempVec3a$o = math.vec3();
55627
55627
 
55628
55628
  /**
55629
55629
  * @private
@@ -55686,7 +55686,7 @@ class LinesInstancingColorRenderer {
55686
55686
  if (active) {
55687
55687
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
55688
55688
  if (origin) {
55689
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n);
55689
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$o);
55690
55690
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
55691
55691
  } else {
55692
55692
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -55983,7 +55983,7 @@ class LinesInstancingColorRenderer {
55983
55983
  }
55984
55984
  }
55985
55985
 
55986
- const tempVec3a$m = math.vec3();
55986
+ const tempVec3a$n = math.vec3();
55987
55987
 
55988
55988
  /**
55989
55989
  * @private
@@ -56068,7 +56068,7 @@ class LinesInstancingSilhouetteRenderer {
56068
56068
  if (active) {
56069
56069
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
56070
56070
  if (origin) {
56071
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m);
56071
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n);
56072
56072
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
56073
56073
  } else {
56074
56074
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -57085,7 +57085,7 @@ class LinesInstancingLayer {
57085
57085
  }
57086
57086
  }
57087
57087
 
57088
- const tempVec3a$l = math.vec3();
57088
+ const tempVec3a$m = math.vec3();
57089
57089
 
57090
57090
  /**
57091
57091
  * @private
@@ -57146,7 +57146,7 @@ class PointsBatchingColorRenderer {
57146
57146
  if (active) {
57147
57147
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
57148
57148
  if (origin) {
57149
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l);
57149
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m);
57150
57150
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
57151
57151
  } else {
57152
57152
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -57445,7 +57445,7 @@ class PointsBatchingColorRenderer {
57445
57445
  }
57446
57446
 
57447
57447
  const defaultColor = new Float32Array([1, 1, 1]);
57448
- const tempVec3a$k = math.vec3();
57448
+ const tempVec3a$l = math.vec3();
57449
57449
 
57450
57450
  /**
57451
57451
  * @private
@@ -57530,7 +57530,7 @@ class PointsBatchingSilhouetteRenderer {
57530
57530
  if (active) {
57531
57531
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
57532
57532
  if (origin) {
57533
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k);
57533
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l);
57534
57534
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
57535
57535
  } else {
57536
57536
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -57785,7 +57785,7 @@ class PointsBatchingSilhouetteRenderer {
57785
57785
  }
57786
57786
  }
57787
57787
 
57788
- const tempVec3a$j = math.vec3();
57788
+ const tempVec3a$k = math.vec3();
57789
57789
 
57790
57790
  /**
57791
57791
  * @private
@@ -57852,7 +57852,7 @@ class PointsBatchingPickMeshRenderer {
57852
57852
  if (active) {
57853
57853
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
57854
57854
  if (origin) {
57855
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j);
57855
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k);
57856
57856
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
57857
57857
  } else {
57858
57858
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -58110,7 +58110,7 @@ class PointsBatchingPickMeshRenderer {
58110
58110
  }
58111
58111
  }
58112
58112
 
58113
- const tempVec3a$i = math.vec3();
58113
+ const tempVec3a$j = math.vec3();
58114
58114
 
58115
58115
  /**
58116
58116
  * @private
@@ -58182,7 +58182,7 @@ class PointsBatchingPickDepthRenderer {
58182
58182
  if (active) {
58183
58183
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
58184
58184
  if (origin) {
58185
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i);
58185
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j);
58186
58186
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
58187
58187
  } else {
58188
58188
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -58447,7 +58447,7 @@ class PointsBatchingPickDepthRenderer {
58447
58447
  }
58448
58448
  }
58449
58449
 
58450
- const tempVec3a$h = math.vec3();
58450
+ const tempVec3a$i = math.vec3();
58451
58451
 
58452
58452
  /**
58453
58453
  * @private
@@ -58508,7 +58508,7 @@ class PointsBatchingOcclusionRenderer {
58508
58508
  if (active) {
58509
58509
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
58510
58510
  if (origin) {
58511
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
58511
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i);
58512
58512
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
58513
58513
  } else {
58514
58514
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -58893,8 +58893,8 @@ class PointsBatchingBuffer {
58893
58893
  }
58894
58894
  }
58895
58895
 
58896
- const tempVec3a$g = math.vec4();
58897
- const tempVec3b$5 = math.vec4();
58896
+ const tempVec3a$h = math.vec4();
58897
+ const tempVec3b$6 = math.vec4();
58898
58898
  const tempVec4a$5 = math.vec4([0, 0, 0, 1]);
58899
58899
  const tempVec4b$5 = math.vec4([0, 0, 0, 1]);
58900
58900
  const tempVec4c$3 = math.vec4([0, 0, 0, 1]);
@@ -59030,8 +59030,8 @@ class PointsBatchingLayer {
59030
59030
 
59031
59031
  const bounds = geometryCompressionUtils.getPositionsBounds(positions);
59032
59032
 
59033
- const min = geometryCompressionUtils.decompressPosition(bounds.min, this._positionsDecodeMatrix, tempVec3a$g);
59034
- const max = geometryCompressionUtils.decompressPosition(bounds.max, this._positionsDecodeMatrix, tempVec3b$5);
59033
+ const min = geometryCompressionUtils.decompressPosition(bounds.min, this._positionsDecodeMatrix, tempVec3a$h);
59034
+ const max = geometryCompressionUtils.decompressPosition(bounds.max, this._positionsDecodeMatrix, tempVec3b$6);
59035
59035
 
59036
59036
  worldAABB[0] = min[0];
59037
59037
  worldAABB[1] = min[1];
@@ -59657,7 +59657,7 @@ class PointsBatchingLayer {
59657
59657
  }
59658
59658
  }
59659
59659
 
59660
- const tempVec3a$f = math.vec3();
59660
+ const tempVec3a$g = math.vec3();
59661
59661
 
59662
59662
  /**
59663
59663
  * @private
@@ -59726,7 +59726,7 @@ class PointsInstancingColorRenderer {
59726
59726
  if (active) {
59727
59727
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
59728
59728
  if (origin) {
59729
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f);
59729
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g);
59730
59730
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
59731
59731
  } else {
59732
59732
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -60049,7 +60049,7 @@ class PointsInstancingColorRenderer {
60049
60049
  }
60050
60050
  }
60051
60051
 
60052
- const tempVec3a$e = math.vec3();
60052
+ const tempVec3a$f = math.vec3();
60053
60053
 
60054
60054
  /**
60055
60055
  * @private
@@ -60133,7 +60133,7 @@ class PointsInstancingSilhouetteRenderer {
60133
60133
  if (active) {
60134
60134
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
60135
60135
  if (origin) {
60136
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e);
60136
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f);
60137
60137
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
60138
60138
  } else {
60139
60139
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -60424,7 +60424,7 @@ class PointsInstancingSilhouetteRenderer {
60424
60424
  }
60425
60425
  }
60426
60426
 
60427
- const tempVec3a$d = math.vec3();
60427
+ const tempVec3a$e = math.vec3();
60428
60428
 
60429
60429
  /**
60430
60430
  * @private
@@ -60530,7 +60530,7 @@ class PointsInstancingPickMeshRenderer {
60530
60530
  if (active) {
60531
60531
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
60532
60532
  if (origin) {
60533
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
60533
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e);
60534
60534
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
60535
60535
  } else {
60536
60536
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -60794,7 +60794,7 @@ class PointsInstancingPickMeshRenderer {
60794
60794
  }
60795
60795
  }
60796
60796
 
60797
- const tempVec3a$c = math.vec3();
60797
+ const tempVec3a$d = math.vec3();
60798
60798
 
60799
60799
  /**
60800
60800
  * @private
@@ -60872,7 +60872,7 @@ class PointsInstancingPickDepthRenderer {
60872
60872
  if (active) {
60873
60873
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
60874
60874
  if (origin) {
60875
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c);
60875
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
60876
60876
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
60877
60877
  } else {
60878
60878
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -61174,7 +61174,7 @@ class PointsInstancingPickDepthRenderer {
61174
61174
  }
61175
61175
  }
61176
61176
 
61177
- const tempVec3a$b = math.vec3();
61177
+ const tempVec3a$c = math.vec3();
61178
61178
 
61179
61179
  /**
61180
61180
  * @private
@@ -61236,7 +61236,7 @@ class PointsInstancingOcclusionRenderer {
61236
61236
  if (active) {
61237
61237
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
61238
61238
  if (origin) {
61239
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b);
61239
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c);
61240
61240
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
61241
61241
  } else {
61242
61242
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -61538,7 +61538,7 @@ class PointsInstancingOcclusionRenderer {
61538
61538
  }
61539
61539
  }
61540
61540
 
61541
- const tempVec3a$a = math.vec3();
61541
+ const tempVec3a$b = math.vec3();
61542
61542
 
61543
61543
  /**
61544
61544
  * @private
@@ -61600,7 +61600,7 @@ class PointsInstancingDepthRenderer {
61600
61600
  if (active) {
61601
61601
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
61602
61602
  if (origin) {
61603
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$a);
61603
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b);
61604
61604
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
61605
61605
  } else {
61606
61606
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -61898,7 +61898,7 @@ class PointsInstancingDepthRenderer {
61898
61898
  }
61899
61899
  }
61900
61900
 
61901
- const tempVec3a$9 = math.vec3();
61901
+ const tempVec3a$a = math.vec3();
61902
61902
 
61903
61903
  /**
61904
61904
  * Renders InstancingLayer fragment depths to a shadow map.
@@ -61986,7 +61986,7 @@ class PointsInstancingShadowRenderer {
61986
61986
  if (active) {
61987
61987
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
61988
61988
  if (origin) {
61989
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$9);
61989
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$a);
61990
61990
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
61991
61991
  } else {
61992
61992
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -63063,7 +63063,7 @@ class PointsInstancingLayer {
63063
63063
 
63064
63064
  const instancedArraysSupported = WEBGL_INFO$1.SUPPORTED_EXTENSIONS["ANGLE_instanced_arrays"];
63065
63065
 
63066
- const tempVec3a$8 = math.vec3();
63066
+ const tempVec3a$9 = math.vec3();
63067
63067
  const tempMat4$1 = math.mat4();
63068
63068
 
63069
63069
  const defaultScale = math.vec3([1, 1, 1]);
@@ -63087,7 +63087,7 @@ const defaultQuaternion = math.identityQuaternion();
63087
63087
  *
63088
63088
  * 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.
63089
63089
  *
63090
- * ````PerformanceModel```` is the default model representation loaded by {@link GLTFLoaderPlugin} and {@link XKTLoaderPlugin}.
63090
+ * ````PerformanceModel```` is the default model representation loaded by (at least) {@link GLTFLoaderPlugin}, {@link XKTLoaderPlugin} and {@link WebIFCLoaderPlugin}.
63091
63091
  *
63092
63092
  * 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.
63093
63093
  *
@@ -63103,7 +63103,7 @@ const defaultQuaternion = math.identityQuaternion();
63103
63103
  * - [Classifying with Metadata](#classifying-with-metadata)
63104
63104
  * - [Querying Metadata](#querying-metadata)
63105
63105
  * - [Metadata Structure](#metadata-structure)
63106
- * - [RTC Coordinates](#rtc-coordinates)
63106
+ * - [RTC Coordinates](#rtc-coordinates-for-double-precision)
63107
63107
  * - [Example 3: RTC Coordinates with Geometry Instancing](#example-2--rtc-coordinates-with-geometry-instancing)
63108
63108
  * - [Example 4: RTC Coordinates with Geometry Batching](#example-2--rtc-coordinates-with-geometry-batching)
63109
63109
  *
@@ -63632,7 +63632,7 @@ const defaultQuaternion = math.identityQuaternion();
63632
63632
  * Note also that a {@link MetaObject} does not need to have a corresponding
63633
63633
  * {@link Entity} and vice-versa.
63634
63634
  *
63635
- * # RTC Coordinates for 64-Bit Precision
63635
+ * # RTC Coordinates for Double Precision
63636
63636
  *
63637
63637
  * ````PerformanceModel```` can emulate 64-bit precision on GPUs using relative-to-center (RTC) coordinates.
63638
63638
  *
@@ -63650,7 +63650,7 @@ const defaultQuaternion = math.identityQuaternion();
63650
63650
  *
63651
63651
  * ## RTC Coordinates with Geometry Instancing
63652
63652
  *
63653
- * 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````.
63653
+ * 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````.
63654
63654
  *
63655
63655
  * For simplicity, our example's meshes all instance the same geometry. Therefore, our example model has only one RTC center.
63656
63656
  *
@@ -63847,7 +63847,106 @@ const defaultQuaternion = math.identityQuaternion();
63847
63847
  * meshIds: ["top"],
63848
63848
  * isObject: true
63849
63849
  * });
63850
- ````
63850
+ * ````
63851
+ *
63852
+ * ## Positioning at World-space coordinates
63853
+ *
63854
+ * To position a PerformanceModel at given double-precision World coordinates, we can
63855
+ * configure the ````origin```` of the PerformanceModel itself. The ````origin```` is a double-precision
63856
+ * 3D World-space position at which the PerformanceModel will be located.
63857
+ *
63858
+ * Note that ````position```` is a single-precision offset relative to ````origin````.
63859
+ *
63860
+ * ````javascript
63861
+ * const origin = [100000000, 0, 100000000];
63862
+ *
63863
+ * const performanceModel = new PerformanceModel(viewer.scene, {
63864
+ * id: "table",
63865
+ * isModel: true,
63866
+ * origin: origin, // Everything in this PerformanceModel is relative to this RTC center
63867
+ * position: [0, 0, 0],
63868
+ * scale: [1, 1, 1],
63869
+ * rotation: [0, 0, 0]
63870
+ * });
63871
+ *
63872
+ * performanceModel.createGeometry({
63873
+ * id: "box",
63874
+ * primitive: "triangles",
63875
+ * positions: [ 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1 ... ],
63876
+ * normals: [ 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, ... ],
63877
+ * indices: [ 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7, ... ],
63878
+ * });
63879
+ *
63880
+ * performanceModel.createMesh({
63881
+ * id: "leg1",
63882
+ * geometryId: "box",
63883
+ * position: [-4, -6, -4],
63884
+ * scale: [1, 3, 1],
63885
+ * rotation: [0, 0, 0],
63886
+ * color: [1, 0.3, 0.3]
63887
+ * });
63888
+ *
63889
+ * performanceModel.createEntity({
63890
+ * meshIds: ["leg1"],
63891
+ * isObject: true
63892
+ * });
63893
+ *
63894
+ * performanceModel.createMesh({
63895
+ * id: "leg2",
63896
+ * geometryId: "box",
63897
+ * position: [4, -6, -4],
63898
+ * scale: [1, 3, 1],
63899
+ * rotation: [0, 0, 0],
63900
+ * color: [0.3, 1.0, 0.3]
63901
+ * });
63902
+ *
63903
+ * performanceModel.createEntity({
63904
+ * meshIds: ["leg2"],
63905
+ * isObject: true
63906
+ * });
63907
+ *
63908
+ * performanceModel.createMesh({
63909
+ * id: "leg3",
63910
+ * geometryId: "box",
63911
+ * position: [4, -6, 4],
63912
+ * scale: [1, 3, 1],
63913
+ * rotation: [0, 0, 0],
63914
+ * color: [0.3, 0.3, 1.0]
63915
+ * });
63916
+ *
63917
+ * performanceModel.createEntity({
63918
+ * meshIds: ["leg3"],
63919
+ * isObject: true
63920
+ * });
63921
+ *
63922
+ * performanceModel.createMesh({
63923
+ * id: "leg4",
63924
+ * geometryId: "box",
63925
+ * position: [-4, -6, 4],
63926
+ * scale: [1, 3, 1],
63927
+ * rotation: [0, 0, 0],
63928
+ * color: [1.0, 1.0, 0.0]
63929
+ * });
63930
+ *
63931
+ * performanceModel.createEntity({
63932
+ * meshIds: ["leg4"],
63933
+ * isObject: true
63934
+ * });
63935
+ *
63936
+ * performanceModel.createMesh({
63937
+ * id: "top",
63938
+ * geometryId: "box",
63939
+ * position: [0, -3, 0],
63940
+ * scale: [6, 0.5, 6],
63941
+ * rotation: [0, 0, 0],
63942
+ * color: [1.0, 0.3, 1.0]
63943
+ * });
63944
+ *
63945
+ * performanceModel.createEntity({
63946
+ * meshIds: ["top"],
63947
+ * isObject: true
63948
+ * });
63949
+ * ````
63851
63950
  *
63852
63951
  * @implements {Drawable}
63853
63952
  * @implements {Entity}
@@ -63860,8 +63959,8 @@ class PerformanceModel extends Component {
63860
63959
  * @param {*} [cfg] Configs
63861
63960
  * @param {String} [cfg.id] Optional ID, unique among all components in the parent scene, generated automatically when omitted.
63862
63961
  * @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}.
63863
- * @param {Number[]} [cfg.origin=[0,0,0]] World-space 3D origin.
63864
- * @param {Number[]} [cfg.position=[0,0,0]] Local 3D position.
63962
+ * @param {Number[]} [cfg.origin=[0,0,0]] World-space double-precision 3D origin.
63963
+ * @param {Number[]} [cfg.position=[0,0,0]] Local, single-precision 3D position, relative to the origin parameter.
63865
63964
  * @param {Number[]} [cfg.scale=[1,1,1]] Local scale.
63866
63965
  * @param {Number[]} [cfg.rotation=[0,0,0]] Local rotation, as Euler angles given in degrees, for each of the X, Y and Z axis.
63867
63966
  * @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.
@@ -64002,14 +64101,14 @@ class PerformanceModel extends Component {
64002
64101
 
64003
64102
  // Build static matrix
64004
64103
 
64005
- this._origin = new Float64Array(cfg.origin || [0, 0, 0]);
64006
- this._position = new Float32Array(cfg.position || [0, 0, 0]);
64007
- this._rotation = new Float32Array(cfg.rotation || [0, 0, 0]);
64008
- this._quaternion = new Float32Array(cfg.quaternion || [0, 0, 0, 1]);
64104
+ this._origin = math.vec3(cfg.origin || [0, 0, 0]);
64105
+ this._position = math.vec3(cfg.position || [0, 0, 0]);
64106
+ this._rotation = math.vec3(cfg.rotation || [0, 0, 0]);
64107
+ this._quaternion = math.vec4(cfg.quaternion || [0, 0, 0, 1]);
64009
64108
  if (cfg.rotation) {
64010
64109
  math.eulerToQuaternion(this._rotation, "XYZ", this._quaternion);
64011
64110
  }
64012
- this._scale = new Float32Array(cfg.scale || [1, 1, 1]);
64111
+ this._scale = math.vec3(cfg.scale || [1, 1, 1]);
64013
64112
  this._worldMatrix = math.mat4();
64014
64113
  math.composeMat4(this._position, this._quaternion, this._scale, this._worldMatrix);
64015
64114
  this._worldNormalMatrix = math.mat4();
@@ -64767,7 +64866,10 @@ class PerformanceModel extends Component {
64767
64866
  this.error("Config missing: primitive");
64768
64867
  return;
64769
64868
  }
64770
- const origin = (cfg.origin || cfg.rtcCenter) ? math.addVec3(this._origin, cfg.origin || cfg.rtcCenter, tempVec3a$8) : null;
64869
+
64870
+ const cfgOrigin = cfg.origin || cfg.rtcCenter;
64871
+ const origin = (cfgOrigin) ? math.addVec3(this._origin, cfgOrigin, tempVec3a$9) : this._origin;
64872
+
64771
64873
  switch (primitive) {
64772
64874
  case "triangles":
64773
64875
  instancingLayer = new TrianglesInstancingLayer(this, utils.apply({
@@ -64973,22 +65075,29 @@ class PerformanceModel extends Component {
64973
65075
 
64974
65076
  let needNewBatchingLayers = false;
64975
65077
 
64976
- const cellSize = 100000;
64977
-
64978
65078
  let origin = null;
64979
65079
 
64980
- if (cfg.origin || cfg.rtcCenter) {
64981
- origin = math.addVec3(this._origin, cfg.origin || cfg.rtcCenter, tempVec3a$8);
64982
- } else if (!cfg.positionsDecodeMatrix) { // TODO: Assumes we never quantize double-precision coordinates
65080
+ if (!cfg.positionsDecodeMatrix) { // TODO: Assumes we never quantize double-precision coordinates
64983
65081
  const rtcCenter = math.vec3();
64984
65082
  const rtcPositions = [];
64985
- const rtcNeeded = worldToRTCPositions(positions, rtcPositions, rtcCenter, cellSize);
65083
+ const rtcNeeded = worldToRTCPositions(positions, rtcPositions, rtcCenter);
64986
65084
  if (rtcNeeded) {
64987
65085
  positions = rtcPositions;
64988
65086
  origin = math.addVec3(this._origin, rtcCenter, rtcCenter);
64989
65087
  }
64990
65088
  }
64991
65089
 
65090
+ const cfgOrigin = cfg.origin || cfg.rtcCenter;
65091
+ if (cfgOrigin) {
65092
+ if (!origin) {
65093
+ origin = cfgOrigin;
65094
+ } else {
65095
+ origin = math.addVec3(this._origin, cfgOrigin, tempVec3a$9);
65096
+ }
65097
+ } else {
65098
+ origin = this._origin;
65099
+ }
65100
+
64992
65101
  if (origin) {
64993
65102
  if (!this._lastOrigin) {
64994
65103
  needNewBatchingLayers = true;
@@ -65862,7 +65971,7 @@ const identityMat = math.identityMat4();
65862
65971
  *
65863
65972
  * @implements {Entity}
65864
65973
  */
65865
- class Node extends Component {
65974
+ class Node$1 extends Component {
65866
65975
 
65867
65976
  /**
65868
65977
  * @constructor
@@ -66054,6 +66163,7 @@ class Node extends Component {
66054
66163
  for (let i = 0, len = this._children.length; i < len; i++) {
66055
66164
  this._children[i].origin = origin;
66056
66165
  }
66166
+ this.glRedraw();
66057
66167
  }
66058
66168
 
66059
66169
  /**
@@ -70496,7 +70606,7 @@ var parseGLTF$1 = (function () {
70496
70606
  };
70497
70607
  utils.apply(ctx.modelNodeProps, nodeCfg);
70498
70608
  utils.apply(createEntity, nodeCfg);
70499
- let childNode = new Node(modelNode, nodeCfg);
70609
+ let childNode = new Node$1(modelNode, nodeCfg);
70500
70610
  parent.addChild(childNode, false);
70501
70611
  for (let i = 0, len = numMeshes; i < len; i++) {
70502
70612
  meshesInfoMesh = meshesInfo[i];
@@ -70521,7 +70631,7 @@ var parseGLTF$1 = (function () {
70521
70631
  matrix: matrix
70522
70632
  };
70523
70633
  utils.apply(ctx.modelNodeProps, nodeCfg);
70524
- let childNode = new Node(modelNode, nodeCfg);
70634
+ let childNode = new Node$1(modelNode, nodeCfg);
70525
70635
  parent.addChild(childNode, false);
70526
70636
  for (let i = 0, len = numMeshes; i < len; i++) {
70527
70637
  meshesInfoMesh = meshesInfo[i];
@@ -70549,7 +70659,7 @@ var parseGLTF$1 = (function () {
70549
70659
  utils.apply(ctx.modelNodeProps, nodeCfg);
70550
70660
  utils.apply(createEntity, nodeCfg);
70551
70661
  createEntity.matrix = matrix;
70552
- let childNode = new Node(modelNode, nodeCfg);
70662
+ let childNode = new Node$1(modelNode, nodeCfg);
70553
70663
  parent.addChild(childNode, false); // Don't automatically inherit properties
70554
70664
  matrix = null;
70555
70665
  parent = childNode;
@@ -70566,7 +70676,7 @@ var parseGLTF$1 = (function () {
70566
70676
  if (createEntity) {
70567
70677
  utils.apply(createEntity, nodeCfg);
70568
70678
  }
70569
- let childNode = new Node(modelNode, nodeCfg);
70679
+ let childNode = new Node$1(modelNode, nodeCfg);
70570
70680
  parent.addChild(childNode, false); // Don't automatically inherit properties
70571
70681
  for (let i = 0, len = numMeshes; i < len; i++) {
70572
70682
  meshesInfoMesh = meshesInfo[i];
@@ -71006,7 +71116,7 @@ const parseGLTF = (function () {
71006
71116
  loadPrimitiveGeometry(ctx, primitiveInfo, meshCfg);
71007
71117
  math.transformPositions3(worldMatrix, meshCfg.localPositions, meshCfg.positions);
71008
71118
  const origin = math.vec3();
71009
- const rtcNeeded = worldToRTCPositions(meshCfg.positions, meshCfg.positions, origin, 10000); // Small cellsize guarantees better accuracy
71119
+ const rtcNeeded = worldToRTCPositions(meshCfg.positions, meshCfg.positions, origin); // Small cellsize guarantees better accuracy
71010
71120
  if (rtcNeeded) {
71011
71121
  meshCfg.origin = origin;
71012
71122
  }
@@ -71386,11 +71496,11 @@ class GLTFLoaderPlugin extends Plugin {
71386
71496
  * @params {String[]} [params.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
71387
71497
  * @params {String[]} [params.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
71388
71498
  * @param {Boolean} [params.edges=false] Whether or not xeokit renders the model with edges emphasized.
71389
- * @param {Number[]} [params.origin=[0,0,0]] The World-space origin of the model's coordinates.
71390
- * @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
71391
- * @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
71392
- * @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.
71393
- * @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.
71499
+ * @param {Number[]} [params.origin=[0,0,0]] The double-precision World-space origin of the model's coordinates.
71500
+ * @param {Number[]} [params.position=[0,0,0]] The single-precision position, relative to ````origin````.
71501
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
71502
+ * @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.
71503
+ * @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````.
71394
71504
  * @param {Boolean} [params.backfaces=false] When true, allows visible backfaces, wherever specified in the glTF. When false, ignores backfaces.
71395
71505
  * @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.
71396
71506
  * @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.
@@ -71416,7 +71526,7 @@ class GLTFLoaderPlugin extends Plugin {
71416
71526
 
71417
71527
  // Scene Node graph supports original glTF materials
71418
71528
 
71419
- : new Node(this.viewer.scene, utils.apply(params, {
71529
+ : new Node$1(this.viewer.scene, utils.apply(params, {
71420
71530
  isModel: true
71421
71531
  }));
71422
71532
 
@@ -72516,7 +72626,7 @@ class NavCubePlugin extends Plugin {
72516
72626
  }
72517
72627
  }
72518
72628
 
72519
- const tempVec3a$7 = math.vec3();
72629
+ const tempVec3a$8 = math.vec3();
72520
72630
 
72521
72631
  /**
72522
72632
  * @private
@@ -73214,7 +73324,7 @@ function createMeshes(modelNode, state) {
73214
73324
  }
73215
73325
  geometryCfg.indices = indices;
73216
73326
 
73217
- const origin = tempVec3a$7;
73327
+ const origin = tempVec3a$8;
73218
73328
 
73219
73329
  worldToRTCPositions(geometry.positions, geometry.positions, origin);
73220
73330
 
@@ -73380,7 +73490,7 @@ class OBJLoaderPlugin extends Plugin {
73380
73490
  delete params.id;
73381
73491
  }
73382
73492
 
73383
- var modelNode = new Node(this.viewer.scene, utils.apply(params, {
73493
+ var modelNode = new Node$1(this.viewer.scene, utils.apply(params, {
73384
73494
  isModel: true
73385
73495
  }));
73386
73496
 
@@ -73763,7 +73873,7 @@ class Control {
73763
73873
  const tubeRadius = 0.01;
73764
73874
  const arrowRadius = 0.07;
73765
73875
 
73766
- this._rootNode = new Node(scene, {
73876
+ this._rootNode = new Node$1(scene, {
73767
73877
  position: [0, 0, 0],
73768
73878
  scale: [5, 5, 5]
73769
73879
  });
@@ -75956,7 +76066,7 @@ class STLDefaultDataSource {
75956
76066
  }
75957
76067
  }
75958
76068
 
75959
- const tempVec3a$6 = math.vec3();
76069
+ const tempVec3a$7 = math.vec3();
75960
76070
 
75961
76071
  /**
75962
76072
  * @private
@@ -76208,7 +76318,7 @@ function addMesh(modelNode, positions, normals, colors, material, options) {
76208
76318
  math.faceToVertexNormals(positions, normals, options);
76209
76319
  }
76210
76320
 
76211
- const origin = tempVec3a$6;
76321
+ const origin = tempVec3a$7;
76212
76322
 
76213
76323
  worldToRTCPositions(positions, positions, origin);
76214
76324
 
@@ -76485,10 +76595,11 @@ class STLLoaderPlugin extends Plugin {
76485
76595
  * @param {String} [params.src] Path to an STL file. Overrides the ````stl```` parameter.
76486
76596
  * @param {String} [params.stl] Contents of an STL file, either binary of ASCII. Overridden by the ````src```` parameter.
76487
76597
  * @param {Boolean} [params.edges=false] Whether or not to renders the model with edges emphasized.
76488
- * @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
76489
- * @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
76490
- * @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.
76491
- * @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.
76598
+ * @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.
76599
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
76600
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
76601
+ * @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.
76602
+ * @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````.
76492
76603
  * @param {Boolean} [params.backfaces=false] When true, allows visible backfaces, wherever specified in the STL. When false, ignores backfaces.
76493
76604
  * @param {Boolean} [params.smoothNormals=true] When true, automatically converts face-oriented normals to vertex normals for a smooth appearance.
76494
76605
  * @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.
@@ -76503,7 +76614,7 @@ class STLLoaderPlugin extends Plugin {
76503
76614
  delete params.id;
76504
76615
  }
76505
76616
 
76506
- const modelNode = new Node(this.viewer.scene, utils.apply(params, {
76617
+ const modelNode = new Node$1(this.viewer.scene, utils.apply(params, {
76507
76618
  isModel: true
76508
76619
  }));
76509
76620
 
@@ -77169,7 +77280,7 @@ class StoreyMap {
77169
77280
  }
77170
77281
  }
77171
77282
 
77172
- const tempVec3a$5 = math.vec3();
77283
+ const tempVec3a$6 = math.vec3();
77173
77284
  const tempMat4 = math.mat4();
77174
77285
 
77175
77286
  const EMPTY_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";
@@ -77589,7 +77700,7 @@ class StoreyViewsPlugin extends Plugin {
77589
77700
 
77590
77701
  const orthoScale2 = diag * 1.3;
77591
77702
 
77592
- const eye2 = tempVec3a$5;
77703
+ const eye2 = tempVec3a$6;
77593
77704
 
77594
77705
  eye2[0] = look2[0] + (camera.worldUp[0] * sca);
77595
77706
  eye2[1] = look2[1] + (camera.worldUp[1] * sca);
@@ -77800,7 +77911,7 @@ class StoreyViewsPlugin extends Plugin {
77800
77911
  const aabb = storey.aabb;
77801
77912
  const look = math.getAABB3Center(aabb);
77802
77913
  const sca = 0.5;
77803
- const eye = tempVec3a$5;
77914
+ const eye = tempVec3a$6;
77804
77915
  eye[0] = look[0] + (camera.worldUp[0] * sca);
77805
77916
  eye[1] = look[1] + (camera.worldUp[1] * sca);
77806
77917
  eye[2] = look[2] + (camera.worldUp[2] * sca);
@@ -77856,7 +77967,7 @@ class StoreyViewsPlugin extends Plugin {
77856
77967
 
77857
77968
  const origin = math.vec3([xmin + (xWorldSize * normX), ymin + (yWorldSize * 0.5), zmin + (zWorldSize * normZ)]);
77858
77969
  const direction = math.vec3([0, -1, 0]);
77859
- const look = math.addVec3(origin, direction, tempVec3a$5);
77970
+ const look = math.addVec3(origin, direction, tempVec3a$6);
77860
77971
  const worldForward = this.viewer.camera.worldForward;
77861
77972
  const matrix = math.lookAtMat4v(origin, look, worldForward, tempMat4);
77862
77973
 
@@ -77954,7 +78065,7 @@ class StoreyViewsPlugin extends Plugin {
77954
78065
  const camera = this.viewer.camera;
77955
78066
  const eye = camera.eye;
77956
78067
  const look = camera.look;
77957
- const eyeLookDir = math.subVec3(look, eye, tempVec3a$5);
78068
+ const eyeLookDir = math.subVec3(look, eye, tempVec3a$6);
77958
78069
  const worldUp = camera.worldUp;
77959
78070
  const xUp = worldUp[0] > worldUp[1] && worldUp[0] > worldUp[2];
77960
78071
  const yUp = !xUp && worldUp[1] > worldUp[0] && worldUp[1] > worldUp[2];
@@ -79527,8 +79638,8 @@ class TreeViewPlugin extends Plugin {
79527
79638
  }
79528
79639
  }
79529
79640
 
79530
- const tempVec3a$4 = math.vec3();
79531
- const tempVec3b$4 = math.vec3();
79641
+ const tempVec3a$5 = math.vec3();
79642
+ const tempVec3b$5 = math.vec3();
79532
79643
  const tempMat4a = math.mat4();
79533
79644
 
79534
79645
  /**
@@ -79605,8 +79716,8 @@ function frustumIntersectsAABB3(frustum, aabb) {
79605
79716
 
79606
79717
  let ret = Frustum.INSIDE;
79607
79718
 
79608
- const min = tempVec3a$4;
79609
- const max = tempVec3b$4;
79719
+ const min = tempVec3a$5;
79720
+ const max = tempVec3b$5;
79610
79721
 
79611
79722
  min[0] = aabb[0];
79612
79723
  min[1] = aabb[1];
@@ -89953,7 +90064,10 @@ parsers[ParserV9.version] = ParserV9;
89953
90064
  *
89954
90065
  * ## Creating *````.XKT````* Files and Metadata
89955
90066
  *
89956
- * See [Creating Files for Offline BIM](https://github.com/xeokit/xeokit-sdk/wiki/Creating-Files-for-Offline-BIM).
90067
+ * We have several sways to convert your files into XKT. See these tutorials for more info:
90068
+ *
90069
+ * * [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.
90070
+ * * [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.
89957
90071
  *
89958
90072
  * ## Scene representation
89959
90073
  *
@@ -90540,11 +90654,11 @@ class XKTLoaderPlugin extends Plugin {
90540
90654
  * @param {String[]} [params.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
90541
90655
  * @param {String[]} [params.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
90542
90656
  * @param {Boolean} [params.edges=false] Whether or not xeokit renders the model with edges emphasized.
90543
- * @param {Number[]} [params.origin=[0,0,0]] The World-space origin of the model's coordinates.
90544
- * @param {Number[]} [params.position=[0,0,0]] The model's position, relative to the model's origin.
90657
+ * @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.
90658
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
90545
90659
  * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
90546
- * @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.
90547
- * @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.
90660
+ * @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.
90661
+ * @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````.
90548
90662
  * @param {Boolean} [params.edges=false] Indicates if the model's edges are initially emphasized.
90549
90663
  * @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````
90550
90664
  * @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````.
@@ -92812,7 +92926,7 @@ var parse3DXML = (function () {
92812
92926
  var translate = [matrix[9], matrix[10], matrix[11]];
92813
92927
  var mat3 = matrix.slice(0, 9); // Rotation matrix
92814
92928
  var mat4 = math.mat3ToMat4(mat3, math.identityMat4()); // Convert rotation matrix to 4x4
92815
- var childGroup = new Node(ctx.modelNode, {
92929
+ var childGroup = new Node$1(ctx.modelNode, {
92816
92930
  position: translate
92817
92931
  });
92818
92932
  if (ctx.metaModelData) {
@@ -92829,7 +92943,7 @@ var parse3DXML = (function () {
92829
92943
  ctx.modelNode.addChild(childGroup, true);
92830
92944
  }
92831
92945
  group = childGroup;
92832
- childGroup = new Node(ctx.modelNode, {
92946
+ childGroup = new Node$1(ctx.modelNode, {
92833
92947
  matrix: mat4
92834
92948
  });
92835
92949
  if (ctx.metaModelData) {
@@ -92843,7 +92957,7 @@ var parse3DXML = (function () {
92843
92957
  group.addChild(childGroup, true);
92844
92958
  group = childGroup;
92845
92959
  } else {
92846
- var childGroup = new Node(ctx.modelNode, {});
92960
+ var childGroup = new Node$1(ctx.modelNode, {});
92847
92961
  if (ctx.metaModelData) {
92848
92962
  ctx.metaModelData.metaObjects.push({
92849
92963
  id: childGroup.id,
@@ -93841,7 +93955,7 @@ class XML3DLoaderPlugin extends Plugin {
93841
93955
  delete params.id;
93842
93956
  }
93843
93957
 
93844
- const modelNode = new Node(this.viewer.scene, utils.apply(params, {
93958
+ const modelNode = new Node$1(this.viewer.scene, utils.apply(params, {
93845
93959
  isModel: true
93846
93960
  }));
93847
93961
 
@@ -94537,7 +94651,7 @@ var require_web_ifc_mt = __commonJS({
94537
94651
  function receiveInstance(instance, module2) {
94538
94652
  var exports3 = instance.exports;
94539
94653
  Module["asm"] = exports3;
94540
- wasmTable = Module["asm"]["qa"];
94654
+ wasmTable = Module["asm"]["pa"];
94541
94655
  wasmModule = module2;
94542
94656
  if (!ENVIRONMENT_IS_PTHREAD) {
94543
94657
  var numWorkersToLoad = PThread.unusedWorkers.length;
@@ -94591,11 +94705,11 @@ var require_web_ifc_mt = __commonJS({
94591
94705
  }
94592
94706
  var tempDouble;
94593
94707
  var tempI64;
94594
- var ASM_CONSTS = { 41585: function($0, $1) {
94708
+ var ASM_CONSTS = { 41793: function($0, $1) {
94595
94709
  setTimeout(function() {
94596
94710
  _do_emscripten_dispatch_to_thread($0, $1);
94597
94711
  }, 0);
94598
- }, 41663: function() {
94712
+ }, 41871: function() {
94599
94713
  throw "Canceled!";
94600
94714
  } };
94601
94715
  function initPthreadsJS() {
@@ -97071,60 +97185,9 @@ var require_web_ifc_mt = __commonJS({
97071
97185
  }, get64: function(low, high) {
97072
97186
  return low;
97073
97187
  } };
97074
- function ___sys_fcntl64(fd, cmd, varargs) {
97075
- if (ENVIRONMENT_IS_PTHREAD)
97076
- return _emscripten_proxy_to_main_thread_js(2, 1, fd, cmd, varargs);
97077
- SYSCALLS.varargs = varargs;
97078
- try {
97079
- var stream = SYSCALLS.getStreamFromFD(fd);
97080
- switch (cmd) {
97081
- case 0: {
97082
- var arg = SYSCALLS.get();
97083
- if (arg < 0) {
97084
- return -28;
97085
- }
97086
- var newStream;
97087
- newStream = FS.open(stream.path, stream.flags, 0, arg);
97088
- return newStream.fd;
97089
- }
97090
- case 1:
97091
- case 2:
97092
- return 0;
97093
- case 3:
97094
- return stream.flags;
97095
- case 4: {
97096
- var arg = SYSCALLS.get();
97097
- stream.flags |= arg;
97098
- return 0;
97099
- }
97100
- case 12: {
97101
- var arg = SYSCALLS.get();
97102
- var offset = 0;
97103
- GROWABLE_HEAP_I16()[arg + offset >> 1] = 2;
97104
- return 0;
97105
- }
97106
- case 13:
97107
- case 14:
97108
- return 0;
97109
- case 16:
97110
- case 8:
97111
- return -28;
97112
- case 9:
97113
- setErrNo(28);
97114
- return -1;
97115
- default: {
97116
- return -28;
97117
- }
97118
- }
97119
- } catch (e) {
97120
- if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError))
97121
- abort(e);
97122
- return -e.errno;
97123
- }
97124
- }
97125
97188
  function ___sys_ioctl(fd, op, varargs) {
97126
97189
  if (ENVIRONMENT_IS_PTHREAD)
97127
- return _emscripten_proxy_to_main_thread_js(3, 1, fd, op, varargs);
97190
+ return _emscripten_proxy_to_main_thread_js(2, 1, fd, op, varargs);
97128
97191
  SYSCALLS.varargs = varargs;
97129
97192
  try {
97130
97193
  var stream = SYSCALLS.getStreamFromFD(fd);
@@ -97182,7 +97245,7 @@ var require_web_ifc_mt = __commonJS({
97182
97245
  }
97183
97246
  function ___sys_open(path, flags, varargs) {
97184
97247
  if (ENVIRONMENT_IS_PTHREAD)
97185
- return _emscripten_proxy_to_main_thread_js(4, 1, path, flags, varargs);
97248
+ return _emscripten_proxy_to_main_thread_js(3, 1, path, flags, varargs);
97186
97249
  SYSCALLS.varargs = varargs;
97187
97250
  try {
97188
97251
  var pathname = SYSCALLS.getStr(path);
@@ -98984,7 +99047,7 @@ var require_web_ifc_mt = __commonJS({
98984
99047
  }
98985
99048
  function _emscripten_set_canvas_element_size_main_thread(target, width, height) {
98986
99049
  if (ENVIRONMENT_IS_PTHREAD)
98987
- return _emscripten_proxy_to_main_thread_js(5, 1, target, width, height);
99050
+ return _emscripten_proxy_to_main_thread_js(4, 1, target, width, height);
98988
99051
  return _emscripten_set_canvas_element_size_calling_thread(target, width, height);
98989
99052
  }
98990
99053
  function _emscripten_set_canvas_element_size(target, width, height) {
@@ -99175,7 +99238,7 @@ var require_web_ifc_mt = __commonJS({
99175
99238
  }
99176
99239
  function _environ_get(__environ, environ_buf) {
99177
99240
  if (ENVIRONMENT_IS_PTHREAD)
99178
- return _emscripten_proxy_to_main_thread_js(6, 1, __environ, environ_buf);
99241
+ return _emscripten_proxy_to_main_thread_js(5, 1, __environ, environ_buf);
99179
99242
  try {
99180
99243
  var bufSize = 0;
99181
99244
  getEnvStrings().forEach(function(string, i) {
@@ -99193,7 +99256,7 @@ var require_web_ifc_mt = __commonJS({
99193
99256
  }
99194
99257
  function _environ_sizes_get(penviron_count, penviron_buf_size) {
99195
99258
  if (ENVIRONMENT_IS_PTHREAD)
99196
- return _emscripten_proxy_to_main_thread_js(7, 1, penviron_count, penviron_buf_size);
99259
+ return _emscripten_proxy_to_main_thread_js(6, 1, penviron_count, penviron_buf_size);
99197
99260
  try {
99198
99261
  var strings = getEnvStrings();
99199
99262
  GROWABLE_HEAP_I32()[penviron_count >> 2] = strings.length;
@@ -99211,7 +99274,7 @@ var require_web_ifc_mt = __commonJS({
99211
99274
  }
99212
99275
  function _fd_close(fd) {
99213
99276
  if (ENVIRONMENT_IS_PTHREAD)
99214
- return _emscripten_proxy_to_main_thread_js(8, 1, fd);
99277
+ return _emscripten_proxy_to_main_thread_js(7, 1, fd);
99215
99278
  try {
99216
99279
  var stream = SYSCALLS.getStreamFromFD(fd);
99217
99280
  FS.close(stream);
@@ -99224,7 +99287,7 @@ var require_web_ifc_mt = __commonJS({
99224
99287
  }
99225
99288
  function _fd_read(fd, iov, iovcnt, pnum) {
99226
99289
  if (ENVIRONMENT_IS_PTHREAD)
99227
- return _emscripten_proxy_to_main_thread_js(9, 1, fd, iov, iovcnt, pnum);
99290
+ return _emscripten_proxy_to_main_thread_js(8, 1, fd, iov, iovcnt, pnum);
99228
99291
  try {
99229
99292
  var stream = SYSCALLS.getStreamFromFD(fd);
99230
99293
  var num = SYSCALLS.doReadv(stream, iov, iovcnt);
@@ -99238,7 +99301,7 @@ var require_web_ifc_mt = __commonJS({
99238
99301
  }
99239
99302
  function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {
99240
99303
  if (ENVIRONMENT_IS_PTHREAD)
99241
- return _emscripten_proxy_to_main_thread_js(10, 1, fd, offset_low, offset_high, whence, newOffset);
99304
+ return _emscripten_proxy_to_main_thread_js(9, 1, fd, offset_low, offset_high, whence, newOffset);
99242
99305
  try {
99243
99306
  var stream = SYSCALLS.getStreamFromFD(fd);
99244
99307
  var HIGH_OFFSET = 4294967296;
@@ -99260,7 +99323,7 @@ var require_web_ifc_mt = __commonJS({
99260
99323
  }
99261
99324
  function _fd_write(fd, iov, iovcnt, pnum) {
99262
99325
  if (ENVIRONMENT_IS_PTHREAD)
99263
- return _emscripten_proxy_to_main_thread_js(11, 1, fd, iov, iovcnt, pnum);
99326
+ return _emscripten_proxy_to_main_thread_js(10, 1, fd, iov, iovcnt, pnum);
99264
99327
  try {
99265
99328
  var stream = SYSCALLS.getStreamFromFD(fd);
99266
99329
  var num = SYSCALLS.doWritev(stream, iov, iovcnt);
@@ -99680,7 +99743,7 @@ var require_web_ifc_mt = __commonJS({
99680
99743
  UnboundTypeError = Module["UnboundTypeError"] = extendError(Error, "UnboundTypeError");
99681
99744
  init_emval();
99682
99745
  var GLctx;
99683
- 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];
99746
+ 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];
99684
99747
  function intArrayFromString(stringy, dontAddNull, length) {
99685
99748
  var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1;
99686
99749
  var u8array = new Array(len);
@@ -99693,126 +99756,126 @@ var require_web_ifc_mt = __commonJS({
99693
99756
  __ATINIT__.push({ func: function() {
99694
99757
  ___wasm_call_ctors();
99695
99758
  } });
99696
- 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 };
99759
+ 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 };
99697
99760
  createWasm();
99698
99761
  var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() {
99699
- return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["ra"]).apply(null, arguments);
99762
+ return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["qa"]).apply(null, arguments);
99700
99763
  };
99701
99764
  Module["_main"] = function() {
99702
- return (Module["_main"] = Module["asm"]["sa"]).apply(null, arguments);
99765
+ return (Module["_main"] = Module["asm"]["ra"]).apply(null, arguments);
99703
99766
  };
99704
99767
  var _malloc = Module["_malloc"] = function() {
99705
- return (_malloc = Module["_malloc"] = Module["asm"]["ta"]).apply(null, arguments);
99768
+ return (_malloc = Module["_malloc"] = Module["asm"]["sa"]).apply(null, arguments);
99706
99769
  };
99707
99770
  var _free = Module["_free"] = function() {
99708
- return (_free = Module["_free"] = Module["asm"]["ua"]).apply(null, arguments);
99771
+ return (_free = Module["_free"] = Module["asm"]["ta"]).apply(null, arguments);
99709
99772
  };
99710
99773
  var ___getTypeName = Module["___getTypeName"] = function() {
99711
- return (___getTypeName = Module["___getTypeName"] = Module["asm"]["va"]).apply(null, arguments);
99774
+ return (___getTypeName = Module["___getTypeName"] = Module["asm"]["ua"]).apply(null, arguments);
99712
99775
  };
99713
99776
  Module["___embind_register_native_and_builtin_types"] = function() {
99714
- return (Module["___embind_register_native_and_builtin_types"] = Module["asm"]["wa"]).apply(null, arguments);
99777
+ return (Module["___embind_register_native_and_builtin_types"] = Module["asm"]["va"]).apply(null, arguments);
99715
99778
  };
99716
99779
  var ___errno_location = Module["___errno_location"] = function() {
99717
- return (___errno_location = Module["___errno_location"] = Module["asm"]["xa"]).apply(null, arguments);
99780
+ return (___errno_location = Module["___errno_location"] = Module["asm"]["wa"]).apply(null, arguments);
99718
99781
  };
99719
99782
  var _emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = function() {
99720
- return (_emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = Module["asm"]["ya"]).apply(null, arguments);
99783
+ return (_emscripten_get_global_libc = Module["_emscripten_get_global_libc"] = Module["asm"]["xa"]).apply(null, arguments);
99721
99784
  };
99722
99785
  Module["___em_js__initPthreadsJS"] = function() {
99723
- return (Module["___em_js__initPthreadsJS"] = Module["asm"]["za"]).apply(null, arguments);
99786
+ return (Module["___em_js__initPthreadsJS"] = Module["asm"]["ya"]).apply(null, arguments);
99724
99787
  };
99725
99788
  var stackSave = Module["stackSave"] = function() {
99726
- return (stackSave = Module["stackSave"] = Module["asm"]["Aa"]).apply(null, arguments);
99789
+ return (stackSave = Module["stackSave"] = Module["asm"]["za"]).apply(null, arguments);
99727
99790
  };
99728
99791
  var stackRestore = Module["stackRestore"] = function() {
99729
- return (stackRestore = Module["stackRestore"] = Module["asm"]["Ba"]).apply(null, arguments);
99792
+ return (stackRestore = Module["stackRestore"] = Module["asm"]["Aa"]).apply(null, arguments);
99730
99793
  };
99731
99794
  var stackAlloc = Module["stackAlloc"] = function() {
99732
- return (stackAlloc = Module["stackAlloc"] = Module["asm"]["Ca"]).apply(null, arguments);
99795
+ return (stackAlloc = Module["stackAlloc"] = Module["asm"]["Ba"]).apply(null, arguments);
99733
99796
  };
99734
99797
  var _emscripten_stack_set_limits = Module["_emscripten_stack_set_limits"] = function() {
99735
- return (_emscripten_stack_set_limits = Module["_emscripten_stack_set_limits"] = Module["asm"]["Da"]).apply(null, arguments);
99798
+ return (_emscripten_stack_set_limits = Module["_emscripten_stack_set_limits"] = Module["asm"]["Ca"]).apply(null, arguments);
99736
99799
  };
99737
99800
  var _memalign = Module["_memalign"] = function() {
99738
- return (_memalign = Module["_memalign"] = Module["asm"]["Ea"]).apply(null, arguments);
99801
+ return (_memalign = Module["_memalign"] = Module["asm"]["Da"]).apply(null, arguments);
99739
99802
  };
99740
99803
  Module["_emscripten_main_browser_thread_id"] = function() {
99741
- return (Module["_emscripten_main_browser_thread_id"] = Module["asm"]["Fa"]).apply(null, arguments);
99804
+ return (Module["_emscripten_main_browser_thread_id"] = Module["asm"]["Ea"]).apply(null, arguments);
99742
99805
  };
99743
99806
  var ___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = function() {
99744
- return (___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = Module["asm"]["Ga"]).apply(null, arguments);
99807
+ return (___pthread_tsd_run_dtors = Module["___pthread_tsd_run_dtors"] = Module["asm"]["Fa"]).apply(null, arguments);
99745
99808
  };
99746
99809
  var _emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = function() {
99747
- return (_emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = Module["asm"]["Ha"]).apply(null, arguments);
99810
+ return (_emscripten_main_thread_process_queued_calls = Module["_emscripten_main_thread_process_queued_calls"] = Module["asm"]["Ga"]).apply(null, arguments);
99748
99811
  };
99749
99812
  Module["_emscripten_current_thread_process_queued_calls"] = function() {
99750
- return (Module["_emscripten_current_thread_process_queued_calls"] = Module["asm"]["Ia"]).apply(null, arguments);
99813
+ return (Module["_emscripten_current_thread_process_queued_calls"] = Module["asm"]["Ha"]).apply(null, arguments);
99751
99814
  };
99752
99815
  var _emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = function() {
99753
- return (_emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = Module["asm"]["Ja"]).apply(null, arguments);
99816
+ return (_emscripten_register_main_browser_thread_id = Module["_emscripten_register_main_browser_thread_id"] = Module["asm"]["Ia"]).apply(null, arguments);
99754
99817
  };
99755
99818
  var _do_emscripten_dispatch_to_thread = Module["_do_emscripten_dispatch_to_thread"] = function() {
99756
- return (_do_emscripten_dispatch_to_thread = Module["_do_emscripten_dispatch_to_thread"] = Module["asm"]["Ka"]).apply(null, arguments);
99819
+ return (_do_emscripten_dispatch_to_thread = Module["_do_emscripten_dispatch_to_thread"] = Module["asm"]["Ja"]).apply(null, arguments);
99757
99820
  };
99758
99821
  Module["_emscripten_async_run_in_main_thread"] = function() {
99759
- return (Module["_emscripten_async_run_in_main_thread"] = Module["asm"]["La"]).apply(null, arguments);
99822
+ return (Module["_emscripten_async_run_in_main_thread"] = Module["asm"]["Ka"]).apply(null, arguments);
99760
99823
  };
99761
99824
  Module["_emscripten_sync_run_in_main_thread"] = function() {
99762
- return (Module["_emscripten_sync_run_in_main_thread"] = Module["asm"]["Ma"]).apply(null, arguments);
99825
+ return (Module["_emscripten_sync_run_in_main_thread"] = Module["asm"]["La"]).apply(null, arguments);
99763
99826
  };
99764
99827
  Module["_emscripten_sync_run_in_main_thread_0"] = function() {
99765
- return (Module["_emscripten_sync_run_in_main_thread_0"] = Module["asm"]["Na"]).apply(null, arguments);
99828
+ return (Module["_emscripten_sync_run_in_main_thread_0"] = Module["asm"]["Ma"]).apply(null, arguments);
99766
99829
  };
99767
99830
  Module["_emscripten_sync_run_in_main_thread_1"] = function() {
99768
- return (Module["_emscripten_sync_run_in_main_thread_1"] = Module["asm"]["Oa"]).apply(null, arguments);
99831
+ return (Module["_emscripten_sync_run_in_main_thread_1"] = Module["asm"]["Na"]).apply(null, arguments);
99769
99832
  };
99770
99833
  Module["_emscripten_sync_run_in_main_thread_2"] = function() {
99771
- return (Module["_emscripten_sync_run_in_main_thread_2"] = Module["asm"]["Pa"]).apply(null, arguments);
99834
+ return (Module["_emscripten_sync_run_in_main_thread_2"] = Module["asm"]["Oa"]).apply(null, arguments);
99772
99835
  };
99773
99836
  Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = function() {
99774
- return (Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = Module["asm"]["Qa"]).apply(null, arguments);
99837
+ return (Module["_emscripten_sync_run_in_main_thread_xprintf_varargs"] = Module["asm"]["Pa"]).apply(null, arguments);
99775
99838
  };
99776
99839
  Module["_emscripten_sync_run_in_main_thread_3"] = function() {
99777
- return (Module["_emscripten_sync_run_in_main_thread_3"] = Module["asm"]["Ra"]).apply(null, arguments);
99840
+ return (Module["_emscripten_sync_run_in_main_thread_3"] = Module["asm"]["Qa"]).apply(null, arguments);
99778
99841
  };
99779
99842
  var _emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = function() {
99780
- return (_emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = Module["asm"]["Sa"]).apply(null, arguments);
99843
+ return (_emscripten_sync_run_in_main_thread_4 = Module["_emscripten_sync_run_in_main_thread_4"] = Module["asm"]["Ra"]).apply(null, arguments);
99781
99844
  };
99782
99845
  Module["_emscripten_sync_run_in_main_thread_5"] = function() {
99783
- return (Module["_emscripten_sync_run_in_main_thread_5"] = Module["asm"]["Ta"]).apply(null, arguments);
99846
+ return (Module["_emscripten_sync_run_in_main_thread_5"] = Module["asm"]["Sa"]).apply(null, arguments);
99784
99847
  };
99785
99848
  Module["_emscripten_sync_run_in_main_thread_6"] = function() {
99786
- return (Module["_emscripten_sync_run_in_main_thread_6"] = Module["asm"]["Ua"]).apply(null, arguments);
99849
+ return (Module["_emscripten_sync_run_in_main_thread_6"] = Module["asm"]["Ta"]).apply(null, arguments);
99787
99850
  };
99788
99851
  Module["_emscripten_sync_run_in_main_thread_7"] = function() {
99789
- return (Module["_emscripten_sync_run_in_main_thread_7"] = Module["asm"]["Va"]).apply(null, arguments);
99852
+ return (Module["_emscripten_sync_run_in_main_thread_7"] = Module["asm"]["Ua"]).apply(null, arguments);
99790
99853
  };
99791
99854
  var _emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = function() {
99792
- return (_emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = Module["asm"]["Wa"]).apply(null, arguments);
99855
+ return (_emscripten_run_in_main_runtime_thread_js = Module["_emscripten_run_in_main_runtime_thread_js"] = Module["asm"]["Va"]).apply(null, arguments);
99793
99856
  };
99794
99857
  var __emscripten_call_on_thread = Module["__emscripten_call_on_thread"] = function() {
99795
- return (__emscripten_call_on_thread = Module["__emscripten_call_on_thread"] = Module["asm"]["Xa"]).apply(null, arguments);
99858
+ return (__emscripten_call_on_thread = Module["__emscripten_call_on_thread"] = Module["asm"]["Wa"]).apply(null, arguments);
99796
99859
  };
99797
99860
  Module["_emscripten_tls_init"] = function() {
99798
- return (Module["_emscripten_tls_init"] = Module["asm"]["Ya"]).apply(null, arguments);
99861
+ return (Module["_emscripten_tls_init"] = Module["asm"]["Xa"]).apply(null, arguments);
99799
99862
  };
99800
99863
  Module["dynCall_jiji"] = function() {
99801
- return (Module["dynCall_jiji"] = Module["asm"]["Za"]).apply(null, arguments);
99864
+ return (Module["dynCall_jiji"] = Module["asm"]["Ya"]).apply(null, arguments);
99802
99865
  };
99803
99866
  Module["dynCall_viijii"] = function() {
99804
- return (Module["dynCall_viijii"] = Module["asm"]["_a"]).apply(null, arguments);
99867
+ return (Module["dynCall_viijii"] = Module["asm"]["Za"]).apply(null, arguments);
99805
99868
  };
99806
99869
  Module["dynCall_iiiiiijj"] = function() {
99807
- return (Module["dynCall_iiiiiijj"] = Module["asm"]["$a"]).apply(null, arguments);
99870
+ return (Module["dynCall_iiiiiijj"] = Module["asm"]["_a"]).apply(null, arguments);
99808
99871
  };
99809
99872
  Module["dynCall_iiiiij"] = function() {
99810
- return (Module["dynCall_iiiiij"] = Module["asm"]["ab"]).apply(null, arguments);
99873
+ return (Module["dynCall_iiiiij"] = Module["asm"]["$a"]).apply(null, arguments);
99811
99874
  };
99812
99875
  Module["dynCall_iiiiijj"] = function() {
99813
- return (Module["dynCall_iiiiijj"] = Module["asm"]["bb"]).apply(null, arguments);
99876
+ return (Module["dynCall_iiiiijj"] = Module["asm"]["ab"]).apply(null, arguments);
99814
99877
  };
99815
- var _main_thread_futex = Module["_main_thread_futex"] = 51720;
99878
+ var _main_thread_futex = Module["_main_thread_futex"] = 51928;
99816
99879
  Module["addRunDependency"] = addRunDependency;
99817
99880
  Module["removeRunDependency"] = removeRunDependency;
99818
99881
  Module["FS_createPath"] = FS.createPath;
@@ -100474,7 +100537,7 @@ var require_web_ifc = __commonJS({
100474
100537
  function receiveInstance(instance, module2) {
100475
100538
  var exports3 = instance.exports;
100476
100539
  Module["asm"] = exports3;
100477
- wasmTable = Module["asm"]["ca"];
100540
+ wasmTable = Module["asm"]["ba"];
100478
100541
  removeRunDependency();
100479
100542
  }
100480
100543
  addRunDependency();
@@ -100609,10 +100672,6 @@ var require_web_ifc = __commonJS({
100609
100672
  info.init(type, destructor);
100610
100673
  throw ptr;
100611
100674
  }
100612
- function setErrNo(value) {
100613
- HEAP32[___errno_location() >>> 2] = value;
100614
- return value;
100615
- }
100616
100675
  var PATH = { splitPath: function(filename) {
100617
100676
  var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
100618
100677
  return splitPathRe.exec(filename).slice(1);
@@ -102690,55 +102749,6 @@ var require_web_ifc = __commonJS({
102690
102749
  }, get64: function(low, high) {
102691
102750
  return low;
102692
102751
  } };
102693
- function ___sys_fcntl64(fd, cmd, varargs) {
102694
- SYSCALLS.varargs = varargs;
102695
- try {
102696
- var stream = SYSCALLS.getStreamFromFD(fd);
102697
- switch (cmd) {
102698
- case 0: {
102699
- var arg = SYSCALLS.get();
102700
- if (arg < 0) {
102701
- return -28;
102702
- }
102703
- var newStream;
102704
- newStream = FS.open(stream.path, stream.flags, 0, arg);
102705
- return newStream.fd;
102706
- }
102707
- case 1:
102708
- case 2:
102709
- return 0;
102710
- case 3:
102711
- return stream.flags;
102712
- case 4: {
102713
- var arg = SYSCALLS.get();
102714
- stream.flags |= arg;
102715
- return 0;
102716
- }
102717
- case 12: {
102718
- var arg = SYSCALLS.get();
102719
- var offset = 0;
102720
- HEAP16[arg + offset >>> 1] = 2;
102721
- return 0;
102722
- }
102723
- case 13:
102724
- case 14:
102725
- return 0;
102726
- case 16:
102727
- case 8:
102728
- return -28;
102729
- case 9:
102730
- setErrNo(28);
102731
- return -1;
102732
- default: {
102733
- return -28;
102734
- }
102735
- }
102736
- } catch (e) {
102737
- if (typeof FS === "undefined" || !(e instanceof FS.ErrnoError))
102738
- abort(e);
102739
- return -e.errno;
102740
- }
102741
- }
102742
102752
  function ___sys_ioctl(fd, op, varargs) {
102743
102753
  SYSCALLS.varargs = varargs;
102744
102754
  try {
@@ -104290,6 +104300,10 @@ var require_web_ifc = __commonJS({
104290
104300
  return performance.now();
104291
104301
  };
104292
104302
  var _emscripten_get_now_is_monotonic = true;
104303
+ function setErrNo(value) {
104304
+ HEAP32[___errno_location() >>> 2] = value;
104305
+ return value;
104306
+ }
104293
104307
  function _clock_gettime(clk_id, tp) {
104294
104308
  var now;
104295
104309
  if (clk_id === 0) {
@@ -104727,43 +104741,43 @@ var require_web_ifc = __commonJS({
104727
104741
  __ATINIT__.push({ func: function() {
104728
104742
  ___wasm_call_ctors();
104729
104743
  } });
104730
- 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 };
104744
+ 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 };
104731
104745
  createWasm();
104732
104746
  var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() {
104733
- return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["da"]).apply(null, arguments);
104747
+ return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["ca"]).apply(null, arguments);
104734
104748
  };
104735
104749
  Module["_main"] = function() {
104736
- return (Module["_main"] = Module["asm"]["ea"]).apply(null, arguments);
104750
+ return (Module["_main"] = Module["asm"]["da"]).apply(null, arguments);
104737
104751
  };
104738
104752
  var _malloc = Module["_malloc"] = function() {
104739
- return (_malloc = Module["_malloc"] = Module["asm"]["fa"]).apply(null, arguments);
104753
+ return (_malloc = Module["_malloc"] = Module["asm"]["ea"]).apply(null, arguments);
104740
104754
  };
104741
104755
  var _free = Module["_free"] = function() {
104742
- return (_free = Module["_free"] = Module["asm"]["ga"]).apply(null, arguments);
104756
+ return (_free = Module["_free"] = Module["asm"]["fa"]).apply(null, arguments);
104743
104757
  };
104744
104758
  var ___getTypeName = Module["___getTypeName"] = function() {
104745
- return (___getTypeName = Module["___getTypeName"] = Module["asm"]["ha"]).apply(null, arguments);
104759
+ return (___getTypeName = Module["___getTypeName"] = Module["asm"]["ga"]).apply(null, arguments);
104746
104760
  };
104747
104761
  Module["___embind_register_native_and_builtin_types"] = function() {
104748
- return (Module["___embind_register_native_and_builtin_types"] = Module["asm"]["ia"]).apply(null, arguments);
104762
+ return (Module["___embind_register_native_and_builtin_types"] = Module["asm"]["ha"]).apply(null, arguments);
104749
104763
  };
104750
104764
  var ___errno_location = Module["___errno_location"] = function() {
104751
- return (___errno_location = Module["___errno_location"] = Module["asm"]["ja"]).apply(null, arguments);
104765
+ return (___errno_location = Module["___errno_location"] = Module["asm"]["ia"]).apply(null, arguments);
104752
104766
  };
104753
104767
  Module["dynCall_jiji"] = function() {
104754
- return (Module["dynCall_jiji"] = Module["asm"]["ka"]).apply(null, arguments);
104768
+ return (Module["dynCall_jiji"] = Module["asm"]["ja"]).apply(null, arguments);
104755
104769
  };
104756
104770
  Module["dynCall_viijii"] = function() {
104757
- return (Module["dynCall_viijii"] = Module["asm"]["la"]).apply(null, arguments);
104771
+ return (Module["dynCall_viijii"] = Module["asm"]["ka"]).apply(null, arguments);
104758
104772
  };
104759
104773
  Module["dynCall_iiiiiijj"] = function() {
104760
- return (Module["dynCall_iiiiiijj"] = Module["asm"]["ma"]).apply(null, arguments);
104774
+ return (Module["dynCall_iiiiiijj"] = Module["asm"]["la"]).apply(null, arguments);
104761
104775
  };
104762
104776
  Module["dynCall_iiiiij"] = function() {
104763
- return (Module["dynCall_iiiiij"] = Module["asm"]["na"]).apply(null, arguments);
104777
+ return (Module["dynCall_iiiiij"] = Module["asm"]["ma"]).apply(null, arguments);
104764
104778
  };
104765
104779
  Module["dynCall_iiiiijj"] = function() {
104766
- return (Module["dynCall_iiiiijj"] = Module["asm"]["oa"]).apply(null, arguments);
104780
+ return (Module["dynCall_iiiiijj"] = Module["asm"]["na"]).apply(null, arguments);
104767
104781
  };
104768
104782
  Module["addRunDependency"] = addRunDependency;
104769
104783
  Module["removeRunDependency"] = removeRunDependency;
@@ -117576,19 +117590,19 @@ var IfcEventType = class {
117576
117590
  }
117577
117591
  };
117578
117592
  var IfcExtendedProperties = class {
117579
- constructor(expressID, type, Name, Description, Properties) {
117593
+ constructor(expressID, type, Name, Description, Properties2) {
117580
117594
  this.expressID = expressID;
117581
117595
  this.type = type;
117582
117596
  this.Name = Name;
117583
117597
  this.Description = Description;
117584
- this.Properties = Properties;
117598
+ this.Properties = Properties2;
117585
117599
  }
117586
117600
  static FromTape(expressID, type, tape) {
117587
117601
  let ptr = 0;
117588
117602
  let Name = tape[ptr++];
117589
117603
  let Description = tape[ptr++];
117590
- let Properties = tape[ptr++];
117591
- return new IfcExtendedProperties(expressID, type, Name, Description, Properties);
117604
+ let Properties2 = tape[ptr++];
117605
+ return new IfcExtendedProperties(expressID, type, Name, Description, Properties2);
117592
117606
  }
117593
117607
  ToTape() {
117594
117608
  let args = [];
@@ -121988,21 +122002,21 @@ var IfcMaterialProfileWithOffsets = class {
121988
122002
  }
121989
122003
  };
121990
122004
  var IfcMaterialProperties = class {
121991
- constructor(expressID, type, Name, Description, Properties, Material) {
122005
+ constructor(expressID, type, Name, Description, Properties2, Material) {
121992
122006
  this.expressID = expressID;
121993
122007
  this.type = type;
121994
122008
  this.Name = Name;
121995
122009
  this.Description = Description;
121996
- this.Properties = Properties;
122010
+ this.Properties = Properties2;
121997
122011
  this.Material = Material;
121998
122012
  }
121999
122013
  static FromTape(expressID, type, tape) {
122000
122014
  let ptr = 0;
122001
122015
  let Name = tape[ptr++];
122002
122016
  let Description = tape[ptr++];
122003
- let Properties = tape[ptr++];
122017
+ let Properties2 = tape[ptr++];
122004
122018
  let Material = tape[ptr++];
122005
- return new IfcMaterialProperties(expressID, type, Name, Description, Properties, Material);
122019
+ return new IfcMaterialProperties(expressID, type, Name, Description, Properties2, Material);
122006
122020
  }
122007
122021
  ToTape() {
122008
122022
  let args = [];
@@ -124678,21 +124692,21 @@ var IfcProfileDef = class {
124678
124692
  }
124679
124693
  };
124680
124694
  var IfcProfileProperties = class {
124681
- constructor(expressID, type, Name, Description, Properties, ProfileDefinition) {
124695
+ constructor(expressID, type, Name, Description, Properties2, ProfileDefinition) {
124682
124696
  this.expressID = expressID;
124683
124697
  this.type = type;
124684
124698
  this.Name = Name;
124685
124699
  this.Description = Description;
124686
- this.Properties = Properties;
124700
+ this.Properties = Properties2;
124687
124701
  this.ProfileDefinition = ProfileDefinition;
124688
124702
  }
124689
124703
  static FromTape(expressID, type, tape) {
124690
124704
  let ptr = 0;
124691
124705
  let Name = tape[ptr++];
124692
124706
  let Description = tape[ptr++];
124693
- let Properties = tape[ptr++];
124707
+ let Properties2 = tape[ptr++];
124694
124708
  let ProfileDefinition = tape[ptr++];
124695
- return new IfcProfileProperties(expressID, type, Name, Description, Properties, ProfileDefinition);
124709
+ return new IfcProfileProperties(expressID, type, Name, Description, Properties2, ProfileDefinition);
124696
124710
  }
124697
124711
  ToTape() {
124698
124712
  let args = [];
@@ -136336,19 +136350,373 @@ var IfcZone = class {
136336
136350
  }
136337
136351
  };
136338
136352
 
136353
+ // dist/helpers/ifc-elements.ts
136354
+ var IfcElements2 = {
136355
+ 103090709: "IFCPROJECT",
136356
+ 4097777520: "IFCSITE",
136357
+ 4031249490: "IFCBUILDING",
136358
+ 3124254112: "IFCBUILDINGSTOREY",
136359
+ 3856911033: "IFCSPACE",
136360
+ 1674181508: "IFCANNOTATION",
136361
+ 25142252: "IFCCONTROLLER",
136362
+ 32344328: "IFCBOILER",
136363
+ 76236018: "IFCLAMP",
136364
+ 90941305: "IFCPUMP",
136365
+ 177149247: "IFCAIRTERMINALBOX",
136366
+ 182646315: "IFCFLOWINSTRUMENT",
136367
+ 263784265: "IFCFURNISHINGELEMENT",
136368
+ 264262732: "IFCELECTRICGENERATOR",
136369
+ 277319702: "IFCAUDIOVISUALAPPLIANCE",
136370
+ 310824031: "IFCPIPEFITTING",
136371
+ 331165859: "IFCSTAIR",
136372
+ 342316401: "IFCDUCTFITTING",
136373
+ 377706215: "IFCMECHANICALFASTENER",
136374
+ 395920057: "IFCDOOR",
136375
+ 402227799: "IFCELECTRICMOTOR",
136376
+ 413509423: "IFCSYSTEMFURNITUREELEMENT",
136377
+ 484807127: "IFCEVAPORATOR",
136378
+ 486154966: "IFCWINDOWSTANDARDCASE",
136379
+ 629592764: "IFCLIGHTFIXTURE",
136380
+ 630975310: "IFCUNITARYCONTROLELEMENT",
136381
+ 635142910: "IFCCABLECARRIERFITTING",
136382
+ 639361253: "IFCCOIL",
136383
+ 647756555: "IFCFASTENER",
136384
+ 707683696: "IFCFLOWSTORAGEDEVICE",
136385
+ 738039164: "IFCPROTECTIVEDEVICE",
136386
+ 753842376: "IFCBEAM",
136387
+ 812556717: "IFCTANK",
136388
+ 819412036: "IFCFILTER",
136389
+ 843113511: "IFCCOLUMN",
136390
+ 862014818: "IFCELECTRICDISTRIBUTIONBOARD",
136391
+ 900683007: "IFCFOOTING",
136392
+ 905975707: "IFCCOLUMNSTANDARDCASE",
136393
+ 926996030: "IFCVOIDINGFEATURE",
136394
+ 979691226: "IFCREINFORCINGBAR",
136395
+ 987401354: "IFCFLOWSEGMENT",
136396
+ 1003880860: "IFCELECTRICTIMECONTROL",
136397
+ 1051757585: "IFCCABLEFITTING",
136398
+ 1052013943: "IFCDISTRIBUTIONCHAMBERELEMENT",
136399
+ 1062813311: "IFCDISTRIBUTIONCONTROLELEMENT",
136400
+ 1073191201: "IFCMEMBER",
136401
+ 1095909175: "IFCBUILDINGELEMENTPROXY",
136402
+ 1156407060: "IFCPLATESTANDARDCASE",
136403
+ 1162798199: "IFCSWITCHINGDEVICE",
136404
+ 1329646415: "IFCSHADINGDEVICE",
136405
+ 1335981549: "IFCDISCRETEACCESSORY",
136406
+ 1360408905: "IFCDUCTSILENCER",
136407
+ 1404847402: "IFCSTACKTERMINAL",
136408
+ 1426591983: "IFCFIRESUPPRESSIONTERMINAL",
136409
+ 1437502449: "IFCMEDICALDEVICE",
136410
+ 1509553395: "IFCFURNITURE",
136411
+ 1529196076: "IFCSLAB",
136412
+ 1620046519: "IFCTRANSPORTELEMENT",
136413
+ 1634111441: "IFCAIRTERMINAL",
136414
+ 1658829314: "IFCENERGYCONVERSIONDEVICE",
136415
+ 1677625105: "IFCCIVILELEMENT",
136416
+ 1687234759: "IFCPILE",
136417
+ 1904799276: "IFCELECTRICAPPLIANCE",
136418
+ 1911478936: "IFCMEMBERSTANDARDCASE",
136419
+ 1945004755: "IFCDISTRIBUTIONELEMENT",
136420
+ 1973544240: "IFCCOVERING",
136421
+ 1999602285: "IFCSPACEHEATER",
136422
+ 2016517767: "IFCROOF",
136423
+ 2056796094: "IFCAIRTOAIRHEATRECOVERY",
136424
+ 2058353004: "IFCFLOWCONTROLLER",
136425
+ 2068733104: "IFCHUMIDIFIER",
136426
+ 2176052936: "IFCJUNCTIONBOX",
136427
+ 2188021234: "IFCFLOWMETER",
136428
+ 2223149337: "IFCFLOWTERMINAL",
136429
+ 2262370178: "IFCRAILING",
136430
+ 2272882330: "IFCCONDENSER",
136431
+ 2295281155: "IFCPROTECTIVEDEVICETRIPPINGUNIT",
136432
+ 2320036040: "IFCREINFORCINGMESH",
136433
+ 2347447852: "IFCTENDONANCHOR",
136434
+ 2391383451: "IFCVIBRATIONISOLATOR",
136435
+ 2391406946: "IFCWALL",
136436
+ 2474470126: "IFCMOTORCONNECTION",
136437
+ 2769231204: "IFCVIRTUALELEMENT",
136438
+ 2814081492: "IFCENGINE",
136439
+ 2906023776: "IFCBEAMSTANDARDCASE",
136440
+ 2938176219: "IFCBURNER",
136441
+ 2979338954: "IFCBUILDINGELEMENTPART",
136442
+ 3024970846: "IFCRAMP",
136443
+ 3026737570: "IFCTUBEBUNDLE",
136444
+ 3027962421: "IFCSLABSTANDARDCASE",
136445
+ 3040386961: "IFCDISTRIBUTIONFLOWELEMENT",
136446
+ 3053780830: "IFCSANITARYTERMINAL",
136447
+ 3079942009: "IFCOPENINGSTANDARDCASE",
136448
+ 3087945054: "IFCALARM",
136449
+ 3101698114: "IFCSURFACEFEATURE",
136450
+ 3127900445: "IFCSLABELEMENTEDCASE",
136451
+ 3132237377: "IFCFLOWMOVINGDEVICE",
136452
+ 3171933400: "IFCPLATE",
136453
+ 3221913625: "IFCCOMMUNICATIONSAPPLIANCE",
136454
+ 3242481149: "IFCDOORSTANDARDCASE",
136455
+ 3283111854: "IFCRAMPFLIGHT",
136456
+ 3296154744: "IFCCHIMNEY",
136457
+ 3304561284: "IFCWINDOW",
136458
+ 3310460725: "IFCELECTRICFLOWSTORAGEDEVICE",
136459
+ 3319311131: "IFCHEATEXCHANGER",
136460
+ 3415622556: "IFCFAN",
136461
+ 3420628829: "IFCSOLARDEVICE",
136462
+ 3493046030: "IFCGEOGRAPHICELEMENT",
136463
+ 3495092785: "IFCCURTAINWALL",
136464
+ 3508470533: "IFCFLOWTREATMENTDEVICE",
136465
+ 3512223829: "IFCWALLSTANDARDCASE",
136466
+ 3518393246: "IFCDUCTSEGMENT",
136467
+ 3571504051: "IFCCOMPRESSOR",
136468
+ 3588315303: "IFCOPENINGELEMENT",
136469
+ 3612865200: "IFCPIPESEGMENT",
136470
+ 3640358203: "IFCCOOLINGTOWER",
136471
+ 3651124850: "IFCPROJECTIONELEMENT",
136472
+ 3694346114: "IFCOUTLET",
136473
+ 3747195512: "IFCEVAPORATIVECOOLER",
136474
+ 3758799889: "IFCCABLECARRIERSEGMENT",
136475
+ 3824725483: "IFCTENDON",
136476
+ 3825984169: "IFCTRANSFORMER",
136477
+ 3902619387: "IFCCHILLER",
136478
+ 4074379575: "IFCDAMPER",
136479
+ 4086658281: "IFCSENSOR",
136480
+ 4123344466: "IFCELEMENTASSEMBLY",
136481
+ 4136498852: "IFCCOOLEDBEAM",
136482
+ 4156078855: "IFCWALLELEMENTEDCASE",
136483
+ 4175244083: "IFCINTERCEPTOR",
136484
+ 4207607924: "IFCVALVE",
136485
+ 4217484030: "IFCCABLESEGMENT",
136486
+ 4237592921: "IFCWASTETERMINAL",
136487
+ 4252922144: "IFCSTAIRFLIGHT",
136488
+ 4278956645: "IFCFLOWFITTING",
136489
+ 4288193352: "IFCACTUATOR",
136490
+ 4292641817: "IFCUNITARYEQUIPMENT",
136491
+ 3009204131: "IFCGRID"
136492
+ };
136493
+
136494
+ // dist/helpers/properties.ts
136495
+ var PropsNames = {
136496
+ aggregates: {
136497
+ name: IFCRELAGGREGATES,
136498
+ relating: "RelatingObject",
136499
+ related: "RelatedObjects",
136500
+ key: "children"
136501
+ },
136502
+ spatial: {
136503
+ name: IFCRELCONTAINEDINSPATIALSTRUCTURE,
136504
+ relating: "RelatingStructure",
136505
+ related: "RelatedElements",
136506
+ key: "children"
136507
+ },
136508
+ psets: {
136509
+ name: IFCRELDEFINESBYPROPERTIES,
136510
+ relating: "RelatingPropertyDefinition",
136511
+ related: "RelatedObjects",
136512
+ key: "hasPsets"
136513
+ },
136514
+ materials: {
136515
+ name: IFCRELASSOCIATESMATERIAL,
136516
+ relating: "RelatingMaterial",
136517
+ related: "RelatedObjects",
136518
+ key: "hasMaterial"
136519
+ },
136520
+ type: {
136521
+ name: IFCRELDEFINESBYTYPE,
136522
+ relating: "RelatingType",
136523
+ related: "RelatedObjects",
136524
+ key: "hasType"
136525
+ }
136526
+ };
136527
+ var Properties = class {
136528
+ constructor(api) {
136529
+ this.api = api;
136530
+ }
136531
+ getItemProperties(modelID, id, recursive = false) {
136532
+ return __async(this, null, function* () {
136533
+ return this.api.GetLine(modelID, id, recursive);
136534
+ });
136535
+ }
136536
+ getPropertySets(modelID, elementID, recursive = false) {
136537
+ return __async(this, null, function* () {
136538
+ return yield this.getProperty(modelID, elementID, recursive, PropsNames.psets);
136539
+ });
136540
+ }
136541
+ getTypeProperties(modelID, elementID, recursive = false) {
136542
+ return __async(this, null, function* () {
136543
+ return yield this.getProperty(modelID, elementID, recursive, PropsNames.type);
136544
+ });
136545
+ }
136546
+ getMaterialsProperties(modelID, elementID, recursive = false) {
136547
+ return __async(this, null, function* () {
136548
+ return yield this.getProperty(modelID, elementID, recursive, PropsNames.materials);
136549
+ });
136550
+ }
136551
+ getSpatialStructure(modelID, includeProperties) {
136552
+ return __async(this, null, function* () {
136553
+ yield this.getAllTypesOfModel(modelID);
136554
+ const chunks = yield this.getSpatialTreeChunks(modelID);
136555
+ const allLines = yield this.api.GetLineIDsWithType(modelID, IFCPROJECT);
136556
+ const projectID = allLines.get(0);
136557
+ const project = Properties.newIfcProject(projectID);
136558
+ yield this.getSpatialNode(modelID, project, chunks, includeProperties);
136559
+ this.cleanupTypes();
136560
+ return project;
136561
+ });
136562
+ }
136563
+ getAllItemsOfType(modelID, type, verbose) {
136564
+ return __async(this, null, function* () {
136565
+ let items = [];
136566
+ const lines = yield this.api.GetLineIDsWithType(modelID, type);
136567
+ for (let i = 0; i < lines.size(); i++)
136568
+ items.push(lines.get(i));
136569
+ if (!verbose)
136570
+ return items;
136571
+ const result = [];
136572
+ for (let i = 0; i < items.length; i++) {
136573
+ result.push(yield this.api.GetLine(modelID, items[i]));
136574
+ }
136575
+ return result;
136576
+ });
136577
+ }
136578
+ getProperty(modelID, elementID, recursive = false, propName) {
136579
+ return __async(this, null, function* () {
136580
+ const propSetIds = yield this.getAllRelatedItemsOfType(modelID, elementID, propName);
136581
+ const result = [];
136582
+ for (let i = 0; i < propSetIds.length; i++) {
136583
+ result.push(yield this.api.GetLine(modelID, propSetIds[i], recursive));
136584
+ }
136585
+ return result;
136586
+ });
136587
+ }
136588
+ getChunks(modelID, chunks, propNames) {
136589
+ return __async(this, null, function* () {
136590
+ const relation = yield this.api.GetLineIDsWithType(modelID, propNames.name);
136591
+ for (let i = 0; i < relation.size(); i++) {
136592
+ const rel = yield this.api.GetLine(modelID, relation.get(i), false);
136593
+ this.saveChunk(chunks, propNames, rel);
136594
+ }
136595
+ });
136596
+ }
136597
+ static isRelated(id, rel, propNames) {
136598
+ const relatedItems = rel[propNames.related];
136599
+ if (Array.isArray(relatedItems)) {
136600
+ const values = relatedItems.map((item) => item.value);
136601
+ return values.includes(id);
136602
+ }
136603
+ return relatedItems.value === id;
136604
+ }
136605
+ static newIfcProject(id) {
136606
+ return {
136607
+ expressID: id,
136608
+ type: "IFCPROJECT",
136609
+ children: []
136610
+ };
136611
+ }
136612
+ getSpatialNode(modelID, node, treeChunks, includeProperties) {
136613
+ return __async(this, null, function* () {
136614
+ yield this.getChildren(modelID, node, treeChunks, PropsNames.aggregates, includeProperties);
136615
+ yield this.getChildren(modelID, node, treeChunks, PropsNames.spatial, includeProperties);
136616
+ });
136617
+ }
136618
+ getChildren(modelID, node, treeChunks, propNames, includeProperties) {
136619
+ return __async(this, null, function* () {
136620
+ const children = treeChunks[node.expressID];
136621
+ if (children == void 0)
136622
+ return;
136623
+ const prop = propNames.key;
136624
+ const nodes = [];
136625
+ for (let i = 0; i < children.length; i++) {
136626
+ const child = children[i];
136627
+ let node2 = this.newNode(child);
136628
+ if (includeProperties) {
136629
+ const properties = yield this.getItemProperties(modelID, node2.expressID);
136630
+ node2 = __spreadValues(__spreadValues({}, properties), node2);
136631
+ }
136632
+ yield this.getSpatialNode(modelID, node2, treeChunks, includeProperties);
136633
+ nodes.push(node2);
136634
+ }
136635
+ node[prop] = nodes;
136636
+ });
136637
+ }
136638
+ newNode(id) {
136639
+ const typeName = this.getNodeType(id);
136640
+ return {
136641
+ expressID: id,
136642
+ type: typeName,
136643
+ children: []
136644
+ };
136645
+ }
136646
+ getNodeType(id) {
136647
+ const typeID = this.types[id];
136648
+ return IfcElements2[typeID];
136649
+ }
136650
+ getSpatialTreeChunks(modelID) {
136651
+ return __async(this, null, function* () {
136652
+ const treeChunks = {};
136653
+ yield this.getChunks(modelID, treeChunks, PropsNames.aggregates);
136654
+ yield this.getChunks(modelID, treeChunks, PropsNames.spatial);
136655
+ return treeChunks;
136656
+ });
136657
+ }
136658
+ saveChunk(chunks, propNames, rel) {
136659
+ const relating = rel[propNames.relating].value;
136660
+ const related = rel[propNames.related].map((r) => r.value);
136661
+ if (chunks[relating] == void 0) {
136662
+ chunks[relating] = related;
136663
+ } else {
136664
+ chunks[relating] = chunks[relating].concat(related);
136665
+ }
136666
+ }
136667
+ getRelated(rel, propNames, IDs) {
136668
+ const element = rel[propNames.relating];
136669
+ if (!Array.isArray(element))
136670
+ IDs.push(element.value);
136671
+ else
136672
+ element.forEach((ele) => IDs.push(ele.value));
136673
+ }
136674
+ getAllRelatedItemsOfType(modelID, id, propNames) {
136675
+ return __async(this, null, function* () {
136676
+ const lines = yield this.api.GetLineIDsWithType(modelID, propNames.name);
136677
+ const IDs = [];
136678
+ for (let i = 0; i < lines.size(); i++) {
136679
+ const rel = yield this.api.GetLine(modelID, lines.get(i));
136680
+ const isRelated = Properties.isRelated(id, rel, propNames);
136681
+ if (isRelated)
136682
+ this.getRelated(rel, propNames, IDs);
136683
+ }
136684
+ return IDs;
136685
+ });
136686
+ }
136687
+ cleanupTypes() {
136688
+ this.types = {};
136689
+ }
136690
+ getAllTypesOfModel(modelID) {
136691
+ return __async(this, null, function* () {
136692
+ const result = {};
136693
+ const elements = Object.keys(IfcElements2).map((e) => parseInt(e));
136694
+ for (let i = 0; i < elements.length; i++) {
136695
+ const element = elements[i];
136696
+ const lines = yield this.api.GetLineIDsWithType(modelID, element);
136697
+ const size = lines.size();
136698
+ for (let i2 = 0; i2 < size; i2++)
136699
+ result[lines.get(i2)] = element;
136700
+ }
136701
+ this.types = result;
136702
+ });
136703
+ }
136704
+ };
136705
+
136339
136706
  // dist/web-ifc-api.ts
136340
136707
  var WebIFCWasm;
136341
- if (self.crossOriginIsolated) {
136708
+ if (typeof self !== "undefined" && self.crossOriginIsolated) {
136342
136709
  WebIFCWasm = require_web_ifc_mt();
136343
136710
  } else {
136344
136711
  WebIFCWasm = require_web_ifc();
136345
136712
  }
136346
- var IfcAPI = class {
136713
+ var IfcAPI2 = class {
136347
136714
  constructor() {
136348
136715
  this.wasmModule = void 0;
136349
136716
  this.fs = void 0;
136350
136717
  this.wasmPath = "";
136351
136718
  this.ifcGuidMap = new Map();
136719
+ this.properties = new Properties(this);
136352
136720
  }
136353
136721
  Init(customLocateFileHandler) {
136354
136722
  return __async(this, null, function* () {
@@ -136367,7 +136735,6 @@ var IfcAPI = class {
136367
136735
  });
136368
136736
  }
136369
136737
  OpenModel(data, settings) {
136370
- this.wasmModule["FS_createDataFile"]("/", "filename", data, true, true, true);
136371
136738
  let s = __spreadValues({
136372
136739
  COORDINATE_TO_ORIGIN: false,
136373
136740
  USE_FAST_BOOLS: false,
@@ -136376,8 +136743,15 @@ var IfcAPI = class {
136376
136743
  CIRCLE_SEGMENTS_HIGH: 12,
136377
136744
  BOOL_ABORT_THRESHOLD: 1e4
136378
136745
  }, settings);
136379
- let result = this.wasmModule.OpenModel(s);
136380
- this.wasmModule["FS_unlink"]("/filename");
136746
+ let offsetInSrc = 0;
136747
+ let result = this.wasmModule.OpenModel(s, (destPtr, destSize) => {
136748
+ let srcSize = Math.min(data.byteLength - offsetInSrc, destSize);
136749
+ let dest = this.wasmModule.HEAPU8.subarray(destPtr, destPtr + destSize);
136750
+ let src = data.subarray(offsetInSrc, offsetInSrc + srcSize);
136751
+ dest.set(src);
136752
+ offsetInSrc += srcSize;
136753
+ return srcSize;
136754
+ });
136381
136755
  return result;
136382
136756
  }
136383
136757
  CreateModel(settings) {
@@ -136524,9 +136898,9 @@ var IfcAPI = class {
136524
136898
  };
136525
136899
 
136526
136900
  /**
136527
- * Default data access strategy for {@link IFCLoaderPlugin}.
136901
+ * Default data access strategy for {@link WebIFCLoaderPlugin}.
136528
136902
  */
136529
- class IFCDefaultDataSource {
136903
+ class WebIFCDefaultDataSource {
136530
136904
 
136531
136905
  constructor() {
136532
136906
  }
@@ -137360,7 +137734,7 @@ class SplineCurve extends Curve {
137360
137734
  }
137361
137735
  }
137362
137736
 
137363
- const tempVec3a$3 = math.vec3();
137737
+ const tempVec3a$4 = math.vec3();
137364
137738
 
137365
137739
  /**
137366
137740
  * @desc Defines a sequence of frames along which a {@link CameraPathAnimation} can animate a {@link Camera}.
@@ -137492,9 +137866,9 @@ class CameraPath extends Component {
137492
137866
  t = t / (this._frames[this._frames.length - 1].t - this._frames[0].t);
137493
137867
  t = t < 0.0 ? 0.0 : (t > 1.0 ? 1.0 : t);
137494
137868
 
137495
- camera.eye = this._eyeCurve.getPoint(t, tempVec3a$3);
137496
- camera.look = this._lookCurve.getPoint(t, tempVec3a$3);
137497
- camera.up = this._upCurve.getPoint(t, tempVec3a$3);
137869
+ camera.eye = this._eyeCurve.getPoint(t, tempVec3a$4);
137870
+ camera.look = this._lookCurve.getPoint(t, tempVec3a$4);
137871
+ camera.up = this._upCurve.getPoint(t, tempVec3a$4);
137498
137872
  }
137499
137873
 
137500
137874
  /**
@@ -140152,7 +140526,7 @@ function buildPlaneGeometry(cfg = {}) {
140152
140526
  }
140153
140527
 
140154
140528
  const tempVec3$1 = math.vec3();
140155
- const tempVec3b$3 = math.vec3();
140529
+ const tempVec3b$4 = math.vec3();
140156
140530
  math.vec3();
140157
140531
  const zeroVec = math.vec3([0, -1, 0]);
140158
140532
  const tempQuat = math.vec4([0, 0, 0, 1]);
@@ -140344,7 +140718,7 @@ class ImagePlane extends Component {
140344
140718
  clippable: cfg.clippable
140345
140719
  });
140346
140720
 
140347
- this._node = new Node(this, {
140721
+ this._node = new Node$1(this, {
140348
140722
  rotation: [0, 0, 0],
140349
140723
  position: [0, 0, 0],
140350
140724
  scale: [1, 1, 1],
@@ -140580,7 +140954,7 @@ class ImagePlane extends Component {
140580
140954
  const dist = -math.dotVec3(negDir, tempVec3$1);
140581
140955
 
140582
140956
  math.normalizeVec3(negDir);
140583
- math.mulVec3Scalar(negDir, dist, tempVec3b$3);
140957
+ math.mulVec3Scalar(negDir, dist, tempVec3b$4);
140584
140958
  math.vec3PairToQuaternion(zeroVec, dir, tempQuat);
140585
140959
 
140586
140960
  this._node.quaternion = tempQuat;
@@ -142816,9 +143190,9 @@ class QuadraticBezierCurve extends Curve {
142816
143190
  const screenPos = math.vec4();
142817
143191
  const viewPos = math.vec4();
142818
143192
 
142819
- const tempVec3a$2 = math.vec3();
142820
- const tempVec3b$2 = math.vec3();
142821
- const tempVec3c$2 = math.vec3();
143193
+ const tempVec3a$3 = math.vec3();
143194
+ const tempVec3b$3 = math.vec3();
143195
+ const tempVec3c$3 = math.vec3();
142822
143196
 
142823
143197
  const tempVec4a$1 = math.vec4();
142824
143198
  const tempVec4b$1 = math.vec4();
@@ -142851,7 +143225,7 @@ class PanController {
142851
143225
  const camera = this._scene.camera;
142852
143226
 
142853
143227
  if (optionalTargetWorldPos) {
142854
- const eyeToWorldPosVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$2);
143228
+ const eyeToWorldPosVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$3);
142855
143229
  const eyeWorldPosDist = math.lenVec3(eyeToWorldPosVec);
142856
143230
  dolliedThroughSurface = (eyeWorldPosDist < dollyDelta);
142857
143231
  }
@@ -142875,9 +143249,9 @@ class PanController {
142875
143249
  // suddenly a lot closer than the point we pivoted about on the surface of the last object
142876
143250
  // that we click-drag-pivoted on.
142877
143251
 
142878
- const eyeTargetVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$2);
143252
+ const eyeTargetVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$3);
142879
143253
  const lenEyeTargetVec = math.lenVec3(eyeTargetVec);
142880
- const eyeLookVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3b$2)), lenEyeTargetVec);
143254
+ const eyeLookVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3b$3)), lenEyeTargetVec);
142881
143255
  camera.look = [camera.eye[0] + eyeLookVec[0], camera.eye[1] + eyeLookVec[1], camera.eye[2] + eyeLookVec[2]];
142882
143256
  }
142883
143257
 
@@ -142894,8 +143268,8 @@ class PanController {
142894
143268
 
142895
143269
  const worldPos2 = this._unproject(targetCanvasPos, tempVec4b$1);
142896
143270
  const offset = math.subVec3(worldPos2, worldPos1, tempVec4c$1);
142897
- const eyeLookMoveVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$2)), -dollyDelta, tempVec3b$2);
142898
- const moveVec = math.addVec3(offset, eyeLookMoveVec, tempVec3c$2);
143271
+ const eyeLookMoveVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$3)), -dollyDelta, tempVec3b$3);
143272
+ const moveVec = math.addVec3(offset, eyeLookMoveVec, tempVec3c$3);
142899
143273
 
142900
143274
  camera.eye = [camera.eye[0] - moveVec[0], camera.eye[1] - moveVec[1], camera.eye[2] - moveVec[2]];
142901
143275
  camera.look = [camera.look[0] - moveVec[0], camera.look[1] - moveVec[1], camera.look[2] - moveVec[2]];
@@ -142922,9 +143296,9 @@ class PanController {
142922
143296
  }
142923
143297
  }
142924
143298
 
142925
- const tempVec3a$1 = math.vec3();
142926
- const tempVec3b$1 = math.vec3();
142927
- const tempVec3c$1 = math.vec3();
143299
+ const tempVec3a$2 = math.vec3();
143300
+ const tempVec3b$2 = math.vec3();
143301
+ const tempVec3c$2 = math.vec3();
142928
143302
 
142929
143303
  const tempVec4a = math.vec4();
142930
143304
  const tempVec4b = math.vec4();
@@ -143048,8 +143422,8 @@ class PivotController {
143048
143422
 
143049
143423
  _cameraLookingDownwards() { // Returns true if angle between camera viewing direction and World-space "up" axis is too small
143050
143424
  const camera = this._scene.camera;
143051
- const forwardAxis = math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$1));
143052
- const rightAxis = math.cross3Vec3(forwardAxis, camera.worldUp, tempVec3b$1);
143425
+ const forwardAxis = math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$2));
143426
+ const rightAxis = math.cross3Vec3(forwardAxis, camera.worldUp, tempVec3b$2);
143053
143427
  let rightAxisLen = math.sqLenVec3(rightAxis);
143054
143428
  return (rightAxisLen <= 0.0001);
143055
143429
  }
@@ -143089,8 +143463,8 @@ class PivotController {
143089
143463
  const screenZ = math.dotVec4(D, Pt3) / math.dotVec4(D, Pt4);
143090
143464
  const worldPos = tempVec4a;
143091
143465
  camera.project.unproject(canvasPos, screenZ, tempVec4b, tempVec4c, worldPos);
143092
- const eyeWorldPosVec = math.normalizeVec3(math.subVec3(worldPos, camera.eye, tempVec3a$1));
143093
- const posOnSphere = math.addVec3(camera.eye, math.mulVec3Scalar(eyeWorldPosVec, pivotShereRadius, tempVec3b$1), tempVec3c$1);
143466
+ const eyeWorldPosVec = math.normalizeVec3(math.subVec3(worldPos, camera.eye, tempVec3a$2));
143467
+ const posOnSphere = math.addVec3(camera.eye, math.mulVec3Scalar(eyeWorldPosVec, pivotShereRadius, tempVec3b$2), tempVec3c$2);
143094
143468
  this.setPivotPos(posOnSphere);
143095
143469
  }
143096
143470
 
@@ -143697,7 +144071,6 @@ class MousePanRotateDollyHandler {
143697
144071
  mouseMovedOnCanvasSinceLastWheel = false;
143698
144072
  }
143699
144073
 
143700
- e.preventDefault();
143701
144074
  }, {passive: true});
143702
144075
  }
143703
144076
 
@@ -143721,9 +144094,9 @@ class MousePanRotateDollyHandler {
143721
144094
  }
143722
144095
 
143723
144096
  const center = math.vec3();
143724
- const tempVec3a = math.vec3();
143725
- const tempVec3b = math.vec3();
143726
- const tempVec3c = math.vec3();
144097
+ const tempVec3a$1 = math.vec3();
144098
+ const tempVec3b$1 = math.vec3();
144099
+ const tempVec3c$1 = math.vec3();
143727
144100
  const tempVec3d = math.vec3();
143728
144101
 
143729
144102
  const tempCameraTarget = {
@@ -143776,39 +144149,39 @@ class KeyboardAxisViewHandler {
143776
144149
 
143777
144150
  if (axisViewRight) {
143778
144151
 
143779
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, perspectiveDist, tempVec3a), tempVec3d));
144152
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, perspectiveDist, tempVec3a$1), tempVec3d));
143780
144153
  tempCameraTarget.look.set(center);
143781
144154
  tempCameraTarget.up.set(camera.worldUp);
143782
144155
 
143783
144156
  } else if (axisViewBack) {
143784
144157
 
143785
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, perspectiveDist, tempVec3a), tempVec3d));
144158
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, perspectiveDist, tempVec3a$1), tempVec3d));
143786
144159
  tempCameraTarget.look.set(center);
143787
144160
  tempCameraTarget.up.set(camera.worldUp);
143788
144161
 
143789
144162
  } else if (axisViewLeft) {
143790
144163
 
143791
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, -perspectiveDist, tempVec3a), tempVec3d));
144164
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, -perspectiveDist, tempVec3a$1), tempVec3d));
143792
144165
  tempCameraTarget.look.set(center);
143793
144166
  tempCameraTarget.up.set(camera.worldUp);
143794
144167
 
143795
144168
  } else if (axisViewFront) {
143796
144169
 
143797
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, -perspectiveDist, tempVec3a), tempVec3d));
144170
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, -perspectiveDist, tempVec3a$1), tempVec3d));
143798
144171
  tempCameraTarget.look.set(center);
143799
144172
  tempCameraTarget.up.set(camera.worldUp);
143800
144173
 
143801
144174
  } else if (axisViewTop) {
143802
144175
 
143803
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, perspectiveDist, tempVec3a), tempVec3d));
144176
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, perspectiveDist, tempVec3a$1), tempVec3d));
143804
144177
  tempCameraTarget.look.set(center);
143805
- tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, 1, tempVec3b), tempVec3c));
144178
+ tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, 1, tempVec3b$1), tempVec3c$1));
143806
144179
 
143807
144180
  } else if (axisViewBottom) {
143808
144181
 
143809
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, -perspectiveDist, tempVec3a), tempVec3d));
144182
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, -perspectiveDist, tempVec3a$1), tempVec3d));
143810
144183
  tempCameraTarget.look.set(center);
143811
- tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, -1, tempVec3b)));
144184
+ tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, -1, tempVec3b$1)));
143812
144185
  }
143813
144186
 
143814
144187
  if ((!configs.firstPerson) && configs.followPointer) {
@@ -148160,14 +148533,12 @@ class Configs {
148160
148533
  }
148161
148534
  }
148162
148535
 
148163
- const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - smaller size for increasing distance
148164
-
148165
148536
  /**
148166
- * Experimental {@link Viewer} plugin that loads BIM models directly from IFC files.
148537
+ * Experimental {@link Viewer} plugin that uses [web-ifc](https://github.com/tomvandig/web-ifc) to load BIM models directly from IFC files.
148167
148538
  *
148168
- * <a href="https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_IFC_Duplex"><img src="https://xeokit.io/img/docs/IFCLoaderPlugin/IFCLoaderPlugin.png"></a>
148539
+ * <a href="https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_WebIFCLoaderPlugin_Duplex"><img src="https://xeokit.io/img/docs/WebIFCLoaderPlugin/WebIFCLoaderPlugin.png"></a>
148169
148540
  *
148170
- * [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_IFC_Duplex)]
148541
+ * [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_WebIFCLoaderPlugin_Duplex)]
148171
148542
  *
148172
148543
  * ## Overview
148173
148544
  *
@@ -148184,42 +148555,37 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148184
148555
  *
148185
148556
  * ## Limitations
148186
148557
  *
148187
- * IFCLoaderPlugin has certain limitations:
148188
- *
148189
- * * Downloads IFC files over the network, which can be large.
148190
- * * Parsing large IFC files can crash the browser (suspect overrunning browser memory limits).
148191
- * * No IFC geometry reuse yet.
148192
- * <br><br>
148193
- * Despite these limitations, IFCLoaderPlugin may still be perfect for small-scale IFC model viewing
148194
- * applications, and for getting started with xeokit and IFC in general.
148558
+ * Loading and parsing huge IFC STEP files can be slow, and can overwhelm the browser, however. To view your
148559
+ * largest IFC models, we recommend instead pre-converting those to xeokit's compressed native .XKT format, then
148560
+ * loading them with {@link XKTLoaderPlugin} instead.</p>
148195
148561
  *
148196
148562
  * ## Scene representation
148197
148563
  *
148198
- * When loading a model, IFCLoaderPlugin creates an {@link Entity} that represents the model, which
148564
+ * When loading a model, WebIFCLoaderPlugin creates an {@link Entity} that represents the model, which
148199
148565
  * will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id}
148200
- * in {@link Scene#models}. The IFCLoaderPlugin also creates an {@link Entity} for each object within the
148566
+ * in {@link Scene#models}. The WebIFCLoaderPlugin also creates an {@link Entity} for each object within the
148201
148567
  * model. Those Entities will have {@link Entity#isObject} set ````true```` and will be registered
148202
148568
  * by {@link Entity#id} in {@link Scene#objects}.
148203
148569
  *
148204
148570
  * ## Metadata
148205
148571
  *
148206
- * When loading a model, IFCLoaderPlugin also creates a {@link MetaModel} that represents the model, which contains
148572
+ * When loading a model, WebIFCLoaderPlugin also creates a {@link MetaModel} that represents the model, which contains
148207
148573
  * 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
148208
148574
  * don't need it.
148209
148575
  *
148210
148576
  * ## Usage
148211
148577
  *
148212
148578
  * In the example below we'll load the Duplex BIM model from
148213
- * 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
148579
+ * 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
148214
148580
  * that hold their metadata.
148215
148581
  *
148216
- * Since this model contains IFC types, the IFCLoaderPlugin will set the initial appearance of each object
148217
- * {@link Entity} according to its IFC type in {@link IFCLoaderPlugin#objectDefaults}.
148582
+ * Since this model contains IFC types, the WebIFCLoaderPlugin will set the initial appearance of each object
148583
+ * {@link Entity} according to its IFC type in {@link WebIFCLoaderPlugin#objectDefaults}.
148218
148584
  *
148219
- * * [[Run example](https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_IFC_isolateStorey)]
148585
+ * * [[Run example](https://xeokit.github.io/xeokit-sdk/examples/#BIMOffline_WebIFCLoaderPlugin_isolateStorey)]
148220
148586
  *
148221
148587
  * ````javascript
148222
- * import {Viewer, IFCLoaderPlugin} from "xeokit-sdk.es.js";
148588
+ * import {Viewer, WebIFCLoaderPlugin} from "xeokit-sdk.es.js";
148223
148589
  *
148224
148590
  * //------------------------------------------------------------------------------------------------------------------
148225
148591
  * // 1. Create a Viewer,
@@ -148238,12 +148604,12 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148238
148604
  * viewer.camera.up = [0.10, 0.98, -0.14];
148239
148605
  *
148240
148606
  * //------------------------------------------------------------------------------------------------------------------
148241
- * // 1. Create a IFCLoaderPlugin, configured with a path to the bundled third-party web-ifc.wasm module
148607
+ * // 1. Create a WebIFCLoaderPlugin, configured with a path to the bundled third-party web-ifc.wasm module
148242
148608
  * // 2. Load a BIM model fom an IFC file, excluding its IfcSpace elements, and highlighting edges
148243
148609
  * //------------------------------------------------------------------------------------------------------------------
148244
148610
  *
148245
148611
  * // 1
148246
- * const ifcLoader = new IFCLoaderPlugin(viewer, {
148612
+ * const ifcLoader = new WebIFCLoaderPlugin(viewer, {
148247
148613
  * wasmPath: "../dist/" // <<------- Path to web-ifc.wasm, which does the IFC parsing for us
148248
148614
  * });
148249
148615
  *
@@ -148379,7 +148745,7 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148379
148745
  * It's often helpful to make IfcSpaces transparent and unpickable, like this:
148380
148746
  *
148381
148747
  * ````javascript
148382
- * const ifcLoader = new IFCLoaderPlugin(viewer, {
148748
+ * const ifcLoader = new WebIFCLoaderPlugin(viewer, {
148383
148749
  * wasmPath: "../dist/",
148384
148750
  * objectDefaults: {
148385
148751
  * IfcSpace: {
@@ -148393,7 +148759,7 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148393
148759
  * Alternatively, we could just make IfcSpaces invisible, which also makes them unpickable:
148394
148760
  *
148395
148761
  * ````javascript
148396
- * const ifcLoader = new IFCLoaderPlugin(viewer, {
148762
+ * const ifcLoader = new WebIFCLoaderPlugin(viewer, {
148397
148763
  * wasmPath: "../dist/",
148398
148764
  * objectDefaults: {
148399
148765
  * IfcSpace: {
@@ -148405,9 +148771,9 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148405
148771
  *
148406
148772
  * ## Configuring a custom data source
148407
148773
  *
148408
- * By default, IFCLoaderPlugin will load IFC files over HTTP.
148774
+ * By default, WebIFCLoaderPlugin will load IFC files over HTTP.
148409
148775
  *
148410
- * In the example below, we'll customize the way IFCLoaderPlugin loads the files by configuring it with our own data source
148776
+ * In the example below, we'll customize the way WebIFCLoaderPlugin loads the files by configuring it with our own data source
148411
148777
  * object. For simplicity, our custom data source example also uses HTTP, using a couple of xeokit utility functions.
148412
148778
  *
148413
148779
  * ````javascript
@@ -148431,7 +148797,7 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148431
148797
  * }
148432
148798
  * }
148433
148799
  *
148434
- * const ifcLoader2 = new IFCLoaderPlugin(viewer, {
148800
+ * const ifcLoader2 = new WebIFCLoaderPlugin(viewer, {
148435
148801
  * dataSource: new MyDataSource()
148436
148802
  * });
148437
148803
  *
@@ -148446,7 +148812,7 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148446
148812
  * Sometimes we need to load two or more instances of the same model, without having clashes
148447
148813
  * between the IDs of the equivalent objects in the model instances.
148448
148814
  *
148449
- * As shown in the example below, we do this by setting {@link IFCLoaderPlugin#globalizeObjectIds} ````true```` before we load our models.
148815
+ * As shown in the example below, we do this by setting {@link WebIFCLoaderPlugin#globalizeObjectIds} ````true```` before we load our models.
148450
148816
  *
148451
148817
  * ````javascript
148452
148818
  * ifcLoader.globalizeObjectIds = true;
@@ -148493,10 +148859,10 @@ const RTC_TILE_SIZE = 10000; // TODO: Autogenerate from placement distance - sma
148493
148859
  * myViewer.scene.setObjectVisibilities("myModel1#0BTBFw6f90Nfh9rP1dlXrb", true);
148494
148860
  *````
148495
148861
  *
148496
- * @class IFCLoaderPlugin
148862
+ * @class WebIFCLoaderPlugin
148497
148863
  * @since 2.0.13
148498
148864
  */
148499
- class IFCLoaderPlugin extends Plugin {
148865
+ class WebIFCLoaderPlugin extends Plugin {
148500
148866
 
148501
148867
  /**
148502
148868
  * @constructor
@@ -148504,31 +148870,24 @@ class IFCLoaderPlugin extends Plugin {
148504
148870
  * @param {Viewer} viewer The Viewer.
148505
148871
  * @param {Object} cfg Plugin configuration.
148506
148872
  * @param {String} [cfg.id="ifcLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
148507
- * @param {String} cfg.wasmPath Path to ````web-ifc.wasm````, required by IFCLoaderlugin.
148873
+ * @param {String} cfg.wasmPath Path to ````web-ifc.wasm````, required by WebIFCLoaderPlugin.
148508
148874
  * @param {Object} [cfg.objectDefaults] Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.
148509
- * @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.
148875
+ * @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.
148510
148876
  * @param {String[]} [cfg.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
148511
148877
  * @param {String[]} [cfg.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
148512
148878
  * @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}.
148513
- * @param {Number} [cfg.maxGeometryBatchSize=50000000] Maximum geometry batch size, as number of vertices. This is optionally supplied
148514
- * to limit the size of the batched geometry arrays that {@link PerformanceModel} internally creates for batched geometries.
148515
- * A low value means less heap allocation/de-allocation while loading batched geometries, but more draw calls and
148516
- * slower rendering speed. A high value means larger heap allocation/de-allocation while loading, but less draw calls
148517
- * and faster rendering speed. It's recommended to keep this somewhere roughly between ````50000```` and ````50000000```.
148518
148879
  */
148519
148880
  constructor(viewer, cfg = {}) {
148520
148881
 
148521
148882
  super("ifcLoader", viewer, cfg);
148522
148883
 
148523
- this._maxGeometryBatchSize = cfg.maxGeometryBatchSize;
148524
-
148525
148884
  this.dataSource = cfg.dataSource;
148526
148885
  this.objectDefaults = cfg.objectDefaults;
148527
148886
  this.includeTypes = cfg.includeTypes;
148528
148887
  this.excludeTypes = cfg.excludeTypes;
148529
148888
  this.excludeUnclassifiedObjects = cfg.excludeUnclassifiedObjects;
148530
148889
 
148531
- this._ifcAPI = new IfcAPI();
148890
+ this._ifcAPI = new IfcAPI2();
148532
148891
 
148533
148892
  if (cfg.wasmPath) {
148534
148893
  this._ifcAPI.SetWasmPath(cfg.wasmPath);
@@ -148542,7 +148901,7 @@ class IFCLoaderPlugin extends Plugin {
148542
148901
  }
148543
148902
 
148544
148903
  /**
148545
- * Gets the ````IFC```` format versions supported by this IFCLoaderPlugin.
148904
+ * Gets the ````IFC```` format versions supported by this WebIFCLoaderPlugin.
148546
148905
  * @returns {string[]}
148547
148906
  */
148548
148907
  get supportedVersions() {
@@ -148550,9 +148909,9 @@ class IFCLoaderPlugin extends Plugin {
148550
148909
  }
148551
148910
 
148552
148911
  /**
148553
- * Gets the custom data source through which the IFCLoaderPlugin can load IFC files.
148912
+ * Gets the custom data source through which the WebIFCLoaderPlugin can load IFC files.
148554
148913
  *
148555
- * Default value is {@link IFCDefaultDataSource}, which loads via HTTP.
148914
+ * Default value is {@link WebIFCDefaultDataSource}, which loads via HTTP.
148556
148915
  *
148557
148916
  * @type {Object}
148558
148917
  */
@@ -148561,14 +148920,14 @@ class IFCLoaderPlugin extends Plugin {
148561
148920
  }
148562
148921
 
148563
148922
  /**
148564
- * Sets a custom data source through which the IFCLoaderPlugin can load IFC files.
148923
+ * Sets a custom data source through which the WebIFCLoaderPlugin can load IFC files.
148565
148924
  *
148566
- * Default value is {@link IFCDefaultDataSource}, which loads via HTTP.
148925
+ * Default value is {@link WebIFCDefaultDataSource}, which loads via HTTP.
148567
148926
  *
148568
148927
  * @type {Object}
148569
148928
  */
148570
148929
  set dataSource(value) {
148571
- this._dataSource = value || new IFCDefaultDataSource();
148930
+ this._dataSource = value || new WebIFCDefaultDataSource();
148572
148931
  }
148573
148932
 
148574
148933
  /**
@@ -148594,9 +148953,9 @@ class IFCLoaderPlugin extends Plugin {
148594
148953
  }
148595
148954
 
148596
148955
  /**
148597
- * Gets the whitelist of the IFC types loaded by this IFCLoaderPlugin.
148956
+ * Gets the whitelist of the IFC types loaded by this WebIFCLoaderPlugin.
148598
148957
  *
148599
- * When loading IFC models, causes this IFCLoaderPlugin to only load objects whose types are in this
148958
+ * When loading IFC models, causes this WebIFCLoaderPlugin to only load objects whose types are in this
148600
148959
  * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
148601
148960
  *
148602
148961
  * Default value is ````undefined````.
@@ -148608,9 +148967,9 @@ class IFCLoaderPlugin extends Plugin {
148608
148967
  }
148609
148968
 
148610
148969
  /**
148611
- * Sets the whitelist of the IFC types loaded by this IFCLoaderPlugin.
148970
+ * Sets the whitelist of the IFC types loaded by this WebIFCLoaderPlugin.
148612
148971
  *
148613
- * When loading IFC models, causes this IFCLoaderPlugin to only load objects whose types are in this
148972
+ * When loading IFC models, causes this WebIFCLoaderPlugin to only load objects whose types are in this
148614
148973
  * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
148615
148974
  *
148616
148975
  * Default value is ````undefined````.
@@ -148622,9 +148981,9 @@ class IFCLoaderPlugin extends Plugin {
148622
148981
  }
148623
148982
 
148624
148983
  /**
148625
- * Gets the blacklist of IFC types that are never loaded by this IFCLoaderPlugin.
148984
+ * Gets the blacklist of IFC types that are never loaded by this WebIFCLoaderPlugin.
148626
148985
  *
148627
- * When loading IFC models, causes this IFCLoaderPlugin to **not** load objects whose types are in this
148986
+ * When loading IFC models, causes this WebIFCLoaderPlugin to **not** load objects whose types are in this
148628
148987
  * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
148629
148988
  *
148630
148989
  * Default value is ````undefined````.
@@ -148636,9 +148995,9 @@ class IFCLoaderPlugin extends Plugin {
148636
148995
  }
148637
148996
 
148638
148997
  /**
148639
- * Sets the blacklist of IFC types that are never loaded by this IFCLoaderPlugin.
148998
+ * Sets the blacklist of IFC types that are never loaded by this WebIFCLoaderPlugin.
148640
148999
  *
148641
- * When IFC models, causes this IFCLoaderPlugin to **not** load objects whose types are in this
149000
+ * When IFC models, causes this WebIFCLoaderPlugin to **not** load objects whose types are in this
148642
149001
  * list. An object's type is indicated by its {@link MetaObject}'s {@link MetaObject#type}.
148643
149002
  *
148644
149003
  * Default value is ````undefined````.
@@ -148652,7 +149011,7 @@ class IFCLoaderPlugin extends Plugin {
148652
149011
  /**
148653
149012
  * Gets whether we load objects that don't have IFC types.
148654
149013
  *
148655
- * When loading IFC models and this is ````true````, IFCLoaderPlugin will not load objects
149014
+ * When loading IFC models and this is ````true````, WebIFCLoaderPlugin will not load objects
148656
149015
  * that don't have IFC types.
148657
149016
  *
148658
149017
  * Default value is ````false````.
@@ -148666,7 +149025,7 @@ class IFCLoaderPlugin extends Plugin {
148666
149025
  /**
148667
149026
  * Sets whether we load objects that don't have IFC types.
148668
149027
  *
148669
- * When loading IFC models and this is ````true````, IFCLoaderPlugin will not load objects
149028
+ * When loading IFC models and this is ````true````, WebIFCLoaderPlugin will not load objects
148670
149029
  * that don't have IFC types.
148671
149030
  *
148672
149031
  * Default value is ````false````.
@@ -148678,7 +149037,7 @@ class IFCLoaderPlugin extends Plugin {
148678
149037
  }
148679
149038
 
148680
149039
  /**
148681
- * Gets whether IFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
149040
+ * Gets whether WebIFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
148682
149041
  *
148683
149042
  * Default value is ````false````.
148684
149043
  *
@@ -148689,7 +149048,7 @@ class IFCLoaderPlugin extends Plugin {
148689
149048
  }
148690
149049
 
148691
149050
  /**
148692
- * Sets whether IFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
149051
+ * Sets whether WebIFCLoaderPlugin globalizes each {@link Entity#id} and {@link MetaObject#id} as it loads a model.
148693
149052
  *
148694
149053
  * Set this ````true```` when you need to load multiple instances of the same model, to avoid ID clashes
148695
149054
  * between the objects in the different instances.
@@ -148701,7 +149060,7 @@ class IFCLoaderPlugin extends Plugin {
148701
149060
  *
148702
149061
  * Default value is ````false````.
148703
149062
  *
148704
- * See the main {@link IFCLoaderPlugin} class documentation for usage info.
149063
+ * See the main {@link WebIFCLoaderPlugin} class documentation for usage info.
148705
149064
  *
148706
149065
  * @type {Boolean}
148707
149066
  */
@@ -148710,27 +149069,28 @@ class IFCLoaderPlugin extends Plugin {
148710
149069
  }
148711
149070
 
148712
149071
  /**
148713
- * Loads an ````IFC```` model into this IFCLoaderPlugin's {@link Viewer}.
149072
+ * Loads an ````IFC```` model into this WebIFCLoaderPlugin's {@link Viewer}.
148714
149073
  *
148715
149074
  * @param {*} params Loading parameters.
148716
149075
  * @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.
148717
149076
  * @param {String} [params.src] Path to a IFC file, as an alternative to the ````ifc```` parameter.
148718
149077
  * @param {ArrayBuffer} [params.ifc] The IFC file data, as an alternative to the ````src```` parameter.
148719
- * @param {ArrayBuffer} [params.loadMetadata=true] Whether to load IFC metadata (metaobjects and property sets).
149078
+ * @param {Boolean} [params.loadMetadata=true] Whether to load IFC metadata (metaobjects and property sets).
148720
149079
  * @param {{String:Object}} [params.objectDefaults] Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.
148721
149080
  * @param {String[]} [params.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
148722
149081
  * @param {String[]} [params.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
148723
149082
  * @param {Boolean} [params.edges=false] Whether or not xeokit renders the model with edges emphasized.
148724
- * @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
148725
- * @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
148726
- * @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.
148727
- * @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.
149083
+ * @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.
149084
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
149085
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
149086
+ * @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.
149087
+ * @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````.
148728
149088
  * @param {Boolean} [params.edges=false] Indicates if the model's edges are initially emphasized.
148729
149089
  * @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````
148730
149090
  * @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````.
148731
149091
  * @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.
148732
149092
  * @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}.
148733
- * @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.
149093
+ * @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.
148734
149094
  * @param {Object} [params.stats] Collects model statistics.
148735
149095
  * @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}.
148736
149096
  */
@@ -148742,8 +149102,7 @@ class IFCLoaderPlugin extends Plugin {
148742
149102
  }
148743
149103
 
148744
149104
  const performanceModel = new PerformanceModel(this.viewer.scene, utils.apply(params, {
148745
- isModel: true,
148746
- maxGeometryBatchSize: this._maxGeometryBatchSize
149105
+ isModel: true
148747
149106
  }));
148748
149107
 
148749
149108
  if (!params.src && !params.ifc) {
@@ -148836,13 +149195,14 @@ class IFCLoaderPlugin extends Plugin {
148836
149195
  const ifcProjectId = lines.get(0);
148837
149196
 
148838
149197
  const loadMetadata = (params.loadMetadata !== false);
148839
- const metaData = loadMetadata ? {
148840
- id: "1601",
149198
+
149199
+ const metadata = loadMetadata ? {
149200
+ id: "",
148841
149201
  projectId: "" + ifcProjectId,
148842
149202
  author: "",
148843
- createdAt: "2017-01-19T01:36:20",
148844
- schema: "IFC2X3",
148845
- creatingApplication: "20161117_1200(x64) - Exporter 17.2.0.0 - Interface alternative d'export 17.2.0.0",
149203
+ createdAt: "",
149204
+ schema: "",
149205
+ creatingApplication: "",
148846
149206
  metaObjects: [],
148847
149207
  propertySets: []
148848
149208
  } : null;
@@ -148851,7 +149211,7 @@ class IFCLoaderPlugin extends Plugin {
148851
149211
  modelID,
148852
149212
  performanceModel,
148853
149213
  loadMetadata,
148854
- metaData,
149214
+ metadata,
148855
149215
  metaObjects: {},
148856
149216
  options,
148857
149217
  log: function (msg) {
@@ -148886,7 +149246,7 @@ class IFCLoaderPlugin extends Plugin {
148886
149246
 
148887
149247
  if (loadMetadata) {
148888
149248
  const metaModelId = performanceModel.id;
148889
- this.viewer.metaScene.createMetaModel(metaModelId, ctx.metaData, options);
149249
+ this.viewer.metaScene.createMetaModel(metaModelId, ctx.metadata, options);
148890
149250
  }
148891
149251
 
148892
149252
  performanceModel.scene.once("tick", () => {
@@ -148929,7 +149289,7 @@ class IFCLoaderPlugin extends Plugin {
148929
149289
  type: metaObjectName,
148930
149290
  parent: parentMetaObjectId
148931
149291
  };
148932
- ctx.metaData.metaObjects.push(metaObject);
149292
+ ctx.metadata.metaObjects.push(metaObject);
148933
149293
  ctx.metaObjects[id] = metaObject;
148934
149294
  ctx.stats.numMetaObjects++;
148935
149295
  }
@@ -149003,7 +149363,7 @@ class IFCLoaderPlugin extends Plugin {
149003
149363
  name: propertySetName,
149004
149364
  properties: properties
149005
149365
  };
149006
- ctx.metaData.propertySets.push(propertySet);
149366
+ ctx.metadata.propertySets.push(propertySet);
149007
149367
  ctx.stats.numPropertySets++;
149008
149368
  const relatedObjects = rel.RelatedObjects;
149009
149369
  if (!relatedObjects || relatedObjects.length === 0) {
@@ -149050,21 +149410,21 @@ class IFCLoaderPlugin extends Plugin {
149050
149410
  const vertexData = this._ifcAPI.GetVertexArray(geometry.GetVertexData(), geometry.GetVertexDataSize());
149051
149411
  const indices = this._ifcAPI.GetIndexArray(geometry.GetIndexData(), geometry.GetIndexDataSize());
149052
149412
  // De-interleave vertex arrays
149053
- const positions = [];
149054
- const normals = [];
149055
- for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {
149056
- positions.push(vertexData[k * 6 + 0]);
149057
- positions.push(vertexData[k * 6 + 1]);
149058
- positions.push(vertexData[k * 6 + 2]);
149413
+ const positions = new Float64Array(vertexData.length / 2);
149414
+ const normals = new Float32Array(vertexData.length / 2);
149415
+ for (let k = 0, l = 0, lenk = vertexData.length / 6; k < lenk; k++, l += 3) {
149416
+ positions[l + 0] = vertexData[k * 6 + 0];
149417
+ positions[l + 1] = vertexData[k * 6 + 1];
149418
+ positions[l + 2] = vertexData[k * 6 + 2];
149059
149419
  }
149060
149420
  matrix.set(placedGeometry.flatTransformation);
149061
149421
  math.transformPositions3(matrix, positions);
149062
- const rtcNeeded = worldToRTCPositions(positions, positions, origin, RTC_TILE_SIZE);
149422
+ const rtcNeeded = worldToRTCPositions(positions, positions, origin);
149063
149423
  if (!ctx.options.autoNormals) {
149064
- for (let k = 0, lenk = vertexData.length / 6; k < lenk; k++) {
149065
- normals.push(vertexData[k * 6 + 3]);
149066
- normals.push(vertexData[k * 6 + 4]);
149067
- normals.push(vertexData[k * 6 + 5]);
149424
+ for (let k = 0, l = 0, lenk = vertexData.length / 6; k < lenk; k++, l += 3) {
149425
+ normals[l + 0] = vertexData[k * 6 + 3];
149426
+ normals[l + 1] = vertexData[k * 6 + 4];
149427
+ normals[l + 2] = vertexData[k * 6 + 5];
149068
149428
  }
149069
149429
  }
149070
149430
  ctx.stats.numGeometries++;
@@ -151613,7 +151973,7 @@ class LASLoaderPlugin extends Plugin {
151613
151973
  * @param {Viewer} viewer The Viewer.
151614
151974
  * @param {Object} cfg Plugin configuration.
151615
151975
  * @param {String} [cfg.id="lasLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
151616
- * @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.
151976
+ * @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.
151617
151977
  * @param {Number} [cfg.skip=1] Configures LASLoaderPlugin to load every **n** points.
151618
151978
  * @param {Number} [cfg.fp64=false] Configures if LASLoaderPlugin assumes that LAS positions are stored in 64-bit floats instead of 32-bit.
151619
151979
  * @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".
@@ -151727,10 +152087,12 @@ class LASLoaderPlugin extends Plugin {
151727
152087
  * @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.
151728
152088
  * @param {String} [params.src] Path to a LAS file, as an alternative to the ````las```` parameter.
151729
152089
  * @param {ArrayBuffer} [params.las] The LAS file data, as an alternative to the ````src```` parameter.
151730
- * @param {Number[]} [params.position=[0,0,0]] The model World-space 3D position.
151731
- * @param {Number[]} [params.scale=[1,1,1]] The model's World-space scale.
151732
- * @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.
151733
- * @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.
152090
+ * @param {Boolean} [params.loadMetadata=true] Whether to load metadata for the LAS model.
152091
+ * @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.
152092
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
152093
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
152094
+ * @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.
152095
+ * @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````.
151734
152096
  * @param {Object} [params.stats] Collects model statistics.
151735
152097
  * @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}.
151736
152098
  */
@@ -151743,7 +152105,11 @@ class LASLoaderPlugin extends Plugin {
151743
152105
 
151744
152106
  const performanceModel = new PerformanceModel(this.viewer.scene, utils.apply(params, {
151745
152107
  isModel: true,
151746
- maxGeometryBatchSize: this._maxGeometryBatchSize
152108
+ origin: params.origin,
152109
+ position: params.position,
152110
+ scale: params.scale,
152111
+ rotation: params.rotation,
152112
+ matrix: params.matrix
151747
152113
  }));
151748
152114
 
151749
152115
  if (!params.src && !params.las) {
@@ -151916,15 +152282,39 @@ class LASLoaderPlugin extends Plugin {
151916
152282
  colorsCompressed: colorsCompressed
151917
152283
  });
151918
152284
 
152285
+ const pointsObjectId = math.createUUID();
152286
+
151919
152287
  performanceModel.createEntity({
151920
- id: math.createUUID(),
152288
+ id: pointsObjectId,
151921
152289
  meshIds: ["pointsMesh"],
151922
152290
  isObject: true
151923
152291
  });
151924
152292
 
151925
152293
  performanceModel.finalize();
151926
152294
 
151927
- // TODO: Create metamodel
152295
+ if (params.loadMetadata !== false) {
152296
+ const rootMetaObjectId = math.createUUID();
152297
+ const metadata = {
152298
+ projectId: "",
152299
+ author: "",
152300
+ createdAt: "",
152301
+ schema: "",
152302
+ creatingApplication: "",
152303
+ metaObjects: [{
152304
+ id: rootMetaObjectId,
152305
+ name: "Model",
152306
+ type: "Model"
152307
+ }, {
152308
+ id: pointsObjectId,
152309
+ name: "PointCloud (LAS)",
152310
+ type: "PointCloud",
152311
+ parent: rootMetaObjectId
152312
+ }],
152313
+ propertySets: []
152314
+ };
152315
+ const metaModelId = performanceModel.id;
152316
+ this.viewer.metaScene.createMetaModel(metaModelId, metadata, options);
152317
+ }
151928
152318
 
151929
152319
  performanceModel.scene.once("tick", () => {
151930
152320
  if (performanceModel.destroyed) {
@@ -151944,4 +152334,1438 @@ class LASLoaderPlugin extends Plugin {
151944
152334
  }
151945
152335
  }
151946
152336
 
151947
- export { AmbientLight, AngleMeasurementsPlugin, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, CameraMemento, CameraPath, CameraPathAnimation, Component, Configs, ContextMenu, CubicBezierCurve, Curve, DirLight, DistanceMeasurementsPlugin, EdgeMaterial, EmphasisMaterial, FastNavPlugin, Fresnel, GLTFDefaultDataSource, GLTFLoaderPlugin, IFCLoaderPlugin, ImagePlane, LASLoaderPlugin, LambertMaterial, LightMap, LocaleService, Map$1 as Map, Marker, Mesh, MetallicMaterial, ModelMemento, NavCubePlugin, Node, OBJLoaderPlugin, ObjectsMemento, Path, PerformanceModel, PhongMaterial, Plugin, PointLight, QuadraticBezierCurve, Queue, ReadableGeometry, ReflectionMap, STLDefaultDataSource, STLLoaderPlugin, SectionPlane, SectionPlanesPlugin, Skybox, SkyboxesPlugin, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TreeViewPlugin, VBOGeometry, ViewCullPlugin, Viewer, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, buildBoxGeometry, buildBoxLinesGeometry, buildCylinderGeometry, buildGridGeometry, buildPlaneGeometry, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, load3DSGeometry, loadOBJGeometry, math, stats, utils };
152337
+ /**
152338
+ * Default data access strategy for {@link CityJSONLoaderPlugin}.
152339
+ */
152340
+ class CityJSONDefaultDataSource {
152341
+
152342
+ constructor() {
152343
+ }
152344
+
152345
+ /**
152346
+ * Gets the contents of the given CityJSON file.
152347
+ *
152348
+ * @param {String|Number} src Path or ID of an CityJSON file.
152349
+ * @param {Function} ok Callback fired on success, argument is the CityJSON JSON.
152350
+ * @param {Function} error Callback fired on error.
152351
+ */
152352
+ getCityJSON(src, ok, error) {
152353
+ utils.loadJSON(src,
152354
+ (json) => {
152355
+ ok(json);
152356
+ },
152357
+ function (errMsg) {
152358
+ error(errMsg);
152359
+ });
152360
+ }
152361
+ }
152362
+
152363
+ /** @private */
152364
+ function earcut(data, holeIndices, dim) {
152365
+
152366
+ dim = dim || 2;
152367
+
152368
+ var hasHoles = holeIndices && holeIndices.length,
152369
+ outerLen = hasHoles ? holeIndices[0] * dim : data.length,
152370
+ outerNode = linkedList(data, 0, outerLen, dim, true),
152371
+ triangles = [];
152372
+
152373
+ if (!outerNode || outerNode.next === outerNode.prev) return triangles;
152374
+
152375
+ var minX, minY, maxX, maxY, x, y, invSize;
152376
+
152377
+ if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);
152378
+
152379
+ // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
152380
+ if (data.length > 80 * dim) {
152381
+ minX = maxX = data[0];
152382
+ minY = maxY = data[1];
152383
+
152384
+ for (var i = dim; i < outerLen; i += dim) {
152385
+ x = data[i];
152386
+ y = data[i + 1];
152387
+ if (x < minX) minX = x;
152388
+ if (y < minY) minY = y;
152389
+ if (x > maxX) maxX = x;
152390
+ if (y > maxY) maxY = y;
152391
+ }
152392
+
152393
+ // minX, minY and invSize are later used to transform coords into integers for z-order calculation
152394
+ invSize = Math.max(maxX - minX, maxY - minY);
152395
+ invSize = invSize !== 0 ? 1 / invSize : 0;
152396
+ }
152397
+
152398
+ earcutLinked(outerNode, triangles, dim, minX, minY, invSize);
152399
+
152400
+ return triangles;
152401
+ }
152402
+
152403
+ // create a circular doubly linked list from polygon points in the specified winding order
152404
+ function linkedList(data, start, end, dim, clockwise) {
152405
+ var i, last;
152406
+
152407
+ if (clockwise === (signedArea(data, start, end, dim) > 0)) {
152408
+ for (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);
152409
+ } else {
152410
+ for (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);
152411
+ }
152412
+
152413
+ if (last && equals(last, last.next)) {
152414
+ removeNode(last);
152415
+ last = last.next;
152416
+ }
152417
+
152418
+ return last;
152419
+ }
152420
+
152421
+ // eliminate colinear or duplicate points
152422
+ function filterPoints(start, end) {
152423
+ if (!start) return start;
152424
+ if (!end) end = start;
152425
+
152426
+ var p = start,
152427
+ again;
152428
+ do {
152429
+ again = false;
152430
+
152431
+ if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
152432
+ removeNode(p);
152433
+ p = end = p.prev;
152434
+ if (p === p.next) break;
152435
+ again = true;
152436
+
152437
+ } else {
152438
+ p = p.next;
152439
+ }
152440
+ } while (again || p !== end);
152441
+
152442
+ return end;
152443
+ }
152444
+
152445
+ // main ear slicing loop which triangulates a polygon (given as a linked list)
152446
+ function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {
152447
+ if (!ear) return;
152448
+
152449
+ // interlink polygon nodes in z-order
152450
+ if (!pass && invSize) indexCurve(ear, minX, minY, invSize);
152451
+
152452
+ var stop = ear,
152453
+ prev, next;
152454
+
152455
+ // iterate through ears, slicing them one by one
152456
+ while (ear.prev !== ear.next) {
152457
+ prev = ear.prev;
152458
+ next = ear.next;
152459
+
152460
+ if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
152461
+ // cut off the triangle
152462
+ triangles.push(prev.i / dim);
152463
+ triangles.push(ear.i / dim);
152464
+ triangles.push(next.i / dim);
152465
+
152466
+ removeNode(ear);
152467
+
152468
+ // skipping the next vertex leads to less sliver triangles
152469
+ ear = next.next;
152470
+ stop = next.next;
152471
+
152472
+ continue;
152473
+ }
152474
+
152475
+ ear = next;
152476
+
152477
+ // if we looped through the whole remaining polygon and can't find any more ears
152478
+ if (ear === stop) {
152479
+ // try filtering points and slicing again
152480
+ if (!pass) {
152481
+ earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);
152482
+
152483
+ // if this didn't work, try curing all small self-intersections locally
152484
+ } else if (pass === 1) {
152485
+ ear = cureLocalIntersections(filterPoints(ear), triangles, dim);
152486
+ earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);
152487
+
152488
+ // as a last resort, try splitting the remaining polygon into two
152489
+ } else if (pass === 2) {
152490
+ splitEarcut(ear, triangles, dim, minX, minY, invSize);
152491
+ }
152492
+
152493
+ break;
152494
+ }
152495
+ }
152496
+ }
152497
+
152498
+ // check whether a polygon node forms a valid ear with adjacent nodes
152499
+ function isEar(ear) {
152500
+ var a = ear.prev,
152501
+ b = ear,
152502
+ c = ear.next;
152503
+
152504
+ if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
152505
+
152506
+ // now make sure we don't have other points inside the potential ear
152507
+ var p = ear.next.next;
152508
+
152509
+ while (p !== ear.prev) {
152510
+ if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
152511
+ area(p.prev, p, p.next) >= 0) return false;
152512
+ p = p.next;
152513
+ }
152514
+
152515
+ return true;
152516
+ }
152517
+
152518
+ function isEarHashed(ear, minX, minY, invSize) {
152519
+ var a = ear.prev,
152520
+ b = ear,
152521
+ c = ear.next;
152522
+
152523
+ if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
152524
+
152525
+ // triangle bbox; min & max are calculated like this for speed
152526
+ var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),
152527
+ minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),
152528
+ maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),
152529
+ maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);
152530
+
152531
+ // z-order range for the current triangle bbox;
152532
+ var minZ = zOrder(minTX, minTY, minX, minY, invSize),
152533
+ maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);
152534
+
152535
+ var p = ear.prevZ,
152536
+ n = ear.nextZ;
152537
+
152538
+ // look for points inside the triangle in both directions
152539
+ while (p && p.z >= minZ && n && n.z <= maxZ) {
152540
+ if (p !== ear.prev && p !== ear.next &&
152541
+ pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
152542
+ area(p.prev, p, p.next) >= 0) return false;
152543
+ p = p.prevZ;
152544
+
152545
+ if (n !== ear.prev && n !== ear.next &&
152546
+ pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
152547
+ area(n.prev, n, n.next) >= 0) return false;
152548
+ n = n.nextZ;
152549
+ }
152550
+
152551
+ // look for remaining points in decreasing z-order
152552
+ while (p && p.z >= minZ) {
152553
+ if (p !== ear.prev && p !== ear.next &&
152554
+ pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
152555
+ area(p.prev, p, p.next) >= 0) return false;
152556
+ p = p.prevZ;
152557
+ }
152558
+
152559
+ // look for remaining points in increasing z-order
152560
+ while (n && n.z <= maxZ) {
152561
+ if (n !== ear.prev && n !== ear.next &&
152562
+ pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
152563
+ area(n.prev, n, n.next) >= 0) return false;
152564
+ n = n.nextZ;
152565
+ }
152566
+
152567
+ return true;
152568
+ }
152569
+
152570
+ // go through all polygon nodes and cure small local self-intersections
152571
+ function cureLocalIntersections(start, triangles, dim) {
152572
+ var p = start;
152573
+ do {
152574
+ var a = p.prev,
152575
+ b = p.next.next;
152576
+
152577
+ if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
152578
+
152579
+ triangles.push(a.i / dim);
152580
+ triangles.push(p.i / dim);
152581
+ triangles.push(b.i / dim);
152582
+
152583
+ // remove two nodes involved
152584
+ removeNode(p);
152585
+ removeNode(p.next);
152586
+
152587
+ p = start = b;
152588
+ }
152589
+ p = p.next;
152590
+ } while (p !== start);
152591
+
152592
+ return filterPoints(p);
152593
+ }
152594
+
152595
+ // try splitting polygon into two and triangulate them independently
152596
+ function splitEarcut(start, triangles, dim, minX, minY, invSize) {
152597
+ // look for a valid diagonal that divides the polygon into two
152598
+ var a = start;
152599
+ do {
152600
+ var b = a.next.next;
152601
+ while (b !== a.prev) {
152602
+ if (a.i !== b.i && isValidDiagonal(a, b)) {
152603
+ // split the polygon in two by the diagonal
152604
+ var c = splitPolygon(a, b);
152605
+
152606
+ // filter colinear points around the cuts
152607
+ a = filterPoints(a, a.next);
152608
+ c = filterPoints(c, c.next);
152609
+
152610
+ // run earcut on each half
152611
+ earcutLinked(a, triangles, dim, minX, minY, invSize);
152612
+ earcutLinked(c, triangles, dim, minX, minY, invSize);
152613
+ return;
152614
+ }
152615
+ b = b.next;
152616
+ }
152617
+ a = a.next;
152618
+ } while (a !== start);
152619
+ }
152620
+
152621
+ // link every hole into the outer loop, producing a single-ring polygon without holes
152622
+ function eliminateHoles(data, holeIndices, outerNode, dim) {
152623
+ var queue = [],
152624
+ i, len, start, end, list;
152625
+
152626
+ for (i = 0, len = holeIndices.length; i < len; i++) {
152627
+ start = holeIndices[i] * dim;
152628
+ end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
152629
+ list = linkedList(data, start, end, dim, false);
152630
+ if (list === list.next) list.steiner = true;
152631
+ queue.push(getLeftmost(list));
152632
+ }
152633
+
152634
+ queue.sort(compareX);
152635
+
152636
+ // process holes from left to right
152637
+ for (i = 0; i < queue.length; i++) {
152638
+ eliminateHole(queue[i], outerNode);
152639
+ outerNode = filterPoints(outerNode, outerNode.next);
152640
+ }
152641
+
152642
+ return outerNode;
152643
+ }
152644
+
152645
+ function compareX(a, b) {
152646
+ return a.x - b.x;
152647
+ }
152648
+
152649
+ // find a bridge between vertices that connects hole with an outer ring and and link it
152650
+ function eliminateHole(hole, outerNode) {
152651
+ outerNode = findHoleBridge(hole, outerNode);
152652
+ if (outerNode) {
152653
+ var b = splitPolygon(outerNode, hole);
152654
+
152655
+ // filter collinear points around the cuts
152656
+ filterPoints(outerNode, outerNode.next);
152657
+ filterPoints(b, b.next);
152658
+ }
152659
+ }
152660
+
152661
+ // David Eberly's algorithm for finding a bridge between hole and outer polygon
152662
+ function findHoleBridge(hole, outerNode) {
152663
+ var p = outerNode,
152664
+ hx = hole.x,
152665
+ hy = hole.y,
152666
+ qx = -Infinity,
152667
+ m;
152668
+
152669
+ // find a segment intersected by a ray from the hole's leftmost point to the left;
152670
+ // segment's endpoint with lesser x will be potential connection point
152671
+ do {
152672
+ if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {
152673
+ var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
152674
+ if (x <= hx && x > qx) {
152675
+ qx = x;
152676
+ if (x === hx) {
152677
+ if (hy === p.y) return p;
152678
+ if (hy === p.next.y) return p.next;
152679
+ }
152680
+ m = p.x < p.next.x ? p : p.next;
152681
+ }
152682
+ }
152683
+ p = p.next;
152684
+ } while (p !== outerNode);
152685
+
152686
+ if (!m) return null;
152687
+
152688
+ if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint
152689
+
152690
+ // look for points inside the triangle of hole point, segment intersection and endpoint;
152691
+ // if there are no points found, we have a valid connection;
152692
+ // otherwise choose the point of the minimum angle with the ray as connection point
152693
+
152694
+ var stop = m,
152695
+ mx = m.x,
152696
+ my = m.y,
152697
+ tanMin = Infinity,
152698
+ tan;
152699
+
152700
+ p = m;
152701
+
152702
+ do {
152703
+ if (hx >= p.x && p.x >= mx && hx !== p.x &&
152704
+ pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {
152705
+
152706
+ tan = Math.abs(hy - p.y) / (hx - p.x); // tangential
152707
+
152708
+ if (locallyInside(p, hole) &&
152709
+ (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {
152710
+ m = p;
152711
+ tanMin = tan;
152712
+ }
152713
+ }
152714
+
152715
+ p = p.next;
152716
+ } while (p !== stop);
152717
+
152718
+ return m;
152719
+ }
152720
+
152721
+ // whether sector in vertex m contains sector in vertex p in the same coordinates
152722
+ function sectorContainsSector(m, p) {
152723
+ return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;
152724
+ }
152725
+
152726
+ // interlink polygon nodes in z-order
152727
+ function indexCurve(start, minX, minY, invSize) {
152728
+ var p = start;
152729
+ do {
152730
+ if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);
152731
+ p.prevZ = p.prev;
152732
+ p.nextZ = p.next;
152733
+ p = p.next;
152734
+ } while (p !== start);
152735
+
152736
+ p.prevZ.nextZ = null;
152737
+ p.prevZ = null;
152738
+
152739
+ sortLinked(p);
152740
+ }
152741
+
152742
+ // Simon Tatham's linked list merge sort algorithm
152743
+ // http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html
152744
+ function sortLinked(list) {
152745
+ var i, p, q, e, tail, numMerges, pSize, qSize,
152746
+ inSize = 1;
152747
+
152748
+ do {
152749
+ p = list;
152750
+ list = null;
152751
+ tail = null;
152752
+ numMerges = 0;
152753
+
152754
+ while (p) {
152755
+ numMerges++;
152756
+ q = p;
152757
+ pSize = 0;
152758
+ for (i = 0; i < inSize; i++) {
152759
+ pSize++;
152760
+ q = q.nextZ;
152761
+ if (!q) break;
152762
+ }
152763
+ qSize = inSize;
152764
+
152765
+ while (pSize > 0 || (qSize > 0 && q)) {
152766
+
152767
+ if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {
152768
+ e = p;
152769
+ p = p.nextZ;
152770
+ pSize--;
152771
+ } else {
152772
+ e = q;
152773
+ q = q.nextZ;
152774
+ qSize--;
152775
+ }
152776
+
152777
+ if (tail) tail.nextZ = e;
152778
+ else list = e;
152779
+
152780
+ e.prevZ = tail;
152781
+ tail = e;
152782
+ }
152783
+
152784
+ p = q;
152785
+ }
152786
+
152787
+ tail.nextZ = null;
152788
+ inSize *= 2;
152789
+
152790
+ } while (numMerges > 1);
152791
+
152792
+ return list;
152793
+ }
152794
+
152795
+ // z-order of a point given coords and inverse of the longer side of data bbox
152796
+ function zOrder(x, y, minX, minY, invSize) {
152797
+ // coords are transformed into non-negative 15-bit integer range
152798
+ x = 32767 * (x - minX) * invSize;
152799
+ y = 32767 * (y - minY) * invSize;
152800
+
152801
+ x = (x | (x << 8)) & 0x00FF00FF;
152802
+ x = (x | (x << 4)) & 0x0F0F0F0F;
152803
+ x = (x | (x << 2)) & 0x33333333;
152804
+ x = (x | (x << 1)) & 0x55555555;
152805
+
152806
+ y = (y | (y << 8)) & 0x00FF00FF;
152807
+ y = (y | (y << 4)) & 0x0F0F0F0F;
152808
+ y = (y | (y << 2)) & 0x33333333;
152809
+ y = (y | (y << 1)) & 0x55555555;
152810
+
152811
+ return x | (y << 1);
152812
+ }
152813
+
152814
+ // find the leftmost node of a polygon ring
152815
+ function getLeftmost(start) {
152816
+ var p = start,
152817
+ leftmost = start;
152818
+ do {
152819
+ if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;
152820
+ p = p.next;
152821
+ } while (p !== start);
152822
+
152823
+ return leftmost;
152824
+ }
152825
+
152826
+ // check if a point lies within a convex triangle
152827
+ function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
152828
+ return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&
152829
+ (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&
152830
+ (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;
152831
+ }
152832
+
152833
+ // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
152834
+ function isValidDiagonal(a, b) {
152835
+ return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges
152836
+ (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible
152837
+ (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors
152838
+ equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case
152839
+ }
152840
+
152841
+ // signed area of a triangle
152842
+ function area(p, q, r) {
152843
+ return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
152844
+ }
152845
+
152846
+ // check if two points are equal
152847
+ function equals(p1, p2) {
152848
+ return p1.x === p2.x && p1.y === p2.y;
152849
+ }
152850
+
152851
+ // check if two segments intersect
152852
+ function intersects(p1, q1, p2, q2) {
152853
+ var o1 = sign(area(p1, q1, p2));
152854
+ var o2 = sign(area(p1, q1, q2));
152855
+ var o3 = sign(area(p2, q2, p1));
152856
+ var o4 = sign(area(p2, q2, q1));
152857
+
152858
+ if (o1 !== o2 && o3 !== o4) return true; // general case
152859
+
152860
+ if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1
152861
+ if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1
152862
+ if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2
152863
+ if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2
152864
+
152865
+ return false;
152866
+ }
152867
+
152868
+ // for collinear points p, q, r, check if point q lies on segment pr
152869
+ function onSegment(p, q, r) {
152870
+ 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);
152871
+ }
152872
+
152873
+ function sign(num) {
152874
+ return num > 0 ? 1 : num < 0 ? -1 : 0;
152875
+ }
152876
+
152877
+ // check if a polygon diagonal intersects any polygon segments
152878
+ function intersectsPolygon(a, b) {
152879
+ var p = a;
152880
+ do {
152881
+ if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&
152882
+ intersects(p, p.next, a, b)) return true;
152883
+ p = p.next;
152884
+ } while (p !== a);
152885
+
152886
+ return false;
152887
+ }
152888
+
152889
+ // check if a polygon diagonal is locally inside the polygon
152890
+ function locallyInside(a, b) {
152891
+ return area(a.prev, a, a.next) < 0 ?
152892
+ area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :
152893
+ area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;
152894
+ }
152895
+
152896
+ // check if the middle point of a polygon diagonal is inside the polygon
152897
+ function middleInside(a, b) {
152898
+ var p = a,
152899
+ inside = false,
152900
+ px = (a.x + b.x) / 2,
152901
+ py = (a.y + b.y) / 2;
152902
+ do {
152903
+ if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&
152904
+ (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))
152905
+ inside = !inside;
152906
+ p = p.next;
152907
+ } while (p !== a);
152908
+
152909
+ return inside;
152910
+ }
152911
+
152912
+ // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;
152913
+ // if one belongs to the outer ring and another to a hole, it merges it into a single ring
152914
+ function splitPolygon(a, b) {
152915
+ var a2 = new Node(a.i, a.x, a.y),
152916
+ b2 = new Node(b.i, b.x, b.y),
152917
+ an = a.next,
152918
+ bp = b.prev;
152919
+
152920
+ a.next = b;
152921
+ b.prev = a;
152922
+
152923
+ a2.next = an;
152924
+ an.prev = a2;
152925
+
152926
+ b2.next = a2;
152927
+ a2.prev = b2;
152928
+
152929
+ bp.next = b2;
152930
+ b2.prev = bp;
152931
+
152932
+ return b2;
152933
+ }
152934
+
152935
+ // create a node and optionally link it with previous one (in a circular doubly linked list)
152936
+ function insertNode(i, x, y, last) {
152937
+ var p = new Node(i, x, y);
152938
+
152939
+ if (!last) {
152940
+ p.prev = p;
152941
+ p.next = p;
152942
+
152943
+ } else {
152944
+ p.next = last.next;
152945
+ p.prev = last;
152946
+ last.next.prev = p;
152947
+ last.next = p;
152948
+ }
152949
+ return p;
152950
+ }
152951
+
152952
+ function removeNode(p) {
152953
+ p.next.prev = p.prev;
152954
+ p.prev.next = p.next;
152955
+
152956
+ if (p.prevZ) p.prevZ.nextZ = p.nextZ;
152957
+ if (p.nextZ) p.nextZ.prevZ = p.prevZ;
152958
+ }
152959
+
152960
+ function Node(i, x, y) {
152961
+ // vertex index in coordinates array
152962
+ this.i = i;
152963
+
152964
+ // vertex coordinates
152965
+ this.x = x;
152966
+ this.y = y;
152967
+
152968
+ // previous and next vertex nodes in a polygon ring
152969
+ this.prev = null;
152970
+ this.next = null;
152971
+
152972
+ // z-order curve value
152973
+ this.z = null;
152974
+
152975
+ // previous and next nodes in z-order
152976
+ this.prevZ = null;
152977
+ this.nextZ = null;
152978
+
152979
+ // indicates whether this is a steiner point
152980
+ this.steiner = false;
152981
+ }
152982
+
152983
+ // return a percentage difference between the polygon area and its triangulation area;
152984
+ // used to verify correctness of triangulation
152985
+ earcut.deviation = function (data, holeIndices, dim, triangles) {
152986
+ var hasHoles = holeIndices && holeIndices.length;
152987
+ var outerLen = hasHoles ? holeIndices[0] * dim : data.length;
152988
+
152989
+ var polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));
152990
+ if (hasHoles) {
152991
+ for (var i = 0, len = holeIndices.length; i < len; i++) {
152992
+ var start = holeIndices[i] * dim;
152993
+ var end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;
152994
+ polygonArea -= Math.abs(signedArea(data, start, end, dim));
152995
+ }
152996
+ }
152997
+
152998
+ var trianglesArea = 0;
152999
+ for (i = 0; i < triangles.length; i += 3) {
153000
+ var a = triangles[i] * dim;
153001
+ var b = triangles[i + 1] * dim;
153002
+ var c = triangles[i + 2] * dim;
153003
+ trianglesArea += Math.abs(
153004
+ (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -
153005
+ (data[a] - data[b]) * (data[c + 1] - data[a + 1]));
153006
+ }
153007
+
153008
+ return polygonArea === 0 && trianglesArea === 0 ? 0 :
153009
+ Math.abs((trianglesArea - polygonArea) / polygonArea);
153010
+ };
153011
+
153012
+ function signedArea(data, start, end, dim) {
153013
+ var sum = 0;
153014
+ for (var i = start, j = end - dim; i < end; i += dim) {
153015
+ sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);
153016
+ j = i;
153017
+ }
153018
+ return sum;
153019
+ }
153020
+
153021
+ // turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts
153022
+ earcut.flatten = function (data) {
153023
+ var dim = data[0][0].length,
153024
+ result = {vertices: [], holes: [], dimensions: dim},
153025
+ holeIndex = 0;
153026
+
153027
+ for (var i = 0; i < data.length; i++) {
153028
+ for (var j = 0; j < data[i].length; j++) {
153029
+ for (var d = 0; d < dim; d++) result.vertices.push(data[i][j][d]);
153030
+ }
153031
+ if (i > 0) {
153032
+ holeIndex += data[i - 1].length;
153033
+ result.holes.push(holeIndex);
153034
+ }
153035
+ }
153036
+ return result;
153037
+ };
153038
+
153039
+ const tempVec2a = math.vec2();
153040
+ const tempVec3a = math.vec3();
153041
+ const tempVec3b = math.vec3();
153042
+ const tempVec3c = math.vec3();
153043
+
153044
+ /**
153045
+ * {@link Viewer} plugin that loads models from CityJSON files.
153046
+ *
153047
+ * <a href="https://xeokit.github.io/xeokit-sdk/examples/#loading_CityJSONLoaderPlugin_Railway"><img src="https://xeokit.io/img/docs/CityJSONLoaderPlugin/CityJSONLoaderPlugin.png"></a>
153048
+ *
153049
+ * [[Run this example](https://xeokit.github.io/xeokit-sdk/examples/#loading_CityJSONLoaderPlugin_Railway)]
153050
+ *
153051
+ * ## Overview
153052
+ *
153053
+ * * Loads small-to-medium sized models directly from [CityJSON 1.0.0](https://www.cityjson.org/specs/1.0.0/) files.
153054
+ * * Not recommended for large models. For best performance with large CityJSON datasets, we recommend using {@link XKTLoaderPlugin}.
153055
+ * * Loads double-precision coordinates, enabling models to be viewed at global coordinates without accuracy loss.
153056
+ * * Allows to set the position, scale and rotation of each model as you load it.
153057
+ *
153058
+ * ## Limitations
153059
+ *
153060
+ * Loading and parsing huge CityJSON files can be slow, and can overwhelm the browser, however. To view your
153061
+ * largest CityJSON models, we recommend instead pre-converting those to xeokit's compressed native .XKT format, then
153062
+ * loading them with {@link XKTLoaderPlugin} instead.</p>
153063
+ *
153064
+ * ## Scene representation
153065
+ *
153066
+ * When loading a model, CityJSONLoaderPlugin creates an {@link Entity} that represents the model, which
153067
+ * will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id}
153068
+ * in {@link Scene#models}. The CityJSONLoaderPlugin also creates an {@link Entity} for each object within the
153069
+ * model. Those Entities will have {@link Entity#isObject} set ````true```` and will be registered
153070
+ * by {@link Entity#id} in {@link Scene#objects}.
153071
+ *
153072
+ * ## Metadata
153073
+ *
153074
+ * When loading a model, CityJSONLoaderPlugin also creates a {@link MetaModel} that represents the model, which contains
153075
+ * a tree of {@link MetaObject}s that represent the CityJSON objects. .
153076
+ *
153077
+ * ## Usage
153078
+ *
153079
+ * In the example below we'll load the LOD 3 Railway model from
153080
+ * a [CityJSON file](https://github.com/xeokit/xeokit-sdk/tree/master/assets/models/cityjson/LoD3_Railway.json). Within
153081
+ * our {@link Viewer}, this will create a bunch of {@link Entity}s that represents the model and its objects, along with
153082
+ * a {@link MetaModel} and {@link MetaObject}s that hold their metadata.
153083
+ *
153084
+ * We'll also scale our model to half its size, rotate it 90 degrees about its local X-axis, then
153085
+ * translate it 100 units along its X axis.
153086
+ *
153087
+ * * [[Run example](https://xeokit.github.io/xeokit-sdk/examples/#loading_CityJSONLoaderPlugin_Railway)]
153088
+ *
153089
+ * ````javascript
153090
+ * import {Viewer, CityJSONLoaderPlugin} from "xeokit-sdk.es.js";
153091
+ *
153092
+ * const viewer = new Viewer({
153093
+ * canvasId: "myCanvas",
153094
+ * transparent: true
153095
+ * });
153096
+ *
153097
+ * viewer.scene.camera.eye = [14.915582703146043, 14.396781491179095, 5.431098754133695];
153098
+ * viewer.scene.camera.look = [6.599999999999998, 8.34099990051474, -4.159999575600315];
153099
+ * viewer.scene.camera.up = [-0.2820584034861215, 0.9025563895259413, -0.3253229483893775];
153100
+ *
153101
+ * const cityJSONLoader = new CityJSONLoaderPlugin(viewer);
153102
+ *
153103
+ * const model = cityJSONLoader.load({ // Returns an Entity that represents the model
153104
+ * id: "myModel1",
153105
+ * src: "../assets/models/cityjson/LoD3_Railway.json",
153106
+ * saoEnabled: true,
153107
+ * edges: false,
153108
+ * rotation: [-90,0,0],
153109
+ * scale: [0.5, 0.5, 0.5],
153110
+ * origin: [100, 0, 0]
153111
+ * });
153112
+ * ````
153113
+ *
153114
+ * ## Configuring a custom data source
153115
+ *
153116
+ * By default, CityJSONLoaderPlugin will load CityJSON files over HTTP.
153117
+ *
153118
+ * In the example below, we'll customize the way CityJSONLoaderPlugin loads the files by configuring it with our own data source
153119
+ * object. For simplicity, our custom data source example also uses HTTP, using a couple of xeokit utility functions.
153120
+ *
153121
+ * ````javascript
153122
+ * import {utils} from "xeokit-sdk.es.js";
153123
+ *
153124
+ * class MyDataSource {
153125
+ *
153126
+ * constructor() {
153127
+ * }
153128
+ *
153129
+ * getCityJSON(src, ok, error) {
153130
+ * console.log("MyDataSource#getCityJSON(" + CityJSONSrc + ", ... )");
153131
+ * utils.loadJSON(src,
153132
+ * (cityJSON) => {
153133
+ * ok(cityJSON);
153134
+ * },
153135
+ * function (errMsg) {
153136
+ * error(errMsg);
153137
+ * });
153138
+ * }
153139
+ * }
153140
+ * ````
153141
+ *
153142
+ * @class CityJSONLoaderPlugin
153143
+ * @since 2.0.13
153144
+ */
153145
+ class CityJSONLoaderPlugin extends Plugin {
153146
+
153147
+ /**
153148
+ * @constructor
153149
+ *
153150
+ * @param {Viewer} viewer The Viewer.
153151
+ * @param {Object} cfg Plugin configuration.
153152
+ * @param {String} [cfg.id="cityJSONLoader"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
153153
+ * @param {Object} [cfg.dataSource] A custom data source through which the CityJSONLoaderPlugin can load model and
153154
+ * metadata files. Defaults to an instance of {@link CityJSONDefaultDataSource}, which loads over HTTP.
153155
+ */
153156
+ constructor(viewer, cfg = {}) {
153157
+
153158
+ super("cityJSONLoader", viewer, cfg);
153159
+
153160
+ this.dataSource = cfg.dataSource;
153161
+ }
153162
+
153163
+ /**
153164
+ * Gets the custom data source through which the CityJSONLoaderPlugin can load CityJSON files.
153165
+ *
153166
+ * Default value is {@link CityJSONDefaultDataSource}, which loads via HTTP.
153167
+ *
153168
+ * @type {Object}
153169
+ */
153170
+ get dataSource() {
153171
+ return this._dataSource;
153172
+ }
153173
+
153174
+ /**
153175
+ * Sets a custom data source through which the CityJSONLoaderPlugin can load CityJSON files.
153176
+ *
153177
+ * Default value is {@link CityJSONDefaultDataSource}, which loads via HTTP.
153178
+ *
153179
+ * @type {Object}
153180
+ */
153181
+ set dataSource(value) {
153182
+ this._dataSource = value || new CityJSONDefaultDataSource();
153183
+ }
153184
+
153185
+ /**
153186
+ * Loads an ````CityJSON```` model into this CityJSONLoaderPlugin's {@link Viewer}.
153187
+ *
153188
+ * @param {*} params Loading parameters.
153189
+ * @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.
153190
+ * @param {String} [params.src] Path to a CityJSON file, as an alternative to the ````cityJSON```` parameter.
153191
+ * @param {ArrayBuffer} [params.cityJSON] The CityJSON file data, as an alternative to the ````src```` parameter.
153192
+ * @param {Boolean} [params.loadMetadata=true] Whether to load metadata on CityJSON objects.
153193
+ * @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.
153194
+ * @param {Number[]} [params.position=[0,0,0]] The model single-precision 3D position, relative to the ````origin```` parameter.
153195
+ * @param {Number[]} [params.scale=[1,1,1]] The model's scale.
153196
+ * @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.
153197
+ * @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````.
153198
+ * @param {Object} [params.stats] Collects model statistics.
153199
+ * @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}.
153200
+ */
153201
+ load(params = {}) {
153202
+
153203
+ if (params.id && this.viewer.scene.components[params.id]) {
153204
+ this.error("Component with this ID already exists in viewer: " + params.id + " - will autogenerate this ID");
153205
+ delete params.id;
153206
+ }
153207
+
153208
+ const performanceModel = new PerformanceModel(this.viewer.scene, utils.apply(params, {
153209
+ isModel: true
153210
+ }));
153211
+
153212
+ if (!params.src && !params.cityJSON) {
153213
+ this.error("load() param expected: src or cityJSON");
153214
+ return performanceModel; // Return new empty model
153215
+ }
153216
+
153217
+ const options = {};
153218
+
153219
+ if (params.src) {
153220
+ this._loadModel(params.src, params, options, performanceModel);
153221
+ } else {
153222
+ const spinner = this.viewer.scene.canvas.spinner;
153223
+ spinner.processes++;
153224
+ this._parseModel(params.cityJSON, params, options, performanceModel);
153225
+ spinner.processes--;
153226
+ }
153227
+
153228
+ return performanceModel;
153229
+ }
153230
+
153231
+ _loadModel(src, params, options, performanceModel) {
153232
+ const spinner = this.viewer.scene.canvas.spinner;
153233
+ spinner.processes++;
153234
+ this._dataSource.getCityJSON(params.src, (data) => {
153235
+ this._parseModel(data, params, options, performanceModel);
153236
+ spinner.processes--;
153237
+ },
153238
+ (errMsg) => {
153239
+ spinner.processes--;
153240
+ this.error(errMsg);
153241
+ performanceModel.fire("error", errMsg);
153242
+ });
153243
+ }
153244
+
153245
+ _parseModel(data, params, options, performanceModel) {
153246
+
153247
+ if (performanceModel.destroyed) {
153248
+ return;
153249
+ }
153250
+
153251
+ const vertices = data.transform ? this._transformVertices(data.vertices, data.transform, options.rotateX) : data.vertices;
153252
+
153253
+ const stats = params.stats || {};
153254
+ stats.sourceFormat = data.type || "CityJSON";
153255
+ stats.schemaVersion = data.version || "";
153256
+ stats.title = "";
153257
+ stats.author = "";
153258
+ stats.created = "";
153259
+ stats.numMetaObjects = 0;
153260
+ stats.numPropertySets = 0;
153261
+ stats.numObjects = 0;
153262
+ stats.numGeometries = 0;
153263
+ stats.numTriangles = 0;
153264
+ stats.numVertices = 0;
153265
+
153266
+ const loadMetadata = (params.loadMetadata !== false);
153267
+
153268
+ const rootMetaObject = loadMetadata ? {
153269
+ id: math.createUUID(),
153270
+ name: "Model",
153271
+ type: "Model"
153272
+ } : null;
153273
+
153274
+ const metadata = loadMetadata ? {
153275
+ id: "",
153276
+ projectId: "",
153277
+ author: "",
153278
+ createdAt: "",
153279
+ schema: data.version || "",
153280
+ creatingApplication: "",
153281
+ metaObjects: [rootMetaObject],
153282
+ propertySets: []
153283
+ } : null;
153284
+
153285
+ const ctx = {
153286
+ data,
153287
+ vertices,
153288
+ performanceModel,
153289
+ loadMetadata,
153290
+ metadata,
153291
+ rootMetaObject,
153292
+ nextId: 0,
153293
+ stats
153294
+ };
153295
+
153296
+ this._parseCityJSON(ctx);
153297
+
153298
+ performanceModel.finalize();
153299
+
153300
+ if (loadMetadata) {
153301
+ const metaModelId = performanceModel.id;
153302
+ this.viewer.metaScene.createMetaModel(metaModelId, ctx.metadata, options);
153303
+ }
153304
+
153305
+ performanceModel.scene.once("tick", () => {
153306
+ if (performanceModel.destroyed) {
153307
+ return;
153308
+ }
153309
+ performanceModel.scene.fire("modelLoaded", performanceModel.id); // FIXME: Assumes listeners know order of these two events
153310
+ performanceModel.fire("loaded", true, false); // Don't forget the event, for late subscribers
153311
+ });
153312
+ }
153313
+
153314
+ _transformVertices(vertices, transform, rotateX) {
153315
+ const transformedVertices = [];
153316
+ const scale = transform.scale || math.vec3([1, 1, 1]);
153317
+ const translate = transform.translate || math.vec3([0, 0, 0]);
153318
+ for (let i = 0, j = 0; i < vertices.length; i++, j += 3) {
153319
+ const x = (vertices[i][0] * scale[0]) + translate[0];
153320
+ const y = (vertices[i][1] * scale[1]) + translate[1];
153321
+ const z = (vertices[i][2] * scale[2]) + translate[2];
153322
+ if (rotateX) {
153323
+ transformedVertices.push([x, z, y]);
153324
+ } else {
153325
+ transformedVertices.push([x, y, z]);
153326
+ }
153327
+ }
153328
+ return transformedVertices;
153329
+ }
153330
+
153331
+ _parseCityJSON(ctx) {
153332
+ const data = ctx.data;
153333
+ const cityObjects = data.CityObjects;
153334
+ for (const objectId in cityObjects) {
153335
+ if (cityObjects.hasOwnProperty(objectId)) {
153336
+ const cityObject = cityObjects[objectId];
153337
+ this._parseCityObject(ctx, cityObject, objectId);
153338
+ }
153339
+ }
153340
+ }
153341
+
153342
+ _parseCityObject(ctx, cityObject, objectId) {
153343
+
153344
+ const performanceModel = ctx.performanceModel;
153345
+ const data = ctx.data;
153346
+
153347
+ if (ctx.loadMetadata) {
153348
+
153349
+ const metaObjectId = objectId;
153350
+ const metaObjectType = cityObject.type;
153351
+ const metaObjectName = metaObjectType + " : " + objectId;
153352
+ const parentMetaObjectId = cityObject.parents ? cityObject.parents[0] : ctx.rootMetaObject.id;
153353
+
153354
+ ctx.metadata.metaObjects.push({
153355
+ id: metaObjectId,
153356
+ name: metaObjectName,
153357
+ type: metaObjectType,
153358
+ parent: parentMetaObjectId
153359
+ });
153360
+ }
153361
+
153362
+ ctx.stats.numMetaObjects++;
153363
+
153364
+ if (!(cityObject.geometry && cityObject.geometry.length > 0)) {
153365
+ return;
153366
+ }
153367
+
153368
+ const meshIds = [];
153369
+
153370
+ for (let i = 0, len = cityObject.geometry.length; i < len; i++) {
153371
+
153372
+ const geometry = cityObject.geometry[i];
153373
+
153374
+ let objectMaterial;
153375
+ let surfaceMaterials;
153376
+
153377
+ const appearance = data.appearance;
153378
+ if (appearance) {
153379
+ const materials = appearance.materials;
153380
+ if (materials) {
153381
+ const geometryMaterial = geometry.material;
153382
+ if (geometryMaterial) {
153383
+ const themeIds = Object.keys(geometryMaterial);
153384
+ if (themeIds.length > 0) {
153385
+ const themeId = themeIds[0];
153386
+ const theme = geometryMaterial[themeId];
153387
+ if (theme.value !== undefined) {
153388
+ objectMaterial = materials[theme.value];
153389
+ } else {
153390
+ const values = theme.values;
153391
+ if (values) {
153392
+ surfaceMaterials = [];
153393
+ for (let j = 0, lenj = values.length; j < lenj; j++) {
153394
+ const value = values[i];
153395
+ const surfaceMaterial = materials[value];
153396
+ surfaceMaterials.push(surfaceMaterial);
153397
+ }
153398
+ }
153399
+ }
153400
+ }
153401
+ }
153402
+ }
153403
+ }
153404
+
153405
+ if (surfaceMaterials) {
153406
+ this._parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds);
153407
+
153408
+ } else {
153409
+ this._parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds);
153410
+ }
153411
+ }
153412
+
153413
+ if (meshIds.length > 0) {
153414
+ performanceModel.createEntity({
153415
+ id: objectId,
153416
+ meshIds: meshIds,
153417
+ isObject: true
153418
+ });
153419
+
153420
+ ctx.stats.numObjects++;
153421
+ }
153422
+ }
153423
+
153424
+ _parseGeometrySurfacesWithOwnMaterials(ctx, geometry, surfaceMaterials, meshIds) {
153425
+
153426
+ const geomType = geometry.type;
153427
+
153428
+ switch (geomType) {
153429
+
153430
+ case "MultiPoint":
153431
+ break;
153432
+
153433
+ case "MultiLineString":
153434
+ break;
153435
+
153436
+ case "MultiSurface":
153437
+
153438
+ case "CompositeSurface":
153439
+ const surfaces = geometry.boundaries;
153440
+ this._parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);
153441
+ break;
153442
+
153443
+ case "Solid":
153444
+ const shells = geometry.boundaries;
153445
+ for (let j = 0; j < shells.length; j++) {
153446
+ const surfaces = shells[j];
153447
+ this._parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);
153448
+ }
153449
+ break;
153450
+
153451
+ case "MultiSolid":
153452
+
153453
+ case "CompositeSolid":
153454
+ const solids = geometry.boundaries;
153455
+ for (let j = 0; j < solids.length; j++) {
153456
+ for (let k = 0; k < solids[j].length; k++) {
153457
+ const surfaces = solids[j][k];
153458
+ this._parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds);
153459
+ }
153460
+ }
153461
+ break;
153462
+ }
153463
+ }
153464
+
153465
+ _parseSurfacesWithOwnMaterials(ctx, surfaceMaterials, surfaces, meshIds) {
153466
+
153467
+ const vertices = ctx.vertices;
153468
+ const performanceModel = ctx.performanceModel;
153469
+
153470
+ for (let i = 0; i < surfaces.length; i++) {
153471
+
153472
+ const surface = surfaces[i];
153473
+ const surfaceMaterial = surfaceMaterials[i] || {diffuseColor: [0.8, 0.8, 0.8], transparency: 1.0};
153474
+
153475
+ const face = [];
153476
+ const holes = [];
153477
+
153478
+ const sharedIndices = [];
153479
+
153480
+ const geometryCfg = {
153481
+ positions: [],
153482
+ indices: []
153483
+ };
153484
+
153485
+ for (let j = 0; j < surface.length; j++) {
153486
+
153487
+ if (face.length > 0) {
153488
+ holes.push(face.length);
153489
+ }
153490
+
153491
+ const newFace = this._extractLocalIndices(ctx, surface[j], sharedIndices, geometryCfg);
153492
+
153493
+ face.push(...newFace);
153494
+ }
153495
+
153496
+ if (face.length === 3) { // Triangle
153497
+
153498
+ geometryCfg.indices.push(face[0]);
153499
+ geometryCfg.indices.push(face[1]);
153500
+ geometryCfg.indices.push(face[2]);
153501
+
153502
+ } else if (face.length > 3) { // Polygon
153503
+
153504
+ // Prepare to triangulate
153505
+
153506
+ const pList = [];
153507
+
153508
+ for (let k = 0; k < face.length; k++) {
153509
+ pList.push({
153510
+ x: vertices[sharedIndices[face[k]]][0],
153511
+ y: vertices[sharedIndices[face[k]]][1],
153512
+ z: vertices[sharedIndices[face[k]]][2]
153513
+ });
153514
+ }
153515
+
153516
+ const normal = this._getNormalOfPositions(pList, math.vec3());
153517
+
153518
+ // Convert to 2D
153519
+
153520
+ let pv = [];
153521
+
153522
+ for (let k = 0; k < pList.length; k++) {
153523
+
153524
+ this._to2D(pList[k], normal, tempVec2a);
153525
+
153526
+ pv.unshift(tempVec2a[0]);
153527
+ pv.unshift(tempVec2a[1]);
153528
+ }
153529
+
153530
+ // Triangulate
153531
+
153532
+ const tr = earcut(pv, holes, 2);
153533
+
153534
+ // Create triangles
153535
+
153536
+ for (let k = 0; k < tr.length; k += 3) {
153537
+ geometryCfg.indices.unshift(face[tr[k]]);
153538
+ geometryCfg.indices.unshift(face[tr[k + 1]]);
153539
+ geometryCfg.indices.unshift(face[tr[k + 2]]);
153540
+ }
153541
+ }
153542
+
153543
+ const meshId = "" + ctx.nextId++;
153544
+
153545
+ performanceModel.createMesh({
153546
+ id: meshId,
153547
+ primitive: "triangles",
153548
+ positions: geometryCfg.positions,
153549
+ indices: geometryCfg.indices,
153550
+ color: (surfaceMaterial && surfaceMaterial.diffuseColor) ? surfaceMaterial.diffuseColor : [0.8, 0.8, 0.8],
153551
+ opacity: (surfaceMaterial && surfaceMaterial.transparency !== undefined) ? (1.0 - surfaceMaterial.transparency) : 1.0
153552
+ });
153553
+
153554
+ meshIds.push(meshId);
153555
+
153556
+ ctx.stats.numGeometries++;
153557
+ ctx.stats.numVertices += geometryCfg.positions.length / 3;
153558
+ ctx.stats.numTriangles += geometryCfg.indices.length / 3;
153559
+ }
153560
+ }
153561
+
153562
+ _parseGeometrySurfacesWithSharedMaterial(ctx, geometry, objectMaterial, meshIds) {
153563
+
153564
+ const performanceModel = ctx.performanceModel;
153565
+ const sharedIndices = [];
153566
+ const geometryCfg = {
153567
+ positions: [],
153568
+ indices: []
153569
+ };
153570
+
153571
+ const geomType = geometry.type;
153572
+
153573
+ switch (geomType) {
153574
+ case "MultiPoint":
153575
+ break;
153576
+
153577
+ case "MultiLineString":
153578
+ break;
153579
+
153580
+ case "MultiSurface":
153581
+ case "CompositeSurface":
153582
+ const surfaces = geometry.boundaries;
153583
+ this._parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);
153584
+ break;
153585
+
153586
+ case "Solid":
153587
+ const shells = geometry.boundaries;
153588
+ for (let j = 0; j < shells.length; j++) {
153589
+ const surfaces = shells[j];
153590
+ this._parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);
153591
+ }
153592
+ break;
153593
+
153594
+ case "MultiSolid":
153595
+ case "CompositeSolid":
153596
+ const solids = geometry.boundaries;
153597
+ for (let j = 0; j < solids.length; j++) {
153598
+ for (let k = 0; k < solids[j].length; k++) {
153599
+ const surfaces = solids[j][k];
153600
+ this._parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, geometryCfg);
153601
+ }
153602
+ }
153603
+ break;
153604
+ }
153605
+
153606
+ if (geometryCfg.positions.length > 0 && geometryCfg.indices.length > 0) {
153607
+
153608
+ const meshId = "" + ctx.nextId++;
153609
+
153610
+ performanceModel.createMesh({
153611
+ id: meshId,
153612
+ primitive: "triangles",
153613
+ positions: geometryCfg.positions,
153614
+ indices: geometryCfg.indices,
153615
+ color: (objectMaterial && objectMaterial.diffuseColor) ? objectMaterial.diffuseColor : [0.8, 0.8, 0.8],
153616
+ opacity: 1.0
153617
+ //opacity: (objectMaterial && objectMaterial.transparency !== undefined) ? (1.0 - objectMaterial.transparency) : 1.0
153618
+ });
153619
+
153620
+ meshIds.push(meshId);
153621
+
153622
+ ctx.stats.numGeometries++;
153623
+ ctx.stats.numVertices += geometryCfg.positions.length / 3;
153624
+ ctx.stats.numTriangles += geometryCfg.indices.length / 3;
153625
+ }
153626
+ }
153627
+
153628
+ _parseSurfacesWithSharedMaterial(ctx, surfaces, sharedIndices, primitiveCfg) {
153629
+
153630
+ const vertices = ctx.vertices;
153631
+
153632
+ for (let i = 0; i < surfaces.length; i++) {
153633
+
153634
+ let boundary = [];
153635
+ let holes = [];
153636
+
153637
+ for (let j = 0; j < surfaces[i].length; j++) {
153638
+ if (boundary.length > 0) {
153639
+ holes.push(boundary.length);
153640
+ }
153641
+ const newBoundary = this._extractLocalIndices(ctx, surfaces[i][j], sharedIndices, primitiveCfg);
153642
+ boundary.push(...newBoundary);
153643
+ }
153644
+
153645
+ if (boundary.length === 3) { // Triangle
153646
+
153647
+ primitiveCfg.indices.push(boundary[0]);
153648
+ primitiveCfg.indices.push(boundary[1]);
153649
+ primitiveCfg.indices.push(boundary[2]);
153650
+
153651
+ } else if (boundary.length > 3) { // Polygon
153652
+
153653
+ let pList = [];
153654
+
153655
+ for (let k = 0; k < boundary.length; k++) {
153656
+ pList.push({
153657
+ x: vertices[sharedIndices[boundary[k]]][0],
153658
+ y: vertices[sharedIndices[boundary[k]]][1],
153659
+ z: vertices[sharedIndices[boundary[k]]][2]
153660
+ });
153661
+ }
153662
+
153663
+ const normal = this._getNormalOfPositions(pList, math.vec3());
153664
+ let pv = [];
153665
+
153666
+ for (let k = 0; k < pList.length; k++) {
153667
+ this._to2D(pList[k], normal, tempVec2a);
153668
+ pv.unshift(tempVec2a[0]);
153669
+ pv.unshift(tempVec2a[1]);
153670
+ }
153671
+
153672
+ const tr = earcut(pv, holes, 2);
153673
+
153674
+ for (let k = 0; k < tr.length; k += 3) {
153675
+ primitiveCfg.indices.unshift(boundary[tr[k]]);
153676
+ primitiveCfg.indices.unshift(boundary[tr[k + 1]]);
153677
+ primitiveCfg.indices.unshift(boundary[tr[k + 2]]);
153678
+ }
153679
+ }
153680
+ }
153681
+ }
153682
+
153683
+ _extractLocalIndices(ctx, boundary, sharedIndices, geometryCfg) {
153684
+
153685
+ const vertices = ctx.vertices;
153686
+ const newBoundary = [];
153687
+
153688
+ for (let i = 0, len = boundary.length; i < len; i++) {
153689
+
153690
+ const index = boundary[i];
153691
+
153692
+ if (sharedIndices.includes(index)) {
153693
+ const vertexIndex = sharedIndices.indexOf(index);
153694
+ newBoundary.push(vertexIndex);
153695
+
153696
+ } else {
153697
+ geometryCfg.positions.push(vertices[index][0]);
153698
+ geometryCfg.positions.push(vertices[index][1]);
153699
+ geometryCfg.positions.push(vertices[index][2]);
153700
+
153701
+ newBoundary.push(sharedIndices.length);
153702
+
153703
+ sharedIndices.push(index);
153704
+ }
153705
+ }
153706
+
153707
+ return newBoundary
153708
+ }
153709
+
153710
+ _getNormalOfPositions(positions, normal) {
153711
+
153712
+ for (let i = 0; i < positions.length; i++) {
153713
+
153714
+ let nexti = i + 1;
153715
+ if (nexti === positions.length) {
153716
+ nexti = 0;
153717
+ }
153718
+
153719
+ normal[0] += ((positions[i].y - positions[nexti].y) * (positions[i].z + positions[nexti].z));
153720
+ normal[1] += ((positions[i].z - positions[nexti].z) * (positions[i].x + positions[nexti].x));
153721
+ normal[2] += ((positions[i].x - positions[nexti].x) * (positions[i].y + positions[nexti].y));
153722
+ }
153723
+
153724
+ return math.normalizeVec3(normal);
153725
+ }
153726
+
153727
+ _to2D(_p, _n, re) {
153728
+
153729
+ const p = tempVec3a;
153730
+ const n = tempVec3b;
153731
+ const x3 = tempVec3c;
153732
+
153733
+ p[0] = _p.x;
153734
+ p[1] = _p.y;
153735
+ p[2] = _p.z;
153736
+
153737
+ n[0] = _n.x;
153738
+ n[1] = _n.y;
153739
+ n[2] = _n.z;
153740
+
153741
+ x3[0] = 1.1;
153742
+ x3[1] = 1.1;
153743
+ x3[2] = 1.1;
153744
+
153745
+ const dist = math.lenVec3(math.subVec3(x3, n));
153746
+
153747
+ if (dist < 0.01) {
153748
+ x3[0] += 1.0;
153749
+ x3[1] += 2.0;
153750
+ x3[2] += 3.0;
153751
+ }
153752
+
153753
+ const dot = math.dotVec3(x3, n);
153754
+ const tmp2 = math.mulVec3Scalar(n, dot, math.vec3());
153755
+
153756
+ x3[0] -= tmp2[0];
153757
+ x3[1] -= tmp2[1];
153758
+ x3[2] -= tmp2[2];
153759
+
153760
+ math.normalizeVec3(x3);
153761
+
153762
+ const y3 = math.cross3Vec3(n, x3, math.vec3());
153763
+ const x = math.dotVec3(p, x3);
153764
+ const y = math.dotVec3(p, y3);
153765
+
153766
+ re[0] = x;
153767
+ re[1] = y;
153768
+ }
153769
+ }
153770
+
153771
+ export { AmbientLight, AngleMeasurementsPlugin, AnnotationsPlugin, AxisGizmoPlugin, BCFViewpointsPlugin, CameraMemento, CameraPath, CameraPathAnimation, CityJSONLoaderPlugin, Component, Configs, ContextMenu, CubicBezierCurve, Curve, DirLight, DistanceMeasurementsPlugin, EdgeMaterial, EmphasisMaterial, FastNavPlugin, Fresnel, GLTFDefaultDataSource, GLTFLoaderPlugin, ImagePlane, LASLoaderPlugin, LambertMaterial, LightMap, LocaleService, Map$1 as Map, Marker, Mesh, MetallicMaterial, ModelMemento, NavCubePlugin, Node$1 as Node, OBJLoaderPlugin, ObjectsMemento, Path, PerformanceModel, PhongMaterial, Plugin, PointLight, QuadraticBezierCurve, Queue, ReadableGeometry, ReflectionMap, STLDefaultDataSource, STLLoaderPlugin, SectionPlane, SectionPlanesPlugin, Skybox, SkyboxesPlugin, SpecularMaterial, SplineCurve, SpriteMarker, StoreyViewsPlugin, Texture, TreeViewPlugin, VBOGeometry, ViewCullPlugin, Viewer, WebIFCLoaderPlugin, XKTDefaultDataSource, XKTLoaderPlugin, XML3DLoaderPlugin, buildBoxGeometry, buildBoxLinesGeometry, buildCylinderGeometry, buildGridGeometry, buildPlaneGeometry, buildSphereGeometry, buildTorusGeometry, buildVectorTextGeometry, load3DSGeometry, loadOBJGeometry, math, stats, utils };