@xeokit/xeokit-sdk 2.4.0-alpha-2 → 2.4.0-alpha-4

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.
@@ -66540,6 +66540,116 @@ class SpriteMarker extends Marker {
66540
66540
  }
66541
66541
  }
66542
66542
 
66543
+ const tempVec3a$V = math.vec3();
66544
+ const tempVec3b$7 = math.vec3();
66545
+ const tempMat4a = math.mat4();
66546
+
66547
+ /**
66548
+ * @private
66549
+ */
66550
+ class FrustumPlane {
66551
+
66552
+ constructor() {
66553
+ this.normal = math.vec3();
66554
+ this.offset = 0;
66555
+ this.testVertex = math.vec3();
66556
+ }
66557
+
66558
+ set(nx, ny, nz, offset) {
66559
+ const s = 1.0 / Math.sqrt(nx * nx + ny * ny + nz * nz);
66560
+ this.normal[0] = nx * s;
66561
+ this.normal[1] = ny * s;
66562
+ this.normal[2] = nz * s;
66563
+ this.offset = offset * s;
66564
+ this.testVertex[0] = (this.normal[0] >= 0.0) ? 1 : 0;
66565
+ this.testVertex[1] = (this.normal[1] >= 0.0) ? 1 : 0;
66566
+ this.testVertex[2] = (this.normal[2] >= 0.0) ? 1 : 0;
66567
+ }
66568
+ }
66569
+
66570
+ /**
66571
+ * @private
66572
+ */
66573
+ class Frustum {
66574
+ constructor() {
66575
+ this.planes = [
66576
+ new FrustumPlane(), new FrustumPlane(), new FrustumPlane(),
66577
+ new FrustumPlane(), new FrustumPlane(), new FrustumPlane()
66578
+ ];
66579
+ }
66580
+ }
66581
+
66582
+ Frustum.INSIDE = 0;
66583
+ Frustum.INTERSECT = 1;
66584
+ Frustum.OUTSIDE = 2;
66585
+
66586
+ /** @private */
66587
+ function setFrustum(frustum, viewMat, projMat) {
66588
+
66589
+ const m = math.mulMat4(projMat, viewMat, tempMat4a);
66590
+
66591
+ const m0 = m[0];
66592
+ const m1 = m[1];
66593
+ const m2 = m[2];
66594
+ const m3 = m[3];
66595
+ const m4 = m[4];
66596
+ const m5 = m[5];
66597
+ const m6 = m[6];
66598
+ const m7 = m[7];
66599
+ const m8 = m[8];
66600
+ const m9 = m[9];
66601
+ const m10 = m[10];
66602
+ const m11 = m[11];
66603
+ const m12 = m[12];
66604
+ const m13 = m[13];
66605
+ const m14 = m[14];
66606
+ const m15 = m[15];
66607
+
66608
+ frustum.planes[0].set(m3 - m0, m7 - m4, m11 - m8, m15 - m12);
66609
+ frustum.planes[1].set(m3 + m0, m7 + m4, m11 + m8, m15 + m12);
66610
+ frustum.planes[2].set(m3 - m1, m7 - m5, m11 - m9, m15 - m13);
66611
+ frustum.planes[3].set(m3 + m1, m7 + m5, m11 + m9, m15 + m13);
66612
+ frustum.planes[4].set(m3 - m2, m7 - m6, m11 - m10, m15 - m14);
66613
+ frustum.planes[5].set(m3 + m2, m7 + m6, m11 + m10, m15 + m14);
66614
+ }
66615
+
66616
+ /** @private */
66617
+ function frustumIntersectsAABB3(frustum, aabb) {
66618
+
66619
+ let ret = Frustum.INSIDE;
66620
+
66621
+ const min = tempVec3a$V;
66622
+ const max = tempVec3b$7;
66623
+
66624
+ min[0] = aabb[0];
66625
+ min[1] = aabb[1];
66626
+ min[2] = aabb[2];
66627
+ max[0] = aabb[3];
66628
+ max[1] = aabb[4];
66629
+ max[2] = aabb[5];
66630
+
66631
+ const bminmax = [min, max];
66632
+
66633
+ for (let i = 0; i < 6; ++i) {
66634
+ const plane = frustum.planes[i];
66635
+ if (((plane.normal[0] * bminmax[plane.testVertex[0]][0]) +
66636
+ (plane.normal[1] * bminmax[plane.testVertex[1]][1]) +
66637
+ (plane.normal[2] * bminmax[plane.testVertex[2]][2]) +
66638
+ (plane.offset)) < 0.0) {
66639
+ return Frustum.OUTSIDE;
66640
+ }
66641
+
66642
+ if (((plane.normal[0] * bminmax[1 - plane.testVertex[0]][0]) +
66643
+ (plane.normal[1] * bminmax[1 - plane.testVertex[1]][1]) +
66644
+ (plane.normal[2] * bminmax[1 - plane.testVertex[2]][2]) +
66645
+ (plane.offset)) < 0.0) {
66646
+ ret = Frustum.INTERSECT;
66647
+ }
66648
+ }
66649
+
66650
+ return ret;
66651
+ }
66652
+
66543
66653
  /**
66544
66654
  * @desc Saves and restores the state of a {@link Scene}'s {@link Camera}.
66545
66655
  *
@@ -69090,7 +69200,7 @@ const RENDER_PASSES = {
69090
69200
  };
69091
69201
 
69092
69202
  const tempVec4$7 = math.vec4();
69093
- const tempVec3a$V = math.vec3();
69203
+ const tempVec3a$U = math.vec3();
69094
69204
 
69095
69205
  /**
69096
69206
  * @private
@@ -69155,7 +69265,7 @@ class TrianglesBatchingColorRenderer {
69155
69265
  if (active) {
69156
69266
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
69157
69267
  if (origin) {
69158
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$V);
69268
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$U);
69159
69269
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
69160
69270
  } else {
69161
69271
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -69583,7 +69693,7 @@ class TrianglesBatchingColorRenderer {
69583
69693
  }
69584
69694
 
69585
69695
  const tempVec4$6 = math.vec4();
69586
- const tempVec3a$U = math.vec3();
69696
+ const tempVec3a$T = math.vec3();
69587
69697
 
69588
69698
  /**
69589
69699
  * @private
@@ -69645,7 +69755,7 @@ class TrianglesBatchingFlatColorRenderer {
69645
69755
  if (active) {
69646
69756
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
69647
69757
  if (origin) {
69648
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$U);
69758
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$T);
69649
69759
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
69650
69760
  } else {
69651
69761
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -70062,7 +70172,7 @@ class TrianglesBatchingFlatColorRenderer {
70062
70172
  }
70063
70173
 
70064
70174
  const defaultColor$4 = new Float32Array([1, 1, 1]);
70065
- const tempVec3a$T = math.vec3();
70175
+ const tempVec3a$S = math.vec3();
70066
70176
 
70067
70177
  /**
70068
70178
  * @private
@@ -70110,22 +70220,22 @@ class TrianglesBatchingSilhouetteRenderer {
70110
70220
  const material = scene.xrayMaterial._state;
70111
70221
  const fillColor = material.fillColor;
70112
70222
  const fillAlpha = material.fillAlpha;
70113
- gl.uniform4f(this._uColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
70223
+ gl.uniform4f(this._uSilhouetteColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
70114
70224
 
70115
70225
  } else if (renderPass === RENDER_PASSES.SILHOUETTE_HIGHLIGHTED) {
70116
70226
  const material = scene.highlightMaterial._state;
70117
70227
  const fillColor = material.fillColor;
70118
70228
  const fillAlpha = material.fillAlpha;
70119
- gl.uniform4f(this._uColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
70229
+ gl.uniform4f(this._uSilhouetteColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
70120
70230
 
70121
70231
  } else if (renderPass === RENDER_PASSES.SILHOUETTE_SELECTED) {
70122
70232
  const material = scene.selectedMaterial._state;
70123
70233
  const fillColor = material.fillColor;
70124
70234
  const fillAlpha = material.fillAlpha;
70125
- gl.uniform4f(this._uColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
70235
+ gl.uniform4f(this._uSilhouetteColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
70126
70236
 
70127
70237
  } else {
70128
- gl.uniform4fv(this._uColor, defaultColor$4);
70238
+ gl.uniform4fv(this._uSilhouetteColor, defaultColor$4);
70129
70239
  }
70130
70240
 
70131
70241
  const viewMat = (origin) ? createRTCViewMat(camera.viewMatrix, origin) : camera.viewMatrix;
@@ -70146,7 +70256,7 @@ class TrianglesBatchingSilhouetteRenderer {
70146
70256
  if (active) {
70147
70257
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
70148
70258
  if (origin) {
70149
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$T);
70259
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$S);
70150
70260
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
70151
70261
  } else {
70152
70262
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -70173,6 +70283,10 @@ class TrianglesBatchingSilhouetteRenderer {
70173
70283
  this._aFlags2.bindArrayBuffer(state.flags2Buf);
70174
70284
  }
70175
70285
 
70286
+ if (this._aColor) {
70287
+ this._aColor.bindArrayBuffer(state.colorsBuf);
70288
+ }
70289
+
70176
70290
  state.indicesBuf.bind();
70177
70291
 
70178
70292
  gl.drawElements(gl.TRIANGLES, state.indicesBuf.numItems, state.indicesBuf.itemType, 0);
@@ -70197,7 +70311,7 @@ class TrianglesBatchingSilhouetteRenderer {
70197
70311
  this._uWorldMatrix = program.getLocation("worldMatrix");
70198
70312
  this._uViewMatrix = program.getLocation("viewMatrix");
70199
70313
  this._uProjMatrix = program.getLocation("projMatrix");
70200
- this._uColor = program.getLocation("color");
70314
+ this._uSilhouetteColor = program.getLocation("silhouetteColor");
70201
70315
  this._uSectionPlanes = [];
70202
70316
 
70203
70317
  for (let i = 0, len = scene._sectionPlanesState.sectionPlanes.length; i < len; i++) {
@@ -70212,6 +70326,7 @@ class TrianglesBatchingSilhouetteRenderer {
70212
70326
  this._aOffset = program.getAttribute("offset");
70213
70327
  this._aFlags = program.getAttribute("flags");
70214
70328
  this._aFlags2 = program.getAttribute("flags2");
70329
+ this._aColor = program.getAttribute("color");
70215
70330
 
70216
70331
  if (scene.logarithmicDepthBufferEnabled) {
70217
70332
  this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
@@ -70259,11 +70374,12 @@ class TrianglesBatchingSilhouetteRenderer {
70259
70374
  }
70260
70375
  src.push("in vec4 flags;");
70261
70376
  src.push("in vec4 flags2;");
70377
+ src.push("in vec4 color;");
70262
70378
  src.push("uniform mat4 worldMatrix;");
70263
70379
  src.push("uniform mat4 viewMatrix;");
70264
70380
  src.push("uniform mat4 projMatrix;");
70265
70381
  src.push("uniform mat4 positionsDecodeMatrix;");
70266
- src.push("uniform vec4 color;");
70382
+ src.push("uniform vec4 silhouetteColor;");
70267
70383
 
70268
70384
  if (scene.logarithmicDepthBufferEnabled) {
70269
70385
  src.push("uniform float logDepthBufFC;");
@@ -70279,6 +70395,8 @@ class TrianglesBatchingSilhouetteRenderer {
70279
70395
  src.push("out vec4 vFlags2;");
70280
70396
  }
70281
70397
 
70398
+ src.push("out vec4 vColor;");
70399
+
70282
70400
  src.push("void main(void) {");
70283
70401
 
70284
70402
  // flags.y = NOT_RENDERED | SILHOUETTE_HIGHLIGHTED | SILHOUETTE_SELECTED | SILHOUETTE_XRAYED
@@ -70297,6 +70415,7 @@ class TrianglesBatchingSilhouetteRenderer {
70297
70415
  src.push("vWorldPosition = worldPosition;");
70298
70416
  src.push("vFlags2 = flags2;");
70299
70417
  }
70418
+ src.push("vColor = vec4(silhouetteColor.r, silhouetteColor.g, silhouetteColor.b, min(silhouetteColor.a, float(color.a) / 255.0));");
70300
70419
  src.push("vec4 clipPos = projMatrix * viewPosition;");
70301
70420
  if (scene.logarithmicDepthBufferEnabled) {
70302
70421
  src.push("vFragDepth = 1.0 + clipPos.w;");
@@ -70339,7 +70458,7 @@ class TrianglesBatchingSilhouetteRenderer {
70339
70458
  src.push("uniform vec3 sectionPlaneDir" + i + ";");
70340
70459
  }
70341
70460
  }
70342
- src.push("uniform vec4 color;");
70461
+ src.push("in vec4 vColor;");
70343
70462
  src.push("out vec4 outColor;");
70344
70463
  src.push("void main(void) {");
70345
70464
  if (clipping) {
@@ -70357,7 +70476,7 @@ class TrianglesBatchingSilhouetteRenderer {
70357
70476
  if (scene.logarithmicDepthBufferEnabled) {
70358
70477
  src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
70359
70478
  }
70360
- src.push("outColor = color;");
70479
+ src.push("outColor = vColor;");
70361
70480
  src.push("}");
70362
70481
  return src;
70363
70482
  }
@@ -70374,7 +70493,7 @@ class TrianglesBatchingSilhouetteRenderer {
70374
70493
  }
70375
70494
  }
70376
70495
 
70377
- const tempVec3a$S = math.vec3();
70496
+ const tempVec3a$R = math.vec3();
70378
70497
  const defaultColor$3 = new Float32Array([0,0,0,1]);
70379
70498
 
70380
70499
  /**
@@ -70457,7 +70576,7 @@ class TrianglesBatchingEdgesRenderer {
70457
70576
  if (active) {
70458
70577
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
70459
70578
  if (origin) {
70460
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$S);
70579
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$R);
70461
70580
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
70462
70581
  } else {
70463
70582
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -70685,7 +70804,7 @@ class TrianglesBatchingEdgesRenderer {
70685
70804
  }
70686
70805
  }
70687
70806
 
70688
- const tempVec3a$R = math.vec3();
70807
+ const tempVec3a$Q = math.vec3();
70689
70808
 
70690
70809
  /**
70691
70810
  * @private
@@ -70745,7 +70864,7 @@ class TrianglesBatchingEdgesColorRenderer {
70745
70864
  if (active) {
70746
70865
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
70747
70866
  if (origin) {
70748
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$R);
70867
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Q);
70749
70868
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
70750
70869
  } else {
70751
70870
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -70973,7 +71092,7 @@ class TrianglesBatchingEdgesColorRenderer {
70973
71092
  }
70974
71093
  }
70975
71094
 
70976
- const tempVec3a$Q = math.vec3();
71095
+ const tempVec3a$P = math.vec3();
70977
71096
 
70978
71097
  /**
70979
71098
  * @private
@@ -71039,7 +71158,7 @@ class TrianglesBatchingPickMeshRenderer {
71039
71158
  if (active) {
71040
71159
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
71041
71160
  if (origin) {
71042
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$Q);
71161
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$P);
71043
71162
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
71044
71163
  } else {
71045
71164
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -71269,7 +71388,7 @@ class TrianglesBatchingPickMeshRenderer {
71269
71388
  }
71270
71389
  }
71271
71390
 
71272
- const tempVec3a$P = math.vec3();
71391
+ const tempVec3a$O = math.vec3();
71273
71392
 
71274
71393
  /**
71275
71394
  * @private
@@ -71340,7 +71459,7 @@ class TrianglesBatchingPickDepthRenderer {
71340
71459
  if (active) {
71341
71460
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
71342
71461
  if (origin) {
71343
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$P);
71462
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$O);
71344
71463
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
71345
71464
  } else {
71346
71465
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -71578,7 +71697,7 @@ class TrianglesBatchingPickDepthRenderer {
71578
71697
  }
71579
71698
  }
71580
71699
 
71581
- const tempVec3a$O = math.vec3();
71700
+ const tempVec3a$N = math.vec3();
71582
71701
 
71583
71702
  /**
71584
71703
  * @private
@@ -71646,7 +71765,7 @@ class TrianglesBatchingPickNormalsRenderer {
71646
71765
  if (active) {
71647
71766
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
71648
71767
  if (origin) {
71649
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$O);
71768
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$N);
71650
71769
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
71651
71770
  } else {
71652
71771
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -71871,7 +71990,7 @@ class TrianglesBatchingPickNormalsRenderer {
71871
71990
  }
71872
71991
  }
71873
71992
 
71874
- const tempVec3a$N = math.vec3();
71993
+ const tempVec3a$M = math.vec3();
71875
71994
 
71876
71995
  /**
71877
71996
  * @private
@@ -71931,7 +72050,7 @@ class TrianglesBatchingOcclusionRenderer {
71931
72050
  if (active) {
71932
72051
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
71933
72052
  if (origin) {
71934
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$N);
72053
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$M);
71935
72054
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
71936
72055
  } else {
71937
72056
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -72154,7 +72273,7 @@ class TrianglesBatchingOcclusionRenderer {
72154
72273
  }
72155
72274
  }
72156
72275
 
72157
- const tempVec3a$M = math.vec3();
72276
+ const tempVec3a$L = math.vec3();
72158
72277
 
72159
72278
  /**
72160
72279
  * @private
@@ -72214,7 +72333,7 @@ class TrianglesBatchingDepthRenderer {
72214
72333
  if (active) {
72215
72334
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
72216
72335
  if (origin) {
72217
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$M);
72336
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$L);
72218
72337
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
72219
72338
  } else {
72220
72339
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -72438,7 +72557,7 @@ class TrianglesBatchingDepthRenderer {
72438
72557
  }
72439
72558
  }
72440
72559
 
72441
- const tempVec3a$L = math.vec3();
72560
+ const tempVec3a$K = math.vec3();
72442
72561
 
72443
72562
  /**
72444
72563
  * @private
@@ -72501,7 +72620,7 @@ class TrianglesBatchingNormalsRenderer {
72501
72620
  if (active) {
72502
72621
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
72503
72622
  if (origin) {
72504
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$L);
72623
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$K);
72505
72624
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
72506
72625
  } else {
72507
72626
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -72741,7 +72860,7 @@ class TrianglesBatchingNormalsRenderer {
72741
72860
  }
72742
72861
  }
72743
72862
 
72744
- const tempVec3a$K = math.vec3();
72863
+ const tempVec3a$J = math.vec3();
72745
72864
 
72746
72865
  /**
72747
72866
  * Renders BatchingLayer fragment depths to a shadow map.
@@ -72810,7 +72929,7 @@ class TrianglesBatchingShadowRenderer {
72810
72929
  if (active) {
72811
72930
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
72812
72931
  if (origin) {
72813
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$K);
72932
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$J);
72814
72933
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
72815
72934
  } else {
72816
72935
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -72982,7 +73101,7 @@ class TrianglesBatchingShadowRenderer {
72982
73101
  }
72983
73102
 
72984
73103
  const tempVec4$5 = math.vec4();
72985
- const tempVec3a$J = math.vec3();
73104
+ const tempVec3a$I = math.vec3();
72986
73105
 
72987
73106
  // const TEXTURE_DECODE_FUNCS = {};
72988
73107
  // TEXTURE_DECODE_FUNCS[LinearEncoding] = "linearToLinear";
@@ -73055,7 +73174,7 @@ class TrianglesBatchingPBRRenderer {
73055
73174
  if (active) {
73056
73175
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
73057
73176
  if (origin) {
73058
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$J);
73177
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$I);
73059
73178
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
73060
73179
  } else {
73061
73180
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -73860,7 +73979,7 @@ class TrianglesBatchingPBRRenderer {
73860
73979
  }
73861
73980
  }
73862
73981
 
73863
- const tempVec3a$I = math.vec3();
73982
+ const tempVec3a$H = math.vec3();
73864
73983
 
73865
73984
  /**
73866
73985
  * @private
@@ -73927,7 +74046,7 @@ class TrianglesBatchingPickNormalsFlatRenderer {
73927
74046
  if (active) {
73928
74047
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
73929
74048
  if (origin) {
73930
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$I);
74049
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$H);
73931
74050
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
73932
74051
  } else {
73933
74052
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -74137,7 +74256,7 @@ class TrianglesBatchingPickNormalsFlatRenderer {
74137
74256
  }
74138
74257
 
74139
74258
  const tempVec4$4 = math.vec4();
74140
- const tempVec3a$H = math.vec3();
74259
+ const tempVec3a$G = math.vec3();
74141
74260
 
74142
74261
  /**
74143
74262
  * @private
@@ -74202,7 +74321,7 @@ class TrianglesBatchingColorTextureRenderer {
74202
74321
  if (active) {
74203
74322
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74204
74323
  if (origin) {
74205
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$H);
74324
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$G);
74206
74325
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74207
74326
  } else {
74208
74327
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -75208,8 +75327,8 @@ const tempVec4b$a = math.vec4([0, 0, 0, 1]);
75208
75327
  const tempVec4c$7 = math.vec4([0, 0, 0, 1]);
75209
75328
  const tempOBB3$2 = math.OBB3();
75210
75329
 
75211
- const tempVec3a$G = math.vec3();
75212
- const tempVec3b$7 = math.vec3();
75330
+ const tempVec3a$F = math.vec3();
75331
+ const tempVec3b$6 = math.vec3();
75213
75332
  const tempVec3c$5 = math.vec3();
75214
75333
  const tempVec3d$2 = math.vec3();
75215
75334
  const tempVec3e$1 = math.vec3();
@@ -76388,8 +76507,8 @@ class TrianglesBatchingLayer {
76388
76507
  const origin = state.origin;
76389
76508
  const offset = portion.offset;
76390
76509
 
76391
- const rtcRayOrigin = tempVec3a$G;
76392
- const rtcRayDir = tempVec3b$7;
76510
+ const rtcRayOrigin = tempVec3a$F;
76511
+ const rtcRayDir = tempVec3b$6;
76393
76512
 
76394
76513
  rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$5) : worldRayOrigin); // World -> RTC
76395
76514
  rtcRayDir.set(worldRayDir);
@@ -76512,7 +76631,7 @@ class TrianglesBatchingLayer {
76512
76631
  }
76513
76632
 
76514
76633
  const tempVec4$3 = math.vec4();
76515
- const tempVec3a$F = math.vec3();
76634
+ const tempVec3a$E = math.vec3();
76516
76635
 
76517
76636
  /**
76518
76637
  * @private
@@ -76578,7 +76697,7 @@ class TrianglesInstancingColorRenderer {
76578
76697
  if (active) {
76579
76698
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
76580
76699
  if (origin) {
76581
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$F);
76700
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$E);
76582
76701
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76583
76702
  } else {
76584
76703
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77055,7 +77174,7 @@ class TrianglesInstancingColorRenderer {
77055
77174
  }
77056
77175
 
77057
77176
  const tempVec4$2 = math.vec4();
77058
- const tempVec3a$E = math.vec3();
77177
+ const tempVec3a$D = math.vec3();
77059
77178
 
77060
77179
  /**
77061
77180
  * @private
@@ -77117,7 +77236,7 @@ class TrianglesInstancingFlatColorRenderer {
77117
77236
  if (active) {
77118
77237
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77119
77238
  if (origin) {
77120
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$E);
77239
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$D);
77121
77240
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77122
77241
  } else {
77123
77242
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77564,7 +77683,7 @@ class TrianglesInstancingFlatColorRenderer {
77564
77683
  }
77565
77684
  }
77566
77685
 
77567
- const tempVec3a$D = math.vec3();
77686
+ const tempVec3a$C = math.vec3();
77568
77687
 
77569
77688
  /**
77570
77689
  * @private
@@ -77613,22 +77732,22 @@ class TrianglesInstancingSilhouetteRenderer {
77613
77732
  const material = scene.xrayMaterial._state;
77614
77733
  const fillColor = material.fillColor;
77615
77734
  const fillAlpha = material.fillAlpha;
77616
- gl.uniform4f(this._uColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
77735
+ gl.uniform4f(this._uSilhouetteColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
77617
77736
 
77618
77737
  } else if (renderPass === RENDER_PASSES.SILHOUETTE_HIGHLIGHTED) {
77619
77738
  const material = scene.highlightMaterial._state;
77620
77739
  const fillColor = material.fillColor;
77621
77740
  const fillAlpha = material.fillAlpha;
77622
- gl.uniform4f(this._uColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
77741
+ gl.uniform4f(this._uSilhouetteColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
77623
77742
 
77624
77743
  } else if (renderPass === RENDER_PASSES.SILHOUETTE_SELECTED) {
77625
77744
  const material = scene.selectedMaterial._state;
77626
77745
  const fillColor = material.fillColor;
77627
77746
  const fillAlpha = material.fillAlpha;
77628
- gl.uniform4f(this._uColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
77747
+ gl.uniform4f(this._uSilhouetteColor, fillColor[0], fillColor[1], fillColor[2], fillAlpha);
77629
77748
 
77630
77749
  } else {
77631
- gl.uniform4fv(this._uColor, math.vec3([1, 1, 1]));
77750
+ gl.uniform4fv(this._uSilhouetteColor, math.vec3([1, 1, 1]));
77632
77751
  }
77633
77752
 
77634
77753
  gl.uniformMatrix4fv(this._uViewMatrix, false, (origin) ? createRTCViewMat(camera.viewMatrix, origin) : camera.viewMatrix);
@@ -77647,7 +77766,7 @@ class TrianglesInstancingSilhouetteRenderer {
77647
77766
  if (active) {
77648
77767
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77649
77768
  if (origin) {
77650
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$D);
77769
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C);
77651
77770
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77652
77771
  } else {
77653
77772
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77683,6 +77802,11 @@ class TrianglesInstancingSilhouetteRenderer {
77683
77802
  gl.vertexAttribDivisor(this._aOffset.location, 1);
77684
77803
  }
77685
77804
 
77805
+ if (this._aColor) {
77806
+ this._aColor.bindArrayBuffer(state.colorsBuf);
77807
+ gl.vertexAttribDivisor(this._aColor.location, 1);
77808
+ }
77809
+
77686
77810
  geometry.indicesBuf.bind();
77687
77811
 
77688
77812
  gl.drawElementsInstanced(gl.TRIANGLES, geometry.indicesBuf.numItems, geometry.indicesBuf.itemType, 0, state.numInstances);
@@ -77698,6 +77822,9 @@ class TrianglesInstancingSilhouetteRenderer {
77698
77822
  if (this._aOffset) {
77699
77823
  gl.vertexAttribDivisor(this._aOffset.location, 0);
77700
77824
  }
77825
+ if (this._aColor) {
77826
+ gl.vertexAttribDivisor(this._aColor.location, 0);
77827
+ }
77701
77828
  }
77702
77829
 
77703
77830
  _allocate() {
@@ -77720,7 +77847,7 @@ class TrianglesInstancingSilhouetteRenderer {
77720
77847
  this._uWorldMatrix = program.getLocation("worldMatrix");
77721
77848
  this._uViewMatrix = program.getLocation("viewMatrix");
77722
77849
  this._uProjMatrix = program.getLocation("projMatrix");
77723
- this._uColor = program.getLocation("color");
77850
+ this._uSilhouetteColor = program.getLocation("silhouetteColor");
77724
77851
  this._uSectionPlanes = [];
77725
77852
 
77726
77853
  const clips = sectionPlanesState.sectionPlanes;
@@ -77736,6 +77863,8 @@ class TrianglesInstancingSilhouetteRenderer {
77736
77863
  this._aOffset = program.getAttribute("offset");
77737
77864
  this._aFlags = program.getAttribute("flags");
77738
77865
  this._aFlags2 = program.getAttribute("flags2");
77866
+ this._aColor = program.getAttribute("color");
77867
+
77739
77868
  this._aModelMatrixCol0 = program.getAttribute("modelMatrixCol0");
77740
77869
  this._aModelMatrixCol1 = program.getAttribute("modelMatrixCol1");
77741
77870
  this._aModelMatrixCol2 = program.getAttribute("modelMatrixCol2");
@@ -77774,7 +77903,7 @@ class TrianglesInstancingSilhouetteRenderer {
77774
77903
  const clipping = sectionPlanesState.sectionPlanes.length > 0;
77775
77904
  const src = [];
77776
77905
  src.push("#version 300 es");
77777
- src.push("// Instancing fill vertex shader");
77906
+ src.push("// Instancing silhouette vertex shader");
77778
77907
 
77779
77908
  src.push("uniform int renderPass;");
77780
77909
 
@@ -77784,6 +77913,7 @@ class TrianglesInstancingSilhouetteRenderer {
77784
77913
  }
77785
77914
  src.push("in vec4 flags;");
77786
77915
  src.push("in vec4 flags2;");
77916
+ src.push("in vec4 color;");
77787
77917
 
77788
77918
  src.push("in vec4 modelMatrixCol0;"); // Modeling matrix
77789
77919
  src.push("in vec4 modelMatrixCol1;");
@@ -77793,6 +77923,7 @@ class TrianglesInstancingSilhouetteRenderer {
77793
77923
  src.push("uniform mat4 viewMatrix;");
77794
77924
  src.push("uniform mat4 projMatrix;");
77795
77925
  src.push("uniform mat4 positionsDecodeMatrix;");
77926
+ src.push("uniform vec4 silhouetteColor;");
77796
77927
 
77797
77928
  if (scene.logarithmicDepthBufferEnabled) {
77798
77929
  src.push("uniform float logDepthBufFC;");
@@ -77803,13 +77934,13 @@ class TrianglesInstancingSilhouetteRenderer {
77803
77934
  src.push("out float isPerspective;");
77804
77935
  }
77805
77936
 
77806
- src.push("uniform vec4 color;");
77807
-
77808
77937
  if (clipping) {
77809
77938
  src.push("out vec4 vWorldPosition;");
77810
77939
  src.push("out vec4 vFlags2;");
77811
77940
  }
77812
77941
 
77942
+ src.push("out vec4 vColor;");
77943
+
77813
77944
  src.push("void main(void) {");
77814
77945
 
77815
77946
  // flags.y = NOT_RENDERED | SILHOUETTE_HIGHLIGHTED | SILHOUETTE_SELECTED | | SILHOUETTE_XRAYED
@@ -77831,6 +77962,7 @@ class TrianglesInstancingSilhouetteRenderer {
77831
77962
  src.push("vWorldPosition = worldPosition;");
77832
77963
  src.push("vFlags2 = flags2;");
77833
77964
  }
77965
+ src.push("vColor = vec4(silhouetteColor.r, silhouetteColor.g, silhouetteColor.b, min(silhouetteColor.a, float(color.a) / 255.0));");
77834
77966
  src.push("vec4 clipPos = projMatrix * viewPosition;");
77835
77967
  if (scene.logarithmicDepthBufferEnabled) {
77836
77968
  src.push("vFragDepth = 1.0 + clipPos.w;");
@@ -77871,7 +78003,7 @@ class TrianglesInstancingSilhouetteRenderer {
77871
78003
  src.push("uniform vec3 sectionPlaneDir" + i + ";");
77872
78004
  }
77873
78005
  }
77874
- src.push("uniform vec4 color;");
78006
+ src.push("in vec4 vColor;");
77875
78007
  src.push("out vec4 outColor;");
77876
78008
  src.push("void main(void) {");
77877
78009
  if (clipping) {
@@ -77889,7 +78021,7 @@ class TrianglesInstancingSilhouetteRenderer {
77889
78021
  if (scene.logarithmicDepthBufferEnabled) {
77890
78022
  src.push(" gl_FragDepth = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
77891
78023
  }
77892
- src.push("outColor = color;");
78024
+ src.push("outColor = vColor;");
77893
78025
  src.push("}");
77894
78026
  return src;
77895
78027
  }
@@ -77906,7 +78038,7 @@ class TrianglesInstancingSilhouetteRenderer {
77906
78038
  }
77907
78039
  }
77908
78040
 
77909
- const tempVec3a$C = math.vec3();
78041
+ const tempVec3a$B = math.vec3();
77910
78042
  const defaultColor$2 = new Float32Array([0,0,0,1]);
77911
78043
 
77912
78044
  /**
@@ -77990,7 +78122,7 @@ class TrianglesInstancingEdgesRenderer {
77990
78122
  if (active) {
77991
78123
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77992
78124
  if (origin) {
77993
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C);
78125
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$B);
77994
78126
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77995
78127
  } else {
77996
78128
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -78251,7 +78383,7 @@ class TrianglesInstancingEdgesRenderer {
78251
78383
  }
78252
78384
  }
78253
78385
 
78254
- const tempVec3a$B = math.vec3();
78386
+ const tempVec3a$A = math.vec3();
78255
78387
 
78256
78388
  /**
78257
78389
  * @private
@@ -78312,7 +78444,7 @@ class TrianglesInstancingEdgesColorRenderer {
78312
78444
  if (active) {
78313
78445
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
78314
78446
  if (origin) {
78315
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$B);
78447
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$A);
78316
78448
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
78317
78449
  } else {
78318
78450
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -78578,7 +78710,7 @@ class TrianglesInstancingEdgesColorRenderer {
78578
78710
  }
78579
78711
  }
78580
78712
 
78581
- const tempVec3a$A = math.vec3();
78713
+ const tempVec3a$z = math.vec3();
78582
78714
 
78583
78715
  /**
78584
78716
  * @private
@@ -78681,7 +78813,7 @@ class TrianglesInstancingPickMeshRenderer {
78681
78813
  if (active) {
78682
78814
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
78683
78815
  if (origin) {
78684
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$A);
78816
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$z);
78685
78817
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
78686
78818
  } else {
78687
78819
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -78916,7 +79048,7 @@ class TrianglesInstancingPickMeshRenderer {
78916
79048
  }
78917
79049
  }
78918
79050
 
78919
- const tempVec3a$z = math.vec3();
79051
+ const tempVec3a$y = math.vec3();
78920
79052
 
78921
79053
  /**
78922
79054
  * @private
@@ -78993,7 +79125,7 @@ class TrianglesInstancingPickDepthRenderer {
78993
79125
  if (active) {
78994
79126
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
78995
79127
  if (origin) {
78996
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$z);
79128
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$y);
78997
79129
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
78998
79130
  } else {
78999
79131
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -79261,7 +79393,7 @@ class TrianglesInstancingPickDepthRenderer {
79261
79393
  }
79262
79394
  }
79263
79395
 
79264
- const tempVec3a$y = math.vec3();
79396
+ const tempVec3a$x = math.vec3();
79265
79397
 
79266
79398
  /**
79267
79399
  * @private
@@ -79338,7 +79470,7 @@ class TrianglesInstancingPickNormalsRenderer {
79338
79470
  if (active) {
79339
79471
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
79340
79472
  if (origin) {
79341
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$y);
79473
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$x);
79342
79474
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
79343
79475
  } else {
79344
79476
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -79615,7 +79747,7 @@ class TrianglesInstancingPickNormalsRenderer {
79615
79747
  }
79616
79748
  }
79617
79749
 
79618
- const tempVec3a$x = math.vec3();
79750
+ const tempVec3a$w = math.vec3();
79619
79751
 
79620
79752
  /**
79621
79753
  * @private
@@ -79676,7 +79808,7 @@ class TrianglesInstancingOcclusionRenderer {
79676
79808
  if (active) {
79677
79809
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
79678
79810
  if (origin) {
79679
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$x);
79811
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$w);
79680
79812
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
79681
79813
  } else {
79682
79814
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -79934,7 +80066,7 @@ class TrianglesInstancingOcclusionRenderer {
79934
80066
  }
79935
80067
  }
79936
80068
 
79937
- const tempVec3a$w = math.vec3();
80069
+ const tempVec3a$v = math.vec3();
79938
80070
 
79939
80071
  /**
79940
80072
  * @private
@@ -79995,7 +80127,7 @@ class TrianglesInstancingDepthRenderer {
79995
80127
  if (active) {
79996
80128
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
79997
80129
  if (origin) {
79998
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$w);
80130
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$v);
79999
80131
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
80000
80132
  } else {
80001
80133
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -80245,7 +80377,7 @@ class TrianglesInstancingDepthRenderer {
80245
80377
  }
80246
80378
  }
80247
80379
 
80248
- const tempVec3a$v = math.vec3();
80380
+ const tempVec3a$u = math.vec3();
80249
80381
 
80250
80382
  /**
80251
80383
  * @private
@@ -80309,7 +80441,7 @@ class TrianglesInstancingNormalsRenderer {
80309
80441
  if (active) {
80310
80442
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
80311
80443
  if (origin) {
80312
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$v);
80444
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$u);
80313
80445
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
80314
80446
  } else {
80315
80447
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -80589,7 +80721,7 @@ class TrianglesInstancingNormalsRenderer {
80589
80721
  }
80590
80722
  }
80591
80723
 
80592
- const tempVec3a$u = math.vec3();
80724
+ const tempVec3a$t = math.vec3();
80593
80725
 
80594
80726
  /**
80595
80727
  * Renders InstancingLayer fragment depths to a shadow map.
@@ -80676,7 +80808,7 @@ class TrianglesInstancingShadowRenderer {
80676
80808
  if (active) {
80677
80809
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
80678
80810
  if (origin) {
80679
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$u);
80811
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$t);
80680
80812
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
80681
80813
  } else {
80682
80814
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -80869,7 +81001,7 @@ class TrianglesInstancingShadowRenderer {
80869
81001
  }
80870
81002
 
80871
81003
  const tempVec4$1 = math.vec4();
80872
- const tempVec3a$t = math.vec3();
81004
+ const tempVec3a$s = math.vec3();
80873
81005
 
80874
81006
  const TEXTURE_DECODE_FUNCS = {};
80875
81007
  TEXTURE_DECODE_FUNCS[LinearEncoding] = "linearToLinear";
@@ -80943,7 +81075,7 @@ class TrianglesInstancingPBRRenderer {
80943
81075
  if (active) {
80944
81076
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
80945
81077
  if (origin) {
80946
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$t);
81078
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$s);
80947
81079
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
80948
81080
  } else {
80949
81081
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -81779,7 +81911,7 @@ class TrianglesInstancingPBRRenderer {
81779
81911
  }
81780
81912
  }
81781
81913
 
81782
- const tempVec3a$s = math.vec3();
81914
+ const tempVec3a$r = math.vec3();
81783
81915
 
81784
81916
  /**
81785
81917
  * @private
@@ -81854,7 +81986,7 @@ class TrianglesInstancingPickNormalsFlatRenderer {
81854
81986
  if (active) {
81855
81987
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
81856
81988
  if (origin) {
81857
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$s);
81989
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$r);
81858
81990
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
81859
81991
  } else {
81860
81992
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -82094,7 +82226,7 @@ class TrianglesInstancingPickNormalsFlatRenderer {
82094
82226
  }
82095
82227
 
82096
82228
  const tempVec4 = math.vec4();
82097
- const tempVec3a$r = math.vec3();
82229
+ const tempVec3a$q = math.vec3();
82098
82230
 
82099
82231
  /**
82100
82232
  * @private
@@ -82159,7 +82291,7 @@ class TrianglesInstancingColorTextureRenderer {
82159
82291
  if (active) {
82160
82292
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
82161
82293
  if (origin) {
82162
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$r);
82294
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$q);
82163
82295
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
82164
82296
  } else {
82165
82297
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -82970,8 +83102,8 @@ const tempVec4b$9 = math.vec4([0, 0, 0, 1]);
82970
83102
  const tempVec4c$6 = math.vec4([0, 0, 0, 1]);
82971
83103
  const tempVec3fa$2 = new Float32Array(3);
82972
83104
 
82973
- const tempVec3a$q = math.vec3();
82974
- const tempVec3b$6 = math.vec3();
83105
+ const tempVec3a$p = math.vec3();
83106
+ const tempVec3b$5 = math.vec3();
82975
83107
  const tempVec3c$4 = math.vec3();
82976
83108
  const tempVec3d$1 = math.vec3();
82977
83109
  const tempVec3e = math.vec3();
@@ -83899,8 +84031,8 @@ class TrianglesInstancingLayer {
83899
84031
  const origin = state.origin;
83900
84032
  const offset = portion.offset;
83901
84033
 
83902
- const rtcRayOrigin = tempVec3a$q;
83903
- const rtcRayDir = tempVec3b$6;
84034
+ const rtcRayOrigin = tempVec3a$p;
84035
+ const rtcRayDir = tempVec3b$5;
83904
84036
 
83905
84037
  rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$4) : worldRayOrigin); // World -> RTC
83906
84038
  rtcRayDir.set(worldRayDir);
@@ -84033,7 +84165,7 @@ class TrianglesInstancingLayer {
84033
84165
  }
84034
84166
  }
84035
84167
 
84036
- const tempVec3a$p = math.vec3();
84168
+ const tempVec3a$o = math.vec3();
84037
84169
 
84038
84170
  /**
84039
84171
  * @private
@@ -84096,7 +84228,7 @@ class LinesBatchingColorRenderer {
84096
84228
  if (active) {
84097
84229
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
84098
84230
  if (origin) {
84099
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$p);
84231
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$o);
84100
84232
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
84101
84233
  } else {
84102
84234
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -84316,7 +84448,7 @@ class LinesBatchingColorRenderer {
84316
84448
  }
84317
84449
 
84318
84450
  const defaultColor$1 = new Float32Array([1, 1, 1]);
84319
- const tempVec3a$o = math.vec3();
84451
+ const tempVec3a$n = math.vec3();
84320
84452
 
84321
84453
  /**
84322
84454
  * @private
@@ -84403,7 +84535,7 @@ class LinesBatchingSilhouetteRenderer {
84403
84535
  if (active) {
84404
84536
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
84405
84537
  if (origin) {
84406
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$o);
84538
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n);
84407
84539
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
84408
84540
  } else {
84409
84541
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -85500,7 +85632,7 @@ class LinesBatchingLayer {
85500
85632
  }
85501
85633
  }
85502
85634
 
85503
- const tempVec3a$n = math.vec3();
85635
+ const tempVec3a$m = math.vec3();
85504
85636
 
85505
85637
  /**
85506
85638
  * @private
@@ -85563,7 +85695,7 @@ class LinesInstancingColorRenderer {
85563
85695
  if (active) {
85564
85696
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
85565
85697
  if (origin) {
85566
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$n);
85698
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m);
85567
85699
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
85568
85700
  } else {
85569
85701
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -85845,7 +85977,7 @@ class LinesInstancingColorRenderer {
85845
85977
  }
85846
85978
  }
85847
85979
 
85848
- const tempVec3a$m = math.vec3();
85980
+ const tempVec3a$l = math.vec3();
85849
85981
 
85850
85982
  /**
85851
85983
  * @private
@@ -85930,7 +86062,7 @@ class LinesInstancingSilhouetteRenderer {
85930
86062
  if (active) {
85931
86063
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
85932
86064
  if (origin) {
85933
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$m);
86065
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l);
85934
86066
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
85935
86067
  } else {
85936
86068
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -86912,7 +87044,7 @@ class LinesInstancingLayer {
86912
87044
  }
86913
87045
  }
86914
87046
 
86915
- const tempVec3a$l = math.vec3();
87047
+ const tempVec3a$k = math.vec3();
86916
87048
 
86917
87049
  /**
86918
87050
  * @private
@@ -86973,7 +87105,7 @@ class PointsBatchingColorRenderer {
86973
87105
  if (active) {
86974
87106
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
86975
87107
  if (origin) {
86976
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$l);
87108
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k);
86977
87109
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
86978
87110
  } else {
86979
87111
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -87258,7 +87390,7 @@ class PointsBatchingColorRenderer {
87258
87390
  }
87259
87391
 
87260
87392
  const defaultColor = new Float32Array([1, 1, 1]);
87261
- const tempVec3a$k = math.vec3();
87393
+ const tempVec3a$j = math.vec3();
87262
87394
 
87263
87395
  /**
87264
87396
  * @private
@@ -87343,7 +87475,7 @@ class PointsBatchingSilhouetteRenderer {
87343
87475
  if (active) {
87344
87476
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
87345
87477
  if (origin) {
87346
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$k);
87478
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j);
87347
87479
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
87348
87480
  } else {
87349
87481
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -87587,7 +87719,7 @@ class PointsBatchingSilhouetteRenderer {
87587
87719
  }
87588
87720
  }
87589
87721
 
87590
- const tempVec3a$j = math.vec3();
87722
+ const tempVec3a$i = math.vec3();
87591
87723
 
87592
87724
  /**
87593
87725
  * @private
@@ -87654,7 +87786,7 @@ class PointsBatchingPickMeshRenderer {
87654
87786
  if (active) {
87655
87787
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
87656
87788
  if (origin) {
87657
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$j);
87789
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i);
87658
87790
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
87659
87791
  } else {
87660
87792
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -87899,7 +88031,7 @@ class PointsBatchingPickMeshRenderer {
87899
88031
  }
87900
88032
  }
87901
88033
 
87902
- const tempVec3a$i = math.vec3();
88034
+ const tempVec3a$h = math.vec3();
87903
88035
 
87904
88036
  /**
87905
88037
  * @private
@@ -87971,7 +88103,7 @@ class PointsBatchingPickDepthRenderer {
87971
88103
  if (active) {
87972
88104
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
87973
88105
  if (origin) {
87974
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$i);
88106
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
87975
88107
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
87976
88108
  } else {
87977
88109
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -88222,7 +88354,7 @@ class PointsBatchingPickDepthRenderer {
88222
88354
  }
88223
88355
  }
88224
88356
 
88225
- const tempVec3a$h = math.vec3();
88357
+ const tempVec3a$g = math.vec3();
88226
88358
 
88227
88359
  /**
88228
88360
  * @private
@@ -88283,7 +88415,7 @@ class PointsBatchingOcclusionRenderer {
88283
88415
  if (active) {
88284
88416
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
88285
88417
  if (origin) {
88286
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
88418
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g);
88287
88419
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
88288
88420
  } else {
88289
88421
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -88649,8 +88781,8 @@ class PointsBatchingBuffer {
88649
88781
  }
88650
88782
  }
88651
88783
 
88652
- const tempVec3a$g = math.vec4();
88653
- const tempVec3b$5 = math.vec4();
88784
+ const tempVec3a$f = math.vec4();
88785
+ const tempVec3b$4 = math.vec4();
88654
88786
  const tempVec4a$6 = math.vec4([0, 0, 0, 1]);
88655
88787
  const tempVec4b$6 = math.vec4([0, 0, 0, 1]);
88656
88788
  const tempVec4c$3 = math.vec4([0, 0, 0, 1]);
@@ -88802,8 +88934,8 @@ class PointsBatchingLayer {
88802
88934
 
88803
88935
  const bounds = geometryCompressionUtils.getPositionsBounds(positionsCompressed);
88804
88936
 
88805
- const min = geometryCompressionUtils.decompressPosition(bounds.min, this._state.positionsDecodeMatrix, tempVec3a$g);
88806
- const max = geometryCompressionUtils.decompressPosition(bounds.max, this._state.positionsDecodeMatrix, tempVec3b$5);
88937
+ const min = geometryCompressionUtils.decompressPosition(bounds.min, this._state.positionsDecodeMatrix, tempVec3a$f);
88938
+ const max = geometryCompressionUtils.decompressPosition(bounds.max, this._state.positionsDecodeMatrix, tempVec3b$4);
88807
88939
 
88808
88940
  worldAABB[0] = min[0];
88809
88941
  worldAABB[1] = min[1];
@@ -89441,7 +89573,7 @@ class PointsBatchingLayer {
89441
89573
  }
89442
89574
  }
89443
89575
 
89444
- const tempVec3a$f = math.vec3();
89576
+ const tempVec3a$e = math.vec3();
89445
89577
 
89446
89578
  /**
89447
89579
  * @private
@@ -89510,7 +89642,7 @@ class PointsInstancingColorRenderer {
89510
89642
  if (active) {
89511
89643
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
89512
89644
  if (origin) {
89513
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$f);
89645
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e);
89514
89646
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
89515
89647
  } else {
89516
89648
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -89820,7 +89952,7 @@ class PointsInstancingColorRenderer {
89820
89952
  }
89821
89953
  }
89822
89954
 
89823
- const tempVec3a$e = math.vec3();
89955
+ const tempVec3a$d = math.vec3();
89824
89956
 
89825
89957
  /**
89826
89958
  * @private
@@ -89904,7 +90036,7 @@ class PointsInstancingSilhouetteRenderer {
89904
90036
  if (active) {
89905
90037
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
89906
90038
  if (origin) {
89907
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$e);
90039
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
89908
90040
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
89909
90041
  } else {
89910
90042
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -89979,7 +90111,7 @@ class PointsInstancingSilhouetteRenderer {
89979
90111
  this._uWorldMatrix = program.getLocation("worldMatrix");
89980
90112
  this._uViewMatrix = program.getLocation("viewMatrix");
89981
90113
  this._uProjMatrix = program.getLocation("projMatrix");
89982
- this._uColor = program.getLocation("color");
90114
+ this._uColor = program.getLocation("silhouetteColor");
89983
90115
  this._uSectionPlanes = [];
89984
90116
 
89985
90117
  const clips = sectionPlanesState.sectionPlanes;
@@ -90048,6 +90180,7 @@ class PointsInstancingSilhouetteRenderer {
90048
90180
  }
90049
90181
  src.push("in vec4 flags;");
90050
90182
  src.push("in vec4 flags2;");
90183
+ src.push("in vec4 color;");
90051
90184
 
90052
90185
  src.push("in vec4 modelMatrixCol0;"); // Modeling matrix
90053
90186
  src.push("in vec4 modelMatrixCol1;");
@@ -90068,12 +90201,13 @@ class PointsInstancingSilhouetteRenderer {
90068
90201
  src.push("out float vFragDepth;");
90069
90202
  }
90070
90203
 
90071
- src.push("uniform vec4 color;");
90204
+ src.push("uniform vec4 silhouetteColor;");
90072
90205
 
90073
90206
  if (clipping) {
90074
90207
  src.push("out vec4 vWorldPosition;");
90075
90208
  src.push("out vec4 vFlags2;");
90076
90209
  }
90210
+ src.push("out vec4 vColor;");
90077
90211
 
90078
90212
  src.push("void main(void) {");
90079
90213
 
@@ -90100,6 +90234,7 @@ class PointsInstancingSilhouetteRenderer {
90100
90234
  if (scene.logarithmicDepthBufferEnabled) {
90101
90235
  src.push("vFragDepth = 1.0 + clipPos.w;");
90102
90236
  }
90237
+ src.push("vColor = vec4(float(silhouetteColor.r) / 255.0, float(silhouetteColor.g) / 255.0, float(silhouetteColor.b) / 255.0, float(color.a) / 255.0);");
90103
90238
  src.push("gl_Position = clipPos;");
90104
90239
  if (pointsMaterial.perspectivePoints) {
90105
90240
  src.push("gl_PointSize = (nearPlaneHeight * pointSize) / clipPos.w;");
@@ -90140,7 +90275,7 @@ class PointsInstancingSilhouetteRenderer {
90140
90275
  src.push("uniform vec3 sectionPlaneDir" + i + ";");
90141
90276
  }
90142
90277
  }
90143
- src.push("uniform vec4 color;");
90278
+ src.push("in vec4 vColor;");
90144
90279
  src.push("out vec4 outColor;");
90145
90280
  src.push("void main(void) {");
90146
90281
  if (scene.pointsMaterial.roundPoints) {
@@ -90165,7 +90300,7 @@ class PointsInstancingSilhouetteRenderer {
90165
90300
  if (scene.logarithmicDepthBufferEnabled) {
90166
90301
  src.push("gl_FragDepth = log2( vFragDepth ) * logDepthBufFC * 0.5;");
90167
90302
  }
90168
- src.push("outColor = color;");
90303
+ src.push("outColor = vColor;");
90169
90304
  src.push("}");
90170
90305
  return src;
90171
90306
  }
@@ -90182,7 +90317,7 @@ class PointsInstancingSilhouetteRenderer {
90182
90317
  }
90183
90318
  }
90184
90319
 
90185
- const tempVec3a$d = math.vec3();
90320
+ const tempVec3a$c = math.vec3();
90186
90321
 
90187
90322
  /**
90188
90323
  * @private
@@ -90288,7 +90423,7 @@ class PointsInstancingPickMeshRenderer {
90288
90423
  if (active) {
90289
90424
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
90290
90425
  if (origin) {
90291
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
90426
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c);
90292
90427
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
90293
90428
  } else {
90294
90429
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -90539,7 +90674,7 @@ class PointsInstancingPickMeshRenderer {
90539
90674
  }
90540
90675
  }
90541
90676
 
90542
- const tempVec3a$c = math.vec3();
90677
+ const tempVec3a$b = math.vec3();
90543
90678
 
90544
90679
  /**
90545
90680
  * @private
@@ -90617,7 +90752,7 @@ class PointsInstancingPickDepthRenderer {
90617
90752
  if (active) {
90618
90753
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
90619
90754
  if (origin) {
90620
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c);
90755
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b);
90621
90756
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
90622
90757
  } else {
90623
90758
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -90905,7 +91040,7 @@ class PointsInstancingPickDepthRenderer {
90905
91040
  }
90906
91041
  }
90907
91042
 
90908
- const tempVec3a$b = math.vec3();
91043
+ const tempVec3a$a = math.vec3();
90909
91044
 
90910
91045
  /**
90911
91046
  * @private
@@ -90967,7 +91102,7 @@ class PointsInstancingOcclusionRenderer {
90967
91102
  if (active) {
90968
91103
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
90969
91104
  if (origin) {
90970
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$b);
91105
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$a);
90971
91106
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
90972
91107
  } else {
90973
91108
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -91256,7 +91391,7 @@ class PointsInstancingOcclusionRenderer {
91256
91391
  }
91257
91392
  }
91258
91393
 
91259
- const tempVec3a$a = math.vec3();
91394
+ const tempVec3a$9 = math.vec3();
91260
91395
 
91261
91396
  /**
91262
91397
  * @private
@@ -91318,7 +91453,7 @@ class PointsInstancingDepthRenderer {
91318
91453
  if (active) {
91319
91454
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
91320
91455
  if (origin) {
91321
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$a);
91456
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$9);
91322
91457
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
91323
91458
  } else {
91324
91459
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -91602,7 +91737,7 @@ class PointsInstancingDepthRenderer {
91602
91737
  }
91603
91738
  }
91604
91739
 
91605
- const tempVec3a$9 = math.vec3();
91740
+ const tempVec3a$8 = math.vec3();
91606
91741
 
91607
91742
  /**
91608
91743
  * Renders InstancingLayer fragment depths to a shadow map.
@@ -91689,7 +91824,7 @@ class PointsInstancingShadowRenderer {
91689
91824
  if (active) {
91690
91825
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
91691
91826
  if (origin) {
91692
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$9);
91827
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$8);
91693
91828
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
91694
91829
  } else {
91695
91830
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -94030,7 +94165,7 @@ function getKTX2TextureTranscoder(viewer) {
94030
94165
  return transcoder;
94031
94166
  }
94032
94167
 
94033
- const tempVec3a$8 = math.vec3();
94168
+ const tempVec3a$7 = math.vec3();
94034
94169
  const tempMat4$1 = math.mat4();
94035
94170
 
94036
94171
  const defaultScale = math.vec3([1, 1, 1]);
@@ -96411,7 +96546,7 @@ class VBOSceneModel extends Component {
96411
96546
  }
96412
96547
 
96413
96548
  const cfgOrigin = cfg.origin || cfg.rtcCenter;
96414
- const origin = (cfgOrigin) ? math.addVec3(this._origin, cfgOrigin, tempVec3a$8) : this._origin;
96549
+ const origin = (cfgOrigin) ? math.addVec3(this._origin, cfgOrigin, tempVec3a$7) : this._origin;
96415
96550
 
96416
96551
  const instancingLayer = this._getInstancingLayer(origin, textureSetId, geometryId);
96417
96552
 
@@ -96473,7 +96608,7 @@ class VBOSceneModel extends Component {
96473
96608
 
96474
96609
  let indices = cfg.indices;
96475
96610
  let edgeIndices = cfg.edgeIndices;
96476
- let origin = (cfg.origin || cfg.rtcCenter) ? math.addVec3(this._origin, cfg.origin || cfg.rtcCenter, tempVec3a$8) : this._origin;
96611
+ let origin = (cfg.origin || cfg.rtcCenter) ? math.addVec3(this._origin, cfg.origin || cfg.rtcCenter, tempVec3a$7) : this._origin;
96477
96612
  let positions = cfg.positions;
96478
96613
 
96479
96614
  if (positions) {
@@ -97487,8 +97622,8 @@ class TextureTranscoder {
97487
97622
  const screenPos = math.vec4();
97488
97623
  const viewPos = math.vec4();
97489
97624
 
97490
- const tempVec3a$7 = math.vec3();
97491
- const tempVec3b$4 = math.vec3();
97625
+ const tempVec3a$6 = math.vec3();
97626
+ const tempVec3b$3 = math.vec3();
97492
97627
  const tempVec3c$3 = math.vec3();
97493
97628
 
97494
97629
  const tempVec4a$4 = math.vec4();
@@ -97522,7 +97657,7 @@ class PanController {
97522
97657
  const camera = this._scene.camera;
97523
97658
 
97524
97659
  if (optionalTargetWorldPos) {
97525
- const eyeToWorldPosVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$7);
97660
+ const eyeToWorldPosVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$6);
97526
97661
  const eyeWorldPosDist = math.lenVec3(eyeToWorldPosVec);
97527
97662
  dolliedThroughSurface = (eyeWorldPosDist < dollyDelta);
97528
97663
  }
@@ -97546,9 +97681,9 @@ class PanController {
97546
97681
  // suddenly a lot closer than the point we pivoted about on the surface of the last object
97547
97682
  // that we click-drag-pivoted on.
97548
97683
 
97549
- const eyeTargetVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$7);
97684
+ const eyeTargetVec = math.subVec3(optionalTargetWorldPos, camera.eye, tempVec3a$6);
97550
97685
  const lenEyeTargetVec = math.lenVec3(eyeTargetVec);
97551
- const eyeLookVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3b$4)), lenEyeTargetVec);
97686
+ const eyeLookVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3b$3)), lenEyeTargetVec);
97552
97687
  camera.look = [camera.eye[0] + eyeLookVec[0], camera.eye[1] + eyeLookVec[1], camera.eye[2] + eyeLookVec[2]];
97553
97688
  }
97554
97689
 
@@ -97565,7 +97700,7 @@ class PanController {
97565
97700
 
97566
97701
  const worldPos2 = this._unproject(targetCanvasPos, tempVec4b$4);
97567
97702
  const offset = math.subVec3(worldPos2, worldPos1, tempVec4c$1);
97568
- const eyeLookMoveVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$7)), -dollyDelta, tempVec3b$4);
97703
+ const eyeLookMoveVec = math.mulVec3Scalar(math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$6)), -dollyDelta, tempVec3b$3);
97569
97704
  const moveVec = math.addVec3(offset, eyeLookMoveVec, tempVec3c$3);
97570
97705
 
97571
97706
  camera.eye = [camera.eye[0] - moveVec[0], camera.eye[1] - moveVec[1], camera.eye[2] - moveVec[2]];
@@ -97593,8 +97728,8 @@ class PanController {
97593
97728
  }
97594
97729
  }
97595
97730
 
97596
- const tempVec3a$6 = math.vec3();
97597
- const tempVec3b$3 = math.vec3();
97731
+ const tempVec3a$5 = math.vec3();
97732
+ const tempVec3b$2 = math.vec3();
97598
97733
  const tempVec3c$2 = math.vec3();
97599
97734
 
97600
97735
  const tempVec4a$3 = math.vec4();
@@ -97726,8 +97861,8 @@ class PivotController {
97726
97861
 
97727
97862
  _cameraLookingDownwards() { // Returns true if angle between camera viewing direction and World-space "up" axis is too small
97728
97863
  const camera = this._scene.camera;
97729
- const forwardAxis = math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$6));
97730
- const rightAxis = math.cross3Vec3(forwardAxis, camera.worldUp, tempVec3b$3);
97864
+ const forwardAxis = math.normalizeVec3(math.subVec3(camera.look, camera.eye, tempVec3a$5));
97865
+ const rightAxis = math.cross3Vec3(forwardAxis, camera.worldUp, tempVec3b$2);
97731
97866
  let rightAxisLen = math.sqLenVec3(rightAxis);
97732
97867
  return (rightAxisLen <= 0.0001);
97733
97868
  }
@@ -97767,8 +97902,8 @@ class PivotController {
97767
97902
  const screenZ = math.dotVec4(D, Pt3) / math.dotVec4(D, Pt4);
97768
97903
  const worldPos = tempVec4a$3;
97769
97904
  camera.project.unproject(canvasPos, screenZ, tempVec4b$3, tempVec4c, worldPos);
97770
- const eyeWorldPosVec = math.normalizeVec3(math.subVec3(worldPos, camera.eye, tempVec3a$6));
97771
- const posOnSphere = math.addVec3(camera.eye, math.mulVec3Scalar(eyeWorldPosVec, pivotShereRadius, tempVec3b$3), tempVec3c$2);
97905
+ const eyeWorldPosVec = math.normalizeVec3(math.subVec3(worldPos, camera.eye, tempVec3a$5));
97906
+ const posOnSphere = math.addVec3(camera.eye, math.mulVec3Scalar(eyeWorldPosVec, pivotShereRadius, tempVec3b$2), tempVec3c$2);
97772
97907
  this.setPivotPos(posOnSphere);
97773
97908
  }
97774
97909
 
@@ -98399,8 +98534,8 @@ class MousePanRotateDollyHandler {
98399
98534
  }
98400
98535
 
98401
98536
  const center = math.vec3();
98402
- const tempVec3a$5 = math.vec3();
98403
- const tempVec3b$2 = math.vec3();
98537
+ const tempVec3a$4 = math.vec3();
98538
+ const tempVec3b$1 = math.vec3();
98404
98539
  const tempVec3c$1 = math.vec3();
98405
98540
  const tempVec3d = math.vec3();
98406
98541
 
@@ -98454,39 +98589,39 @@ class KeyboardAxisViewHandler {
98454
98589
 
98455
98590
  if (axisViewRight) {
98456
98591
 
98457
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, perspectiveDist, tempVec3a$5), tempVec3d));
98592
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, perspectiveDist, tempVec3a$4), tempVec3d));
98458
98593
  tempCameraTarget.look.set(center);
98459
98594
  tempCameraTarget.up.set(camera.worldUp);
98460
98595
 
98461
98596
  } else if (axisViewBack) {
98462
98597
 
98463
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, perspectiveDist, tempVec3a$5), tempVec3d));
98598
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, perspectiveDist, tempVec3a$4), tempVec3d));
98464
98599
  tempCameraTarget.look.set(center);
98465
98600
  tempCameraTarget.up.set(camera.worldUp);
98466
98601
 
98467
98602
  } else if (axisViewLeft) {
98468
98603
 
98469
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, -perspectiveDist, tempVec3a$5), tempVec3d));
98604
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldRight, -perspectiveDist, tempVec3a$4), tempVec3d));
98470
98605
  tempCameraTarget.look.set(center);
98471
98606
  tempCameraTarget.up.set(camera.worldUp);
98472
98607
 
98473
98608
  } else if (axisViewFront) {
98474
98609
 
98475
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, -perspectiveDist, tempVec3a$5), tempVec3d));
98610
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldForward, -perspectiveDist, tempVec3a$4), tempVec3d));
98476
98611
  tempCameraTarget.look.set(center);
98477
98612
  tempCameraTarget.up.set(camera.worldUp);
98478
98613
 
98479
98614
  } else if (axisViewTop) {
98480
98615
 
98481
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, perspectiveDist, tempVec3a$5), tempVec3d));
98616
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, perspectiveDist, tempVec3a$4), tempVec3d));
98482
98617
  tempCameraTarget.look.set(center);
98483
- tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, 1, tempVec3b$2), tempVec3c$1));
98618
+ tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, 1, tempVec3b$1), tempVec3c$1));
98484
98619
 
98485
98620
  } else if (axisViewBottom) {
98486
98621
 
98487
- tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, -perspectiveDist, tempVec3a$5), tempVec3d));
98622
+ tempCameraTarget.eye.set(math.addVec3(center, math.mulVec3Scalar(camera.worldUp, -perspectiveDist, tempVec3a$4), tempVec3d));
98488
98623
  tempCameraTarget.look.set(center);
98489
- tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, -1, tempVec3b$2)));
98624
+ tempCameraTarget.up.set(math.normalizeVec3(math.mulVec3Scalar(camera.worldForward, -1, tempVec3b$1)));
98490
98625
  }
98491
98626
 
98492
98627
  if ((!configs.firstPerson) && configs.followPointer) {
@@ -102923,7 +103058,8 @@ class DistanceMeasurementsControl extends Component {
102923
103058
  this._active = false;
102924
103059
 
102925
103060
  // Mouse input uses a combo of events that requires us to track
102926
- // the current DistanceMeasurement under construction. This is not used for touch input.
103061
+ // the current DistanceMeasurement under construction. This is not used for touch input, which
103062
+ // just uses touch-move-release to make a measurement.
102927
103063
  this._currentDistanceMeasurementByMouse = null;
102928
103064
 
102929
103065
  this._currentDistanceMeasurementByMouseInittouchState = {
@@ -103111,6 +103247,7 @@ class DistanceMeasurementsControl extends Component {
103111
103247
 
103112
103248
  this._onPickedNothing = cameraControl.on("pickedNothing", event => {
103113
103249
  if (this._currentDistanceMeasurementByMouse) {
103250
+ this.fire("measurementCancel", this._currentDistanceMeasurementByMouse);
103114
103251
  this._currentDistanceMeasurementByMouse.destroy();
103115
103252
  this._currentDistanceMeasurementByMouse = null;
103116
103253
  }
@@ -103153,7 +103290,7 @@ class DistanceMeasurementsControl extends Component {
103153
103290
  case SECOND_TOUCH_EXPECTED:
103154
103291
  startDot.setVisible(false);
103155
103292
  this._touchStartMarker.worldPos = pickResult.worldPos;
103156
- const measurement = plugin.createMeasurement({
103293
+ const measurement = plugin.createMeasurement({
103157
103294
  id: math.createUUID(),
103158
103295
  origin: {
103159
103296
  entity: mouseHoverEntity,
@@ -103167,6 +103304,7 @@ class DistanceMeasurementsControl extends Component {
103167
103304
  });
103168
103305
  measurement.clickable = true;
103169
103306
  touchState = FIRST_TOUCH_EXPECTED;
103307
+ this.fire("measurementEnd", measurement);
103170
103308
  break;
103171
103309
  }
103172
103310
  } else {
@@ -103208,7 +103346,11 @@ class DistanceMeasurementsControl extends Component {
103208
103346
  canvas.removeEventListener("touchstart", this._onCanvasTouchStart);
103209
103347
  canvas.removeEventListener("touchend", this._onCanvasTouchEnd);
103210
103348
 
103211
- this._currentDistanceMeasurementByMouse = null;
103349
+ if (this._currentDistanceMeasurementByMouse) {
103350
+ this.fire("measurementCancel", this._currentDistanceMeasurementByMouse);
103351
+ this._currentDistanceMeasurementByMouse.destroy();
103352
+ this._currentDistanceMeasurementByMouse = null;
103353
+ }
103212
103354
 
103213
103355
  this._active = false;
103214
103356
  }
@@ -103225,6 +103367,7 @@ class DistanceMeasurementsControl extends Component {
103225
103367
  return;
103226
103368
  }
103227
103369
  if (this._currentDistanceMeasurementByMouse) {
103370
+ this.fire("measurementCancel", this._currentDistanceMeasurementByMouse);
103228
103371
  this._currentDistanceMeasurementByMouse.destroy();
103229
103372
  this._currentDistanceMeasurementByMouse = null;
103230
103373
  }
@@ -113658,7 +113801,7 @@ class NavCubePlugin extends Plugin {
113658
113801
  }
113659
113802
  }
113660
113803
 
113661
- const tempVec3a$4 = math.vec3();
113804
+ const tempVec3a$3 = math.vec3();
113662
113805
 
113663
113806
  /**
113664
113807
  * @private
@@ -114356,7 +114499,7 @@ function createMeshes(modelNode, state) {
114356
114499
  }
114357
114500
  geometryCfg.indices = indices;
114358
114501
 
114359
- const origin = tempVec3a$4;
114502
+ const origin = tempVec3a$3;
114360
114503
 
114361
114504
  worldToRTCPositions(geometry.positions, geometry.positions, origin);
114362
114505
 
@@ -116815,7 +116958,7 @@ class STLDefaultDataSource {
116815
116958
  }
116816
116959
  }
116817
116960
 
116818
- const tempVec3a$3 = math.vec3();
116961
+ const tempVec3a$2 = math.vec3();
116819
116962
 
116820
116963
  /**
116821
116964
  * @private
@@ -117067,7 +117210,7 @@ function addMesh(modelNode, positions, normals, colors, material, options) {
117067
117210
  math.faceToVertexNormals(positions, normals, options);
117068
117211
  }
117069
117212
 
117070
- const origin = tempVec3a$3;
117213
+ const origin = tempVec3a$2;
117071
117214
 
117072
117215
  worldToRTCPositions(positions, positions, origin);
117073
117216
 
@@ -117577,7 +117720,7 @@ class StoreyMap {
117577
117720
  }
117578
117721
  }
117579
117722
 
117580
- const tempVec3a$2 = math.vec3();
117723
+ const tempVec3a$1 = math.vec3();
117581
117724
  const tempMat4 = math.mat4();
117582
117725
 
117583
117726
  const EMPTY_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==";
@@ -117997,7 +118140,7 @@ class StoreyViewsPlugin extends Plugin {
117997
118140
 
117998
118141
  const orthoScale2 = diag * 1.3;
117999
118142
 
118000
- const eye2 = tempVec3a$2;
118143
+ const eye2 = tempVec3a$1;
118001
118144
 
118002
118145
  eye2[0] = look2[0] + (camera.worldUp[0] * sca);
118003
118146
  eye2[1] = look2[1] + (camera.worldUp[1] * sca);
@@ -118208,7 +118351,7 @@ class StoreyViewsPlugin extends Plugin {
118208
118351
  const aabb = storey.aabb;
118209
118352
  const look = math.getAABB3Center(aabb);
118210
118353
  const sca = 0.5;
118211
- const eye = tempVec3a$2;
118354
+ const eye = tempVec3a$1;
118212
118355
  eye[0] = look[0] + (camera.worldUp[0] * sca);
118213
118356
  eye[1] = look[1] + (camera.worldUp[1] * sca);
118214
118357
  eye[2] = look[2] + (camera.worldUp[2] * sca);
@@ -118264,7 +118407,7 @@ class StoreyViewsPlugin extends Plugin {
118264
118407
 
118265
118408
  const origin = math.vec3([xmin + (xWorldSize * normX), ymin + (yWorldSize * 0.5), zmin + (zWorldSize * normZ)]);
118266
118409
  const direction = math.vec3([0, -1, 0]);
118267
- const look = math.addVec3(origin, direction, tempVec3a$2);
118410
+ const look = math.addVec3(origin, direction, tempVec3a$1);
118268
118411
  const worldForward = this.viewer.camera.worldForward;
118269
118412
  const matrix = math.lookAtMat4v(origin, look, worldForward, tempMat4);
118270
118413
 
@@ -118362,7 +118505,7 @@ class StoreyViewsPlugin extends Plugin {
118362
118505
  const camera = this.viewer.camera;
118363
118506
  const eye = camera.eye;
118364
118507
  const look = camera.look;
118365
- const eyeLookDir = math.subVec3(look, eye, tempVec3a$2);
118508
+ const eyeLookDir = math.subVec3(look, eye, tempVec3a$1);
118366
118509
  const worldUp = camera.worldUp;
118367
118510
  const xUp = worldUp[0] > worldUp[1] && worldUp[0] > worldUp[2];
118368
118511
  const yUp = !xUp && worldUp[1] > worldUp[0] && worldUp[1] > worldUp[2];
@@ -119790,116 +119933,6 @@ class TreeViewPlugin extends Plugin {
119790
119933
  }
119791
119934
  }
119792
119935
 
119793
- const tempVec3a$1 = math.vec3();
119794
- const tempVec3b$1 = math.vec3();
119795
- const tempMat4a = math.mat4();
119796
-
119797
- /**
119798
- * @private
119799
- */
119800
- class FrustumPlane {
119801
-
119802
- constructor() {
119803
- this.normal = math.vec3();
119804
- this.offset = 0;
119805
- this.testVertex = math.vec3();
119806
- }
119807
-
119808
- set(nx, ny, nz, offset) {
119809
- const s = 1.0 / Math.sqrt(nx * nx + ny * ny + nz * nz);
119810
- this.normal[0] = nx * s;
119811
- this.normal[1] = ny * s;
119812
- this.normal[2] = nz * s;
119813
- this.offset = offset * s;
119814
- this.testVertex[0] = (this.normal[0] >= 0.0) ? 1 : 0;
119815
- this.testVertex[1] = (this.normal[1] >= 0.0) ? 1 : 0;
119816
- this.testVertex[2] = (this.normal[2] >= 0.0) ? 1 : 0;
119817
- }
119818
- }
119819
-
119820
- /**
119821
- * @private
119822
- */
119823
- class Frustum {
119824
- constructor() {
119825
- this.planes = [
119826
- new FrustumPlane(), new FrustumPlane(), new FrustumPlane(),
119827
- new FrustumPlane(), new FrustumPlane(), new FrustumPlane()
119828
- ];
119829
- }
119830
- }
119831
-
119832
- Frustum.INSIDE = 0;
119833
- Frustum.INTERSECT = 1;
119834
- Frustum.OUTSIDE = 2;
119835
-
119836
- /** @private */
119837
- function setFrustum(frustum, viewMat, projMat) {
119838
-
119839
- const m = math.mulMat4(projMat, viewMat, tempMat4a);
119840
-
119841
- const m0 = m[0];
119842
- const m1 = m[1];
119843
- const m2 = m[2];
119844
- const m3 = m[3];
119845
- const m4 = m[4];
119846
- const m5 = m[5];
119847
- const m6 = m[6];
119848
- const m7 = m[7];
119849
- const m8 = m[8];
119850
- const m9 = m[9];
119851
- const m10 = m[10];
119852
- const m11 = m[11];
119853
- const m12 = m[12];
119854
- const m13 = m[13];
119855
- const m14 = m[14];
119856
- const m15 = m[15];
119857
-
119858
- frustum.planes[0].set(m3 - m0, m7 - m4, m11 - m8, m15 - m12);
119859
- frustum.planes[1].set(m3 + m0, m7 + m4, m11 + m8, m15 + m12);
119860
- frustum.planes[2].set(m3 - m1, m7 - m5, m11 - m9, m15 - m13);
119861
- frustum.planes[3].set(m3 + m1, m7 + m5, m11 + m9, m15 + m13);
119862
- frustum.planes[4].set(m3 - m2, m7 - m6, m11 - m10, m15 - m14);
119863
- frustum.planes[5].set(m3 + m2, m7 + m6, m11 + m10, m15 + m14);
119864
- }
119865
-
119866
- /** @private */
119867
- function frustumIntersectsAABB3(frustum, aabb) {
119868
-
119869
- let ret = Frustum.INSIDE;
119870
-
119871
- const min = tempVec3a$1;
119872
- const max = tempVec3b$1;
119873
-
119874
- min[0] = aabb[0];
119875
- min[1] = aabb[1];
119876
- min[2] = aabb[2];
119877
- max[0] = aabb[3];
119878
- max[1] = aabb[4];
119879
- max[2] = aabb[5];
119880
-
119881
- const bminmax = [min, max];
119882
-
119883
- for (let i = 0; i < 6; ++i) {
119884
- const plane = frustum.planes[i];
119885
- if (((plane.normal[0] * bminmax[plane.testVertex[0]][0]) +
119886
- (plane.normal[1] * bminmax[plane.testVertex[1]][1]) +
119887
- (plane.normal[2] * bminmax[plane.testVertex[2]][2]) +
119888
- (plane.offset)) < 0.0) {
119889
- return Frustum.OUTSIDE;
119890
- }
119891
-
119892
- if (((plane.normal[0] * bminmax[1 - plane.testVertex[0]][0]) +
119893
- (plane.normal[1] * bminmax[1 - plane.testVertex[1]][1]) +
119894
- (plane.normal[2] * bminmax[1 - plane.testVertex[2]][2]) +
119895
- (plane.offset)) < 0.0) {
119896
- ret = Frustum.INTERSECT;
119897
- }
119898
- }
119899
-
119900
- return ret;
119901
- }
119902
-
119903
119936
  /**
119904
119937
  * For each Entity in its Scene, efficiently combines updates from multiple culling systems into a single "culled" state.
119905
119938
  *
@@ -181217,6 +181250,8 @@ exports.EmphasisMaterial = EmphasisMaterial;
181217
181250
  exports.FastNavPlugin = FastNavPlugin;
181218
181251
  exports.FloatType = FloatType;
181219
181252
  exports.Fresnel = Fresnel;
181253
+ exports.Frustum = Frustum;
181254
+ exports.FrustumPlane = FrustumPlane;
181220
181255
  exports.GIFMediaType = GIFMediaType;
181221
181256
  exports.GLTFDefaultDataSource = GLTFDefaultDataSource;
181222
181257
  exports.GLTFLoaderPlugin = GLTFLoaderPlugin;
@@ -181337,10 +181372,12 @@ exports.buildPlaneGeometry = buildPlaneGeometry;
181337
181372
  exports.buildSphereGeometry = buildSphereGeometry;
181338
181373
  exports.buildTorusGeometry = buildTorusGeometry;
181339
181374
  exports.buildVectorTextGeometry = buildVectorTextGeometry;
181375
+ exports.frustumIntersectsAABB3 = frustumIntersectsAABB3;
181340
181376
  exports.getKTX2TextureTranscoder = getKTX2TextureTranscoder;
181341
181377
  exports.load3DSGeometry = load3DSGeometry;
181342
181378
  exports.loadOBJGeometry = loadOBJGeometry;
181343
181379
  exports.math = math;
181344
181380
  exports.sRGBEncoding = sRGBEncoding;
181381
+ exports.setFrustum = setFrustum;
181345
181382
  exports.stats = stats;
181346
181383
  exports.utils = utils;