@xeokit/xeokit-sdk 2.4.0-alpha-80 → 2.4.0-alpha-81

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.
@@ -8208,7 +8208,7 @@ class Component {
8208
8208
  }
8209
8209
  }
8210
8210
 
8211
- const tempVec3a$E = math.vec3();
8211
+ const tempVec3a$F = math.vec3();
8212
8212
 
8213
8213
  /**
8214
8214
  * Given a view matrix and a relative-to-center (RTC) coordinate origin, returns a view matrix
@@ -8288,7 +8288,7 @@ function worldToRTCPos(worldPos, rtcCenter, rtcPos) {
8288
8288
  */
8289
8289
  function worldToRTCPositions(worldPositions, rtcPositions, rtcCenter, cellSize = 1000) {
8290
8290
 
8291
- const center = math.getPositionsCenter(worldPositions, tempVec3a$E);
8291
+ const center = math.getPositionsCenter(worldPositions, tempVec3a$F);
8292
8292
 
8293
8293
  const rtcCenterX = Math.round(center[0] / cellSize) * cellSize;
8294
8294
  const rtcCenterY = Math.round(center[1] / cellSize) * cellSize;
@@ -8339,7 +8339,7 @@ function rtcToWorldPos(rtcCenter, rtcPos, worldPos) {
8339
8339
  */
8340
8340
  function getPlaneRTCPos(dist, dir, rtcCenter, rtcPlanePos) {
8341
8341
  const rtcCenterToPlaneDist = math.dotVec3(dir, rtcCenter) + dist;
8342
- const dirNormalized = math.normalizeVec3(dir, tempVec3a$E);
8342
+ const dirNormalized = math.normalizeVec3(dir, tempVec3a$F);
8343
8343
  math.mulVec3Scalar(dirNormalized, -rtcCenterToPlaneDist, rtcPlanePos);
8344
8344
  return rtcPlanePos;
8345
8345
  }
@@ -10639,15 +10639,18 @@ class AngleMeasurementsControl extends Component {
10639
10639
  break;
10640
10640
  case FINDING_CORNER:
10641
10641
  this._currentAngleMeasurement.corner.worldPos = pickResult.worldPos;
10642
+ this._currentAngleMeasurement.originWireVisible = true;
10642
10643
  this._currentAngleMeasurement.targetWireVisible = false;
10643
10644
  this._currentAngleMeasurement.targetVisible = true;
10644
10645
  this._currentAngleMeasurement.angleVisible = true;
10646
+ this._currentAngleMeasurement.cornerVisible = true;
10645
10647
  this._state = FINDING_TARGET;
10646
10648
  break;
10647
10649
  case FINDING_TARGET:
10648
10650
  this._currentAngleMeasurement.target.worldPos = pickResult.worldPos;
10649
10651
  // this._currentAngleMeasurement.approximate = false;
10650
10652
  this._currentAngleMeasurement.targetVisible = true;
10653
+ this._currentAngleMeasurement.targetWireVisible = true;
10651
10654
  this._currentAngleMeasurement.angleVisible = true;
10652
10655
  this._currentAngleMeasurement.clickable = true;
10653
10656
  this.fire("measurementEnd", this._currentAngleMeasurement);
@@ -11513,9 +11516,9 @@ class Annotation extends Marker {
11513
11516
  }
11514
11517
  }
11515
11518
 
11516
- const tempVec3a$D = math.vec3();
11517
- const tempVec3b$q = math.vec3();
11518
- const tempVec3c$m = math.vec3();
11519
+ const tempVec3a$E = math.vec3();
11520
+ const tempVec3b$r = math.vec3();
11521
+ const tempVec3c$n = math.vec3();
11519
11522
 
11520
11523
  /**
11521
11524
  * {@link Viewer} plugin that creates {@link Annotation}s.
@@ -11999,9 +12002,9 @@ class AnnotationsPlugin extends Plugin {
11999
12002
  if (!pickResult.worldPos || !pickResult.worldNormal) {
12000
12003
  this.error("Param 'pickResult' does not have both worldPos and worldNormal");
12001
12004
  } else {
12002
- const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$D);
12003
- const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$q);
12004
- const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$m);
12005
+ const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$E);
12006
+ const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$r);
12007
+ const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$n);
12005
12008
  worldPos = offsetWorldPos;
12006
12009
  entity = pickResult.entity;
12007
12010
  }
@@ -13295,6 +13298,18 @@ class PickResult {
13295
13298
  */
13296
13299
  this.touchInput = false;
13297
13300
 
13301
+ /**
13302
+ * True when snapped to the nearest vertex position.
13303
+ * @type {boolean}
13304
+ */
13305
+ this.snappedToVertex = false;
13306
+
13307
+ /**
13308
+ * True when snapped to the nearest edge.
13309
+ * @type {boolean}
13310
+ */
13311
+ this.snappedToEdge = false;
13312
+
13298
13313
  this._canvasPos = new Int16Array([0, 0]);
13299
13314
  this._origin = new Float64Array([0, 0, 0]);
13300
13315
  this._direction = new Float64Array([0, 0, 0]);
@@ -13566,6 +13581,8 @@ class PickResult {
13566
13581
  this._gotWorldNormal = false;
13567
13582
  this._gotUV = false;
13568
13583
  this.touchInput = false;
13584
+ this.snappedToVertex = false;
13585
+ this.snappedToEdge = false;
13569
13586
  }
13570
13587
  }
13571
13588
 
@@ -14164,7 +14181,7 @@ const MARKER_COLOR = math.vec3([1.0, 0.0, 0.0]);
14164
14181
  const POINT_SIZE = 20;
14165
14182
  const MARKER_SPRITE_CLIPZ_OFFSET = -0.001; // Amount that we offset sprite clip Z coords to raise them from surfaces
14166
14183
 
14167
- const tempVec3a$C = math.vec3();
14184
+ const tempVec3a$D = math.vec3();
14168
14185
 
14169
14186
  /**
14170
14187
  * Manages occlusion testing. Private member of a Renderer.
@@ -14501,7 +14518,7 @@ class OcclusionTester {
14501
14518
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
14502
14519
  if (active) {
14503
14520
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
14504
- gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$C));
14521
+ gl.uniform3fv(sectionPlaneUniforms.pos, getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$D));
14505
14522
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
14506
14523
  }
14507
14524
  }
@@ -19885,9 +19902,9 @@ class CustomProjection extends Component {
19885
19902
  }
19886
19903
 
19887
19904
  const tempVec3$7 = math.vec3();
19888
- const tempVec3b$p = math.vec3();
19889
- const tempVec3c$l = math.vec3();
19890
- const tempVec3d$f = math.vec3();
19905
+ const tempVec3b$q = math.vec3();
19906
+ const tempVec3c$m = math.vec3();
19907
+ const tempVec3d$g = math.vec3();
19891
19908
  const tempVec3e$8 = math.vec3();
19892
19909
  const tempVec3f$2 = math.vec3();
19893
19910
  const tempVec4a$d = math.vec4();
@@ -20198,9 +20215,9 @@ class Camera extends Component {
20198
20215
  orbitYaw(angleInc) {
20199
20216
  let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3$7);
20200
20217
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
20201
- lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$p);
20202
- this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$l); // Set eye position as 'look' plus 'eye' vector
20203
- this.up = math.transformPoint3(tempMat, this._up, tempVec3d$f); // Rotate 'up' vector
20218
+ lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$q);
20219
+ this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$m); // Set eye position as 'look' plus 'eye' vector
20220
+ this.up = math.transformPoint3(tempMat, this._up, tempVec3d$g); // Rotate 'up' vector
20204
20221
  }
20205
20222
 
20206
20223
  /**
@@ -20216,9 +20233,9 @@ class Camera extends Component {
20216
20233
  }
20217
20234
  }
20218
20235
  let eye2 = math.subVec3(this._eye, this._look, tempVec3$7);
20219
- const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$p), math.normalizeVec3(this._up, tempVec3c$l));
20236
+ const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$m));
20220
20237
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
20221
- eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$f);
20238
+ eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$g);
20222
20239
  this.up = math.transformPoint3(tempMat, this._up, tempVec3e$8);
20223
20240
  this.eye = math.addVec3(eye2, this._look, tempVec3f$2);
20224
20241
  }
@@ -20231,10 +20248,10 @@ class Camera extends Component {
20231
20248
  yaw(angleInc) {
20232
20249
  let look2 = math.subVec3(this._look, this._eye, tempVec3$7);
20233
20250
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
20234
- look2 = math.transformPoint3(tempMat, look2, tempVec3b$p);
20235
- this.look = math.addVec3(look2, this._eye, tempVec3c$l);
20251
+ look2 = math.transformPoint3(tempMat, look2, tempVec3b$q);
20252
+ this.look = math.addVec3(look2, this._eye, tempVec3c$m);
20236
20253
  if (this._gimbalLock) {
20237
- this.up = math.transformPoint3(tempMat, this._up, tempVec3d$f);
20254
+ this.up = math.transformPoint3(tempMat, this._up, tempVec3d$g);
20238
20255
  }
20239
20256
  }
20240
20257
 
@@ -20251,10 +20268,10 @@ class Camera extends Component {
20251
20268
  }
20252
20269
  }
20253
20270
  let look2 = math.subVec3(this._look, this._eye, tempVec3$7);
20254
- const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$p), math.normalizeVec3(this._up, tempVec3c$l));
20271
+ const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$m));
20255
20272
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
20256
20273
  this.up = math.transformPoint3(tempMat, this._up, tempVec3f$2);
20257
- look2 = math.transformPoint3(tempMat, look2, tempVec3d$f);
20274
+ look2 = math.transformPoint3(tempMat, look2, tempVec3d$g);
20258
20275
  this.look = math.addVec3(look2, this._eye, tempVec3e$8);
20259
20276
  }
20260
20277
 
@@ -20268,20 +20285,20 @@ class Camera extends Component {
20268
20285
  const vec = [0, 0, 0];
20269
20286
  let v;
20270
20287
  if (pan[0] !== 0) {
20271
- const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$p));
20288
+ const left = math.cross3Vec3(math.normalizeVec3(eye2, []), math.normalizeVec3(this._up, tempVec3b$q));
20272
20289
  v = math.mulVec3Scalar(left, pan[0]);
20273
20290
  vec[0] += v[0];
20274
20291
  vec[1] += v[1];
20275
20292
  vec[2] += v[2];
20276
20293
  }
20277
20294
  if (pan[1] !== 0) {
20278
- v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$l), pan[1]);
20295
+ v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$m), pan[1]);
20279
20296
  vec[0] += v[0];
20280
20297
  vec[1] += v[1];
20281
20298
  vec[2] += v[2];
20282
20299
  }
20283
20300
  if (pan[2] !== 0) {
20284
- v = math.mulVec3Scalar(math.normalizeVec3(eye2, tempVec3d$f), pan[2]);
20301
+ v = math.mulVec3Scalar(math.normalizeVec3(eye2, tempVec3d$g), pan[2]);
20285
20302
  vec[0] += v[0];
20286
20303
  vec[1] += v[1];
20287
20304
  vec[2] += v[2];
@@ -20297,13 +20314,13 @@ class Camera extends Component {
20297
20314
  */
20298
20315
  zoom(delta) {
20299
20316
  const vec = math.subVec3(this._eye, this._look, tempVec3$7);
20300
- const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$p));
20317
+ const lenLook = Math.abs(math.lenVec3(vec, tempVec3b$q));
20301
20318
  const newLenLook = Math.abs(lenLook + delta);
20302
20319
  if (newLenLook < 0.5) {
20303
20320
  return;
20304
20321
  }
20305
- const dir = math.normalizeVec3(vec, tempVec3c$l);
20306
- this.eye = math.addVec3(this._look, math.mulVec3Scalar(dir, newLenLook), tempVec3d$f);
20322
+ const dir = math.normalizeVec3(vec, tempVec3c$m);
20323
+ this.eye = math.addVec3(this._look, math.mulVec3Scalar(dir, newLenLook), tempVec3d$g);
20307
20324
  }
20308
20325
 
