@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.
@@ -12998,7 +12998,7 @@ class Annotation extends Marker {
12998
12998
 
12999
12999
  const tempVec3a$C = math.vec3();
13000
13000
  const tempVec3b$r = math.vec3();
13001
- const tempVec3c$o = math.vec3();
13001
+ const tempVec3c$n = math.vec3();
13002
13002
 
13003
13003
  /**
13004
13004
  * {@link Viewer} plugin that creates {@link Annotation}s.
@@ -13484,7 +13484,7 @@ class AnnotationsPlugin extends Plugin {
13484
13484
  } else {
13485
13485
  const normalizedWorldNormal = math.normalizeVec3(pickResult.worldNormal, tempVec3a$C);
13486
13486
  const offsetVec = math.mulVec3Scalar(normalizedWorldNormal, this._surfaceOffset, tempVec3b$r);
13487
- const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$o);
13487
+ const offsetWorldPos = math.addVec3(pickResult.worldPos, offsetVec, tempVec3c$n);
13488
13488
  worldPos = offsetWorldPos;
13489
13489
  entity = pickResult.entity;
13490
13490
  }
@@ -21567,7 +21567,7 @@ class CustomProjection extends Component {
21567
21567
 
21568
21568
  const tempVec3$6 = math.vec3();
21569
21569
  const tempVec3b$q = math.vec3();
21570
- const tempVec3c$n = math.vec3();
21570
+ const tempVec3c$m = math.vec3();
21571
21571
  const tempVec3d$9 = math.vec3();
21572
21572
  const tempVec3e$2 = math.vec3();
21573
21573
  const tempVec3f$2 = math.vec3();
@@ -21880,7 +21880,7 @@ class Camera extends Component {
21880
21880
  let lookEyeVec = math.subVec3(this._eye, this._look, tempVec3$6);
21881
21881
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
21882
21882
  lookEyeVec = math.transformPoint3(tempMat, lookEyeVec, tempVec3b$q);
21883
- this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$n); // Set eye position as 'look' plus 'eye' vector
21883
+ this.eye = math.addVec3(this._look, lookEyeVec, tempVec3c$m); // Set eye position as 'look' plus 'eye' vector
21884
21884
  this.up = math.transformPoint3(tempMat, this._up, tempVec3d$9); // Rotate 'up' vector
21885
21885
  }
21886
21886
 
@@ -21897,7 +21897,7 @@ class Camera extends Component {
21897
21897
  }
21898
21898
  }
21899
21899
  let eye2 = math.subVec3(this._eye, this._look, tempVec3$6);
21900
- const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$n));
21900
+ const left = math.cross3Vec3(math.normalizeVec3(eye2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$m));
21901
21901
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
21902
21902
  eye2 = math.transformPoint3(tempMat, eye2, tempVec3d$9);
21903
21903
  this.up = math.transformPoint3(tempMat, this._up, tempVec3e$2);
@@ -21913,7 +21913,7 @@ class Camera extends Component {
21913
21913
  let look2 = math.subVec3(this._look, this._eye, tempVec3$6);
21914
21914
  math.rotationMat4v(angleInc * 0.0174532925, this._gimbalLock ? this._worldUp : this._up, tempMat);
21915
21915
  look2 = math.transformPoint3(tempMat, look2, tempVec3b$q);
21916
- this.look = math.addVec3(look2, this._eye, tempVec3c$n);
21916
+ this.look = math.addVec3(look2, this._eye, tempVec3c$m);
21917
21917
  if (this._gimbalLock) {
21918
21918
  this.up = math.transformPoint3(tempMat, this._up, tempVec3d$9);
21919
21919
  }
@@ -21932,7 +21932,7 @@ class Camera extends Component {
21932
21932
  }
21933
21933
  }
21934
21934
  let look2 = math.subVec3(this._look, this._eye, tempVec3$6);
21935
- const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$n));
21935
+ const left = math.cross3Vec3(math.normalizeVec3(look2, tempVec3b$q), math.normalizeVec3(this._up, tempVec3c$m));
21936
21936
  math.rotationMat4v(angleInc * 0.0174532925, left, tempMat);
21937
21937
  this.up = math.transformPoint3(tempMat, this._up, tempVec3f$2);
21938
21938
  look2 = math.transformPoint3(tempMat, look2, tempVec3d$9);
@@ -21956,7 +21956,7 @@ class Camera extends Component {
21956
21956
  vec[2] += v[2];
21957
21957
  }
21958
21958
  if (pan[1] !== 0) {
21959
- v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$n), pan[1]);
21959
+ v = math.mulVec3Scalar(math.normalizeVec3(this._up, tempVec3c$m), pan[1]);
21960
21960
  vec[0] += v[0];
21961
21961
  vec[1] += v[1];
21962
21962
  vec[2] += v[2];
@@ -21983,7 +21983,7 @@ class Camera extends Component {
21983
21983
  if (newLenLook < 0.5) {
21984
21984
  return;
21985
21985
  }
21986
- const dir = math.normalizeVec3(vec, tempVec3c$n);
21986
+ const dir = math.normalizeVec3(vec, tempVec3c$m);
21987
21987
  this.eye = math.addVec3(this._look, math.mulVec3Scalar(dir, newLenLook), tempVec3d$9);
21988
21988
  }
21989
21989
 
@@ -47948,7 +47948,7 @@ class LineSet extends Component {
47948
47948
  const tempVec3$5 = math.vec3();
47949
47949
  const tempVec3a$u = math.vec3();
47950
47950
  const tempVec3b$p = math.vec3();
47951
- const tempVec3c$m = math.vec3();
47951
+ const tempVec3c$l = math.vec3();
47952
47952
 
47953
47953
  /**
47954
47954
  * {@link Viewer} plugin that saves and loads BCF viewpoints as JSON objects.
@@ -48256,29 +48256,11 @@ class BCFViewpointsPlugin extends Plugin {
48256
48256
  * @param {String} [cfg.id="BCFViewpoints"] Optional ID for this plugin, so that we can find it within {@link Viewer#plugins}.
48257
48257
  * @param {String} [cfg.originatingSystem] Identifies the originating system for BCF records.
48258
48258
  * @param {String} [cfg.authoringTool] Identifies the authoring tool for BCF records.
48259
- * @param {Boolean} [cfg.xrayAsZeroAlpha=false] Specifies how xeokit's X-ray emphasis effect is handled in BCF viewpoints. See {@link BCFViewpointsPlugin#xrayAsZeroAlpha} for details.
48260
48259
  */
48261
48260
  constructor(viewer, cfg = {}) {
48262
48261
 
48263
48262
  super("BCFViewpoints", viewer, cfg);
48264
48263
 
48265
- /**
48266
- * Specifies how xeokit's X-ray emphasis effect is handled in BCF viewpoints.
48267
- *
48268
- * When `xrayAsZeroAlpha` is `true`:
48269
- *
48270
- * * when saving a viewpoint, set the `A` channel of each `coloring` component to `0` for each X-rayed object, and
48271
- * * 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`
48272
- *
48273
- * When `xrayAsZeroAlpha` is `false`:
48274
- *
48275
- * * don't save any X-ray information in viewpoints, and
48276
- * * reset all objects as not X-rayed whenever loading a viewpoint.
48277
- *
48278
- * @type {boolean}
48279
- */
48280
- this.xrayAsZeroAlpha = !!cfg.xrayAsZeroAlpha;
48281
-
48282
48264
  /**
48283
48265
  * Identifies the originating system to include in BCF viewpoints saved by this plugin.
48284
48266
  * @property originatingSystem
@@ -48303,6 +48285,9 @@ class BCFViewpointsPlugin extends Plugin {
48303
48285
  * @param {Boolean} [options.spacesVisible=false] Indicates whether ````IfcSpace```` types should be forced visible in the viewpoint.
48304
48286
  * @param {Boolean} [options.openingsVisible=false] Indicates whether ````IfcOpening```` types should be forced visible in the viewpoint.
48305
48287
  * @param {Boolean} [options.spaceBoundariesVisible=false] Indicates whether the boundaries of ````IfcSpace```` types should be visible in the viewpoint.
48288
+ * @param {Boolean} [options.spacesTranslucent=false] Indicates whether ````IfcSpace```` types should be forced translucent in the viewpoint.
48289
+ * @param {Boolean} [options.spaceBoundariesTranslucent=false] Indicates whether the boundaries of ````IfcSpace```` types should be forced translucent in the viewpoint.
48290
+ * @param {Boolean} [options.openingsTranslucent=true] Indicates whether ````IfcOpening```` types should be forced translucent in the viewpoint.
48306
48291
  * @param {Boolean} [options.snapshot=true] Indicates whether the snapshot should be included in the viewpoint.
48307
48292
  * @param {Boolean} [options.defaultInvisible=false] When ````true````, will save the default visibility of all objects
48308
48293
  * as ````false````. This means that when we load the viewpoint again, and there are additional models loaded that
@@ -48450,7 +48435,10 @@ class BCFViewpointsPlugin extends Plugin {
48450
48435
  view_setup_hints: {
48451
48436
  spaces_visible: !!options.spacesVisible,
48452
48437
  space_boundaries_visible: !!options.spaceBoundariesVisible,
48453
- openings_visible: !!options.openingsVisible
48438
+ openings_visible: !!options.openingsVisible,
48439
+ spaces_translucent: !!options.spaces_translucent,
48440
+ space_boundaries_translucent: !!options.space_boundaries_translucent,
48441
+ openings_translucent: !!options.openings_translucent
48454
48442
  }
48455
48443
  }
48456
48444
  };
@@ -48467,15 +48455,11 @@ class BCFViewpointsPlugin extends Plugin {
48467
48455
  let alpha;
48468
48456
 
48469
48457
  if (entity.xrayed) {
48470
- if (this.xrayAsZeroAlpha) {
48471
- alpha = 0;
48458
+ if (scene.xrayMaterial.fillAlpha === 0.0 && scene.xrayMaterial.edgeAlpha !== 0.0) {
48459
+ // BCF can't deal with edges. If xRay is implemented only with edges, set an arbitrary opacity
48460
+ alpha = 0.1;
48472
48461
  } else {
48473
- if (scene.xrayMaterial.fillAlpha === 0.0 && scene.xrayMaterial.edgeAlpha !== 0.0) {
48474
- // BCF can't deal with edges. If xRay is implemented only with edges, set an arbitrary opacity
48475
- alpha = 0.1;
48476
- } else {
48477
- alpha = scene.xrayMaterial.fillAlpha;
48478
- }
48462
+ alpha = scene.xrayMaterial.fillAlpha;
48479
48463
  }
48480
48464
  alpha = Math.round(alpha * 255).toString(16).padStart(2, "0");
48481
48465
  color = alpha + color;
@@ -48526,6 +48510,8 @@ class BCFViewpointsPlugin extends Plugin {
48526
48510
 
48527
48511
  bcfViewpoint.components.selection = this._createBCFComponents(selectedObjectIds);
48528
48512
 
48513
+ bcfViewpoint.components.translucency = this._createBCFComponents(scene.xrayedObjectIds);
48514
+
48529
48515
  if (options.snapshot !== false) {
48530
48516
  bcfViewpoint.snapshot = {
48531
48517
  snapshot_type: "png",
@@ -48651,7 +48637,7 @@ class BCFViewpointsPlugin extends Plugin {
48651
48637
  const bitmap_data = e.bitmap_data; // base64
48652
48638
  let location = xyzObjectToArray(e.location, tempVec3a$u);
48653
48639
  let normal = xyzObjectToArray(e.normal, tempVec3b$p);
48654
- let up = xyzObjectToArray(e.up, tempVec3c$m);
48640
+ let up = xyzObjectToArray(e.up, tempVec3c$l);
48655
48641
  let height = e.height || 1;
48656
48642
  if (!bitmap_type) {
48657
48643
  return;
@@ -48711,12 +48697,19 @@ class BCFViewpointsPlugin extends Plugin {
48711
48697
  const view_setup_hints = bcfViewpoint.components.visibility.view_setup_hints;
48712
48698
  if (view_setup_hints) {
48713
48699
  if (view_setup_hints.spaces_visible === false) {
48714
- scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcSpace"), false);
48700
+ scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcSpace"), true);
48715
48701
  }
48716
- if (view_setup_hints.openings_visible === false) {
48717
- scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcOpening"), false);
48702
+ if (view_setup_hints.spaces_translucent !== undefined) {
48703
+ scene.setObjectsXRayed(viewer.metaScene.getObjectIDsByType("IfcSpace"), true);
48718
48704
  }
48719
48705
  if (view_setup_hints.space_boundaries_visible !== undefined) ;
48706
+ if (view_setup_hints.openings_visible === false) {
48707
+ scene.setObjectsVisible(viewer.metaScene.getObjectIDsByType("IfcOpening"), true);
48708
+ }
48709
+ if (view_setup_hints.space_boundaries_translucent !== undefined) ;
48710
+ if (view_setup_hints.openings_translucent !== undefined) {
48711
+ scene.setObjectsXRayed(viewer.metaScene.getObjectIDsByType("IfcOpening"), true);
48712
+ }
48720
48713
  }
48721
48714
  }
48722
48715
 
@@ -48726,6 +48719,11 @@ class BCFViewpointsPlugin extends Plugin {
48726
48719
 
48727
48720
  }
48728
48721
 
48722
+ if (bcfViewpoint.components.translucency) {
48723
+ scene.setObjectsXRayed(scene.xrayedObjectIds, false);
48724
+ bcfViewpoint.components.translucency.forEach(component => this._withBCFComponent(options, component, entity => entity.xrayed = true));
48725
+ }
48726
+
48729
48727
  if (bcfViewpoint.components.coloring) {
48730
48728
  bcfViewpoint.components.coloring.forEach(coloring => {
48731
48729
 
@@ -48752,16 +48750,7 @@ class BCFViewpointsPlugin extends Plugin {
48752
48750
  this._withBCFComponent(options, component, entity => {
48753
48751
  entity.colorize = colorize;
48754
48752
  if (alphaDefined) {
48755
- if (alpha === 0 && this.xrayAsZeroAlpha) {
48756
- const savedFromXeokit = (component.originating_system === this.originatingSystem);
48757
- if (savedFromXeokit) {
48758
- entity.xrayed = true;
48759
- } else {
48760
- entity.opacity = alpha;
48761
- }
48762
- } else {
48763
- entity.opacity = alpha;
48764
- }
48753
+ entity.opacity = alpha;
48765
48754
  }
48766
48755
  }));
48767
48756
  });
@@ -56599,7 +56588,7 @@ const edgesDefaultColor = new Float32Array([0, 0, 0, 1]);
56599
56588
 
56600
56589
  const tempVec4 = math.vec4();
56601
56590
  const tempVec3a$s = math.vec3();
56602
- const tempVec3c$l = math.vec3();
56591
+ const tempVec3c$k = math.vec3();
56603
56592
  const tempMat4a$h = math.mat4();
56604
56593
 
56605
56594
  /**
@@ -57044,7 +57033,7 @@ class VBOSceneModelRenderer {
57044
57033
  if (gotOrigin || gotPosition) {
57045
57034
  const rtcOrigin = tempVec3a$s;
57046
57035
  if (gotOrigin) {
57047
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$l);
57036
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$k);
57048
57037
  rtcOrigin[0] = rotatedOrigin[0];
57049
57038
  rtcOrigin[1] = rotatedOrigin[1];
57050
57039
  rtcOrigin[2] = rotatedOrigin[2];
@@ -60584,7 +60573,7 @@ function octDecodeVec2(oct) { // Decode an oct-encoded normal
60584
60573
 
60585
60574
  const tempVec3a$r = math.vec3();
60586
60575
  const tempVec3b$n = math.vec3();
60587
- const tempVec3c$k = math.vec3();
60576
+ const tempVec3c$j = math.vec3();
60588
60577
  const tempVec3d$8 = math.vec3();
60589
60578
  const tempMat4a$g = math.mat4();
60590
60579
 
@@ -60637,7 +60626,7 @@ class SnapBatchingDepthBufInitRenderer extends VBOSceneModelRenderer {
60637
60626
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
60638
60627
  const rtcOrigin = tempVec3b$n;
60639
60628
  if (origin) {
60640
- const rotatedOrigin = tempVec3c$k;
60629
+ const rotatedOrigin = tempVec3c$j;
60641
60630
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
60642
60631
  rtcOrigin[0] = rotatedOrigin[0];
60643
60632
  rtcOrigin[1] = rotatedOrigin[1];
@@ -60889,7 +60878,7 @@ class SnapBatchingDepthBufInitRenderer extends VBOSceneModelRenderer {
60889
60878
 
60890
60879
  const tempVec3a$q = math.vec3();
60891
60880
  const tempVec3b$m = math.vec3();
60892
- const tempVec3c$j = math.vec3();
60881
+ const tempVec3c$i = math.vec3();
60893
60882
  const tempVec3d$7 = math.vec3();
60894
60883
  const tempMat4a$f = math.mat4();
60895
60884
 
@@ -60946,7 +60935,7 @@ class SnapBatchingDepthRenderer extends VBOSceneModelRenderer{
60946
60935
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
60947
60936
  const rtcOrigin = tempVec3b$m;
60948
60937
  if (origin) {
60949
- const rotatedOrigin = tempVec3c$j;
60938
+ const rotatedOrigin = tempVec3c$i;
60950
60939
  math.transformPoint3(rotationMatrix, origin, rotatedOrigin);
60951
60940
  rtcOrigin[0] = rotatedOrigin[0];
60952
60941
  rtcOrigin[1] = rotatedOrigin[1];
@@ -61282,7 +61271,7 @@ math.OBB3();
61282
61271
 
61283
61272
  const tempVec3a$p = math.vec3();
61284
61273
  const tempVec3b$l = math.vec3();
61285
- const tempVec3c$i = math.vec3();
61274
+ const tempVec3c$h = math.vec3();
61286
61275
  const tempVec3d$6 = math.vec3();
61287
61276
  const tempVec3e$1 = math.vec3();
61288
61277
  const tempVec3f$1 = math.vec3();
@@ -62466,7 +62455,7 @@ class TrianglesBatchingLayer {
62466
62455
  const rtcRayOrigin = tempVec3a$p;
62467
62456
  const rtcRayDir = tempVec3b$l;
62468
62457
 
62469
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$i) : worldRayOrigin); // World -> RTC
62458
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$h) : worldRayOrigin); // World -> RTC
62470
62459
  rtcRayDir.set(worldRayDir);
62471
62460
 
62472
62461
  if (offset) {
@@ -65653,7 +65642,7 @@ function getInstancingRenderers$1(scene) {
65653
65642
 
65654
65643
  const tempVec3a$o = math.vec3();
65655
65644
  const tempVec3b$k = math.vec3();
65656
- const tempVec3c$h = math.vec3();
65645
+ const tempVec3c$g = math.vec3();
65657
65646
  const tempVec3d$5 = math.vec3();
65658
65647
  const tempMat4a$e = math.mat4();
65659
65648
 
@@ -65710,7 +65699,7 @@ class SnapInstancingDepthBufInitRenderer extends VBOSceneModelRenderer {
65710
65699
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
65711
65700
  const rtcOrigin = tempVec3b$k;
65712
65701
  if (origin) {
65713
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$h);
65702
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$g);
65714
65703
  rtcOrigin[0] = rotatedOrigin[0];
65715
65704
  rtcOrigin[1] = rotatedOrigin[1];
65716
65705
  rtcOrigin[2] = rotatedOrigin[2];
@@ -65989,7 +65978,7 @@ class SnapInstancingDepthBufInitRenderer extends VBOSceneModelRenderer {
65989
65978
 
65990
65979
  const tempVec3a$n = math.vec3();
65991
65980
  const tempVec3b$j = math.vec3();
65992
- const tempVec3c$g = math.vec3();
65981
+ const tempVec3c$f = math.vec3();
65993
65982
  const tempVec3d$4 = math.vec3();
65994
65983
  const tempMat4a$d = math.mat4();
65995
65984
 
@@ -66047,7 +66036,7 @@ class SnapInstancingDepthRenderer extends VBOSceneModelRenderer {
66047
66036
  if (origin || position[0] !== 0 || position[1] !== 0 || position[2] !== 0) {
66048
66037
  const rtcOrigin = tempVec3b$j;
66049
66038
  if (origin) {
66050
- const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$g);
66039
+ const rotatedOrigin = math.transformPoint3(rotationMatrix, origin, tempVec3c$f);
66051
66040
  rtcOrigin[0] = rotatedOrigin[0];
66052
66041
  rtcOrigin[1] = rotatedOrigin[1];
66053
66042
  rtcOrigin[2] = rotatedOrigin[2];
@@ -66399,7 +66388,7 @@ const tempVec3fa$2 = new Float32Array(3);
66399
66388
 
66400
66389
  const tempVec3a$m = math.vec3();
66401
66390
  const tempVec3b$i = math.vec3();
66402
- const tempVec3c$f = math.vec3();
66391
+ const tempVec3c$e = math.vec3();
66403
66392
  const tempVec3d$3 = math.vec3();
66404
66393
  const tempVec3e = math.vec3();
66405
66394
  const tempVec3f = math.vec3();
@@ -67466,7 +67455,7 @@ class TrianglesInstancingLayer {
67466
67455
  const rtcRayOrigin = tempVec3a$m;
67467
67456
  const rtcRayDir = tempVec3b$i;
67468
67457
 
67469
- rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$f) : worldRayOrigin); // World -> RTC
67458
+ rtcRayOrigin.set(origin ? math.subVec3(worldRayOrigin, origin, tempVec3c$e) : worldRayOrigin); // World -> RTC
67470
67459
  rtcRayDir.set(worldRayDir);
67471
67460
 
67472
67461
  if (offset) {
@@ -74779,7 +74768,7 @@ function doCheckResult(buckets, mesh) {
74779
74768
 
74780
74769
  const tempVec3a$k = math.vec3();
74781
74770
  const tempVec3b$g = math.vec3();
74782
- const tempVec3c$e = math.vec3();
74771
+ const tempVec3c$d = math.vec3();
74783
74772
  math.vec3();
74784
74773
 
74785
74774
  const tempVec4a$6 = math.vec4();
@@ -74859,7 +74848,7 @@ class TrianglesDataTextureColorRenderer {
74859
74848
  rtcOrigin[1] += position[1];
74860
74849
  rtcOrigin[2] += position[2];
74861
74850
  rtcViewMatrix = createRTCViewMat(camera.viewMatrix, rtcOrigin, tempMat4a$c);
74862
- rtcCameraEye = tempVec3c$e;
74851
+ rtcCameraEye = tempVec3c$d;
74863
74852
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
74864
74853
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
74865
74854
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -75396,7 +75385,7 @@ const defaultColor$1 = new Float32Array([1, 1, 1]);
75396
75385
 
75397
75386
  const tempVec3a$j = math.vec3();
75398
75387
  const tempVec3b$f = math.vec3();
75399
- const tempVec3c$d = math.vec3();
75388
+ const tempVec3c$c = math.vec3();
75400
75389
  math.vec3();
75401
75390
  const tempMat4a$b = math.mat4();
75402
75391
 
@@ -75472,7 +75461,7 @@ class TrianglesDataTextureSilhouetteRenderer {
75472
75461
  rtcOrigin[1] += position[1];
75473
75462
  rtcOrigin[2] += position[2];
75474
75463
  rtcViewMatrix = createRTCViewMat(viewMatrix, rtcOrigin, tempMat4a$b);
75475
- rtcCameraEye = tempVec3c$d;
75464
+ rtcCameraEye = tempVec3c$c;
75476
75465
  rtcCameraEye[0] = camera.eye[0] - rtcOrigin[0];
75477
75466
  rtcCameraEye[1] = camera.eye[1] - rtcOrigin[1];
75478
75467
  rtcCameraEye[2] = camera.eye[2] - rtcOrigin[2];
@@ -76274,7 +76263,7 @@ class TrianglesDataTextureEdgesRenderer {
76274
76263
 
76275
76264
  const tempVec3a$h = math.vec3();
76276
76265
  const tempVec3b$d = math.vec3();
76277
- const tempVec3c$c = math.vec3();
76266
+ math.vec3();
76278
76267
  const tempMat4a$9 = math.mat4();
76279
76268
 
76280
76269
  /**
@@ -76356,25 +76345,30 @@ class TrianglesDataTextureEdgesColorRenderer {
76356
76345
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
76357
76346
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
76358
76347
 
76359
- const numSectionPlanes = scene._sectionPlanesState.getNumAllocatedSectionPlanes();
76360
- if (numSectionPlanes > 0) {
76348
+ const numAllocatedSectionPlanes = scene._sectionPlanesState.getNumAllocatedSectionPlanes();
76349
+ const numSectionPlanes = scene._sectionPlanesState.sectionPlanes.length;
76350
+ if (numAllocatedSectionPlanes > 0) {
76361
76351
  const sectionPlanes = scene._sectionPlanesState.sectionPlanes;
76362
76352
  const baseIndex = dataTextureLayer.layerIndex * numSectionPlanes;
76363
76353
  const renderFlags = model.renderFlags;
76364
- for (let sectionPlaneIndex = 0; sectionPlaneIndex < numSectionPlanes; sectionPlaneIndex++) {
76354
+ for (let sectionPlaneIndex = 0; sectionPlaneIndex < numAllocatedSectionPlanes; sectionPlaneIndex++) {
76365
76355
  const sectionPlaneUniforms = this._uSectionPlanes[sectionPlaneIndex];
76366
76356
  if (sectionPlaneUniforms) {
76367
- const active = renderFlags.sectionPlanesActivePerLayer[baseIndex + sectionPlaneIndex];
76368
- gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
76369
- if (active) {
76370
- const sectionPlane = sectionPlanes[sectionPlaneIndex];
76371
- if (origin) {
76372
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3c$c);
76373
- gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76374
- } else {
76375
- gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
76357
+ if (sectionPlaneIndex < numSectionPlanes) {
76358
+ const active = renderFlags.sectionPlanesActivePerLayer[baseIndex + sectionPlaneIndex];
76359
+ gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
76360
+ if (active) {
76361
+ const sectionPlane = sectionPlanes[sectionPlaneIndex];
76362
+ if (origin) {
76363
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a$h);
76364
+ gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
76365
+ } else {
76366
+ gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
76367
+ }
76368
+ gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
76376
76369
  }
76377
- gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
76370
+ } else {
76371
+ gl.uniform1i(sectionPlaneUniforms.active, 0);
76378
76372
  }
76379
76373
  }
76380
76374
  }