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

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.4.2-beta-27",
3
+ "version": "2.4.2-beta-29",
4
4
  "description": "Web Programming Toolkit for 3D/2D BIM and AEC Graphics",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -86,25 +86,30 @@ export class TrianglesDataTextureEdgesColorRenderer {
86
86
  gl.uniformMatrix4fv(this._uViewMatrix, false, rtcViewMatrix);
87
87
  gl.uniformMatrix4fv(this._uProjMatrix, false, camera.projMatrix);
88
88
 
89
- const numSectionPlanes = scene._sectionPlanesState.getNumAllocatedSectionPlanes();
90
- if (numSectionPlanes > 0) {
89
+ const numAllocatedSectionPlanes = scene._sectionPlanesState.getNumAllocatedSectionPlanes();
90
+ const numSectionPlanes = scene._sectionPlanesState.sectionPlanes.length;
91
+ if (numAllocatedSectionPlanes > 0) {
91
92
  const sectionPlanes = scene._sectionPlanesState.sectionPlanes;
92
93
  const baseIndex = dataTextureLayer.layerIndex * numSectionPlanes;
93
94
  const renderFlags = model.renderFlags;
94
- for (let sectionPlaneIndex = 0; sectionPlaneIndex < numSectionPlanes; sectionPlaneIndex++) {
95
+ for (let sectionPlaneIndex = 0; sectionPlaneIndex < numAllocatedSectionPlanes; sectionPlaneIndex++) {
95
96
  const sectionPlaneUniforms = this._uSectionPlanes[sectionPlaneIndex];
96
97
  if (sectionPlaneUniforms) {
97
- const active = renderFlags.sectionPlanesActivePerLayer[baseIndex + sectionPlaneIndex];
98
- gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
99
- if (active) {
100
- const sectionPlane = sectionPlanes[sectionPlaneIndex];
101
- if (origin) {
102
- const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3c);
103
- gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
104
- } else {
105
- gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
98
+ if (sectionPlaneIndex < numSectionPlanes) {
99
+ const active = renderFlags.sectionPlanesActivePerLayer[baseIndex + sectionPlaneIndex];
100
+ gl.uniform1i(sectionPlaneUniforms.active, active ? 1 : 0);
101
+ if (active) {
102
+ const sectionPlane = sectionPlanes[sectionPlaneIndex];
103
+ if (origin) {
104
+ const rtcSectionPlanePos = getPlaneRTCPos(sectionPlane.dist, sectionPlane.dir, origin, tempVec3a);
105
+ gl.uniform3fv(sectionPlaneUniforms.pos, rtcSectionPlanePos);
106
+ } else {
107
+ gl.uniform3fv(sectionPlaneUniforms.pos, sectionPlane.pos);
108
+ }
109
+ gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
106
110
  }
107
- gl.uniform3fv(sectionPlaneUniforms.dir, sectionPlane.dir);
111
+ } else {
112
+ gl.uniform1i(sectionPlaneUniforms.active, 0);
108
113
  }
109
114
  }
110
115
  }