20309
20326
  /**
@@ -25966,9 +25983,9 @@ class LinesMaterial extends Material {
25966
25983
  }
25967
25984
  }
25968
25985
 
25969
- const tempVec3a$B = math.vec3();
25970
- const tempVec3b$o = math.vec3();
25971
- const tempMat4a$f = math.mat4();
25986
+ const tempVec3a$C = math.vec3();
25987
+ const tempVec3b$p = math.vec3();
25988
+ const tempMat4a$g = math.mat4();
25972
25989
 
25973
25990
  /**
25974
25991
  * @private
@@ -26012,7 +26029,7 @@ Frustum.OUTSIDE = 2;
26012
26029
  /** @private */
26013
26030
  function setFrustum(frustum, viewMat, projMat) {
26014
26031
 
26015
- const m = math.mulMat4(projMat, viewMat, tempMat4a$f);
26032
+ const m = math.mulMat4(projMat, viewMat, tempMat4a$g);
26016
26033
 
26017
26034
  const m0 = m[0];
26018
26035
  const m1 = m[1];
@@ -26044,8 +26061,8 @@ function frustumIntersectsAABB3(frustum, aabb) {
26044
26061
 
26045
26062
  let ret = Frustum.INSIDE;
26046
26063
 
26047
- const min = tempVec3a$B;
26048
- const max = tempVec3b$o;
26064
+ const min = tempVec3a$C;
26065
+ const max = tempVec3b$p;
26049
26066
 
26050
26067
  min[0] = aabb[0];
26051
26068
  min[1] = aabb[1];
@@ -32815,7 +32832,7 @@ function buildFragmentDraw(mesh) {
32815
32832
  * @author xeolabs / https://github.com/xeolabs
32816
32833
  */
32817
32834
 
32818
- const tempVec3a$A = math.vec3();
32835
+ const tempVec3a$B = math.vec3();
32819
32836
 
32820
32837
  const ids$2 = new Map$1({});
32821
32838
 
@@ -32914,7 +32931,7 @@ DrawRenderer.prototype.drawMesh = function (frameCtx, mesh) {
32914
32931
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
32915
32932
  if (active) {
32916
32933
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
32917
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$A) : sectionPlane.pos);
32934
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$B) : sectionPlane.pos);
32918
32935
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
32919
32936
  }
32920
32937
  }
@@ -34052,7 +34069,7 @@ function buildFragment$5(mesh) {
34052
34069
 
34053
34070
  const ids$1 = new Map$1({});
34054
34071
 
34055
- const tempVec3a$z = math.vec3();
34072
+ const tempVec3a$A = math.vec3();
34056
34073
 
34057
34074
  /**
34058
34075
  * @private
@@ -34136,7 +34153,7 @@ EmphasisFillRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
34136
34153
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
34137
34154
  if (active) {
34138
34155
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
34139
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$z) : sectionPlane.pos);
34156
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$A) : sectionPlane.pos);
34140
34157
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
34141
34158
  }
34142
34159
  }
@@ -34472,7 +34489,7 @@ function buildFragment$4(mesh) {
34472
34489
 
34473
34490
  const ids = new Map$1({});
34474
34491
 
34475
- const tempVec3a$y = math.vec3();
34492
+ const tempVec3a$z = math.vec3();
34476
34493
 
34477
34494
  /**
34478
34495
  * @private
@@ -34555,7 +34572,7 @@ EmphasisEdgesRenderer.prototype.drawMesh = function (frameCtx, mesh, mode) {
34555
34572
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
34556
34573
  if (active) {
34557
34574
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
34558
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$y) : sectionPlane.pos);
34575
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$z) : sectionPlane.pos);
34559
34576
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
34560
34577
  }
34561
34578
  }
@@ -34850,7 +34867,7 @@ function buildFragment$3(mesh) {
34850
34867
  * @author xeolabs / https://github.com/xeolabs
34851
34868
  */
34852
34869
 
34853
- const tempVec3a$x = math.vec3();
34870
+ const tempVec3a$y = math.vec3();
34854
34871
 
34855
34872
  // No ID, because there is exactly one PickMeshRenderer per scene
34856
34873
 
@@ -34934,7 +34951,7 @@ PickMeshRenderer.prototype.drawMesh = function (frameCtx, mesh) {
34934
34951
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
34935
34952
  if (active) {
34936
34953
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
34937
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$x) : sectionPlane.pos);
34954
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$y) : sectionPlane.pos);
34938
34955
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
34939
34956
  }
34940
34957
  }
@@ -35167,7 +35184,7 @@ function buildFragment$2(mesh) {
35167
35184
  * @author xeolabs / https://github.com/xeolabs
35168
35185
  */
35169
35186
 
35170
- const tempVec3a$w = math.vec3();
35187
+ const tempVec3a$x = math.vec3();
35171
35188
 
35172
35189
  /**
35173
35190
  * @private
@@ -35259,7 +35276,7 @@ PickTriangleRenderer.prototype.drawMesh = function (frameCtx, mesh) {
35259
35276
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
35260
35277
  if (active) {
35261
35278
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
35262
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$w) : sectionPlane.pos);
35279
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$x) : sectionPlane.pos);
35263
35280
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
35264
35281
  }
35265
35282
  }
@@ -35496,7 +35513,7 @@ function buildFragment$1(mesh) {
35496
35513
  * @author xeolabs / https://github.com/xeolabs
35497
35514
  */
35498
35515
 
35499
- const tempVec3a$v = math.vec3();
35516
+ const tempVec3a$w = math.vec3();
35500
35517
 
35501
35518
  // No ID, because there is exactly one PickMeshRenderer per scene
35502
35519
 
@@ -35604,7 +35621,7 @@ OcclusionRenderer.prototype.drawMesh = function (frameCtx, mesh) {
35604
35621
  gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
35605
35622
  if (active) {
35606
35623
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
35607
- gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$v) : sectionPlane.pos);
35624
+ gl.uniform3fv(sectionPlaneUniforms.pos, origin ? getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$w) : sectionPlane.pos);
35608
35625
  gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
35609
35626
  }
35610
35627
  }
@@ -48425,9 +48442,9 @@ class LineSet extends Component {
48425
48442
  }
48426
48443
 
48427
48444
  const tempVec3$5 = math.vec3();
48428
- const tempVec3a$u = math.vec3();
48429
- const tempVec3b$n = math.vec3();
48430
- const tempVec3c$k = math.vec3();
48445
+ const tempVec3a$v = math.vec3();
48446
+ const tempVec3b$o = math.vec3();
48447
+ const tempVec3c$l = math.vec3();
48431
48448
 
