@xeokit/xeokit-sdk 2.4.2-beta-8 → 2.4.2-beta-9

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-8",
3
+ "version": "2.4.2-beta-9",
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",
@@ -151,8 +151,7 @@ class MetaModel {
151
151
  * @property rootMetaObject
152
152
  * @type {MetaObject|null}
153
153
  */
154
- get rootMetaObject()
155
- {
154
+ get rootMetaObject() {
156
155
  if (this.rootMetaObjects.length == 1) {
157
156
  return this.rootMetaObjects[0];
158
157
  }
@@ -172,6 +171,7 @@ class MetaModel {
172
171
  this._globalizeIDs(metaModelData, options)
173
172
 
174
173
  const metaScene = this.metaScene;
174
+ const propertyLookup = metaModelData.properties;
175
175
 
176
176
  // Create global Property Sets
177
177
 
@@ -180,6 +180,9 @@ class MetaModel {
180
180
  const propertySetData = metaModelData.propertySets[i];
181
181
  let propertySet = metaScene.propertySets[propertySetData.id];
182
182
  if (!propertySet) {
183
+ if (propertyLookup) {
184
+ this._decompressProperties(propertyLookup, propertySetData.properties);
185
+ }
183
186
  propertySet = new PropertySet({
184
187
  id: propertySetData.id,
185
188
  originalSystemId: propertySetData.originalSystemId || propertySetData.id,
@@ -225,6 +228,18 @@ class MetaModel {
225
228
  }
226
229
  }
227
230
 
231
+ _decompressProperties(propertyLookup, properties) {
232
+ for (let i = 0, len = properties.length; i < len; i++) {
233
+ const property = properties[i];
234
+ if (Number.isInteger(property)) {
235
+ const lookupProperty = propertyLookup[property];
236
+ if (lookupProperty) {
237
+ properties[i] = lookupProperty;
238
+ }
239
+ }
240
+ }
241
+ }
242
+
228
243
  finalize() {
229
244
 
230
245
  if (this.finalized) {
@@ -522,6 +522,11 @@ class LinesInstancingLayer {
522
522
  }
523
523
 
524
524
  setMatrix(portionId, matrix) {
525
+
526
+ ////////////////////////////////////////
527
+ // TODO: Update portion matrix
528
+ ////////////////////////////////////////
529
+
525
530
  if (!this._finalized) {
526
531
  throw "Not finalized";
527
532
  }
@@ -427,6 +427,10 @@ class PointsInstancingLayer {
427
427
  }
428
428
 
429
429
  // setMatrix(portionId, matrix) {
430
+
431
+ ////////////////////////////////////////
432
+ // TODO: Update portion matrix
433
+ ////////////////////////////////////////
430
434
  //
431
435
  // if (!this._finalized) {
432
436
  // throw "Not finalized";
@@ -752,28 +752,33 @@ class TrianglesInstancingLayer {
752
752
  if (!this._finalized) {
753
753
  throw "Not finalized";
754
754
  }
755
- var offset = portionId * 4;
756
755
 
757
- tempFloat32Vec4[0] = matrix[0];
758
- tempFloat32Vec4[1] = matrix[4];
759
- tempFloat32Vec4[2] = matrix[8];
760
- tempFloat32Vec4[3] = matrix[12];
756
+ ////////////////////////////////////////
757
+ // TODO: Update portion matrix
758
+ ////////////////////////////////////////
761
759
 
762
- this._state.modelMatrixCol0Buf.setData(tempFloat32Vec4, offset);
760
+ var offset = portionId * 4;
763
761
 
764
- tempFloat32Vec4[0] = matrix[1];
765
- tempFloat32Vec4[1] = matrix[5];
766
- tempFloat32Vec4[2] = matrix[9];
767
- tempFloat32Vec4[3] = matrix[13];
762
+ tempFloat32Vec4[0] = matrix[0];
763
+ tempFloat32Vec4[1] = matrix[4];
764
+ tempFloat32Vec4[2] = matrix[8];
765
+ tempFloat32Vec4[3] = matrix[12];
768
766
 
769
- this._state.modelMatrixCol1Buf.setData(tempFloat32Vec4, offset);
767
+ this._state.modelMatrixCol0Buf.setData(tempFloat32Vec4, offset);
770
768
 
771
- tempFloat32Vec4[0] = matrix[2];
772
- tempFloat32Vec4[1] = matrix[6];
773
- tempFloat32Vec4[2] = matrix[10];
774
- tempFloat32Vec4[3] = matrix[14];
769
+ tempFloat32Vec4[0] = matrix[1];
770
+ tempFloat32Vec4[1] = matrix[5];
771
+ tempFloat32Vec4[2] = matrix[9];
772
+ tempFloat32Vec4[3] = matrix[13];
775
773
 
776
- this._state.modelMatrixCol2Buf.setData(tempFloat32Vec4, offset);
774
+ this._state.modelMatrixCol1Buf.setData(tempFloat32Vec4, offset);
775
+
776
+ tempFloat32Vec4[0] = matrix[2];
777
+ tempFloat32Vec4[1] = matrix[6];
778
+ tempFloat32Vec4[2] = matrix[10];
779
+ tempFloat32Vec4[3] = matrix[14];
780
+
781
+ this._state.modelMatrixCol2Buf.setData(tempFloat32Vec4, offset);
777
782
  }
778
783
 
779
784
  // ---------------------- COLOR RENDERING -----------------------------------
@@ -783,4 +783,11 @@ export declare class Mesh extends Component implements Omit<Entity, 'parent'> {
783
783
  * @returns {number}
784
784
  */
785
785
  stateSortCompare(mesh1: Mesh, mesh2: Mesh): number;
786
+
787
+ /**
788
+ * Gets the World, View and Canvas-space positions of each vertex in a callback.
789
+ *
790
+ * @param callback
791
+ */
792
+ getEachVertex(callback: any): void;
786
793
  }