@xeokit/xeokit-sdk 2.6.67 → 2.6.69

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.6.67",
3
+ "version": "2.6.69",
4
4
  "description": "3D BIM IFC Viewer SDK for AEC engineering applications. Open Source JavaScript Toolkit based on pure WebGL for top performance, real-world coordinates and full double precision",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -520,7 +520,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
520
520
  case 7:
521
521
  geometryArrays.primitiveName = "lines";
522
522
  geometryArrays.geometryPositions = positions.subarray(eachGeometryPositionsPortion [geometryIndex], atLastGeometry ? positions.length : eachGeometryPositionsPortion [geometryIndex + 1]);
523
- geometryArrays.decompressedPositions = geometryCompressionUtils.decompressPositions(geometryArrays.geometryPositions, tileDecodeMatrix);
523
+ geometryArrays.decompressedPositions = geometryCompressionUtils.decompressPositions(geometryArrays.geometryPositions, reusedGeometriesDecodeMatrix);
524
524
  ifcLabel = buildVectorTextGeometry({
525
525
  origin: geometryArrays.decompressedPositions,
526
526
  text: axisLabel,
@@ -545,7 +545,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
545
545
  if (geometryReuseCount > 1000) { // TODO: Heuristic to force batching of instanced geometry beyond a certain reuse count (or budget)?
546
546
  // geometryArrays.batchThisMesh = true;
547
547
  }
548
- if (geometryArrays.geometryPositions.length > 1000) { // TODO: Heuristic to force batching on instanced geometry above certain vertex size?
548
+ if (geometryArrays.geometryPositions && geometryArrays.geometryPositions.length > 1000) { // TODO: Heuristic to force batching on instanced geometry above certain vertex size?
549
549
  // geometryArrays.batchThisMesh = true;
550
550
  }
551
551
  if (geometryArrays.batchThisMesh) {
@@ -4951,9 +4951,10 @@ const math = {
4951
4951
 
4952
4952
  // Calculate clip space coordinates, which will be in range
4953
4953
  // of x=[-1..1] and y=[-1..1], with y=(+1) at top
4954
-
4955
- const clipX = 2 * canvasPos[0] / canvas.width - 1; // Calculate clip space coordinates
4956
- const clipY = 1 - 2 * canvasPos[1] / canvas.height;
4954
+ // clientWidth/Height needs to be used in case canvas.width/height is scaled down,
4955
+ // but not reflecting client dimensions (e.g. when using FastNavPlugin)
4956
+ const clipX = 2 * canvasPos[0] / canvas.clientWidth - 1; // Calculate clip space coordinates
4957
+ const clipY = 1 - 2 * canvasPos[1] / canvas.clientHeight;
4957
4958
 
4958
4959
  clipToWorld(clipX, clipY, -1, isOrtho, vec4Near);
4959
4960
 
@@ -46,6 +46,12 @@ class SAOOcclusionRenderer {
46
46
  this._uvBuf = null;
47
47
  this._positionsBuf = null;
48
48
  this._indicesBuf = null;
49
+
50
+ this.init();
51
+ }
52
+
53
+ init() {
54
+ this._rebuild = true;
49
55
  }
50
56
 
51
57
  render(depthRenderBuffer) {
@@ -136,10 +142,12 @@ class SAOOcclusionRenderer {
136
142
  dirty = true;
137
143
  }
138
144
 
139
- if (!dirty) {
145
+ if (! (dirty || this._rebuild)) {
140
146
  return;
141
147
  }
142
148
 
149
+ this._rebuild = false;
150
+
143
151
  const gl = this._scene.canvas.gl;
144
152
 
145
153
  if (this._program) {