48432
48449
  /**
48433
48450
  * {@link Viewer} plugin that saves and loads BCF viewpoints as JSON objects.
@@ -49106,9 +49123,9 @@ class BCFViewpointsPlugin extends Plugin {
49106
49123
  bcfViewpoint.bitmaps.forEach(function (e) {
49107
49124
  const bitmap_type = e.bitmap_type || "jpg"; // "jpg" | "png"
49108
49125
  const bitmap_data = e.bitmap_data; // base64
49109
- let location = xyzObjectToArray(e.location, tempVec3a$u);
49110
- let normal = xyzObjectToArray(e.normal, tempVec3b$n);
49111
- let up = xyzObjectToArray(e.up, tempVec3c$k);
49126
+ let location = xyzObjectToArray(e.location, tempVec3a$v);
49127
+ let normal = xyzObjectToArray(e.normal, tempVec3b$o);
49128
+ let up = xyzObjectToArray(e.up, tempVec3c$l);
49112
49129
  let height = e.height || 1;
49113
49130
  if (!bitmap_type) {
49114
49131
  return;
@@ -51010,7 +51027,7 @@ class SplineCurve extends Curve {
51010
51027
  }
51011
51028
  }
51012
51029
 
51013
- const tempVec3a$t = math.vec3();
51030
+ const tempVec3a$u = math.vec3();
51014
51031
 
51015
51032
  /**
51016
51033
  * @desc Defines a sequence of frames along which a {@link CameraPathAnimation} can animate a {@link Camera}.
@@ -51142,9 +51159,9 @@ class CameraPath extends Component {
51142
51159
  t = t / (this._frames[this._frames.length - 1].t - this._frames[0].t);
51143
51160
  t = t < 0.0 ? 0.0 : (t > 1.0 ? 1.0 : t);
51144
51161
 
51145
- camera.eye = this._eyeCurve.getPoint(t, tempVec3a$t);
51146
- camera.look = this._lookCurve.getPoint(t, tempVec3a$t);
51147
- camera.up = this._upCurve.getPoint(t, tempVec3a$t);
51162
+ camera.eye = this._eyeCurve.getPoint(t, tempVec3a$u);
51163
+ camera.look = this._lookCurve.getPoint(t, tempVec3a$u);
51164
+ camera.up = this._upCurve.getPoint(t, tempVec3a$u);
51148
51165
  }
51149
51166
 
51150
51167
  /**
@@ -52183,7 +52200,7 @@ CameraPathAnimation.PLAYING = 2;
52183
52200
  CameraPathAnimation.PLAYING_TO = 3;
52184
52201
 
52185
52202
  const tempVec3$3 = math.vec3();
52186
- const tempVec3b$m = math.vec3();
52203
+ const tempVec3b$n = math.vec3();
52187
52204
  math.vec3();
52188
52205
  const zeroVec$2 = math.vec3([0, -1, 0]);
52189
52206
  const tempQuat = math.vec4([0, 0, 0, 1]);
@@ -52611,7 +52628,7 @@ class ImagePlane extends Component {
52611
52628
  const dist = -math.dotVec3(negDir, tempVec3$3);
52612
52629
 
52613
52630
  math.normalizeVec3(negDir);
52614
- math.mulVec3Scalar(negDir, dist, tempVec3b$m);
52631
+ math.mulVec3Scalar(negDir, dist, tempVec3b$n);
52615
52632
  math.vec3PairToQuaternion(zeroVec$2, dir, tempQuat);
52616
52633
 
52617
52634
  this._node.quaternion = tempQuat;
@@ -55329,10 +55346,10 @@ const defaultColor$2 = new Float32Array([1, 1, 1, 1]);
55329
55346
  const edgesDefaultColor = new Float32Array([0, 0, 0, 1]);
55330
55347
 
55331
55348
  const tempVec4 = math.vec4();
55332
- const tempVec3a$s = math.vec3();
55349
+ const tempVec3a$t = math.vec3();
55333
55350
  math.vec3();
55334
- const tempVec3c$j = math.vec3();
55335
- const tempMat4a$e = math.mat4();
55351
+ const tempVec3c$k = math.vec3();
55352
+ const tempMat4a$f = math.mat4();
55336
55353
 
55337
55354
  class VBOSceneModelRenderer {
55338
55355
  constructor(scene, withSAO = false, {instancing = false, edges = false} = {}) {
@@ -55426,7 +55443,7 @@ class VBOSceneModelRenderer {
55426
55443
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
55427
55444
  const origin = layer._state.origin;
55428
55445
  if (origin) {
55429
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$s);
55446
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$t);
55430
55447
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
55431
55448
  } else {
55432
55449
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -55777,9 +55794,9 @@ class VBOSceneModelRenderer {
55777
55794
  const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
55778
55795
  const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
55779
55796
  if (gotOrigin || gotPosition) {
55780
- const rtcOrigin = tempVec3a$s;
55797
+ const rtcOrigin = tempVec3a$t;
55781
55798
  if (gotOrigin) {
55782
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$j);
55799
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$k);
55783
55800
  rtcOrigin[0] = rotatedOrigin[0];
55784
55801
  rtcOrigin[1] = rotatedOrigin[1];
55785
55802
  rtcOrigin[2] = rotatedOrigin[2];
@@ -55791,7 +55808,7 @@ class VBOSceneModelRenderer {
55791
55808
  rtcOrigin[0] += position[0];
55792
55809
  rtcOrigin[1] += position[1];
55793
55810
  rtcOrigin[2] += position[2];
55794
- this._matricesUniformBlockBufferData.set(createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$e), offset += mat4Size);
55811
+ this._matricesUniformBlockBufferData.set(createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$f), offset += mat4Size);
55795
55812
  } else {
55796
55813
  this._matricesUniformBlockBufferData.set(viewMatrix, offset += mat4Size);
55797
55814
  }
@@ -59254,12 +59271,12 @@ function octDecodeVec2(oct) { // Decode an oct-encoded normal
59254
59271
  ];
59255
59272
  }
59256
59273
 
59257
- const tempVec3a$r = math.vec3();
59258
- const tempVec3b$l = math.vec3();
59259
- const tempVec3c$i = math.vec3();
59260
- const tempVec3d$e = math.vec3();
59274
+ const tempVec3a$s = math.vec3();
59275
+ const tempVec3b$m = math.vec3();
59276
+ const tempVec3c$j = math.vec3();
59277
+ const tempVec3d$f = math.vec3();
59261
59278
  const tempVec3e$7 = math.vec3();
59262
- const tempMat4a$d = math.mat4();
59279
+ const tempMat4a$e = math.mat4();
59263
59280
 
59264
59281
  /**
59265
59282
  * @private
@@ -59304,7 +59321,7 @@ class SnapBatchingDepthBufInitRenderer {
59304
59321
  const aabb = batchingLayer.aabb;
59305
59322
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
59306
59323
 
59307
- const coordinateScaler = tempVec3a$r;
59324
+ const coordinateScaler = tempVec3a$s;
59308
59325
  coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
59309
59326
  coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
59310
59327
  coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
@@ -59317,9 +59334,9 @@ class SnapBatchingDepthBufInitRenderer {
59317
59334
  let rtcCameraEye;
59318
59335
 
59319
59336
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
59320
- const rtcOrigin = tempVec3b$l;
59337
+ const rtcOrigin = tempVec3b$m;
59321
59338
  if (origin) {
59322
- const rotatedOrigin = tempVec3c$i;
59339
+ const rotatedOrigin = tempVec3c$j;
59323
59340
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
59324
59341
  rtcOrigin[0] = rotatedOrigin[0];
59325
59342
  rtcOrigin[1] = rotatedOrigin[1];
@@ -59332,8 +59349,8 @@ class SnapBatchingDepthBufInitRenderer {
59332
59349
  rtcOrigin[0] += position[0];
59333
59350
  rtcOrigin[1] += position[1];
59334
59351
  rtcOrigin[2] += position[2];
59335
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$d);
59336
- rtcCameraEye = tempVec3d$e;
59352
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$e);
59353
+ rtcCameraEye = tempVec3d$f;
59337
59354
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
59338
59355
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
59339
59356
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -59600,12 +59617,12 @@ class SnapBatchingDepthBufInitRenderer {
59600
59617
  }
59601
59618
  }
59602
59619
 
59603
- const tempVec3a$q = math.vec3();
59604
- const tempVec3b$k = math.vec3();
59605
- const tempVec3c$h = math.vec3();
59606
- const tempVec3d$d = math.vec3();
59620
+ const tempVec3a$r = math.vec3();
59621
+ const tempVec3b$l = math.vec3();
59622
+ const tempVec3c$i = math.vec3();
59623
+ const tempVec3d$e = math.vec3();
59607
59624
  const tempVec3e$6 = math.vec3();
59608
- const tempMat4a$c = math.mat4();
59625
+ const tempMat4a$d = math.mat4();
59609
59626
 
59610
59627
  /**
59611
59628
  * @private
@@ -59650,7 +59667,7 @@ class SnapBatchingDepthRenderer {
59650
59667
  const aabb = batchingLayer.aabb;
59651
59668
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
59652
59669
 
59653
- const coordinateScaler = tempVec3a$q;
59670
+ const coordinateScaler = tempVec3a$r;
59654
59671
  coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
59655
59672
  coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
59656
59673
  coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
@@ -59663,9 +59680,9 @@ class SnapBatchingDepthRenderer {
59663
59680
  let rtcCameraEye;
59664
59681
 
59665
59682
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
59666
- const rtcOrigin = tempVec3b$k;
59683
+ const rtcOrigin = tempVec3b$l;
59667
59684
  if (origin) {
59668
- const rotatedOrigin = tempVec3c$h;
59685
+ const rotatedOrigin = tempVec3c$i;
59669
59686
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
59670
59687
  rtcOrigin[0] = rotatedOrigin[0];
59671
59688
  rtcOrigin[1] = rotatedOrigin[1];
@@ -59678,8 +59695,8 @@ class SnapBatchingDepthRenderer {
59678
59695
  rtcOrigin[0] += position[0];
59679
59696
  rtcOrigin[1] += position[1];
59680
59697
  rtcOrigin[2] += position[2];
59681
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$c);
59682
- rtcCameraEye = tempVec3d$d;
59698
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$d);
59699
+ rtcCameraEye = tempVec3d$e;
59683
59700
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
59684
59701
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
59685
59702
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -60033,10 +60050,10 @@ const tempVec4b$b = math.vec4([0, 0, 0, 1]);
60033
60050
  math.vec4([0, 0, 0, 1]);
60034
60051
  math.OBB3();
60035
60052
 
60036
- const tempVec3a$p = math.vec3();
60037
- const tempVec3b$j = math.vec3();
60038
- const tempVec3c$g = math.vec3();
60039
- const tempVec3d$c = math.vec3();
60053
+ const tempVec3a$q = math.vec3();
60054
+ const tempVec3b$k = math.vec3();
60055
+ const tempVec3c$h = math.vec3();
60056
+ const tempVec3d$d = math.vec3();
60040
60057
  const tempVec3e$5 = math.vec3();
60041
60058
  const tempVec3f$1 = math.vec3();
60042
60059
  const tempVec3g$1 = math.vec3();
@@ -61216,10 +61233,10 @@ class TrianglesBatchingLayer {
61216
61233
  const origin = state.origin;
61217
61234
  const offset = portion.offset;
61218
61235
 
61219
- const rtcRayOrigin = tempVec3a$p;
61220
- const rtcRayDir = tempVec3b$j;
61236
+ const rtcRayOrigin = tempVec3a$q;
61237
+ const rtcRayDir = tempVec3b$k;
61221
61238
 
61222
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$g) : worldRayOrigin); // World -> RTC
61239
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$h) : worldRayOrigin); // World -> RTC
61223
61240
  rtcRayDir.set(worldRayDir);
61224
61241
 
61225
61242
  if (offset) {
@@ -61228,7 +61245,7 @@ class TrianglesBatchingLayer {
61228
61245
 
61229
61246
  math.transformRay(this.model.worldNormalMatrix, rtcRayOrigin, rtcRayDir, rtcRayOrigin, rtcRayDir); // RTC -> local
61230
61247
 
61231
- const a = tempVec3d$c;
61248
+ const a = tempVec3d$d;
61232
61249
  const b = tempVec3e$5;
61233
61250
  const c = tempVec3f$1;
61234
61251
 
@@ -64378,12 +64395,12 @@ function getInstancingRenderers$1(scene) {
64378
64395
  return instancingRenderers;
64379
64396
  }
64380
64397
 
64381
- const tempVec3a$o = math.vec3();
64382
- const tempVec3b$i = math.vec3();
64383
- const tempVec3c$f = math.vec3();
64384
- const tempVec3d$b = math.vec3();
64398
+ const tempVec3a$p = math.vec3();
64399
+ const tempVec3b$j = math.vec3();
64400
+ const tempVec3c$g = math.vec3();
64401
+ const tempVec3d$c = math.vec3();
64385
64402
  const tempVec3e$4 = math.vec3();
64386
- const tempMat4a$b = math.mat4();
64403
+ const tempMat4a$c = math.mat4();
64387
64404
 
64388
64405
  /**
64389
64406
  * @private
@@ -64428,7 +64445,7 @@ class SnapInstancingDepthBufInitRenderer {
64428
64445
  const aabb = instancingLayer.aabb;
64429
64446
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
64430
64447
 
64431
- const coordinateScaler = tempVec3a$o;
64448
+ const coordinateScaler = tempVec3a$p;
64432
64449
  coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
64433
64450
  coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
64434
64451
  coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
@@ -64440,9 +64457,9 @@ class SnapInstancingDepthBufInitRenderer {
64440
64457
  let rtcViewMatrix;
64441
64458
  let rtcCameraEye;
64442
64459
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
64443
- const rtcOrigin = tempVec3b$i;
64460
+ const rtcOrigin = tempVec3b$j;
64444
64461
  if (origin) {
64445
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$f);
64462
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$g);
64446
64463
  rtcOrigin[0] = rotatedOrigin[0];
64447
64464
  rtcOrigin[1] = rotatedOrigin[1];
64448
64465
  rtcOrigin[2] = rotatedOrigin[2];
@@ -64454,8 +64471,8 @@ class SnapInstancingDepthBufInitRenderer {
64454
64471
  rtcOrigin[0] += position[0];
64455
64472
  rtcOrigin[1] += position[1];
64456
64473
  rtcOrigin[2] += position[2];
64457
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$b);
64458
- rtcCameraEye = tempVec3d$b;
64474
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$c);
64475
+ rtcCameraEye = tempVec3d$c;
64459
64476
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
64460
64477
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
64461
64478
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -64752,12 +64769,12 @@ class SnapInstancingDepthBufInitRenderer {
64752
64769
  }
64753
64770
  }
64754
64771
 
64755
- const tempVec3a$n = math.vec3();
64756
- const tempVec3b$h = math.vec3();
64757
- const tempVec3c$e = math.vec3();
64758
- const tempVec3d$a = math.vec3();
64772
+ const tempVec3a$o = math.vec3();
64773
+ const tempVec3b$i = math.vec3();
64774
+ const tempVec3c$f = math.vec3();
64775
+ const tempVec3d$b = math.vec3();
64759
64776
  const tempVec3e$3 = math.vec3();
64760
- const tempMat4a$a = math.mat4();
64777
+ const tempMat4a$b = math.mat4();
64761
64778
 
64762
64779
  /**
64763
64780
  * @private
@@ -64802,7 +64819,7 @@ class SnapInstancingDepthRenderer {
64802
64819
  const aabb = instancingLayer.aabb;
64803
64820
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
64804
64821
 
64805
- const coordinateScaler = tempVec3a$n;
64822
+ const coordinateScaler = tempVec3a$o;
64806
64823
  coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
64807
64824
  coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
64808
64825
  coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
@@ -64815,9 +64832,9 @@ class SnapInstancingDepthRenderer {
64815
64832
  let rtcCameraEye;
64816
64833
 
64817
64834
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
64818
- const rtcOrigin = tempVec3b$h;
64835
+ const rtcOrigin = tempVec3b$i;
64819
64836
  if (origin) {
64820
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$e);
64837
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$f);
64821
64838
  rtcOrigin[0] = rotatedOrigin[0];
64822
64839
  rtcOrigin[1] = rotatedOrigin[1];
64823
64840
  rtcOrigin[2] = rotatedOrigin[2];
@@ -64829,8 +64846,8 @@ class SnapInstancingDepthRenderer {
64829
64846
  rtcOrigin[0] += position[0];
64830
64847
  rtcOrigin[1] += position[1];
64831
64848
  rtcOrigin[2] += position[2];
64832
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$a);
64833
- rtcCameraEye = tempVec3d$a;
64849
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$b);
64850
+ rtcCameraEye = tempVec3d$b;
64834
64851
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
64835
64852
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
64836
64853
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -65193,10 +65210,10 @@ const tempVec4b$a = math.vec4([0, 0, 0, 1]);
65193
65210
  math.vec4([0, 0, 0, 1]);
65194
65211
  const tempVec3fa$2 = new Float32Array(3);
65195
65212
 
65196
- const tempVec3a$m = math.vec3();
65197
- const tempVec3b$g = math.vec3();
65198
- const tempVec3c$d = math.vec3();
65199
- const tempVec3d$9 = math.vec3();
65213
+ const tempVec3a$n = math.vec3();
65214
+ const tempVec3b$h = math.vec3();
65215
+ const tempVec3c$e = math.vec3();
65216
+ const tempVec3d$a = math.vec3();
65200
65217
  const tempVec3e$2 = math.vec3();
65201
65218
  const tempVec3f = math.vec3();
65202
65219
  const tempVec3g = math.vec3();
@@ -66210,10 +66227,10 @@ class TrianglesInstancingLayer {
66210
66227
  const origin = state.origin;
66211
66228
  const offset = portion.offset;
66212
66229
 
66213
- const rtcRayOrigin = tempVec3a$m;
66214
- const rtcRayDir = tempVec3b$g;
66230
+ const rtcRayOrigin = tempVec3a$n;
66231
+ const rtcRayDir = tempVec3b$h;
66215
66232
 
66216
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$d) : worldRayOrigin); // World -> RTC
66233
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$e) : worldRayOrigin); // World -> RTC
66217
66234
  rtcRayDir.set(worldRayDir);
66218
66235
 
66219
66236
  if (offset) {
@@ -66224,7 +66241,7 @@ class TrianglesInstancingLayer {
66224
66241
 
66225
66242
  math.transformRay(portion.inverseMatrix, rtcRayOrigin, rtcRayDir, rtcRayOrigin, rtcRayDir);
66226
66243
 
66227
- const a = tempVec3d$9;
66244
+ const a = tempVec3d$a;
66228
66245
  const b = tempVec3e$2;
66229
66246
  const c = tempVec3f;
66230
66247
 
@@ -69245,8 +69262,8 @@ class PointsBatchingBuffer {
69245
69262
  }
69246
69263
  }
69247
69264
 
69248
- const tempVec3a$l = math.vec4();
69249
- const tempVec3b$f = math.vec4();
69265
+ const tempVec3a$m = math.vec4();
69266
+ const tempVec3b$g = math.vec4();
69250
69267
  const tempVec4a$8 = math.vec4([0, 0, 0, 1]);
69251
69268
  const tempVec4b$7 = math.vec4([0, 0, 0, 1]);
69252
69269
  math.vec4([0, 0, 0, 1]);
@@ -69395,8 +69412,8 @@ class PointsBatchingLayer {
69395
69412
 
69396
69413
  const bounds = geometryCompressionUtils.getPositionsBounds(positionsCompressed);
69397
69414
 
69398
- const min = geometryCompressionUtils.decompressPosition(bounds.min, this._state.positionsDecodeMatrix, tempVec3a$l);
69399
- const max = geometryCompressionUtils.decompressPosition(bounds.max, this._state.positionsDecodeMatrix, tempVec3b$f);
69415
+ const min = geometryCompressionUtils.decompressPosition(bounds.min, this._state.positionsDecodeMatrix, tempVec3a$m);
69416
+ const max = geometryCompressionUtils.decompressPosition(bounds.max, this._state.positionsDecodeMatrix, tempVec3b$g);
69400
69417
 
69401
69418
  worldAABB[0] = min[0];
69402
69419
  worldAABB[1] = min[1];
@@ -73361,14 +73378,14 @@ function doCheckResult(buckets, mesh) {
73361
73378
  }
73362
73379
  }
73363
73380
 
73364
- const tempVec3a$k = math.vec3();
73365
- const tempVec3b$e = math.vec3();
73366
- const tempVec3c$c = math.vec3();
73367
- const tempVec3d$8 = math.vec3();
73381
+ const tempVec3a$l = math.vec3();
73382
+ const tempVec3b$f = math.vec3();
73383
+ const tempVec3c$d = math.vec3();
73384
+ const tempVec3d$9 = math.vec3();
73368
73385
 
73369
73386
  const tempVec4a$6 = math.vec4();
73370
73387
 
73371
- const tempMat4a$9 = math.mat4();
73388
+ const tempMat4a$a = math.mat4();
73372
73389
 
73373
73390
  /**
73374
73391
  * @private
@@ -73429,9 +73446,9 @@ class TrianglesDataTextureColorRenderer {
73429
73446
  const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
73430
73447
  const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
73431
73448
  if (gotOrigin || gotPosition) {
73432
- const rtcOrigin = tempVec3a$k;
73449
+ const rtcOrigin = tempVec3a$l;
73433
73450
  if (gotOrigin) {
73434
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$e);
73451
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$f);
73435
73452
  rtcOrigin[0] = rotatedOrigin[0];
73436
73453
  rtcOrigin[1] = rotatedOrigin[1];
73437
73454
  rtcOrigin[2] = rotatedOrigin[2];
@@ -73443,8 +73460,8 @@ class TrianglesDataTextureColorRenderer {
73443
73460
  rtcOrigin[0] += position[0];
73444
73461
  rtcOrigin[1] += position[1];
73445
73462
  rtcOrigin[2] += position[2];
73446
- rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$9);
73447
- rtcCameraEye = tempVec3c$c;
73463
+ rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$a);
73464
+ rtcCameraEye = tempVec3c$d;
73448
73465
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
73449
73466
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
73450
73467
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -73477,7 +73494,7 @@ class TrianglesDataTextureColorRenderer {
73477
73494
  if (active) {
73478
73495
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
73479
73496
  if (origin) {
73480
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$8);
73497
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$9);
73481
73498
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
73482
73499
  } else {
73483
73500
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -73993,11 +74010,11 @@ class TrianglesDataTextureColorRenderer {
73993
74010
 
73994
74011
  const defaultColor$1 = new Float32Array([1, 1, 1]);
73995
74012
 
73996
- const tempVec3a$j = math.vec3();
73997
- const tempVec3b$d = math.vec3();
73998
- const tempVec3c$b = math.vec3();
73999
- const tempVec3d$7 = math.vec3();
74000
- const tempMat4a$8 = math.mat4();
74013
+ const tempVec3a$k = math.vec3();
74014
+ const tempVec3b$e = math.vec3();
74015
+ const tempVec3c$c = math.vec3();
74016
+ const tempVec3d$8 = math.vec3();
74017
+ const tempMat4a$9 = math.mat4();
74001
74018
 
74002
74019
  /**
74003
74020
  * @private
@@ -74056,9 +74073,9 @@ class TrianglesDataTextureSilhouetteRenderer {
74056
74073
  let rtcCameraEye;
74057
74074
 
74058
74075
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
74059
- const rtcOrigin = tempVec3a$j;
74076
+ const rtcOrigin = tempVec3a$k;
74060
74077
  if (origin) {
74061
- const rotatedOrigin = tempVec3b$d;
74078
+ const rotatedOrigin = tempVec3b$e;
74062
74079
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
74063
74080
  rtcOrigin[0] = rotatedOrigin[0];
74064
74081
  rtcOrigin[1] = rotatedOrigin[1];
@@ -74071,8 +74088,8 @@ class TrianglesDataTextureSilhouetteRenderer {
74071
74088
  rtcOrigin[0] += position[0];
74072
74089
  rtcOrigin[1] += position[1];
74073
74090
  rtcOrigin[2] += position[2];
74074
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$8);
74075
- rtcCameraEye = tempVec3c$b;
74091
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$9);
74092
+ rtcCameraEye = tempVec3c$c;
74076
74093
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
74077
74094
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
74078
74095
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -74125,7 +74142,7 @@ class TrianglesDataTextureSilhouetteRenderer {
74125
74142
  if (active) {
74126
74143
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74127
74144
  if (origin) {
74128
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$7);
74145
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$8);
74129
74146
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74130
74147
  } else {
74131
74148
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -74458,11 +74475,11 @@ class TrianglesDataTextureSilhouetteRenderer {
74458
74475
 
74459
74476
  const defaultColor = new Float32Array([0, 0, 0, 1]);
74460
74477
 
74461
- const tempVec3a$i = math.vec3();
74462
- const tempVec3b$c = math.vec3();
74478
+ const tempVec3a$j = math.vec3();
74479
+ const tempVec3b$d = math.vec3();
74463
74480
  math.vec3();
74464
- const tempVec3d$6 = math.vec3();
74465
- const tempMat4a$7 = math.mat4();
74481
+ const tempVec3d$7 = math.vec3();
74482
+ const tempMat4a$8 = math.mat4();
74466
74483
 
74467
74484
  /**
74468
74485
  * @private
@@ -74521,9 +74538,9 @@ class TrianglesDataTextureEdgesRenderer {
74521
74538
  const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
74522
74539
  const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
74523
74540
  if (gotOrigin || gotPosition) {
74524
- const rtcOrigin = tempVec3a$i;
74541
+ const rtcOrigin = tempVec3a$j;
74525
74542
  if (gotOrigin) {
74526
- const rotatedOrigin = tempVec3b$c;
74543
+ const rotatedOrigin = tempVec3b$d;
74527
74544
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
74528
74545
  rtcOrigin[0] = rotatedOrigin[0];
74529
74546
  rtcOrigin[1] = rotatedOrigin[1];
@@ -74536,7 +74553,7 @@ class TrianglesDataTextureEdgesRenderer {
74536
74553
  rtcOrigin[0] += position[0];
74537
74554
  rtcOrigin[1] += position[1];
74538
74555
  rtcOrigin[2] += position[2];
74539
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$7);
74556
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$8);
74540
74557
  } else {
74541
74558
  rtcViewMatrix = viewMatrix;
74542
74559
  }
@@ -74581,7 +74598,7 @@ class TrianglesDataTextureEdgesRenderer {
74581
74598
  if (active) {
74582
74599
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74583
74600
  if (origin) {
74584
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$6);
74601
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$7);
74585
74602
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74586
74603
  } else {
74587
74604
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -74882,10 +74899,10 @@ class TrianglesDataTextureEdgesRenderer {
74882
74899
  }
74883
74900
  }
74884
74901
 
74885
- const tempVec3a$h = math.vec3();
74886
- const tempVec3b$b = math.vec3();
74887
- const tempVec3c$a = math.vec3();
74888
- const tempMat4a$6 = math.mat4();
74902
+ const tempVec3a$i = math.vec3();
74903
+ const tempVec3b$c = math.vec3();
74904
+ const tempVec3c$b = math.vec3();
74905
+ const tempMat4a$7 = math.mat4();
74889
74906
 
74890
74907
  /**
74891
74908
  * @private
@@ -74943,9 +74960,9 @@ class TrianglesDataTextureEdgesColorRenderer {
74943
74960
  const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
74944
74961
  const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
74945
74962
  if (gotOrigin || gotPosition) {
74946
- const rtcOrigin = tempVec3a$h;
74963
+ const rtcOrigin = tempVec3a$i;
74947
74964
  if (gotOrigin) {
74948
- const rotatedOrigin = tempVec3b$b;
74965
+ const rotatedOrigin = tempVec3b$c;
74949
74966
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
74950
74967
  rtcOrigin[0] = rotatedOrigin[0];
74951
74968
  rtcOrigin[1] = rotatedOrigin[1];
@@ -74958,7 +74975,7 @@ class TrianglesDataTextureEdgesColorRenderer {
74958
74975
  rtcOrigin[0] += position[0];
74959
74976
  rtcOrigin[1] += position[1];
74960
74977
  rtcOrigin[2] += position[2];
74961
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$6);
74978
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$7);
74962
74979
  } else {
74963
74980
  rtcViewMatrix = viewMatrix;
74964
74981
  }
@@ -74981,7 +74998,7 @@ class TrianglesDataTextureEdgesColorRenderer {
74981
74998
  if (active) {
74982
74999
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
74983
75000
  if (origin) {
74984
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3c$a);
75001
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3c$b);
74985
75002
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
74986
75003
  } else {
74987
75004
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -75303,10 +75320,10 @@ class TrianglesDataTextureEdgesColorRenderer {
75303
75320
  }
75304
75321
  }
75305
75322
 
75306
- const tempVec3a$g = math.vec3();
75307
- const tempVec3b$a = math.vec3();
75308
- const tempVec3c$9 = math.vec3();
75309
- const tempMat4a$5 = math.mat4();
75323
+ const tempVec3a$h = math.vec3();
75324
+ const tempVec3b$b = math.vec3();
75325
+ const tempVec3c$a = math.vec3();
75326
+ const tempMat4a$6 = math.mat4();
75310
75327
 
75311
75328
  /**
75312
75329
  * @private
@@ -75359,9 +75376,9 @@ class TrianglesDataTexturePickMeshRenderer {
75359
75376
  const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
75360
75377
  const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
75361
75378
  if (gotOrigin || gotPosition) {
75362
- const rtcOrigin = tempVec3a$g;
75379
+ const rtcOrigin = tempVec3a$h;
75363
75380
  if (gotOrigin) {
75364
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$a);
75381
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3b$b);
75365
75382
  rtcOrigin[0] = rotatedOrigin[0];
75366
75383
  rtcOrigin[1] = rotatedOrigin[1];
75367
75384
  rtcOrigin[2] = rotatedOrigin[2];
@@ -75373,8 +75390,8 @@ class TrianglesDataTexturePickMeshRenderer {
75373
75390
  rtcOrigin[0] += position[0];
75374
75391
  rtcOrigin[1] += position[1];
75375
75392
  rtcOrigin[2] += position[2];
75376
- rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$5);
75377
- rtcCameraEye = tempVec3c$9;
75393
+ rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$6);
75394
+ rtcCameraEye = tempVec3c$a;
75378
75395
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
75379
75396
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
75380
75397
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -75404,7 +75421,7 @@ class TrianglesDataTexturePickMeshRenderer {
75404
75421
  if (active) {
75405
75422
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
75406
75423
  if (origin) {
75407
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$g);
75424
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
75408
75425
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
75409
75426
  } else {
75410
75427
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -75736,11 +75753,11 @@ class TrianglesDataTexturePickMeshRenderer {
75736
75753
  }
75737
75754
  }
75738
75755
 
75739
- const tempVec3a$f = math.vec3();
75740
- const tempVec3b$9 = math.vec3();
75741
- const tempVec3c$8 = math.vec3();
75742
- const tempVec3d$5 = math.vec3();
75743
- const tempMat4a$4 = math.mat4();
75756
+ const tempVec3a$g = math.vec3();
75757
+ const tempVec3b$a = math.vec3();
75758
+ const tempVec3c$9 = math.vec3();
75759
+ const tempVec3d$6 = math.vec3();
75760
+ const tempMat4a$5 = math.mat4();
75744
75761
 
75745
75762
  /**
75746
75763
  * @private
@@ -75791,16 +75808,13 @@ class TrianglesDataTexturePickDepthRenderer {
75791
75808
  this._uTexturePerObjectIdOffsets
75792
75809
  );
75793
75810
 
75794
- camera.eye;
75795
-
75796
-
75797
75811
  let rtcViewMatrix;
75798
75812
  let rtcCameraEye;
75799
75813
 
75800
75814
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
75801
- const rtcOrigin = tempVec3a$f;
75815
+ const rtcOrigin = tempVec3a$g;
75802
75816
  if (origin) {
75803
- const rotatedOrigin = tempVec3b$9;
75817
+ const rotatedOrigin = tempVec3b$a;
75804
75818
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
75805
75819
  rtcOrigin[0] = rotatedOrigin[0];
75806
75820
  rtcOrigin[1] = rotatedOrigin[1];
@@ -75813,8 +75827,8 @@ class TrianglesDataTexturePickDepthRenderer {
75813
75827
  rtcOrigin[0] += position[0];
75814
75828
  rtcOrigin[1] += position[1];
75815
75829
  rtcOrigin[2] += position[2];
75816
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$4);
75817
- rtcCameraEye = tempVec3c$8;
75830
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$5);
75831
+ rtcCameraEye = tempVec3c$9;
75818
75832
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
75819
75833
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
75820
75834
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -75855,7 +75869,7 @@ class TrianglesDataTexturePickDepthRenderer {
75855
75869
  if (active) {
75856
75870
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
75857
75871
  if (origin) {
75858
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$5);
75872
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$6);
75859
75873
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
75860
75874
  } else {
75861
75875
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -76186,12 +76200,12 @@ class TrianglesDataTexturePickDepthRenderer {
76186
76200
  }
76187
76201
  }
76188
76202
 
76189
- const tempVec3a$e = math.vec3();
76190
- const tempVec3b$8 = math.vec3();
76191
- const tempVec3c$7 = math.vec3();
76192
- const tempVec3d$4 = math.vec3();
76203
+ const tempVec3a$f = math.vec3();
76204
+ const tempVec3b$9 = math.vec3();
76205
+ const tempVec3c$8 = math.vec3();
76206
+ const tempVec3d$5 = math.vec3();
76193
76207
  const tempVec3e$1 = math.vec3();
76194
- const tempMat4a$3 = math.mat4();
76208
+ const tempMat4a$4 = math.mat4();
76195
76209
 
76196
76210
  /**
76197
76211
  * @private
@@ -76237,7 +76251,7 @@ class TrianglesDataTextureSnapDepthRenderer {
76237
76251
  const aabb = dataTextureLayer.aabb;
76238
76252
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
76239
76253
 
76240
- const coordinateScaler = tempVec3a$e;
76254
+ const coordinateScaler = tempVec3a$f;
76241
76255
  coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
76242
76256
  coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
76243
76257
  coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
@@ -76261,9 +76275,9 @@ class TrianglesDataTextureSnapDepthRenderer {
76261
76275
  const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
76262
76276
  const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
76263
76277
  if (gotOrigin || gotPosition) {
76264
- const rtcOrigin = tempVec3b$8;
76278
+ const rtcOrigin = tempVec3b$9;
76265
76279
  if (gotOrigin) {
76266
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$7);
76280
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$8);
76267
76281
  rtcOrigin[0] = rotatedOrigin[0];
76268
76282
  rtcOrigin[1] = rotatedOrigin[1];
76269
76283
  rtcOrigin[2] = rotatedOrigin[2];
@@ -76275,8 +76289,8 @@ class TrianglesDataTextureSnapDepthRenderer {
76275
76289
  rtcOrigin[0] += position[0];
76276
76290
  rtcOrigin[1] += position[1];
76277
76291
  rtcOrigin[2] += position[2];
76278
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$3);
76279
- rtcCameraEye = tempVec3d$4;
76292
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$4);
76293
+ rtcCameraEye = tempVec3d$5;
76280
76294
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
76281
76295
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
76282
76296
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -76605,12 +76619,12 @@ class TrianglesDataTextureSnapDepthRenderer {
76605
76619
  }
76606
76620
  }
76607
76621
 
76608
- const tempVec3a$d = math.vec3();
76609
- const tempVec3b$7 = math.vec3();
76610
- const tempVec3c$6 = math.vec3();
76611
- const tempVec3d$3 = math.vec3();
76622
+ const tempVec3a$e = math.vec3();
76623
+ const tempVec3b$8 = math.vec3();
76624
+ const tempVec3c$7 = math.vec3();
76625
+ const tempVec3d$4 = math.vec3();
76612
76626
  const tempVec3e = math.vec3();
76613
- const tempMat4a$2 = math.mat4();
76627
+ const tempMat4a$3 = math.mat4();
76614
76628
  /**
76615
76629
  * @private
76616
76630
  */
