@xeokit/xeokit-sdk 2.4.2-beta-27 → 2.4.2-beta-30

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.
@@ -13002,7 +13002,7 @@ class Annotation extends Marker {
13002
13002
 
13003
13003
  const tempVec3a$C = math.vec3();
13004
13004
  const tempVec3b$r = math.vec3();
13005
- const tempVec3c$o = math.vec3();
13005
+ const tempVec3c$n = math.vec3();
13006
13006
 
13007
13007
  /**
13008
13008
  * {@link Viewer} plugin that creates {@link Annotation}s.
@@ -13488,7 +13488,7 @@ class AnnotationsPlugin extends Plugin {
13488
13488
  } else {
13489
13489
  const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$C);
13490
13490
  const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$r);
13491
- const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$o);
13491
+ const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$n);
13492
13492
  worldPos = offsetWorldPos;
13493
13493
  entity = pickResult.entity;
13494
13494
  }
@@ -21571,7 +21571,7 @@ class CustomProjection extends Component {
21571
21571
 
21572
21572
  const tempVec3$6 = math.vec3();
21573
21573
  const tempVec3b$q = math.vec3();
21574
- const tempVec3c$n = math.vec3();
21574
+ const tempVec3c$m = math.vec3();
21575
21575
  const tempVec3d$9 = math.vec3();
21576
21576
  const tempVec3e$2 = math.vec3();
21577
21577
  const tempVec3f$2 = math.vec3();
@@ -21884,7 +21884,7 @@ class Camera extends Component {
21884
21884
  let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3$6);
21885
21885
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
21886
21886
  lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$q);
21887
- this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$n); // Set eye position as 'look' plus 'eye' vector
21887
+ this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$m); // Set eye position as 'look' plus 'eye' vector
21888
21888
  this.up = math.transformPoint3(tempMat, this._up, tempVec3d$9); // Rotate 'up' vector
21889
21889
  }
21890
21890
 
@@ -21901,7 +21901,7 @@ class Camera extends Component {
21901
21901
  }
21902
21902
  }
21903
21903
  let eye2 = math.subVec3(this._eye, this._look, tempVec3$6);
21904
- const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$n));
21904
+ const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$m));
21905
21905
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
21906
21906
  eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$9);
21907
21907
  this.up = math.transformPoint3(tempMat, this._up, tempVec3e$2);
@@ -21917,7 +21917,7 @@ class Camera extends Component {
21917
21917
  let look2 = math.subVec3(this._look, this._eye, tempVec3$6);
21918
21918
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
21919
21919
  look2 = math.transformPoint3(tempMat, look2, tempVec3b$q);
21920
- this.look = math.addVec3(look2, this._eye, tempVec3c$n);
21920
+ this.look = math.addVec3(look2, this._eye, tempVec3c$m);
21921
21921
  if (this._gimbalLock) {
21922
21922
  this.up = math.transformPoint3(tempMat, this._up, tempVec3d$9);
21923
21923
  }
@@ -21936,7 +21936,7 @@ class Camera extends Component {
21936
21936
  }
21937
21937
  }
21938
21938
  let look2 = math.subVec3(this._look, this._eye, tempVec3$6);
21939
- const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$n));
21939
+ const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$m));
21940
21940
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
21941
21941
  this.up = math.transformPoint3(tempMat, this._up, tempVec3f$2);
21942
21942
  look2 = math.transformPoint3(tempMat, look2, tempVec3d$9);
@@ -21960,7 +21960,7 @@ class Camera extends Component {
21960
21960
  vec[2] += v[2];
21961
21961
  }
21962
21962
  if (pan[1] !== 0) {
21963
- v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$n), pan[1]);
21963
+ v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$m), pan[1]);
21964
21964
  vec[0] += v[0];
21965
21965
  vec[1] += v[1];
21966
21966
  vec[2] += v[2];
@@ -21987,7 +21987,7 @@ class Camera extends Component {
21987
21987
  if (newLenLook < 0.5) {
21988
21988
  return;
21989
21989
  }
21990
- const dir = math.normalizeVec3(vec, tempVec3c$n);
21990
+ const dir = math.normalizeVec3(vec, tempVec3c$m);
21991
21991
  this.eye = math.addVec3(this._look, math.mulVec3Scalar(dir, newLenLook), tempVec3d$9);
21992
21992
  }
21993
21993
 
@@ -47952,7 +47952,7 @@ class LineSet extends Component {
47952
47952
  const tempVec3$5 = math.vec3();
47953
47953
  const tempVec3a$u = math.vec3();
47954
47954
  const tempVec3b$p = math.vec3();
47955
- const tempVec3c$m = math.vec3();
47955
+ const tempVec3c$l = math.vec3();
47956
47956
 
47957
47957
  /**
47958
47958
  * {@link Viewer} plugin that saves and loads BCF viewpoints as JSON objects.
@@ -48260,29 +48260,11 @@ class BCFViewpointsPlugin extends Plugin {
48260
48260
  * @param {String} [cfg.id="BCFViewpoints"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
48261
48261
  * @param {String} [cfg.originatingSystem] Identifies the originating system for BCF records.
48262
48262
  * @param {String} [cfg.authoringTool] Identifies the authoring tool for BCF records.
48263
- * @param {Boolean} [cfg.xrayAsZeroAlpha=false] Specifies how xeokit's X-ray emphasis effect is handled in BCF viewpoints. See {@link BCFViewpointsPlugin#xrayAsZeroAlpha} for details.
48264
48263
  */
48265
48264
  constructor(viewer, cfg = {}) {
48266
48265
 
48267
48266
  super("BCFViewpoints", viewer, cfg);
48268
48267
 
48269
- /**
48270
- * Specifies how xeokit's X-ray emphasis effect is handled in BCF viewpoints.
48271
- *
48272
- * When `xrayAsZeroAlpha` is `true`:
48273
- *
48274
- * * when saving a viewpoint, set the `A` channel of each `coloring` component to `0` for each X-rayed object, and
48275
- * * when loading a viewpoint saved from a xeokit application (i.e. when the viewpoint's `originating_system == "xeokit.io"`), set an object X-rayed if the `A` channel of its corresponding `coloring` component equals `0`
48276
- *
48277
- * When `xrayAsZeroAlpha` is `false`:
48278
- *
48279
- * * don't save any X-ray information in viewpoints, and
48280
- * * reset all objects as not X-rayed whenever loading a viewpoint.
48281
- *
48282
- * @type {boolean}
48283
- */
48284
- this.xrayAsZeroAlpha = !!cfg.xrayAsZeroAlpha;
48285
-
48286
48268
  /**
48287
48269
  * Identifies the originating system to include in BCF viewpoints saved by this plugin.
48288
48270
  * @property originatingSystem
@@ -48307,6 +48289,9 @@ class BCFViewpointsPlugin extends Plugin {
48307
48289
  * @param {Boolean} [options.spacesVisible=false] Indicates whether ````IfcSpace```` types should be forced visible in the viewpoint.
48308
48290
  * @param {Boolean} [options.openingsVisible=false] Indicates whether ````IfcOpening```` types should be forced visible in the viewpoint.
48309
48291
  * @param {Boolean} [options.spaceBoundariesVisible=false] Indicates whether the boundaries of ````IfcSpace```` types should be visible in the viewpoint.
48292
+ * @param {Boolean} [options.spacesTranslucent=false] Indicates whether ````IfcSpace```` types should be forced translucent in the viewpoint.
48293
+ * @param {Boolean} [options.spaceBoundariesTranslucent=false] Indicates whether the boundaries of ````IfcSpace```` types should be forced translucent in the viewpoint.
48294
+ * @param {Boolean} [options.openingsTranslucent=true] Indicates whether ````IfcOpening```` types should be forced translucent in the viewpoint.
48310
48295
  * @param {Boolean} [options.snapshot=true] Indicates whether the snapshot should be included in the viewpoint.
48311
48296
  * @param {Boolean} [options.defaultInvisible=false] When ````true````, will save the default visibility of all objects
48312
48297
  * as ````false````. This means that when we load the viewpoint again, and there are additional models loaded that
@@ -48454,7 +48439,10 @@ class BCFViewpointsPlugin extends Plugin {
48454
48439
  view_setup_hints: {
48455
48440
  spaces_visible: !!options.spacesVisible,
48456
48441
  space_boundaries_visible: !!options.spaceBoundariesVisible,
48457
- openings_visible: !!options.openingsVisible
48442
+ openings_visible: !!options.openingsVisible,
48443
+ spaces_translucent: !!options.spaces_translucent,
48444
+ space_boundaries_translucent: !!options.space_boundaries_translucent,
48445
+ openings_translucent: !!options.openings_translucent
48458
48446
  }
48459
48447
  }
48460
48448
  };
@@ -48471,15 +48459,11 @@ class BCFViewpointsPlugin extends Plugin {
48471
48459
  let alpha;
48472
48460
 
48473
48461
  if (entity.xrayed) {
48474
- if (this.xrayAsZeroAlpha) {
48475
- alpha = 0;
48462
+ if (scene.xrayMaterial.fillAlpha === 0.0 && scene.xrayMaterial.edgeAlpha !== 0.0) {
48463
+ // BCF can't deal with edges. If xRay is implemented only with edges, set an arbitrary opacity
48464
+ alpha = 0.1;
48476
48465
  } else {
48477
- if (scene.xrayMaterial.fillAlpha === 0.0 && scene.xrayMaterial.edgeAlpha !== 0.0) {
48478
- // BCF can't deal with edges. If xRay is implemented only with edges, set an arbitrary opacity
48479
- alpha = 0.1;
48480
- } else {
48481
- alpha = scene.xrayMaterial.fillAlpha;
48482
- }
48466
+ alpha = scene.xrayMaterial.fillAlpha;
48483
48467
  }
48484
48468
  alpha = Math.round(alpha * 255).toString(16).padStart(2, "0");
48485
48469
  color = alpha + color;
@@ -48530,6 +48514,8 @@ class BCFViewpointsPlugin extends Plugin {
48530
48514
 
48531
48515
  bcfViewpoint.components.selection = this._createBCFComponents(selectedObjectIds);
48532
48516
 
48517
+ bcfViewpoint.components.translucency = this._createBCFComponents(scene.xrayedObjectIds);
48518
+
48533
48519
  if (options.snapshot !== false) {
48534
48520
  bcfViewpoint.snapshot = {
48535
48521
  snapshot_type: "png",
@@ -48655,7 +48641,7 @@ class BCFViewpointsPlugin extends Plugin {
48655
48641
  const bitmap_data = e.bitmap_data; // base64
48656
48642
  let location = xyzObjectToArray(e.location, tempVec3a$u);
48657
48643
  let normal = xyzObjectToArray(e.normal, tempVec3b$p);
48658
- let up = xyzObjectToArray(e.up, tempVec3c$m);
48644
+ let up = xyzObjectToArray(e.up, tempVec3c$l);
48659
48645
  let height = e.height || 1;
48660
48646
  if (!bitmap_type) {
48661
48647
  return;
@@ -48715,12 +48701,19 @@ class BCFViewpointsPlugin extends Plugin {
48715
48701
  const view_setup_hints = bcfViewpoint.components.visibility.view_setup_hints;
48716
48702
  if (view_setup_hints) {
48717
48703
  if (view_setup_hints.spaces_visible === false) {
48718
- scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcSpace"), false);
48704
+ scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcSpace"), true);
48719
48705
  }
48720
- if (view_setup_hints.openings_visible === false) {
48721
- scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcOpening"), false);
48706
+ if (view_setup_hints.spaces_translucent !== undefined) {
48707
+ scene.setObjectsXRayed(viewer.metaScene.getObjectIDsByType("IfcSpace"), true);
48722
48708
  }
48723
48709
  if (view_setup_hints.space_boundaries_visible !== undefined) ;
48710
+ if (view_setup_hints.openings_visible === false) {
48711
+ scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcOpening"), true);
48712
+ }
48713
+ if (view_setup_hints.space_boundaries_translucent !== undefined) ;
48714
+ if (view_setup_hints.openings_translucent !== undefined) {
48715
+ scene.setObjectsXRayed(viewer.metaScene.getObjectIDsByType("IfcOpening"), true);
48716
+ }
48724
48717
  }
48725
48718
  }
48726
48719
 
@@ -48730,6 +48723,11 @@ class BCFViewpointsPlugin extends Plugin {
48730
48723
 
48731
48724
  }
48732
48725
 
48726
+ if (bcfViewpoint.components.translucency) {
48727
+ scene.setObjectsXRayed(scene.xrayedObjectIds, false);
48728
+ bcfViewpoint.components.translucency.forEach(component => this._withBCFComponent(options, component, entity => entity.xrayed = true));
48729
+ }
48730
+
48733
48731
  if (bcfViewpoint.components.coloring) {
48734
48732
  bcfViewpoint.components.coloring.forEach(coloring => {
48735
48733
 
@@ -48756,16 +48754,7 @@ class BCFViewpointsPlugin extends Plugin {
48756
48754
  this._withBCFComponent(options, component, entity => {
48757
48755
  entity.colorize = colorize;
48758
48756
  if (alphaDefined) {
48759
- if (alpha === 0 && this.xrayAsZeroAlpha) {
48760
- const savedFromXeokit = (component.originating_system === this.originatingSystem);
48761
- if (savedFromXeokit) {
48762
- entity.xrayed = true;
48763
- } else {
48764
- entity.opacity = alpha;
48765
- }
48766
- } else {
48767
- entity.opacity = alpha;
48768
- }
48757
+ entity.opacity = alpha;
48769
48758
  }
48770
48759
  }));
48771
48760
  });
@@ -56603,7 +56592,7 @@ const edgesDefaultColor = new Float32Array([0, 0, 0, 1]);
56603
56592
 
56604
56593
  const tempVec4 = math.vec4();
56605
56594
  const tempVec3a$s = math.vec3();
56606
- const tempVec3c$l = math.vec3();
56595
+ const tempVec3c$k = math.vec3();
56607
56596
  const tempMat4a$h = math.mat4();
56608
56597
 
56609
56598
  /**
@@ -57048,7 +57037,7 @@ class VBOSceneModelRenderer {
57048
57037
  if (gotOrigin || gotPosition) {
57049
57038
  const rtcOrigin = tempVec3a$s;
57050
57039
  if (gotOrigin) {
57051
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$l);
57040
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$k);
57052
57041
  rtcOrigin[0] = rotatedOrigin[0];
57053
57042
  rtcOrigin[1] = rotatedOrigin[1];
57054
57043
  rtcOrigin[2] = rotatedOrigin[2];
@@ -60588,7 +60577,7 @@ function octDecodeVec2(oct) { // Decode an oct-encoded normal
60588
60577
 
60589
60578
  const tempVec3a$r = math.vec3();
60590
60579
  const tempVec3b$n = math.vec3();
60591
- const tempVec3c$k = math.vec3();
60580
+ const tempVec3c$j = math.vec3();
60592
60581
  const tempVec3d$8 = math.vec3();
60593
60582
  const tempMat4a$g = math.mat4();
60594
60583
 
@@ -60641,7 +60630,7 @@ class SnapBatchingDepthBufInitRenderer extends VBOSceneModelRenderer {
60641
60630
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
60642
60631
  const rtcOrigin = tempVec3b$n;
60643
60632
  if (origin) {
60644
- const rotatedOrigin = tempVec3c$k;
60633
+ const rotatedOrigin = tempVec3c$j;
60645
60634
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
60646
60635
  rtcOrigin[0] = rotatedOrigin[0];
60647
60636
  rtcOrigin[1] = rotatedOrigin[1];
@@ -60893,7 +60882,7 @@ class SnapBatchingDepthBufInitRenderer extends VBOSceneModelRenderer {
60893
60882
 
60894
60883
  const tempVec3a$q = math.vec3();
60895
60884
  const tempVec3b$m = math.vec3();
60896
- const tempVec3c$j = math.vec3();
60885
+ const tempVec3c$i = math.vec3();
60897
60886
  const tempVec3d$7 = math.vec3();
60898
60887
  const tempMat4a$f = math.mat4();
60899
60888
 
@@ -60950,7 +60939,7 @@ class SnapBatchingDepthRenderer extends VBOSceneModelRenderer{
60950
60939
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
60951
60940
  const rtcOrigin = tempVec3b$m;
60952
60941
  if (origin) {
60953
- const rotatedOrigin = tempVec3c$j;
60942
+ const rotatedOrigin = tempVec3c$i;
60954
60943
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
60955
60944
  rtcOrigin[0] = rotatedOrigin[0];
60956
60945
  rtcOrigin[1] = rotatedOrigin[1];
@@ -61286,7 +61275,7 @@ math.OBB3();
61286
61275
 
61287
61276
  const tempVec3a$p = math.vec3();
61288
61277
  const tempVec3b$l = math.vec3();
61289
- const tempVec3c$i = math.vec3();
61278
+ const tempVec3c$h = math.vec3();
61290
61279
  const tempVec3d$6 = math.vec3();
61291
61280
  const tempVec3e$1 = math.vec3();
61292
61281
  const tempVec3f$1 = math.vec3();
@@ -62470,7 +62459,7 @@ class TrianglesBatchingLayer {
62470
62459
  const rtcRayOrigin = tempVec3a$p;
62471
62460
  const rtcRayDir = tempVec3b$l;
62472
62461
 
62473
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$i) : worldRayOrigin); // World -> RTC
62462
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$h) : worldRayOrigin); // World -> RTC
62474
62463
  rtcRayDir.set(worldRayDir);
62475
62464
 
62476
62465
  if (offset) {
@@ -65657,7 +65646,7 @@ function getInstancingRenderers$1(scene) {
65657
65646
 
65658
65647
  const tempVec3a$o = math.vec3();
65659
65648
  const tempVec3b$k = math.vec3();
65660
- const tempVec3c$h = math.vec3();
65649
+ const tempVec3c$g = math.vec3();
65661
65650
  const tempVec3d$5 = math.vec3();
65662
65651
  const tempMat4a$e = math.mat4();
65663
65652
 
@@ -65714,7 +65703,7 @@ class SnapInstancingDepthBufInitRenderer extends VBOSceneModelRenderer {
65714
65703
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
65715
65704
  const rtcOrigin = tempVec3b$k;
65716
65705
  if (origin) {
65717
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$h);
65706
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$g);
65718
65707
  rtcOrigin[0] = rotatedOrigin[0];
65719
65708
  rtcOrigin[1] = rotatedOrigin[1];
65720
65709
  rtcOrigin[2] = rotatedOrigin[2];
@@ -65993,7 +65982,7 @@ class SnapInstancingDepthBufInitRenderer extends VBOSceneModelRenderer {
65993
65982
 
65994
65983
  const tempVec3a$n = math.vec3();
65995
65984
  const tempVec3b$j = math.vec3();
65996
- const tempVec3c$g = math.vec3();
65985
+ const tempVec3c$f = math.vec3();
65997
65986
  const tempVec3d$4 = math.vec3();
65998
65987
  const tempMat4a$d = math.mat4();
65999
65988
 
@@ -66051,7 +66040,7 @@ class SnapInstancingDepthRenderer extends VBOSceneModelRenderer {
66051
66040
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
66052
66041
  const rtcOrigin = tempVec3b$j;
66053
66042
  if (origin) {
66054
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$g);
66043
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$f);
66055
66044
  rtcOrigin[0] = rotatedOrigin[0];
66056
66045
  rtcOrigin[1] = rotatedOrigin[1];
66057
66046
  rtcOrigin[2] = rotatedOrigin[2];
@@ -66403,7 +66392,7 @@ const tempVec3fa$2 = new Float32Array(3);
66403
66392
 
66404
66393
  const tempVec3a$m = math.vec3();
66405
66394
  const tempVec3b$i = math.vec3();
66406
- const tempVec3c$f = math.vec3();
66395
+ const tempVec3c$e = math.vec3();
66407
66396
  const tempVec3d$3 = math.vec3();
66408
66397
  const tempVec3e = math.vec3();
66409
66398
  const tempVec3f = math.vec3();
@@ -67470,7 +67459,7 @@ class TrianglesInstancingLayer {
67470
67459
  const rtcRayOrigin = tempVec3a$m;
67471
67460
  const rtcRayDir = tempVec3b$i;
67472
67461
 
67473
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$f) : worldRayOrigin); // World -> RTC
67462
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$e) : worldRayOrigin); // World -> RTC
67474
67463
  rtcRayDir.set(worldRayDir);
67475
67464
 
67476
67465
  if (offset) {
@@ -74783,7 +74772,7 @@ function doCheckResult(buckets, mesh) {
74783
74772
 
74784
74773
  const tempVec3a$k = math.vec3();
74785
74774
  const tempVec3b$g = math.vec3();
74786
- const tempVec3c$e = math.vec3();
74775
+ const tempVec3c$d = math.vec3();
74787
74776
  math.vec3();
74788
74777
 
74789
74778
  const tempVec4a$6 = math.vec4();
@@ -74863,7 +74852,7 @@ class TrianglesDataTextureColorRenderer {
74863
74852
  rtcOrigin[1] += position[1];
74864
74853
  rtcOrigin[2] += position[2];
74865
74854
  rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$c);
74866
- rtcCameraEye = tempVec3c$e;
74855
+ rtcCameraEye = tempVec3c$d;
74867
74856
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
74868
74857
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
74869
74858
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -75400,7 +75389,7 @@ const defaultColor$1 = new Float32Array([1, 1, 1]);
75400
75389
 
75401
75390
  const tempVec3a$j = math.vec3();
75402
75391
  const tempVec3b$f = math.vec3();
75403
- const tempVec3c$d = math.vec3();
75392
+ const tempVec3c$c = math.vec3();
75404
75393
  math.vec3();
75405
75394
  const tempMat4a$b = math.mat4();
75406
75395
 
@@ -75476,7 +75465,7 @@ class TrianglesDataTextureSilhouetteRenderer {
75476
75465
  rtcOrigin[1] += position[1];
75477
75466
  rtcOrigin[2] += position[2];
75478
75467
  rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$b);
75479
- rtcCameraEye = tempVec3c$d;
75468
+ rtcCameraEye = tempVec3c$c;
75480
75469
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
75481
75470
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
75482
75471
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -76278,7 +76267,7 @@ class TrianglesDataTextureEdgesRenderer {
76278
76267
 
76279
76268
  const tempVec3a$h = math.vec3();
76280
76269
  const tempVec3b$d = math.vec3();
76281
- const tempVec3c$c = math.vec3();
76270
+ math.vec3();
76282
76271
  const tempMat4a$9 = math.mat4();
76283
76272
 
76284
76273
  /**
@@ -76360,25 +76349,30 @@ class TrianglesDataTextureEdgesColorRenderer {
76360
76349
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
76361
76350
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
76362
76351
 
76363
- const numSectionPlanes = scene._sectionPlanesState.getNumAllocatedSectionPlanes();
76364
- if (numSectionPlanes > 0) {
76352
+ const numAllocatedSectionPlanes = scene._sectionPlanesState.getNumAllocatedSectionPlanes();
76353
+ const numSectionPlanes = scene._sectionPlanesState.sectionPlanes.length;
76354
+ if (numAllocatedSectionPlanes > 0) {
76365
76355
  const sectionPlanes = scene._sectionPlanesState.sectionPlanes;
76366
76356
  const baseIndex = dataTextureLayer.layerIndex * numSectionPlanes;
76367
76357
  const renderFlags = model.renderFlags;
76368
- for (let sectionPlaneIndex = 0; sectionPlaneIndex < numSectionPlanes; sectionPlaneIndex++) {
76358
+ for (let sectionPlaneIndex = 0; sectionPlaneIndex < numAllocatedSectionPlanes; sectionPlaneIndex++) {
76369
76359
  const sectionPlaneUniforms = this._uSectionPlanes[sectionPlaneIndex];
76370
76360
  if (sectionPlaneUniforms) {
76371
- const active = renderFlags.sectionPlanesActivePerLayer[baseIndex + sectionPlaneIndex];
76372
- gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
76373
- if (active) {
76374
- const sectionPlane = sectionPlanes[sectionPlaneIndex];
76375
- if (origin) {
76376
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3c$c);
76377
- gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76378
- } else {
76379
- gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
76361
+ if (sectionPlaneIndex < numSectionPlanes) {
76362
+ const active = renderFlags.sectionPlanesActivePerLayer[baseIndex + sectionPlaneIndex];
76363
+ gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
76364
+ if (active) {
76365
+ const sectionPlane = sectionPlanes[sectionPlaneIndex];
76366
+ if (origin) {
76367
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
76368
+ gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76369
+ } else {
76370
+ gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
76371
+ }
76372
+ gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
76380
76373
  }
76381
- gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
76374
+ } else {
76375
+ gl.uniform1i(sectionPlaneUniforms.active, 0);
76382
76376
  }
76383
76377
  }
76384
76378
  }