@xeokit/xeokit-sdk 2.4.2-beta-26 → 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-26",
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",
@@ -185,7 +185,7 @@ export class TrianglesDataTextureDepthRenderer {
185
185
  this._uProjMatrix = program.getLocation("projMatrix");
186
186
  this._uSectionPlanes = [];
187
187
 
188
- for (let i = 0, len = scene.getMaxSectionPlanes(); i < len; i++) {
188
+ for (let i = 0, len = scene._sectionPlanesState.getNumAllocatedSectionPlanes(); i < len; i++) {
189
189
  this._uSectionPlanes.push({
190
190
  active: program.getLocation("sectionPlaneActive" + i),
191
191
  pos: program.getLocation("sectionPlanePos" + i),
@@ -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.getMaxSectionPlanes();
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
  }
@@ -193,7 +193,7 @@ export class TrianglesDataTextureEdgesRenderer {
193
193
  this._uViewMatrix = program.getLocation("viewMatrix");
194
194
  this._uProjMatrix = program.getLocation("projMatrix");
195
195
  this._uSectionPlanes = [];
196
- for (let i = 0, len = scene.getMaxSectionPlanes(); i < len; i++) {
196
+ for (let i = 0, len = scene._sectionPlanesState.getNumAllocatedSectionPlanes(); i < len; i++) {
197
197
  this._uSectionPlanes.push({
198
198
  active: program.getLocation("sectionPlaneActive" + i),
199
199
  pos: program.getLocation("sectionPlanePos" + i),
@@ -166,7 +166,7 @@ export class TrianglesDataTexturePickMeshRenderer {
166
166
  this._uViewMatrix = program.getLocation("viewMatrix");
167
167
  this._uProjMatrix = program.getLocation("projMatrix");
168
168
  this._uSectionPlanes = [];
169
- for (let i = 0, len = scene.getMaxSectionPlanes(); i < len; i++) {
169
+ for (let i = 0, len = scene._sectionPlanesState.getNumAllocatedSectionPlanes(); i < len; i++) {
170
170
  this._uSectionPlanes.push({
171
171
  active: program.getLocation("sectionPlaneActive" + i),
172
172
  pos: program.getLocation("sectionPlanePos" + i),
@@ -182,7 +182,7 @@ export class TrianglesDataTexturePickNormalsFlatRenderer {
182
182
  this._uViewMatrix = program.getLocation("viewMatrix");
183
183
  this._uProjMatrix = program.getLocation("projMatrix");
184
184
  this._uSectionPlanes = [];
185
- for (let i = 0, len = scene.getMaxSectionPlanes(); i < len; i++) {
185
+ for (let i = 0, len = scene._sectionPlanesState.getNumAllocatedSectionPlanes(); i < len; i++) {
186
186
  this._uSectionPlanes.push({
187
187
  active: program.getLocation("sectionPlaneActive" + i),
188
188
  pos: program.getLocation("sectionPlanePos" + i),
@@ -203,7 +203,7 @@ export class TrianglesDataTextureSilhouetteRenderer {
203
203
  this._uViewMatrix = program.getLocation("viewMatrix");
204
204
  this._uProjMatrix = program.getLocation("projMatrix");
205
205
  this._uSectionPlanes = [];
206
- for (let i = 0, len = scene.getMaxSectionPlanes(); i < len; i++) {
206
+ for (let i = 0, len = scene._sectionPlanesState.getNumAllocatedSectionPlanes(); i < len; i++) {
207
207
  this._uSectionPlanes.push({
208
208
  active: program.getLocation("sectionPlaneActive" + i),
209
209
  pos: program.getLocation("sectionPlanePos" + i),
@@ -190,7 +190,7 @@ export class TrianglesDataTextureSnapDepthBufInitRenderer {
190
190
  this._uViewMatrix = program.getLocation("viewMatrix");
191
191
  this._uProjMatrix = program.getLocation("projMatrix");
192
192
  this._uSectionPlanes = [];
193
- for (let i = 0, len = scene.getMaxSectionPlanes(); i < len; i++) {
193
+ for (let i = 0, len = scene._sectionPlanesState.getNumAllocatedSectionPlanes(); i < len; i++) {
194
194
  this._uSectionPlanes.push({
195
195
  active: program.getLocation("sectionPlaneActive" + i),
196
196
  pos: program.getLocation("sectionPlanePos" + i),
@@ -196,7 +196,7 @@ export class TrianglesDataTextureSnapDepthRenderer {
196
196
  this._uViewMatrix = program.getLocation("viewMatrix");
197
197
  this._uProjMatrix = program.getLocation("projMatrix");
198
198
  this._uSectionPlanes = [];
199
- for (let i = 0, len = scene.getMaxSectionPlanes(); i < len; i++) {
199
+ for (let i = 0, len = scene._sectionPlanesState.getNumAllocatedSectionPlanes(); i < len; i++) {
200
200
  this._uSectionPlanes.push({
201
201
  active: program.getLocation("sectionPlaneActive" + i),
202
202
  pos: program.getLocation("sectionPlanePos" + i),