@@ -76652,7 +76666,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
76652
76666
  const aabb = dataTextureLayer.aabb;
76653
76667
  const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
76654
76668
 
76655
- const coordinateScaler = tempVec3a$d;
76669
+ const coordinateScaler = tempVec3a$e;
76656
76670
  coordinateScaler[0] = math.safeInv(aabb[3] - aabb[0]) * math.MAX_INT;
76657
76671
  coordinateScaler[1] = math.safeInv(aabb[4] - aabb[1]) * math.MAX_INT;
76658
76672
  coordinateScaler[2] = math.safeInv(aabb[5] - aabb[2]) * math.MAX_INT;
@@ -76673,9 +76687,9 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
76673
76687
  const gotOrigin = (origin[0] !== 0 || origin[1] !== 0 || origin[2] !== 0);
76674
76688
  const gotPosition = (position[0] !== 0 || position[1] !== 0 || position[2] !== 0);
76675
76689
  if (gotOrigin || gotPosition) {
76676
- const rtcOrigin = tempVec3b$7;
76690
+ const rtcOrigin = tempVec3b$8;
76677
76691
  if (gotOrigin) {
76678
- const rotatedOrigin = tempVec3c$6;
76692
+ const rotatedOrigin = tempVec3c$7;
76679
76693
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
76680
76694
  rtcOrigin[0] = rotatedOrigin[0];
76681
76695
  rtcOrigin[1] = rotatedOrigin[1];
@@ -76688,8 +76702,8 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
76688
76702
  rtcOrigin[0] += position[0];
76689
76703
  rtcOrigin[1] += position[1];
76690
76704
  rtcOrigin[2] += position[2];
76691
- rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$2);
76692
- rtcCameraEye = tempVec3d$3;
76705
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$3);
76706
+ rtcCameraEye = tempVec3d$4;
76693
76707
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
76694
76708
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
76695
76709
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -77051,7 +77065,7 @@ class TrianglesDataTextureSnapDepthBufInitRenderer {
77051
77065
  }
77052
77066
  }
77053
77067
 
77054
- const tempVec3a$c = math.vec3();
77068
+ const tempVec3a$d = math.vec3();
77055
77069
 
77056
77070
  /**
77057
77071
  * @private
@@ -77143,7 +77157,7 @@ class TrianglesDataTexturePickNormalsRenderer {
77143
77157
  if (active) {
77144
77158
  const sectionPlane = sectionPlanes[sectionPlaneIndex];
77145
77159
  if (origin) {
77146
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$c);
77160
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$d);
77147
77161
  gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77148
77162
  } else {
77149
77163
  gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
@@ -77478,11 +77492,11 @@ class TrianglesDataTexturePickNormalsRenderer {
77478
77492
  }
77479
77493
  }
77480
77494
 
77481
- math.vec3();
77482
- math.vec3();
77483
- math.vec3();
77484
- math.vec3();
77485
- math.mat4();
77495
+ const tempVec3a$c = math.vec3();
77496
+ const tempVec3b$7 = math.vec3();
77497
+ const tempVec3c$6 = math.vec3();
77498
+ const tempVec3d$3 = math.vec3();
77499
+ const tempMat4a$2 = math.mat4();
77486
77500
 
77487
77501
  /**
77488
77502
  * @private
@@ -77505,30 +77519,142 @@ class TrianglesDataTextureOcclusionRenderer {
77505
77519
 
77506
77520
  drawLayer(frameCtx, dataTextureLayer, renderPass) {
77507
77521
 
77508
- return;
77522
+ const model = dataTextureLayer.model;
77523
+ const scene = model.scene;
77524
+ const camera = scene.camera;
77525
+ const gl = scene.canvas.gl;
77526
+ const state = dataTextureLayer._state;
77527
+ const textureState = state.textureState;
77528
+ const origin = dataTextureLayer._state.origin;
77529
+ const {position, rotationMatrix, rotationMatrixConjugate} = model;
77530
+ const viewMatrix = frameCtx.pickViewMatrix || camera.viewMatrix;
77531
+
77532
+ if (!this._program) {
77533
+ this._allocate(dataTextureLayer);
77534
+ if (this.errors) {
77535
+ return;
77536
+ }
77537
+ }
77538
+
77539
+ if (frameCtx.lastProgramId !== this._program.id) {
77540
+ frameCtx.lastProgramId = this._program.id;
77541
+ this._bindProgram();
77542
+ }
77543
+
77544
+ textureState.bindCommonTextures(
77545
+ this._program,
77546
+ this._uTexturePerObjectIdPositionsDecodeMatrix,
77547
+ this._uTexturePerVertexIdCoordinates,
77548
+ this._uTexturePerObjectIdColorsAndFlags,
77549
+ this._uTextureModelMatrices,
77550
+ this._uTexturePerObjectIdOffsets
77551
+ );
77552
+
77553
+ let rtcViewMatrix;
77554
+ let rtcCameraEye;
77555
+
77556
+ if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
77557
+ const rtcOrigin = tempVec3a$c;
77558
+ if (origin) {
77559
+ const rotatedOrigin = tempVec3b$7;
77560
+ math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
77561
+ rtcOrigin[0] = rotatedOrigin[0];
77562
+ rtcOrigin[1] = rotatedOrigin[1];
77563
+ rtcOrigin[2] = rotatedOrigin[2];
77564
+ } else {
77565
+ rtcOrigin[0] = 0;
77566
+ rtcOrigin[1] = 0;
77567
+ rtcOrigin[2] = 0;
77568
+ }
77569
+ rtcOrigin[0] += position[0];
77570
+ rtcOrigin[1] += position[1];
77571
+ rtcOrigin[2] += position[2];
77572
+ rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$2);
77573
+ rtcCameraEye = tempVec3c$6;
77574
+ rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
77575
+ rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
77576
+ rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
77577
+ } else {
77578
+ rtcViewMatrix = viewMatrix;
77579
+ rtcCameraEye = camera.eye;
77580
+ }
77581
+
77582
+ gl.uniform3fv(this._uCameraEyeRtc, rtcCameraEye);
77583
+ gl.uniform1i(this._uRenderPass, renderPass);
77584
+ gl.uniformMatrix4fv(this._uWorldMatrix, false, rotationMatrixConjugate);
77585
+ gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
77586
+
77587
+ gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
77588
+
77589
+ const numSectionPlanes = scene._sectionPlanesState.sectionPlanes.length;
77590
+ if (numSectionPlanes > 0) {
77591
+ const sectionPlanes = scene._sectionPlanesState.sectionPlanes;
77592
+ const baseIndex = dataTextureLayer.layerIndex * numSectionPlanes;
77593
+ const renderFlags = model.renderFlags;
77594
+ for (let sectionPlaneIndex = 0; sectionPlaneIndex < numSectionPlanes; sectionPlaneIndex++) {
77595
+ const sectionPlaneUniforms = this._uSectionPlanes[sectionPlaneIndex];
77596
+ if (sectionPlaneUniforms) {
77597
+ const active = renderFlags.sectionPlanesActivePerLayer[baseIndex + sectionPlaneIndex];
77598
+ gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
77599
+ if (active) {
77600
+ const sectionPlane = sectionPlanes[sectionPlaneIndex];
77601
+ if (origin) {
77602
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3d$3);
77603
+ gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
77604
+ } else {
77605
+ gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
77606
+ }
77607
+ gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
77608
+ }
77609
+ }
77610
+ }
77611
+ }
77612
+
77613
+ if (state.numIndices8Bits > 0) {
77614
+ textureState.bindTriangleIndicesTextures(
77615
+ this._program,
77616
+ this._uTexturePerPolygonIdPortionIds,
77617
+ this._uTexturePerPolygonIdIndices,
77618
+ 8 // 8 bits indices
77619
+ );
77620
+ gl.drawArrays(gl.TRIANGLES, 0, state.numIndices8Bits);
77621
+ }
77622
+ if (state.numIndices16Bits > 0) {
77623
+ textureState.bindTriangleIndicesTextures(
77624
+ this._program,
77625
+ this._uTexturePerPolygonIdPortionIds,
77626
+ this._uTexturePerPolygonIdIndices,
77627
+ 16 // 16 bits indices
77628
+ );
77629
+ gl.drawArrays(gl.TRIANGLES, 0, state.numIndices16Bits);
77630
+ }
77631
+ if (state.numIndices32Bits > 0) {
77632
+ textureState.bindTriangleIndicesTextures(
77633
+ this._program,
77634
+ this._uTexturePerPolygonIdPortionIds,
77635
+ this._uTexturePerPolygonIdIndices,
77636
+ 32 // 32 bits indices
77637
+ );
77638
+ gl.drawArrays(gl.TRIANGLES, 0, state.numIndices32Bits);
77639
+ }
77640
+ frameCtx.drawElements++;
77509
77641
  }
77510
77642
 
77511
77643
  _allocate() {
77512
-
77513
77644
  const scene = this._scene;
77514
77645
  const gl = scene.canvas.gl;
77515
-
77516
77646
  this._program = new Program(gl, this._buildShader());
77517
-
77518
77647
  if (this._program.errors) {
77519
77648
  this.errors = this._program.errors;
77520
77649
  return;
77521
77650
  }
77522
-
77523
77651
  const program = this._program;
77524
-
77525
77652
  this._uRenderPass = program.getLocation("renderPass");
77526
- this._uPositionsDecodeMatrix = program.getLocation("positionsDecodeMatrix");
77527
- this._uWorldMatrix = program.getLocation("worldMatrix");
77653
+ this._uPickInvisible = program.getLocation("pickInvisible");
77654
+ this._uWorldMatrix = program.getLocation("sceneModelWorldMatrix");
77528
77655
  this._uViewMatrix = program.getLocation("viewMatrix");
77529
77656
  this._uProjMatrix = program.getLocation("projMatrix");
77530
77657
  this._uSectionPlanes = [];
77531
-
77532
77658
  for (let i = 0, len = scene._sectionPlanesState.sectionPlanes.length; i < len; i++) {
77533
77659
  this._uSectionPlanes.push({
77534
77660
  active: program.getLocation("sectionPlaneActive" + i),
@@ -77536,32 +77662,30 @@ class TrianglesDataTextureOcclusionRenderer {
77536
77662
  dir: program.getLocation("sectionPlaneDir" + i)
77537
77663
  });
77538
77664
  }
77539
-
77540
- this._aPosition = program.getAttribute("position");
77541
- this._aOffset = program.getAttribute("offset");
77542
- this._aColor = program.getAttribute("color");
77543
- this._aFlags = program.getAttribute("flags");
77544
- this._aFlags2 = program.getAttribute("flags2");
77545
-
77665
+ this._uPickZNear = program.getLocation("pickZNear");
77666
+ this._uPickZFar = program.getLocation("pickZFar");
77546
77667
  if (scene.logarithmicDepthBufferEnabled) {
77547
77668
  this._uLogDepthBufFC = program.getLocation("logDepthBufFC");
77548
77669
  }
77670
+ this._uTexturePerObjectIdPositionsDecodeMatrix = "uTexturePerObjectIdPositionsDecodeMatrix";
77671
+ this._uTexturePerObjectIdColorsAndFlags = "uTexturePerObjectIdColorsAndFlags";
77672
+ this._uTexturePerVertexIdCoordinates = "uTexturePerVertexIdCoordinates";
77673
+ this._uTexturePerPolygonIdNormals = "uTexturePerPolygonIdNormals";
77674
+ this._uTexturePerPolygonIdIndices = "uTexturePerPolygonIdIndices";
77675
+ this._uTexturePerPolygonIdPortionIds = "uTexturePerPolygonIdPortionIds";
77676
+ this._uTextureCameraMatrices = "uTextureCameraMatrices";
77677
+ this._uTextureModelMatrices = "uTextureModelMatrices";
77678
+ this._uTexturePerObjectIdOffsets = "uTexturePerObjectIdOffsets";
77679
+ this._uCameraEyeRtc = program.getLocation("uCameraEyeRtc");
77549
77680
  }
77550
77681
 
77551
77682
  _bindProgram() {
77552
77683
 
77553
77684
  const scene = this._scene;
77554
- const gl = scene.canvas.gl;
77555
- const project = scene.camera.project;
77685
+ scene.canvas.gl;
77686
+ scene.camera.project;
77556
77687
 
77557
77688
  this._program.bind();
77558
-
77559
- gl.uniformMatrix4fv(this._uProjMatrix, false, project.matrix);
77560
-
77561
- if (scene.logarithmicDepthBufferEnabled) {
77562
- const logDepthBufFC = 2.0 / (Math.log(project.far + 1.0) / Math.LN2);
77563
- gl.uniform1f(this._uLogDepthBufFC, logDepthBufFC);
77564
- }
77565
77689
  }
77566
77690
 
77567
77691
  _buildShader() {
@@ -77577,35 +77701,64 @@ class TrianglesDataTextureOcclusionRenderer {
77577
77701
  const src = [];
77578
77702
  src.push("#version 300 es");
77579
77703
  src.push("// TrianglesDataTextureColorRenderer vertex shader");
77704
+
77705
+ src.push("#ifdef GL_FRAGMENT_PRECISION_HIGH");
77706
+ src.push("precision highp float;");
77707
+ src.push("precision highp int;");
77708
+ src.push("precision highp usampler2D;");
77709
+ src.push("precision highp isampler2D;");
77710
+ src.push("precision highp sampler2D;");
77711
+ src.push("#else");
77712
+ src.push("precision mediump float;");
77713
+ src.push("precision mediump int;");
77714
+ src.push("precision mediump usampler2D;");
77715
+ src.push("precision mediump isampler2D;");
77716
+ src.push("precision mediump sampler2D;");
77717
+ src.push("#endif");
77718
+
77580
77719
  src.push("uniform int renderPass;");
77581
- src.push("attribute vec3 position;");
77720
+
77582
77721
  if (scene.entityOffsetsEnabled) {
77583
- src.push("attribute vec3 offset;");
77722
+ src.push("in vec3 offset;");
77584
77723
  }
77585
- src.push("attribute vec4 color;");
77586
- src.push("attribute vec4 flags;");
77587
- src.push("attribute vec4 flags2;");
77588
77724
 
77589
- src.push("uniform mat4 worldMatrix;");
77725
+ src.push("uniform mat4 sceneModelWorldMatrix;");
77590
77726
  src.push("uniform mat4 viewMatrix;");
77591
77727
  src.push("uniform mat4 projMatrix;");
77592
- src.push("uniform mat4 positionsDecodeMatrix;");
77593
- if (scene.logarithmicDepthBufferEnabled) {
77594
- src.push("uniform float logDepthBufFC;");
77595
- if (WEBGL_INFO.SUPPORTED_EXTENSIONS["EXT_frag_depth"]) {
77596
- src.push("out float vFragDepth;");
77597
- }
77598
- src.push("bool isPerspectiveMatrix(mat4 m) {");
77599
- src.push(" return (m[2][3] == - 1.0);");
77600
- src.push("}");
77601
- src.push("out float isPerspective;");
77602
- }
77728
+
77729
+ src.push("uniform highp sampler2D uTexturePerObjectIdPositionsDecodeMatrix;");
77730
+ src.push("uniform lowp usampler2D uTexturePerObjectIdColorsAndFlags;");
77731
+ src.push("uniform highp sampler2D uTexturePerObjectIdOffsets;");
77732
+ src.push("uniform mediump usampler2D uTexturePerVertexIdCoordinates;");
77733
+ src.push("uniform highp usampler2D uTexturePerPolygonIdIndices;");
77734
+ src.push("uniform mediump usampler2D uTexturePerPolygonIdPortionIds;");
77735
+ src.push("uniform highp sampler2D uTextureModelMatrices;");
77736
+ src.push("uniform vec3 uCameraEyeRtc;");
77737
+
77738
+ src.push("vec3 positions[3];");
77739
+ src.push("bool isPerspectiveMatrix(mat4 m) {");
77740
+ src.push(" return (m[2][3] == - 1.0);");
77741
+ src.push("}");
77603
77742
  if (clipping) {
77604
77743
  src.push("out vec4 vWorldPosition;");
77605
77744
  src.push("out vec4 vFlags2;");
77606
77745
  }
77607
77746
  src.push("void main(void) {");
77608
77747
 
77748
+ // constants
77749
+ src.push("int polygonIndex = gl_VertexID / 3;");
77750
+
77751
+ // get packed object-id
77752
+ src.push("int h_packed_object_id_index = (polygonIndex >> 3) & 4095;");
77753
+ src.push("int v_packed_object_id_index = (polygonIndex >> 3) >> 12;");
77754
+
77755
+ src.push("int objectIndex = int(texelFetch(uTexturePerPolygonIdPortionIds, ivec2(h_packed_object_id_index, v_packed_object_id_index), 0).r);");
77756
+ src.push("ivec2 objectIndexCoords = ivec2(objectIndex % 512, objectIndex / 512);");
77757
+
77758
+ // get flags & flags2
77759
+ src.push("uvec4 flags = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+2, objectIndexCoords.y), 0);");
77760
+ src.push("uvec4 flags2 = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+3, objectIndexCoords.y), 0);");
77761
+
77609
77762
  // flags.x = NOT_RENDERED | COLOR_OPAQUE | COLOR_TRANSPARENT
77610
77763
  // renderPass = COLOR_OPAQUE
77611
77764
  // Only opaque objects can be occluders
@@ -77614,20 +77767,75 @@ class TrianglesDataTextureOcclusionRenderer {
77614
77767
  src.push(" gl_Position = vec4(0.0, 0.0, 0.0, 0.0);"); // Cull vertex
77615
77768
 
77616
77769
  src.push(" } else {");
77617
- src.push(" vec4 worldPosition = worldMatrix * (positionsDecodeMatrix * vec4(position, 1.0)); ");
77618
- if (scene.entityOffsetsEnabled) {
77619
- src.push(" worldPosition.xyz = worldPosition.xyz + offset;");
77620
- }
77770
+ // model matrices
77771
+ src.push ("mat4 worldMatrix = sceneModelWorldMatrix * mat4 (texelFetch (uTextureModelMatrices, ivec2(0, 0), 0), texelFetch (uTextureModelMatrices, ivec2(1, 0), 0), texelFetch (uTextureModelMatrices, ivec2(2, 0), 0), texelFetch (uTextureModelMatrices, ivec2(3, 0), 0));");
77621
77772
 
77622
- src.push(" vec4 viewPosition = viewMatrix * worldPosition; ");
77773
+ // get vertex base
77774
+ src.push("ivec4 packedVertexBase = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+4, objectIndexCoords.y), 0));");
77775
+
77776
+ src.push("ivec4 packedIndexBaseOffset = ivec4(texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+5, objectIndexCoords.y), 0));");
77777
+
77778
+ src.push("int indexBaseOffset = (packedIndexBaseOffset.r << 24) + (packedIndexBaseOffset.g << 16) + (packedIndexBaseOffset.b << 8) + packedIndexBaseOffset.a;");
77779
+
77780
+ src.push("int h_index = (polygonIndex - indexBaseOffset) & 4095;");
77781
+ src.push("int v_index = (polygonIndex - indexBaseOffset) >> 12;");
77782
+
77783
+ src.push("ivec3 vertexIndices = ivec3(texelFetch(uTexturePerPolygonIdIndices, ivec2(h_index, v_index), 0));");
77784
+ src.push("ivec3 uniqueVertexIndexes = vertexIndices + (packedVertexBase.r << 24) + (packedVertexBase.g << 16) + (packedVertexBase.b << 8) + packedVertexBase.a;");
77785
+
77786
+ src.push("ivec3 indexPositionH = uniqueVertexIndexes & 4095;");
77787
+ src.push("ivec3 indexPositionV = uniqueVertexIndexes >> 12;");
77788
+
77789
+ src.push("mat4 positionsDecodeMatrix = mat4 (texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+0, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+1, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+2, objectIndexCoords.y), 0), texelFetch (uTexturePerObjectIdPositionsDecodeMatrix, ivec2(objectIndexCoords.x*4+3, objectIndexCoords.y), 0));");
77790
+
77791
+ src.push("uint solid = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+7, objectIndexCoords.y), 0).r;");
77792
+
77793
+ // get position
77794
+ src.push("positions[0] = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH.r, indexPositionV.r), 0));");
77795
+ src.push("positions[1] = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH.g, indexPositionV.g), 0));");
77796
+ src.push("positions[2] = vec3(texelFetch(uTexturePerVertexIdCoordinates, ivec2(indexPositionH.b, indexPositionV.b), 0));");
77797
+
77798
+ // get color
77799
+ src.push("uvec4 color = texelFetch (uTexturePerObjectIdColorsAndFlags, ivec2(objectIndexCoords.x*8+0, objectIndexCoords.y), 0);");
77800
+
77801
+ src.push(`if (color.a == 0u) {`);
77802
+ src.push(" gl_Position = vec4(3.0, 3.0, 3.0, 1.0);"); // Cull vertex
77803
+ src.push(" return;");
77804
+ src.push("};");
77805
+
77806
+ src.push("vec3 normal = normalize(cross(positions[2] - positions[0], positions[1] - positions[0]));");
77807
+ src.push("vec3 position;");
77808
+ src.push("position = positions[gl_VertexID % 3];");
77809
+
77810
+ // when the geometry is not solid, if needed, flip the triangle winding
77811
+ src.push("if (solid != 1u) {");
77812
+ src.push(" if (isPerspectiveMatrix(projMatrix)) {");
77813
+ src.push(" vec3 uCameraEyeRtcInQuantizedSpace = (inverse(worldMatrix * positionsDecodeMatrix) * vec4(uCameraEyeRtc, 1)).xyz;");
77814
+ src.push(" if (dot(position.xyz - uCameraEyeRtcInQuantizedSpace, normal) < 0.0) {");
77815
+ src.push(" position = positions[2 - (gl_VertexID % 3)];");
77816
+ src.push(" }");
77817
+ src.push(" } else {");
77818
+ src.push(" vec3 viewNormal = -normalize((transpose(inverse(viewMatrix*positionsDecodeMatrix)) * vec4(normal,1)).xyz);");
77819
+ src.push(" if (viewNormal.z < 0.0) {");
77820
+ src.push(" position = positions[2 - (gl_VertexID % 3)];");
77821
+ src.push(" }");
77822
+ src.push(" }");
77823
+ src.push("}");
77824
+
77825
+ src.push("vec4 worldPosition = worldMatrix * (positionsDecodeMatrix * vec4(position, 1.0)); ");
77826
+
77827
+ // get XYZ offset
77828
+ src.push("vec4 offset = vec4(texelFetch (uTexturePerObjectIdOffsets, objectIndexCoords, 0).rgb, 0.0);");
77829
+ src.push("worldPosition.xyz = worldPosition.xyz + offset.xyz;");
77830
+ src.push("vec4 viewPosition = viewMatrix * worldPosition; ");
77623
77831
  if (clipping) {
77624
77832
  src.push(" vWorldPosition = worldPosition;");
77625
77833
  src.push(" vFlags2 = flags2;");
77626
77834
  }
77627
77835
  src.push("vec4 clipPos = projMatrix * viewPosition;");
77628
- if (scene.logarithmicDepthBufferEnabled) {
77629
- src.push("vFragDepth = 1.0 + clipPos.w;");
77630
- src.push("isPerspective = float (isPerspectiveMatrix(projMatrix));");
77836
+ if (clipping) {
77837
+ src.push("vWorldPosition = worldPosition;");
77838
+ src.push("vFlags2 = flags2.r;");
77631
77839
  }
77632
77840
  src.push("gl_Position = clipPos;");
77633
77841
  src.push(" }");
@@ -77649,11 +77857,6 @@ class TrianglesDataTextureOcclusionRenderer {
77649
77857
  src.push("precision mediump float;");
77650
77858
  src.push("precision mediump int;");
77651
77859
  src.push("#endif");
77652
- if (scene.logarithmicDepthBufferEnabled) {
77653
- src.push("in float isPerspective;");
77654
- src.push("uniform float logDepthBufFC;");
77655
- src.push("in float vFragDepth;");
77656
- }
77657
77860
  if (clipping) {
77658
77861
  src.push("in vec4 vWorldPosition;");
77659
77862
  src.push("in vec4 vFlags2;");
@@ -77663,6 +77866,7 @@ class TrianglesDataTextureOcclusionRenderer {
77663
77866
  src.push("uniform vec3 sectionPlaneDir" + i + ";");
77664
77867
  }
77665
77868
  }
77869
+ src.push("out vec4 outColor;");
77666
77870
  src.push("void main(void) {");
77667
77871
  if (clipping) {
77668
77872
  src.push(" bool clippable = (float(vFlags2.x) > 0.0);");
@@ -77676,10 +77880,7 @@ class TrianglesDataTextureOcclusionRenderer {
77676
77880
  src.push(" if (dist > 0.0) { discard; }");
77677
77881
  src.push(" }");
77678
77882
  }
77679
- if (scene.logarithmicDepthBufferEnabled) {
77680
- src.push(" gl_FragDepthEXT = isPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;");
77681
- }
77682
- src.push(" gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0); "); // Occluders are blue
77883
+ src.push(" outColor = vec4(0.0, 0.0, 1.0, 1.0); "); // Occluders are blue
77683
77884
  src.push("}");
77684
77885
  return src;
77685
77886
  }
@@ -86150,7 +86351,7 @@ class PickController {
86150
86351
  this.snapPickResult = snapPickResult;
86151
86352
  this.snappedOrPicked = true;
86152
86353
  this._needFireEvents = true;
86153
- }else {
86354
+ } else {
86154
86355
  this.schedulePickSurface = true; // Fallback
86155
86356
  this.snapPickResult = null;
86156
86357
  }
@@ -86204,7 +86405,7 @@ class PickController {
86204
86405
  this.pickedSurface = true;
86205
86406
  }
86206
86407
  this._needFireEvents = true;
86207
- }else if (this.scheduleSnapOrPick) {
86408
+ } else if (this.scheduleSnapOrPick) {
86208
86409
  this.hoveredSnappedOrSurfaceOff = true;
86209
86410
  this._needFireEvents = true;
86210
86411
  }
@@ -86244,6 +86445,11 @@ class PickController {
86244
86445
  const pickResult = new PickResult();
86245
86446
  pickResult.worldPos = this.snapPickResult.snappedWorldPos;
86246
86447
  pickResult.canvasPos = this.snapPickResult.snappedCanvasPos;
86448
+ if (this._configs.snapMode === "vertex") {
86449
+ pickResult.snappedToVertex = true;
86450
+ } else {
86451
+ pickResult.snappedToEdge = true;
86452
+ }
86247
86453
  this._cameraControl.fire("hoverSnapOrSurface", pickResult, true);
86248
86454
  this.snapPickResult = null;
86249
86455
  } else {
@@ -90358,7 +90564,7 @@ class MetaModel {
90358
90564
  * @property metaObjects
90359
90565
  * @type {MetaObject[]}
90360
90566
  */
90361
- this.metaObjects=[];
90567
+ this.metaObjects = [];
90362
90568
 
90363
90569
  /**
90364
90570
  * Connectivity graph.
@@ -90379,7 +90585,7 @@ class MetaModel {
90379
90585
  * Load metamodel data into this MetaModel.
90380
90586
  * @param metaModelData
90381
90587
  */
90382
- loadData(metaModelData, options={}) {
90588
+ loadData(metaModelData, options = {}) {
90383
90589
 
90384
90590
  if (this.finalized) {
90385
90591
  throw "MetaScene already finalized - can't add more data";
@@ -90495,13 +90701,26 @@ class MetaModel {
90495
90701
  this.metaScene.fire("metaModelCreated", this.id);
90496
90702
  }
90497
90703
 
90704
+ /**
90705
+ * Gets this MetaModel as JSON.
90706
+ * @returns {{schema: (String|string|*), createdAt: (String|string|*), metaObjects: *[], author: (String|string|*), id: (String|Number|string|number|*), creatingApplication: (String|string|*), projectId: (String|Number|string|number|*), propertySets: *[]}}
90707
+ */
90498
90708
  getJSON() {
90499
-
90500
- const metaObjects = [];
90501
-
90502
- function visit(metaObject) {
90709
+ const json = {
90710
+ id: this.id,
90711
+ projectId: this.projectId,
90712
+ author: this.author,
90713
+ createdAt: this.createdAt,
90714
+ schema: this.schema,
90715
+ creatingApplication: this.creatingApplication,
90716
+ metaObjects: [],
90717
+ propertySets: []
90718
+ };
90719
+ for (let i = 0, len = this.metaObjects.length; i < len; i++) {
90720
+ const metaObject = this.metaObjects[i];
90503
90721
  const metaObjectCfg = {
90504
90722
  id: metaObject.id,
90723
+ originalSystemId: metaObject.originalSystemId,
90505
90724
  extId: metaObject.extId,
90506
90725
  type: metaObject.type,
90507
90726
  name: metaObject.name
@@ -90509,23 +90728,38 @@ class MetaModel {
90509
90728
  if (metaObject.parent) {
90510
90729
  metaObjectCfg.parent = metaObject.parent.id;
90511
90730
  }
90512
- metaObjects.push(metaObjectCfg);
90513
- const children = metaObject.children;
90514
- if (children) {
90515
- for (let i = 0, len = children.length; i < len; i++) {
90516
- visit(children[i]);
90517
- }
90731
+ if (metaObject.attributes) {
90732
+ metaObjectCfg.attributes = metaObject.attributes;
90733
+ }
90734
+ if (metaObject.propertySetIds) {
90735
+ metaObjectCfg.propertySetIds = metaObject.propertySetIds;
90736
+ }
90737
+ json.metaObjects.push(metaObjectCfg);
90738
+ }
90739
+ for (let i = 0, len = this.propertySets.length; i < len; i++) {
90740
+ const propertySet = this.propertySets[i];
90741
+ const propertySetCfg = {
90742
+ id: propertySet.id,
90743
+ originalSystemId: propertySet.originalSystemId,
90744
+ extId: propertySet.extId,
90745
+ type: propertySet.type,
90746
+ name: propertySet.name,
90747
+ propertyies: []
90748
+ };
90749
+ for (let j = 0, lenj = propertySet.properties.length; j < lenj; j++) {
90750
+ const property = propertySet.properties[j];
90751
+ const propertyCfg = {
90752
+ id: property.id,
90753
+ description: property.description,
90754
+ type: property.type,
90755
+ name: property.name,
90756
+ value: property.value,
90757
+ valueType: property.valueType
90758
+ };
90759
+ propertySetCfg.properties.push(propertyCfg);
90518
90760
  }
90761
+ json.propertySets.push(propertySetCfg);
90519
90762
  }
90520
-
90521
- visit(this.rootMetaObject);
90522
-
90523
- const json = {
90524
- id: this.id,
90525
- projectId: this.projectId,
90526
- revisionId: this.revisionId,
90527
- metaObjects: metaObjects
90528
- };
90529
90763
  return json;
90530
90764
  }
90531
90765
 
@@ -99472,8 +99706,15 @@ class DistanceMeasurementsControl extends Component {
99472
99706
  this.markerDiv.style.marginLeft = `${event.canvasPos[0] - 5}px`;
99473
99707
  this.markerDiv.style.marginTop = `${event.canvasPos[1] - 5}px`;
99474
99708
  this.markerDiv.style.background = "pink";
99475
- this.markerDiv.style.border = "2px solid red";
99476
- } else if (!this.active) {
99709
+ if (event.snappedToVertex || event.snappedToEdge) {
99710
+ this.markerDiv.style.background = "greenyellow";
99711
+ this.markerDiv.style.border ="2px solid green";
99712
+ } else {
99713
+ this.markerDiv.style.background = "pink";
99714
+ this.markerDiv.style.border = "2px solid red";
99715
+ }
99716
+
99717
+ } else {
99477
99718
  this.markerDiv.style.marginLeft = `-10000px`;
99478
99719
  this.markerDiv.style.marginTop = `-10000px`;
99479
99720
  }
@@ -99486,6 +99727,8 @@ class DistanceMeasurementsControl extends Component {
99486
99727
  this._currentDistanceMeasurementByMouse.zAxisVisible = this._currentDistanceMeasurementByMouseInittouchState.zAxisVisible && this.plugin.defaultZAxisVisible;
99487
99728
  this._currentDistanceMeasurementByMouse.targetVisible = this._currentDistanceMeasurementByMouseInittouchState.targetVisible;
99488
99729
  this._currentDistanceMeasurementByMouse.target.worldPos = mouseWorldPos;
99730
+ this.markerDiv.style.marginLeft = `-10000px`;
99731
+ this.markerDiv.style.marginTop = `-10000px`;
99489
99732
  }
99490
99733
  });
99491
99734
 
@@ -188572,6 +188815,181 @@ const LASLoader = {
188572
188815
  options: DEFAULT_LAS_OPTIONS
188573
188816
  };
188574
188817
 
188818
+ //import * as epsgCheck from 'epsg-index/all.json';
188819
+
188820
+ const headerBlockItems = [
188821
+ {item: 'FileSignature', format: 'char', size: 4},
188822
+ {item: 'FileSoureceID', format: 'uShort', size: 2},
188823
+ {item: 'GlobalEncoding', format: 'uShort', size: 2},
188824
+ {item: 'ProjectID1', format: 'notUsed', size: 4},
188825
+ {item: 'ProjectID2', format: 'notUsed', size: 2},
188826
+ {item: 'ProjectID3', format: 'notUsed', size: 2},
188827
+ {item: 'ProjectID4', format: 'notUsed', size: 8},
188828
+ {item: 'VersionMajor', format: 'uChar', size: 1},
188829
+ {item: 'VersionMinor', format: 'uChar', size: 1},
188830
+ {item: 'SystemIdentifier', format: 'char', size: 32},
188831
+ {item: 'GeneratingSoftware', format: 'char', size: 32},
188832
+ {item: 'CreationDay', format: 'uShort', size: 2},
188833
+ {item: 'CreationYear', format: 'uShort', size: 2},
188834
+ {item: 'HeaderSize', format: 'uShort', size: 2},
188835
+ {item: 'OffsetToPointData', format: 'uLong', size: 4},
188836
+ {item: 'NumberOfVariableLengthRecords', format: 'uLong', size: 4},
188837
+ {item: 'PointDataFormatID', format: 'uChar', size: 1},
188838
+ {item: 'PointDataRecordLength', format: 'uShort', size: 2},
188839
+ {item: 'NumberOfPoints', format: 'uLong', size: 4},
188840
+ {item: 'NumberOfPointByReturn', format: 'uLong', size: 20},
188841
+ {item: 'ScaleFactorX', format: 'double', size: 8},
188842
+ {item: 'ScaleFactorY', format: 'double', size: 8},
188843
+ {item: 'ScaleFactorZ', format: 'double', size: 8},
188844
+ {item: 'OffsetX', format: 'double', size: 8},
188845
+ {item: 'OffsetY', format: 'double', size: 8},
188846
+ {item: 'OffsetZ', format: 'double', size: 8},
188847
+ {item: 'MaxX', format: 'double', size: 8},
188848
+ {item: 'MinX', format: 'double', size: 8},
188849
+ {item: 'MaxY', format: 'double', size: 8},
188850
+ {item: 'MinY', format: 'double', size: 8},
188851
+ {item: 'MaxZ', format: 'double', size: 8},
188852
+ {item: 'MinZ', format: 'double', size: 8},
188853
+ ];
188854
+
188855
+ const variableLengthRecord = [
188856
+ {item: 'Reserved', format: 'uShort', size: 2},
188857
+ {item: 'UserId', format: 'char', size: 16},
188858
+ {item: 'RecordId', format: 'uShort', size: 2},
188859
+ {item: 'RecordLengthAfterHeader', format: 'uShort', size: 2},
188860
+ {item: 'Description', format: 'char', size: 32},
188861
+ ];
188862
+
188863
+ /**
188864
+ * @private
188865
+ * @param arrayBuffer
188866
+ * @returns {{}}
188867
+ */
188868
+ const loadLASHeader = (arrayBuffer) => {
188869
+
188870
+ let currentByte = 0;
188871
+ let numOfVarLenRecords = 0;
188872
+ let projectionStart = 0;
188873
+
188874
+ const dataView = new DataView(arrayBuffer);
188875
+ const buffer = new Uint8Array(6000);
188876
+
188877
+ const getGeoKeys = (geoRecord) => {
188878
+ if (geoRecord === undefined) {
188879
+ return undefined;
188880
+ }
188881
+ const projectionEnd = projectionStart + geoRecord["RecordLengthAfterHeader"];
188882
+ const geoTag = buffer.slice(projectionStart, projectionEnd);
188883
+ const arrayBuffer = bufferFlipper(geoTag);
188884
+ const dataView = new DataView(arrayBuffer);
188885
+ let byteCount = 6;
188886
+ let numberOfKeys = Number(dataView.getUint16(byteCount, true));
188887
+ const geoKeys = [];
188888
+ while (numberOfKeys--) {
188889
+ const keyTmp = {};
188890
+ keyTmp.key = dataView.getUint16(byteCount += 2, true);
188891
+ keyTmp.tiffTagLocation = dataView.getUint16(byteCount += 2, true);
188892
+ keyTmp.count = dataView.getUint16(byteCount += 2, true);
188893
+ keyTmp.valueOffset = dataView.getUint16(byteCount += 2, true);
188894
+ geoKeys.push(keyTmp);
188895
+ }
188896
+ const projRecord = geoKeys.find(x => x.key === 3072);
188897
+ if (projRecord && projRecord.hasOwnProperty('valueOffset')) {
188898
+ const epsg = projRecord.valueOffset;
188899
+ {
188900
+ return epsg;
188901
+ }
188902
+ }
188903
+ return undefined;
188904
+ };
188905
+
188906
+ const getValue = ({item, format, size}) => {
188907
+ let str, array;
188908
+ switch (format) {
188909
+ case 'char':
188910
+ array = new Uint8Array(arrayBuffer, currentByte, size);
188911
+ currentByte += size;
188912
+ str = uint8arrayToString(array);
188913
+ return [item, str];
188914
+ case 'uShort':
188915
+ str = dataView.getUint16(currentByte, true);
188916
+ currentByte += size;
188917
+ return [item, str];
188918
+ case 'uLong':
188919
+ str = dataView.getUint32(currentByte, true);
188920
+ if (item === 'NumberOfVariableLengthRecords') {
188921
+ numOfVarLenRecords = str;
188922
+ }
188923
+ currentByte += size;
188924
+ return [item, str];
188925
+ case 'uChar':
188926
+ str = dataView.getUint8(currentByte);
188927
+ currentByte += size;
188928
+ return [item, str];
188929
+ case 'double':
188930
+ str = dataView.getFloat64(currentByte, true);
188931
+ currentByte += size;
188932
+ return [item, str];
188933
+ default:
188934
+ currentByte += size;
188935
+ }
188936
+ };
188937
+
188938
+ const getValues = () => {
188939
+ const publicHeaderBlock = {};
188940
+ headerBlockItems.forEach((obj) => {
188941
+ const myObj = getValue({...obj});
188942
+ if (myObj !== undefined) {
188943
+ if (myObj[0] === 'FileSignature' && myObj[1] !== 'LASF') {
188944
+ throw new Error('Ivalid FileSignature. Is this a LAS/LAZ file');
188945
+ }
188946
+ publicHeaderBlock[myObj[0]] = myObj[1];
188947
+ }
188948
+ });
188949
+ const variableRecords = [];
188950
+ let variableLengthRecords = numOfVarLenRecords;
188951
+ while (variableLengthRecords--) {
188952
+ const variableObj = {};
188953
+ variableLengthRecord.forEach((obj) => {
188954
+ const myObj = getValue({...obj});
188955
+ variableObj[myObj[0]] = myObj[1];
188956
+ if (myObj[0] === 'UserId' && myObj[1] === 'LASF_Projection') {
188957
+ projectionStart = currentByte - 18 + 54;
188958
+ }
188959
+ });
188960
+ variableRecords.push(variableObj);
188961
+ }
188962
+ const geoRecord = variableRecords.find(x => x.UserId === 'LASF_Projection');
188963
+ const epsg = getGeoKeys(geoRecord);
188964
+ if (epsg) {
188965
+ publicHeaderBlock['epsg'] = epsg;
188966
+ }
188967
+ return publicHeaderBlock;
188968
+ };
188969
+
188970
+ return getValues();
188971
+ };
188972
+
188973
+ const bufferFlipper = (buf) => {
188974
+ let ab = new ArrayBuffer(buf.length);
188975
+ let view = new Uint8Array(ab);
188976
+ for (let i = 0; i < buf.length; ++i) {
188977
+ view[i] = buf[i];
188978
+ }
188979
+ return ab;
188980
+ };
188981
+
188982
+ const uint8arrayToString = (array) => {
188983
+ let str = '';
188984
+ array.forEach((item) => {
188985
+ let c = String.fromCharCode(item);
188986
+ if (c !== '\u0000') {
188987
+ str += c;
188988
+ }
188989
+ });
188990
+ return str.trim();
188991
+ };
188992
+
188575
188993
  /**
188576
188994
  * {@link Viewer} plugin that loads lidar point cloud geometry from LAS files.
188577
188995
  *
@@ -188965,6 +189383,9 @@ class LASLoaderPlugin extends Plugin {
188965
189383
  stats.numVertices = 0;
188966
189384
 
188967
189385
  try {
189386
+
189387
+ const lasHeader = loadLASHeader(arrayBuffer);
189388
+
188968
189389
  parse$3(arrayBuffer, LASLoader, options).then((parsedData) => {
188969
189390
 
188970
189391
  const attributes = parsedData.attributes;
@@ -189039,16 +189460,20 @@ class LASLoaderPlugin extends Plugin {
189039
189460
  createdAt: "",
189040
189461
  schema: "",
189041
189462
  creatingApplication: "",
189042
- metaObjects: [{
189043
- id: rootMetaObjectId,
189044
- name: "Model",
189045
- type: "Model"
189046
- }, {
189047
- id: pointsObjectId,
189048
- name: "PointCloud (LAS)",
189049
- type: "PointCloud",
189050
- parent: rootMetaObjectId
189051
- }],
189463
+ metaObjects: [
189464
+ {
189465
+ id: rootMetaObjectId,
189466
+ name: "Model",
189467
+ type: "Model"
189468
+ },
189469
+ {
189470
+ id: pointsObjectId,
189471
+ name: "PointCloud (LAS)",
189472
+ type: "PointCloud",
189473
+ parent: rootMetaObjectId,
189474
+ attributes: lasHeader || {}
189475
+ }
189476
+ ],
189052
189477
  propertySets: []
189053
189478
  };
189054
189479
  const metaModelId = sceneModel.id;