@xeokit/xeokit-sdk 2.4.0-alpha-82 → 2.4.0-alpha-84
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/dist/xeokit-sdk.cjs.js +30 -23
- package/dist/xeokit-sdk.es.js +30 -23
- package/dist/xeokit-sdk.es5.js +18 -24
- package/dist/xeokit-sdk.min.cjs.js +4 -4
- package/dist/xeokit-sdk.min.es.js +4 -4
- package/dist/xeokit-sdk.min.es5.js +4 -4
- package/package.json +1 -1
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV10.js +6 -2
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV9.js +5 -1
- package/src/viewer/scene/model/SceneModel.js +12 -12
- package/src/viewer/scene/model/dtx/triangles/TrianglesDataTextureLayer.js +6 -6
- package/src/viewer/scene/model/vbo/trianglesBatching/TrianglesBatchingLayer.js +2 -2
- package/src/viewer/scene/model/vbo/trianglesInstancing/TrianglesInstancingLayer.js +1 -1
- package/src/viewer/scene/utils.js +0 -1
package/dist/xeokit-sdk.cjs.js
CHANGED
|
@@ -6733,7 +6733,6 @@ function httpRequest(args) {
|
|
|
6733
6733
|
var xhr = new XMLHttpRequest();
|
|
6734
6734
|
xhr.open(args.method || "GET", args.url, true);
|
|
6735
6735
|
xhr.onload = function (e) {
|
|
6736
|
-
console.log(args.url, xhr.readyState, xhr.status);
|
|
6737
6736
|
if (xhr.readyState === 4) {
|
|
6738
6737
|
if (xhr.status === 200) {
|
|
6739
6738
|
resolve(xhr.responseXML);
|
|
@@ -60078,7 +60077,7 @@ class TrianglesBatchingLayer {
|
|
|
60078
60077
|
*/
|
|
60079
60078
|
constructor(cfg) {
|
|
60080
60079
|
|
|
60081
|
-
console.
|
|
60080
|
+
console.info("Creating TrianglesBatchingLayer");
|
|
60082
60081
|
|
|
60083
60082
|
/**
|
|
60084
60083
|
* Owner model
|
|
@@ -65233,7 +65232,7 @@ class TrianglesInstancingLayer {
|
|
|
65233
65232
|
*/
|
|
65234
65233
|
constructor(cfg) {
|
|
65235
65234
|
|
|
65236
|
-
console.
|
|
65235
|
+
console.info("Creating TrianglesInstancingLayer");
|
|
65237
65236
|
|
|
65238
65237
|
/**
|
|
65239
65238
|
* Owner model
|
|
@@ -81250,7 +81249,7 @@ class TrianglesDataTextureLayer {
|
|
|
81250
81249
|
* flags/flags2 set since the previous invocation of `_beginDeferredFlags`.
|
|
81251
81250
|
*/
|
|
81252
81251
|
_uploadDeferredFlags() {
|
|
81253
|
-
|
|
81252
|
+
console.info("_uploadDeferredFlags");
|
|
81254
81253
|
this._deferredSetFlagsActive = false;
|
|
81255
81254
|
if (!this._deferredSetFlagsDirty) {
|
|
81256
81255
|
return;
|
|
@@ -81339,14 +81338,14 @@ class TrianglesDataTextureLayer {
|
|
|
81339
81338
|
// object colors
|
|
81340
81339
|
textureState.texturePerObjectIdColorsAndFlags._textureData.set(tempUint8Array4, subPortionId * 32);
|
|
81341
81340
|
if (this._deferredSetFlagsActive) {
|
|
81342
|
-
|
|
81341
|
+
console.info("_subPortionSetColor defer");
|
|
81343
81342
|
this._deferredSetFlagsDirty = true;
|
|
81344
81343
|
return;
|
|
81345
81344
|
}
|
|
81346
81345
|
if (++this._numUpdatesInFrame >= MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE) {
|
|
81347
81346
|
this._beginDeferredFlags(); // Subsequent flags updates now deferred
|
|
81348
81347
|
}
|
|
81349
|
-
|
|
81348
|
+
console.info("_subPortionSetColor write through");
|
|
81350
81349
|
gl.bindTexture(gl.TEXTURE_2D, textureState.texturePerObjectIdColorsAndFlags._texture);
|
|
81351
81350
|
gl.texSubImage2D(
|
|
81352
81351
|
gl.TEXTURE_2D,
|
|
@@ -81454,14 +81453,14 @@ class TrianglesDataTextureLayer {
|
|
|
81454
81453
|
// object flags
|
|
81455
81454
|
textureState.texturePerObjectIdColorsAndFlags._textureData.set(tempUint8Array4, subPortionId * 32 + 8);
|
|
81456
81455
|
if (this._deferredSetFlagsActive || deferred) {
|
|
81457
|
-
|
|
81456
|
+
console.info("_subPortionSetFlags set flags defer");
|
|
81458
81457
|
this._deferredSetFlagsDirty = true;
|
|
81459
81458
|
return;
|
|
81460
81459
|
}
|
|
81461
81460
|
if (++this._numUpdatesInFrame >= MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE) {
|
|
81462
81461
|
this._beginDeferredFlags(); // Subsequent flags updates now deferred
|
|
81463
81462
|
}
|
|
81464
|
-
|
|
81463
|
+
console.info("_subPortionSetFlags set flags write through");
|
|
81465
81464
|
gl.bindTexture(gl.TEXTURE_2D, textureState.texturePerObjectIdColorsAndFlags._texture);
|
|
81466
81465
|
gl.texSubImage2D(
|
|
81467
81466
|
gl.TEXTURE_2D,
|
|
@@ -81508,7 +81507,7 @@ class TrianglesDataTextureLayer {
|
|
|
81508
81507
|
if (++this._numUpdatesInFrame >= MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE) {
|
|
81509
81508
|
this._beginDeferredFlags(); // Subsequent flags updates now deferred
|
|
81510
81509
|
}
|
|
81511
|
-
|
|
81510
|
+
console.info("_subPortionSetFlags2 set flags write through");
|
|
81512
81511
|
gl.bindTexture(gl.TEXTURE_2D, textureState.texturePerObjectIdColorsAndFlags._texture);
|
|
81513
81512
|
gl.texSubImage2D(
|
|
81514
81513
|
gl.TEXTURE_2D,
|
|
@@ -84734,7 +84733,7 @@ class SceneModel extends Component {
|
|
|
84734
84733
|
return dtxLayer;
|
|
84735
84734
|
}
|
|
84736
84735
|
}
|
|
84737
|
-
console.
|
|
84736
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesDataTextureLayer`);
|
|
84738
84737
|
dtxLayer = new TrianglesDataTextureLayer(this, {layerIndex: 0, origin}); // layerIndex is set in #finalize()
|
|
84739
84738
|
this._dtxLayers[layerId] = dtxLayer;
|
|
84740
84739
|
this.layerList.push(dtxLayer);
|
|
@@ -84757,7 +84756,7 @@ class SceneModel extends Component {
|
|
|
84757
84756
|
while (!vboBatchingLayer) {
|
|
84758
84757
|
switch (cfg.primitive) {
|
|
84759
84758
|
case "triangles":
|
|
84760
|
-
console.
|
|
84759
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesBatchingLayer`);
|
|
84761
84760
|
vboBatchingLayer = new TrianglesBatchingLayer({
|
|
84762
84761
|
model,
|
|
84763
84762
|
textureSet,
|
|
@@ -84772,7 +84771,7 @@ class SceneModel extends Component {
|
|
|
84772
84771
|
});
|
|
84773
84772
|
break;
|
|
84774
84773
|
case "solid":
|
|
84775
|
-
console.
|
|
84774
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesBatchingLayer`);
|
|
84776
84775
|
vboBatchingLayer = new TrianglesBatchingLayer({
|
|
84777
84776
|
model,
|
|
84778
84777
|
textureSet,
|
|
@@ -84787,7 +84786,7 @@ class SceneModel extends Component {
|
|
|
84787
84786
|
});
|
|
84788
84787
|
break;
|
|
84789
84788
|
case "surface":
|
|
84790
|
-
console.
|
|
84789
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesBatchingLayer`);
|
|
84791
84790
|
vboBatchingLayer = new TrianglesBatchingLayer({
|
|
84792
84791
|
model,
|
|
84793
84792
|
textureSet,
|
|
@@ -84802,7 +84801,7 @@ class SceneModel extends Component {
|
|
|
84802
84801
|
});
|
|
84803
84802
|
break;
|
|
84804
84803
|
case "lines":
|
|
84805
|
-
console.
|
|
84804
|
+
console.info(`[SceneModel ${this.id}]: creating LinesBatchingLayer`);
|
|
84806
84805
|
vboBatchingLayer = new LinesBatchingLayer({
|
|
84807
84806
|
model,
|
|
84808
84807
|
layerIndex: 0, // This is set in #finalize()
|
|
@@ -84814,7 +84813,7 @@ class SceneModel extends Component {
|
|
|
84814
84813
|
});
|
|
84815
84814
|
break;
|
|
84816
84815
|
case "points":
|
|
84817
|
-
console.
|
|
84816
|
+
console.info(`[SceneModel ${this.id}]: creating PointsBatchingLayer`);
|
|
84818
84817
|
vboBatchingLayer = new PointsBatchingLayer({
|
|
84819
84818
|
model,
|
|
84820
84819
|
layerIndex: 0, // This is set in #finalize()
|
|
@@ -84868,7 +84867,7 @@ class SceneModel extends Component {
|
|
|
84868
84867
|
while (!vboInstancingLayer) {
|
|
84869
84868
|
switch (geometry.primitive) {
|
|
84870
84869
|
case "triangles":
|
|
84871
|
-
console.
|
|
84870
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesInstancingLayer`);
|
|
84872
84871
|
vboInstancingLayer = new TrianglesInstancingLayer({
|
|
84873
84872
|
model,
|
|
84874
84873
|
textureSet,
|
|
@@ -84879,7 +84878,7 @@ class SceneModel extends Component {
|
|
|
84879
84878
|
});
|
|
84880
84879
|
break;
|
|
84881
84880
|
case "solid":
|
|
84882
|
-
console.
|
|
84881
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesInstancingLayer`);
|
|
84883
84882
|
vboInstancingLayer = new TrianglesInstancingLayer({
|
|
84884
84883
|
model,
|
|
84885
84884
|
textureSet,
|
|
@@ -84890,7 +84889,7 @@ class SceneModel extends Component {
|
|
|
84890
84889
|
});
|
|
84891
84890
|
break;
|
|
84892
84891
|
case "surface":
|
|
84893
|
-
console.
|
|
84892
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesInstancingLayer`);
|
|
84894
84893
|
vboInstancingLayer = new TrianglesInstancingLayer({
|
|
84895
84894
|
model,
|
|
84896
84895
|
textureSet,
|
|
@@ -84901,7 +84900,7 @@ class SceneModel extends Component {
|
|
|
84901
84900
|
});
|
|
84902
84901
|
break;
|
|
84903
84902
|
case "lines":
|
|
84904
|
-
console.
|
|
84903
|
+
console.info(`[SceneModel ${this.id}]: creating LinesInstancingLayer`);
|
|
84905
84904
|
vboInstancingLayer = new LinesInstancingLayer({
|
|
84906
84905
|
model,
|
|
84907
84906
|
textureSet,
|
|
@@ -84911,7 +84910,7 @@ class SceneModel extends Component {
|
|
|
84911
84910
|
});
|
|
84912
84911
|
break;
|
|
84913
84912
|
case "points":
|
|
84914
|
-
console.
|
|
84913
|
+
console.info(`[SceneModel ${this.id}]: creating PointsInstancingLayer`);
|
|
84915
84914
|
vboInstancingLayer = new PointsInstancingLayer({
|
|
84916
84915
|
model,
|
|
84917
84916
|
textureSet,
|
|
@@ -121108,7 +121107,11 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
121108
121107
|
const numTiles = eachTileEntitiesPortion.length;
|
|
121109
121108
|
|
|
121110
121109
|
if (metaModel) {
|
|
121111
|
-
metaModel.loadData(metadata
|
|
121110
|
+
metaModel.loadData(metadata, {
|
|
121111
|
+
includeTypes: options.includeTypes,
|
|
121112
|
+
excludeTypes: options.excludeTypes,
|
|
121113
|
+
globalizeObjectIds: options.globalizeObjectIds
|
|
121114
|
+
}); // Can be empty
|
|
121112
121115
|
}
|
|
121113
121116
|
|
|
121114
121117
|
// Count instances of each geometry
|
|
@@ -121617,7 +121620,11 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121617
121620
|
const numTiles = eachTileEntitiesPortion.length;
|
|
121618
121621
|
|
|
121619
121622
|
if (metaModel) {
|
|
121620
|
-
metaModel.loadData(metadata
|
|
121623
|
+
metaModel.loadData(metadata, {
|
|
121624
|
+
includeTypes: options.includeTypes,
|
|
121625
|
+
excludeTypes: options.excludeTypes,
|
|
121626
|
+
globalizeObjectIds: options.globalizeObjectIds
|
|
121627
|
+
}); // Can be empty
|
|
121621
121628
|
}
|
|
121622
121629
|
|
|
121623
121630
|
// Create textures
|
|
@@ -121888,7 +121895,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121888
121895
|
atLastGeometry
|
|
121889
121896
|
? indices.length
|
|
121890
121897
|
: eachGeometryIndicesPortion [geometryIndex + 1]));
|
|
121891
|
-
|
|
121898
|
+
geometryValid = (geometryArrays.geometryPositions.length > 0 && geometryArrays.geometryIndices.length > 0);
|
|
121892
121899
|
break;
|
|
121893
121900
|
default:
|
|
121894
121901
|
continue;
|
package/dist/xeokit-sdk.es.js
CHANGED
|
@@ -6729,7 +6729,6 @@ function httpRequest(args) {
|
|
|
6729
6729
|
var xhr = new XMLHttpRequest();
|
|
6730
6730
|
xhr.open(args.method || "GET", args.url, true);
|
|
6731
6731
|
xhr.onload = function (e) {
|
|
6732
|
-
console.log(args.url, xhr.readyState, xhr.status);
|
|
6733
6732
|
if (xhr.readyState === 4) {
|
|
6734
6733
|
if (xhr.status === 200) {
|
|
6735
6734
|
resolve(xhr.responseXML);
|
|
@@ -60074,7 +60073,7 @@ class TrianglesBatchingLayer {
|
|
|
60074
60073
|
*/
|
|
60075
60074
|
constructor(cfg) {
|
|
60076
60075
|
|
|
60077
|
-
console.
|
|
60076
|
+
console.info("Creating TrianglesBatchingLayer");
|
|
60078
60077
|
|
|
60079
60078
|
/**
|
|
60080
60079
|
* Owner model
|
|
@@ -65229,7 +65228,7 @@ class TrianglesInstancingLayer {
|
|
|
65229
65228
|
*/
|
|
65230
65229
|
constructor(cfg) {
|
|
65231
65230
|
|
|
65232
|
-
console.
|
|
65231
|
+
console.info("Creating TrianglesInstancingLayer");
|
|
65233
65232
|
|
|
65234
65233
|
/**
|
|
65235
65234
|
* Owner model
|
|
@@ -81246,7 +81245,7 @@ class TrianglesDataTextureLayer {
|
|
|
81246
81245
|
* flags/flags2 set since the previous invocation of `_beginDeferredFlags`.
|
|
81247
81246
|
*/
|
|
81248
81247
|
_uploadDeferredFlags() {
|
|
81249
|
-
|
|
81248
|
+
console.info("_uploadDeferredFlags");
|
|
81250
81249
|
this._deferredSetFlagsActive = false;
|
|
81251
81250
|
if (!this._deferredSetFlagsDirty) {
|
|
81252
81251
|
return;
|
|
@@ -81335,14 +81334,14 @@ class TrianglesDataTextureLayer {
|
|
|
81335
81334
|
// object colors
|
|
81336
81335
|
textureState.texturePerObjectIdColorsAndFlags._textureData.set(tempUint8Array4, subPortionId * 32);
|
|
81337
81336
|
if (this._deferredSetFlagsActive) {
|
|
81338
|
-
|
|
81337
|
+
console.info("_subPortionSetColor defer");
|
|
81339
81338
|
this._deferredSetFlagsDirty = true;
|
|
81340
81339
|
return;
|
|
81341
81340
|
}
|
|
81342
81341
|
if (++this._numUpdatesInFrame >= MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE) {
|
|
81343
81342
|
this._beginDeferredFlags(); // Subsequent flags updates now deferred
|
|
81344
81343
|
}
|
|
81345
|
-
|
|
81344
|
+
console.info("_subPortionSetColor write through");
|
|
81346
81345
|
gl.bindTexture(gl.TEXTURE_2D, textureState.texturePerObjectIdColorsAndFlags._texture);
|
|
81347
81346
|
gl.texSubImage2D(
|
|
81348
81347
|
gl.TEXTURE_2D,
|
|
@@ -81450,14 +81449,14 @@ class TrianglesDataTextureLayer {
|
|
|
81450
81449
|
// object flags
|
|
81451
81450
|
textureState.texturePerObjectIdColorsAndFlags._textureData.set(tempUint8Array4, subPortionId * 32 + 8);
|
|
81452
81451
|
if (this._deferredSetFlagsActive || deferred) {
|
|
81453
|
-
|
|
81452
|
+
console.info("_subPortionSetFlags set flags defer");
|
|
81454
81453
|
this._deferredSetFlagsDirty = true;
|
|
81455
81454
|
return;
|
|
81456
81455
|
}
|
|
81457
81456
|
if (++this._numUpdatesInFrame >= MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE) {
|
|
81458
81457
|
this._beginDeferredFlags(); // Subsequent flags updates now deferred
|
|
81459
81458
|
}
|
|
81460
|
-
|
|
81459
|
+
console.info("_subPortionSetFlags set flags write through");
|
|
81461
81460
|
gl.bindTexture(gl.TEXTURE_2D, textureState.texturePerObjectIdColorsAndFlags._texture);
|
|
81462
81461
|
gl.texSubImage2D(
|
|
81463
81462
|
gl.TEXTURE_2D,
|
|
@@ -81504,7 +81503,7 @@ class TrianglesDataTextureLayer {
|
|
|
81504
81503
|
if (++this._numUpdatesInFrame >= MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE) {
|
|
81505
81504
|
this._beginDeferredFlags(); // Subsequent flags updates now deferred
|
|
81506
81505
|
}
|
|
81507
|
-
|
|
81506
|
+
console.info("_subPortionSetFlags2 set flags write through");
|
|
81508
81507
|
gl.bindTexture(gl.TEXTURE_2D, textureState.texturePerObjectIdColorsAndFlags._texture);
|
|
81509
81508
|
gl.texSubImage2D(
|
|
81510
81509
|
gl.TEXTURE_2D,
|
|
@@ -84730,7 +84729,7 @@ class SceneModel extends Component {
|
|
|
84730
84729
|
return dtxLayer;
|
|
84731
84730
|
}
|
|
84732
84731
|
}
|
|
84733
|
-
console.
|
|
84732
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesDataTextureLayer`);
|
|
84734
84733
|
dtxLayer = new TrianglesDataTextureLayer(this, {layerIndex: 0, origin}); // layerIndex is set in #finalize()
|
|
84735
84734
|
this._dtxLayers[layerId] = dtxLayer;
|
|
84736
84735
|
this.layerList.push(dtxLayer);
|
|
@@ -84753,7 +84752,7 @@ class SceneModel extends Component {
|
|
|
84753
84752
|
while (!vboBatchingLayer) {
|
|
84754
84753
|
switch (cfg.primitive) {
|
|
84755
84754
|
case "triangles":
|
|
84756
|
-
console.
|
|
84755
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesBatchingLayer`);
|
|
84757
84756
|
vboBatchingLayer = new TrianglesBatchingLayer({
|
|
84758
84757
|
model,
|
|
84759
84758
|
textureSet,
|
|
@@ -84768,7 +84767,7 @@ class SceneModel extends Component {
|
|
|
84768
84767
|
});
|
|
84769
84768
|
break;
|
|
84770
84769
|
case "solid":
|
|
84771
|
-
console.
|
|
84770
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesBatchingLayer`);
|
|
84772
84771
|
vboBatchingLayer = new TrianglesBatchingLayer({
|
|
84773
84772
|
model,
|
|
84774
84773
|
textureSet,
|
|
@@ -84783,7 +84782,7 @@ class SceneModel extends Component {
|
|
|
84783
84782
|
});
|
|
84784
84783
|
break;
|
|
84785
84784
|
case "surface":
|
|
84786
|
-
console.
|
|
84785
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesBatchingLayer`);
|
|
84787
84786
|
vboBatchingLayer = new TrianglesBatchingLayer({
|
|
84788
84787
|
model,
|
|
84789
84788
|
textureSet,
|
|
@@ -84798,7 +84797,7 @@ class SceneModel extends Component {
|
|
|
84798
84797
|
});
|
|
84799
84798
|
break;
|
|
84800
84799
|
case "lines":
|
|
84801
|
-
console.
|
|
84800
|
+
console.info(`[SceneModel ${this.id}]: creating LinesBatchingLayer`);
|
|
84802
84801
|
vboBatchingLayer = new LinesBatchingLayer({
|
|
84803
84802
|
model,
|
|
84804
84803
|
layerIndex: 0, // This is set in #finalize()
|
|
@@ -84810,7 +84809,7 @@ class SceneModel extends Component {
|
|
|
84810
84809
|
});
|
|
84811
84810
|
break;
|
|
84812
84811
|
case "points":
|
|
84813
|
-
console.
|
|
84812
|
+
console.info(`[SceneModel ${this.id}]: creating PointsBatchingLayer`);
|
|
84814
84813
|
vboBatchingLayer = new PointsBatchingLayer({
|
|
84815
84814
|
model,
|
|
84816
84815
|
layerIndex: 0, // This is set in #finalize()
|
|
@@ -84864,7 +84863,7 @@ class SceneModel extends Component {
|
|
|
84864
84863
|
while (!vboInstancingLayer) {
|
|
84865
84864
|
switch (geometry.primitive) {
|
|
84866
84865
|
case "triangles":
|
|
84867
|
-
console.
|
|
84866
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesInstancingLayer`);
|
|
84868
84867
|
vboInstancingLayer = new TrianglesInstancingLayer({
|
|
84869
84868
|
model,
|
|
84870
84869
|
textureSet,
|
|
@@ -84875,7 +84874,7 @@ class SceneModel extends Component {
|
|
|
84875
84874
|
});
|
|
84876
84875
|
break;
|
|
84877
84876
|
case "solid":
|
|
84878
|
-
console.
|
|
84877
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesInstancingLayer`);
|
|
84879
84878
|
vboInstancingLayer = new TrianglesInstancingLayer({
|
|
84880
84879
|
model,
|
|
84881
84880
|
textureSet,
|
|
@@ -84886,7 +84885,7 @@ class SceneModel extends Component {
|
|
|
84886
84885
|
});
|
|
84887
84886
|
break;
|
|
84888
84887
|
case "surface":
|
|
84889
|
-
console.
|
|
84888
|
+
console.info(`[SceneModel ${this.id}]: creating TrianglesInstancingLayer`);
|
|
84890
84889
|
vboInstancingLayer = new TrianglesInstancingLayer({
|
|
84891
84890
|
model,
|
|
84892
84891
|
textureSet,
|
|
@@ -84897,7 +84896,7 @@ class SceneModel extends Component {
|
|
|
84897
84896
|
});
|
|
84898
84897
|
break;
|
|
84899
84898
|
case "lines":
|
|
84900
|
-
console.
|
|
84899
|
+
console.info(`[SceneModel ${this.id}]: creating LinesInstancingLayer`);
|
|
84901
84900
|
vboInstancingLayer = new LinesInstancingLayer({
|
|
84902
84901
|
model,
|
|
84903
84902
|
textureSet,
|
|
@@ -84907,7 +84906,7 @@ class SceneModel extends Component {
|
|
|
84907
84906
|
});
|
|
84908
84907
|
break;
|
|
84909
84908
|
case "points":
|
|
84910
|
-
console.
|
|
84909
|
+
console.info(`[SceneModel ${this.id}]: creating PointsInstancingLayer`);
|
|
84911
84910
|
vboInstancingLayer = new PointsInstancingLayer({
|
|
84912
84911
|
model,
|
|
84913
84912
|
textureSet,
|
|
@@ -121104,7 +121103,11 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
|
|
|
121104
121103
|
const numTiles = eachTileEntitiesPortion.length;
|
|
121105
121104
|
|
|
121106
121105
|
if (metaModel) {
|
|
121107
|
-
metaModel.loadData(metadata
|
|
121106
|
+
metaModel.loadData(metadata, {
|
|
121107
|
+
includeTypes: options.includeTypes,
|
|
121108
|
+
excludeTypes: options.excludeTypes,
|
|
121109
|
+
globalizeObjectIds: options.globalizeObjectIds
|
|
121110
|
+
}); // Can be empty
|
|
121108
121111
|
}
|
|
121109
121112
|
|
|
121110
121113
|
// Count instances of each geometry
|
|
@@ -121613,7 +121616,11 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121613
121616
|
const numTiles = eachTileEntitiesPortion.length;
|
|
121614
121617
|
|
|
121615
121618
|
if (metaModel) {
|
|
121616
|
-
metaModel.loadData(metadata
|
|
121619
|
+
metaModel.loadData(metadata, {
|
|
121620
|
+
includeTypes: options.includeTypes,
|
|
121621
|
+
excludeTypes: options.excludeTypes,
|
|
121622
|
+
globalizeObjectIds: options.globalizeObjectIds
|
|
121623
|
+
}); // Can be empty
|
|
121617
121624
|
}
|
|
121618
121625
|
|
|
121619
121626
|
// Create textures
|
|
@@ -121884,7 +121891,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
|
|
|
121884
121891
|
atLastGeometry
|
|
121885
121892
|
? indices.length
|
|
121886
121893
|
: eachGeometryIndicesPortion [geometryIndex + 1]));
|
|
121887
|
-
|
|
121894
|
+
geometryValid = (geometryArrays.geometryPositions.length > 0 && geometryArrays.geometryIndices.length > 0);
|
|
121888
121895
|
break;
|
|
121889
121896
|
default:
|
|
121890
121897
|
continue;
|
package/dist/xeokit-sdk.es5.js
CHANGED
|
@@ -1441,7 +1441,7 @@ if(edge.face2!==undefined){normal1=faces[edge.face1].normal;normal2=faces[edge.f
|
|
|
1441
1441
|
* @private
|
|
1442
1442
|
*/function timeout(dt){return new Promise(function(resolve,reject){setTimeout(resolve,dt);});}/**
|
|
1443
1443
|
* @private
|
|
1444
|
-
*/function httpRequest(args){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest();xhr.open(args.method||"GET",args.url,true);xhr.onload=function(e){
|
|
1444
|
+
*/function httpRequest(args){return new Promise(function(resolve,reject){var xhr=new XMLHttpRequest();xhr.open(args.method||"GET",args.url,true);xhr.onload=function(e){if(xhr.readyState===4){if(xhr.status===200){resolve(xhr.responseXML);}else{reject(xhr.statusText);}}};xhr.send(null);});}/**
|
|
1445
1445
|
* @private
|
|
1446
1446
|
*/var queryString=function(){// This function is anonymous, is executed immediately and
|
|
1447
1447
|
// the return value is assigned to QueryString!
|
|
@@ -16207,7 +16207,7 @@ src.push(" }");src.push("}");return src;}},{key:"_buildFragmentShader",value:fu
|
|
|
16207
16207
|
* @param cfg.scratchMemory
|
|
16208
16208
|
* @param cfg.textureSet
|
|
16209
16209
|
* @param cfg.solid
|
|
16210
|
-
*/function TrianglesBatchingLayer(cfg){_classCallCheck(this,TrianglesBatchingLayer);console.
|
|
16210
|
+
*/function TrianglesBatchingLayer(cfg){_classCallCheck(this,TrianglesBatchingLayer);console.info("Creating TrianglesBatchingLayer");/**
|
|
16211
16211
|
* Owner model
|
|
16212
16212
|
* @type {VBOSceneModel}
|
|
16213
16213
|
*/this.model=cfg.model;/**
|
|
@@ -16438,7 +16438,7 @@ src.push("}");src.push("}");return src;}},{key:"_buildFragmentShader",value:func
|
|
|
16438
16438
|
* @param cfg.geometry
|
|
16439
16439
|
* @param cfg.textureSet
|
|
16440
16440
|
* @param cfg.origin
|
|
16441
|
-
*/function TrianglesInstancingLayer(cfg){_classCallCheck(this,TrianglesInstancingLayer);console.
|
|
16441
|
+
*/function TrianglesInstancingLayer(cfg){_classCallCheck(this,TrianglesInstancingLayer);console.info("Creating TrianglesInstancingLayer");/**
|
|
16442
16442
|
* Owner model
|
|
16443
16443
|
* @type {VBOSceneModel}
|
|
16444
16444
|
*/this.model=cfg.model;/**
|
|
@@ -17903,8 +17903,7 @@ this._onSceneRendering=this.model.scene.on("rendering",function(){if(_this92._de
|
|
|
17903
17903
|
*
|
|
17904
17904
|
* Invoking this method will update the colors+flags texture data with new
|
|
17905
17905
|
* flags/flags2 set since the previous invocation of `_beginDeferredFlags`.
|
|
17906
|
-
*/},{key:"_uploadDeferredFlags",value:function _uploadDeferredFlags(){
|
|
17907
|
-
this._deferredSetFlagsActive=false;if(!this._deferredSetFlagsDirty){return;}this._deferredSetFlagsDirty=false;var gl=this.model.scene.canvas.gl;var textureState=this._dataTextureState;gl.bindTexture(gl.TEXTURE_2D,textureState.texturePerObjectIdColorsAndFlags._texture);gl.texSubImage2D(gl.TEXTURE_2D,0,// level
|
|
17906
|
+
*/},{key:"_uploadDeferredFlags",value:function _uploadDeferredFlags(){console.info("_uploadDeferredFlags");this._deferredSetFlagsActive=false;if(!this._deferredSetFlagsDirty){return;}this._deferredSetFlagsDirty=false;var gl=this.model.scene.canvas.gl;var textureState=this._dataTextureState;gl.bindTexture(gl.TEXTURE_2D,textureState.texturePerObjectIdColorsAndFlags._texture);gl.texSubImage2D(gl.TEXTURE_2D,0,// level
|
|
17908
17907
|
0,// xoffset
|
|
17909
17908
|
0,// yoffset
|
|
17910
17909
|
textureState.texturePerObjectIdColorsAndFlags._textureWidth,// width
|
|
@@ -17916,10 +17915,8 @@ textureState.texturePerObjectIdOffsets._textureWidth,// width
|
|
|
17916
17915
|
textureState.texturePerObjectIdOffsets._textureHeight,// width
|
|
17917
17916
|
gl.RGB,gl.FLOAT,textureState.texturePerObjectIdOffsets._textureData);}},{key:"setCulled",value:function setCulled(portionId,flags,transparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.CULLED){this._numCulledLayerPortions+=this._portionToSubPortionsMap[portionId].length;this.model.numCulledLayerPortions++;}else{this._numCulledLayerPortions-=this._portionToSubPortionsMap[portionId].length;this.model.numCulledLayerPortions--;}this._setFlags(portionId,flags,transparent);}},{key:"setCollidable",value:function setCollidable(portionId,flags){if(!this._finalized){throw"Not finalized";}}},{key:"setPickable",value:function setPickable(portionId,flags,transparent){if(!this._finalized){throw"Not finalized";}if(flags&ENTITY_FLAGS.PICKABLE){this._numPickableLayerPortions++;this.model.numPickableLayerPortions++;}else{this._numPickableLayerPortions--;this.model.numPickableLayerPortions--;}this._setFlags(portionId,flags,transparent);}},{key:"setColor",value:function setColor(portionId,color){var subPortionIds=this._portionToSubPortionsMap[portionId];for(var _i389=0,len=subPortionIds.length;_i389<len;_i389++){this._subPortionSetColor(subPortionIds[_i389],color);}}},{key:"_subPortionSetColor",value:function _subPortionSetColor(subPortionId,color){if(!this._finalized){throw"Not finalized";}// Color
|
|
17918
17917
|
var textureState=this._dataTextureState;var gl=this.model.scene.canvas.gl;tempUint8Array4[0]=color[0];tempUint8Array4[1]=color[1];tempUint8Array4[2]=color[2];tempUint8Array4[3]=color[3];// object colors
|
|
17919
|
-
textureState.texturePerObjectIdColorsAndFlags._textureData.set(tempUint8Array4,subPortionId*32);if(this._deferredSetFlagsActive){
|
|
17920
|
-
|
|
17921
|
-
}// console.log("_subPortionSetColor write through");
|
|
17922
|
-
gl.bindTexture(gl.TEXTURE_2D,textureState.texturePerObjectIdColorsAndFlags._texture);gl.texSubImage2D(gl.TEXTURE_2D,0,// level
|
|
17918
|
+
textureState.texturePerObjectIdColorsAndFlags._textureData.set(tempUint8Array4,subPortionId*32);if(this._deferredSetFlagsActive){console.info("_subPortionSetColor defer");this._deferredSetFlagsDirty=true;return;}if(++this._numUpdatesInFrame>=MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE){this._beginDeferredFlags();// Subsequent flags updates now deferred
|
|
17919
|
+
}console.info("_subPortionSetColor write through");gl.bindTexture(gl.TEXTURE_2D,textureState.texturePerObjectIdColorsAndFlags._texture);gl.texSubImage2D(gl.TEXTURE_2D,0,// level
|
|
17923
17920
|
subPortionId%512*8,// xoffset
|
|
17924
17921
|
Math.floor(subPortionId/512),// yoffset
|
|
17925
17922
|
1,// width
|
|
@@ -17931,10 +17928,8 @@ f0=RENDER_PASSES.NOT_RENDERED;}else{if(transparent){f0=RENDER_PASSES.COLOR_TRANS
|
|
|
17931
17928
|
var f1;if(!visible||culled){f1=RENDER_PASSES.NOT_RENDERED;}else if(selected){f1=RENDER_PASSES.SILHOUETTE_SELECTED;}else if(highlighted){f1=RENDER_PASSES.SILHOUETTE_HIGHLIGHTED;}else if(xrayed){f1=RENDER_PASSES.SILHOUETTE_XRAYED;}else{f1=RENDER_PASSES.NOT_RENDERED;}// Edges
|
|
17932
17929
|
var f2=0;if(!visible||culled){f2=RENDER_PASSES.NOT_RENDERED;}else if(selected){f2=RENDER_PASSES.EDGES_SELECTED;}else if(highlighted){f2=RENDER_PASSES.EDGES_HIGHLIGHTED;}else if(xrayed){f2=RENDER_PASSES.EDGES_XRAYED;}else if(edges){if(transparent){f2=RENDER_PASSES.EDGES_COLOR_TRANSPARENT;}else{f2=RENDER_PASSES.EDGES_COLOR_OPAQUE;}}else{f2=RENDER_PASSES.NOT_RENDERED;}// Pick
|
|
17933
17930
|
var f3=visible&&pickable?RENDER_PASSES.PICK:RENDER_PASSES.NOT_RENDERED;var textureState=this._dataTextureState;var gl=this.model.scene.canvas.gl;tempUint8Array4[0]=f0;tempUint8Array4[1]=f1;tempUint8Array4[2]=f2;tempUint8Array4[3]=f3;// object flags
|
|
17934
|
-
textureState.texturePerObjectIdColorsAndFlags._textureData.set(tempUint8Array4,subPortionId*32+8);if(this._deferredSetFlagsActive||deferred){
|
|
17935
|
-
|
|
17936
|
-
}// console.log("_subPortionSetFlags set flags write through");
|
|
17937
|
-
gl.bindTexture(gl.TEXTURE_2D,textureState.texturePerObjectIdColorsAndFlags._texture);gl.texSubImage2D(gl.TEXTURE_2D,0,// level
|
|
17931
|
+
textureState.texturePerObjectIdColorsAndFlags._textureData.set(tempUint8Array4,subPortionId*32+8);if(this._deferredSetFlagsActive||deferred){console.info("_subPortionSetFlags set flags defer");this._deferredSetFlagsDirty=true;return;}if(++this._numUpdatesInFrame>=MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE){this._beginDeferredFlags();// Subsequent flags updates now deferred
|
|
17932
|
+
}console.info("_subPortionSetFlags set flags write through");gl.bindTexture(gl.TEXTURE_2D,textureState.texturePerObjectIdColorsAndFlags._texture);gl.texSubImage2D(gl.TEXTURE_2D,0,// level
|
|
17938
17933
|
subPortionId%512*8+2,// xoffset
|
|
17939
17934
|
Math.floor(subPortionId/512),// yoffset
|
|
17940
17935
|
1,// width
|
|
@@ -17943,8 +17938,7 @@ gl.RGBA_INTEGER,gl.UNSIGNED_BYTE,tempUint8Array4);// gl.bindTexture (gl.TEXTURE_
|
|
|
17943
17938
|
}},{key:"_setDeferredFlags",value:function _setDeferredFlags(){}},{key:"_setFlags2",value:function _setFlags2(portionId,flags){var deferred=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var subPortionIds=this._portionToSubPortionsMap[portionId];for(var _i391=0,len=subPortionIds.length;_i391<len;_i391++){this._subPortionSetFlags2(subPortionIds[_i391],flags,deferred);}}},{key:"_subPortionSetFlags2",value:function _subPortionSetFlags2(subPortionId,flags){var deferred=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;if(!this._finalized){throw"Not finalized";}var clippable=!!(flags&ENTITY_FLAGS.CLIPPABLE)?255:0;var textureState=this._dataTextureState;var gl=this.model.scene.canvas.gl;tempUint8Array4[0]=clippable;tempUint8Array4[1]=0;tempUint8Array4[2]=1;tempUint8Array4[3]=2;// object flags2
|
|
17944
17939
|
textureState.texturePerObjectIdColorsAndFlags._textureData.set(tempUint8Array4,subPortionId*32+12);if(this._deferredSetFlagsActive||deferred){// console.log("_subPortionSetFlags2 set flags defer");
|
|
17945
17940
|
this._deferredSetFlagsDirty=true;return;}if(++this._numUpdatesInFrame>=MAX_OBJECT_UPDATES_IN_FRAME_WITHOUT_BATCHED_UPDATE){this._beginDeferredFlags();// Subsequent flags updates now deferred
|
|
17946
|
-
}
|
|
17947
|
-
gl.bindTexture(gl.TEXTURE_2D,textureState.texturePerObjectIdColorsAndFlags._texture);gl.texSubImage2D(gl.TEXTURE_2D,0,// level
|
|
17941
|
+
}console.info("_subPortionSetFlags2 set flags write through");gl.bindTexture(gl.TEXTURE_2D,textureState.texturePerObjectIdColorsAndFlags._texture);gl.texSubImage2D(gl.TEXTURE_2D,0,// level
|
|
17948
17942
|
subPortionId%512*8+3,// xoffset
|
|
17949
17943
|
Math.floor(subPortionId/512),// yoffset
|
|
17950
17944
|
1,// width
|
|
@@ -19561,24 +19555,24 @@ if(cfg.textureSetId){cfg.textureSet=this._textureSets[cfg.textureSetId];// if (!
|
|
|
19561
19555
|
createGeometryOBB(cfg.geometry);}}cfg.numPrimitives=this._getNumPrimitives(cfg);if(this._vfcManager&&!this._vfcManager.finalized){this._vfcManager.addMesh(cfg);// Deferred so VFC manager can cluster meshes for GPU cache locality
|
|
19562
19556
|
}else{this._createMesh(cfg);}}},{key:"_createMesh",value:function _createMesh(cfg){var mesh=new SceneModelMesh(this,cfg.id,cfg.color,cfg.opacity);mesh.pickId=this.scene._renderer.getPickID(mesh);var pickId=mesh.pickId;var a=pickId>>24&0xFF;var b=pickId>>16&0xFF;var g=pickId>>8&0xFF;var r=pickId&0xFF;cfg.pickColor=new Uint8Array([r,g,b,a]);// Quantized pick color
|
|
19563
19557
|
cfg.worldAABB=math.collapseAABB3();cfg.aabb=cfg.worldAABB;/// Hack for VBOInstancing layer
|
|
19564
|
-
cfg.solid=cfg.primitive==="solid";mesh.origin=math.vec3(cfg.origin);switch(cfg.type){case DTX:mesh.layer=this._getDTXLayer(cfg);break;case VBO_BATCHED:mesh.layer=this._getVBOBatchingLayer(cfg);break;case VBO_INSTANCED:mesh.layer=this._getVBOInstancingLayer(cfg);break;}mesh.portionId=mesh.layer.createPortion(cfg);mesh.aabb=cfg.worldAABB;mesh.numPrimitives=cfg.numPrimitives;math.expandAABB3(this._aabb,mesh.aabb);this._meshes[cfg.id]=mesh;this._meshList.push(mesh);}},{key:"_getNumPrimitives",value:function _getNumPrimitives(cfg){var countIndices=0;var primitive=cfg.geometry?cfg.geometry.primitive:cfg.primitive;switch(primitive){case"triangles":case"solid":case"surface":switch(cfg.type){case DTX:for(var _i408=0,len=cfg.buckets.length;_i408<len;_i408++){countIndices+=cfg.buckets[_i408].indices.length;}break;case VBO_BATCHED:countIndices+=cfg.indices.length;break;case VBO_INSTANCED:countIndices+=cfg.geometry.indices.length;break;}return Math.round(countIndices/3);case"points":switch(cfg.type){case DTX:for(var _i409=0,_len94=cfg.buckets.length;_i409<_len94;_i409++){countIndices+=cfg.buckets[_i409].positionsCompressed.length;}break;case VBO_BATCHED:countIndices+=cfg.positions?cfg.positions.length:cfg.positionsCompressed.length;break;case VBO_INSTANCED:countIndices+=cfg.positions?cfg.positions.length:cfg.positionsCompressed.length;break;}return Math.round(countIndices);case"lines":case"line-strip":switch(cfg.type){case DTX:for(var _i410=0,_len95=cfg.buckets.length;_i410<_len95;_i410++){countIndices+=cfg.buckets[_i410].indices.length;}break;case VBO_BATCHED:countIndices+=cfg.indices.length;break;case VBO_INSTANCED:countIndices+=cfg.geometry.indices.length;break;}return Math.round(countIndices/2);}return 0;}},{key:"_getDTXLayer",value:function _getDTXLayer(cfg){var origin=cfg.origin;var layerId="".concat(Math.round(origin[0]),".").concat(Math.round(origin[1]),".").concat(Math.round(origin[2]));var dtxLayer=this._dtxLayers[layerId];if(dtxLayer){if(!dtxLayer.canCreatePortion(cfg)){dtxLayer.finalize();delete this._dtxLayers[layerId];dtxLayer=null;}else{return dtxLayer;}}console.
|
|
19565
|
-
this._dtxLayers[layerId]=dtxLayer;this.layerList.push(dtxLayer);return dtxLayer;}},{key:"_getVBOBatchingLayer",value:function _getVBOBatchingLayer(cfg){var model=this;var origin=cfg.origin;var positionsDecodeHash=cfg.positionsDecodeMatrix||cfg.positionsDecodeBoundary?this._createHashStringFromMatrix(cfg.positionsDecodeMatrix||cfg.positionsDecodeBoundary):"-";var textureSetId=cfg.textureSetId||"-";var layerId="".concat(Math.round(origin[0]),".").concat(Math.round(origin[1]),".").concat(Math.round(origin[2]),".").concat(cfg.primitive,".").concat(positionsDecodeHash,".").concat(textureSetId);var vboBatchingLayer=this._vboBatchingLayers[layerId];if(vboBatchingLayer){return vboBatchingLayer;}var textureSet=cfg.textureSet;while(!vboBatchingLayer){switch(cfg.primitive){case"triangles":console.
|
|
19558
|
+
cfg.solid=cfg.primitive==="solid";mesh.origin=math.vec3(cfg.origin);switch(cfg.type){case DTX:mesh.layer=this._getDTXLayer(cfg);break;case VBO_BATCHED:mesh.layer=this._getVBOBatchingLayer(cfg);break;case VBO_INSTANCED:mesh.layer=this._getVBOInstancingLayer(cfg);break;}mesh.portionId=mesh.layer.createPortion(cfg);mesh.aabb=cfg.worldAABB;mesh.numPrimitives=cfg.numPrimitives;math.expandAABB3(this._aabb,mesh.aabb);this._meshes[cfg.id]=mesh;this._meshList.push(mesh);}},{key:"_getNumPrimitives",value:function _getNumPrimitives(cfg){var countIndices=0;var primitive=cfg.geometry?cfg.geometry.primitive:cfg.primitive;switch(primitive){case"triangles":case"solid":case"surface":switch(cfg.type){case DTX:for(var _i408=0,len=cfg.buckets.length;_i408<len;_i408++){countIndices+=cfg.buckets[_i408].indices.length;}break;case VBO_BATCHED:countIndices+=cfg.indices.length;break;case VBO_INSTANCED:countIndices+=cfg.geometry.indices.length;break;}return Math.round(countIndices/3);case"points":switch(cfg.type){case DTX:for(var _i409=0,_len94=cfg.buckets.length;_i409<_len94;_i409++){countIndices+=cfg.buckets[_i409].positionsCompressed.length;}break;case VBO_BATCHED:countIndices+=cfg.positions?cfg.positions.length:cfg.positionsCompressed.length;break;case VBO_INSTANCED:countIndices+=cfg.positions?cfg.positions.length:cfg.positionsCompressed.length;break;}return Math.round(countIndices);case"lines":case"line-strip":switch(cfg.type){case DTX:for(var _i410=0,_len95=cfg.buckets.length;_i410<_len95;_i410++){countIndices+=cfg.buckets[_i410].indices.length;}break;case VBO_BATCHED:countIndices+=cfg.indices.length;break;case VBO_INSTANCED:countIndices+=cfg.geometry.indices.length;break;}return Math.round(countIndices/2);}return 0;}},{key:"_getDTXLayer",value:function _getDTXLayer(cfg){var origin=cfg.origin;var layerId="".concat(Math.round(origin[0]),".").concat(Math.round(origin[1]),".").concat(Math.round(origin[2]));var dtxLayer=this._dtxLayers[layerId];if(dtxLayer){if(!dtxLayer.canCreatePortion(cfg)){dtxLayer.finalize();delete this._dtxLayers[layerId];dtxLayer=null;}else{return dtxLayer;}}console.info("[SceneModel ".concat(this.id,"]: creating TrianglesDataTextureLayer"));dtxLayer=new TrianglesDataTextureLayer(this,{layerIndex:0,origin:origin});// layerIndex is set in #finalize()
|
|
19559
|
+
this._dtxLayers[layerId]=dtxLayer;this.layerList.push(dtxLayer);return dtxLayer;}},{key:"_getVBOBatchingLayer",value:function _getVBOBatchingLayer(cfg){var model=this;var origin=cfg.origin;var positionsDecodeHash=cfg.positionsDecodeMatrix||cfg.positionsDecodeBoundary?this._createHashStringFromMatrix(cfg.positionsDecodeMatrix||cfg.positionsDecodeBoundary):"-";var textureSetId=cfg.textureSetId||"-";var layerId="".concat(Math.round(origin[0]),".").concat(Math.round(origin[1]),".").concat(Math.round(origin[2]),".").concat(cfg.primitive,".").concat(positionsDecodeHash,".").concat(textureSetId);var vboBatchingLayer=this._vboBatchingLayers[layerId];if(vboBatchingLayer){return vboBatchingLayer;}var textureSet=cfg.textureSet;while(!vboBatchingLayer){switch(cfg.primitive){case"triangles":console.info("[SceneModel ".concat(this.id,"]: creating TrianglesBatchingLayer"));vboBatchingLayer=new TrianglesBatchingLayer({model:model,textureSet:textureSet,layerIndex:0,// This is set in #finalize()
|
|
19566
19560
|
scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:cfg.positionsDecodeMatrix,// Can be undefined
|
|
19567
19561
|
uvDecodeMatrix:cfg.uvDecodeMatrix,// Can be undefined
|
|
19568
|
-
origin:origin,maxGeometryBatchSize:this._maxGeometryBatchSize,solid:cfg.primitive==="solid",autoNormals:true});break;case"solid":console.
|
|
19562
|
+
origin:origin,maxGeometryBatchSize:this._maxGeometryBatchSize,solid:cfg.primitive==="solid",autoNormals:true});break;case"solid":console.info("[SceneModel ".concat(this.id,"]: creating TrianglesBatchingLayer"));vboBatchingLayer=new TrianglesBatchingLayer({model:model,textureSet:textureSet,layerIndex:0,// This is set in #finalize()
|
|
19569
19563
|
scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:cfg.positionsDecodeMatrix,// Can be undefined
|
|
19570
19564
|
uvDecodeMatrix:cfg.uvDecodeMatrix,// Can be undefined
|
|
19571
|
-
origin:origin,maxGeometryBatchSize:this._maxGeometryBatchSize,solid:cfg.primitive==="solid",autoNormals:true});break;case"surface":console.
|
|
19565
|
+
origin:origin,maxGeometryBatchSize:this._maxGeometryBatchSize,solid:cfg.primitive==="solid",autoNormals:true});break;case"surface":console.info("[SceneModel ".concat(this.id,"]: creating TrianglesBatchingLayer"));vboBatchingLayer=new TrianglesBatchingLayer({model:model,textureSet:textureSet,layerIndex:0,// This is set in #finalize()
|
|
19572
19566
|
scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:cfg.positionsDecodeMatrix,// Can be undefined
|
|
19573
19567
|
uvDecodeMatrix:cfg.uvDecodeMatrix,// Can be undefined
|
|
19574
|
-
origin:origin,maxGeometryBatchSize:this._maxGeometryBatchSize,solid:cfg.primitive==="solid",autoNormals:true});break;case"lines":console.
|
|
19568
|
+
origin:origin,maxGeometryBatchSize:this._maxGeometryBatchSize,solid:cfg.primitive==="solid",autoNormals:true});break;case"lines":console.info("[SceneModel ".concat(this.id,"]: creating LinesBatchingLayer"));vboBatchingLayer=new LinesBatchingLayer({model:model,layerIndex:0,// This is set in #finalize()
|
|
19575
19569
|
scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:cfg.positionsDecodeMatrix,// Can be undefined
|
|
19576
19570
|
uvDecodeMatrix:cfg.uvDecodeMatrix,// Can be undefined
|
|
19577
|
-
origin:origin,maxGeometryBatchSize:this._maxGeometryBatchSize});break;case"points":console.
|
|
19571
|
+
origin:origin,maxGeometryBatchSize:this._maxGeometryBatchSize});break;case"points":console.info("[SceneModel ".concat(this.id,"]: creating PointsBatchingLayer"));vboBatchingLayer=new PointsBatchingLayer({model:model,layerIndex:0,// This is set in #finalize()
|
|
19578
19572
|
scratchMemory:this._vboBatchingLayerScratchMemory,positionsDecodeMatrix:cfg.positionsDecodeMatrix,// Can be undefined
|
|
19579
19573
|
uvDecodeMatrix:cfg.uvDecodeMatrix,// Can be undefined
|
|
19580
19574
|
origin:origin,maxGeometryBatchSize:this._maxGeometryBatchSize});break;}var lenPositions=cfg.positionsCompressed?cfg.positionsCompressed.length:cfg.positions.length;var canCreatePortion=cfg.primitive==="points"?vboBatchingLayer.canCreatePortion(lenPositions):vboBatchingLayer.canCreatePortion(lenPositions,cfg.indices.length);if(!canCreatePortion){vboBatchingLayer.finalize();delete this._vboBatchingLayers[layerId];vboBatchingLayer=null;}}this._vboBatchingLayers[layerId]=vboBatchingLayer;this.layerList.push(vboBatchingLayer);return vboBatchingLayer;}},{key:"_createHashStringFromMatrix",value:function _createHashStringFromMatrix(matrix){var matrixString=matrix.join('');var hash=0;for(var _i411=0;_i411<matrixString.length;_i411++){var _char=matrixString.charCodeAt(_i411);hash=(hash<<5)-hash+_char;hash|=0;// Convert to 32-bit integer
|
|
19581
|
-
}var hashString=(hash>>>0).toString(16);return hashString;}},{key:"_getVBOInstancingLayer",value:function _getVBOInstancingLayer(cfg){var model=this;var origin=cfg.origin;var textureSetId=cfg.textureSetId||"-";var geometryId=cfg.geometryId;var layerId="".concat(Math.round(origin[0]),".").concat(Math.round(origin[1]),".").concat(Math.round(origin[2]),".").concat(textureSetId,".").concat(geometryId);var vboInstancingLayer=this._vboInstancingLayers[layerId];if(vboInstancingLayer){return vboInstancingLayer;}var textureSet=cfg.textureSet;var geometry=cfg.geometry;while(!vboInstancingLayer){switch(geometry.primitive){case"triangles":console.
|
|
19575
|
+
}var hashString=(hash>>>0).toString(16);return hashString;}},{key:"_getVBOInstancingLayer",value:function _getVBOInstancingLayer(cfg){var model=this;var origin=cfg.origin;var textureSetId=cfg.textureSetId||"-";var geometryId=cfg.geometryId;var layerId="".concat(Math.round(origin[0]),".").concat(Math.round(origin[1]),".").concat(Math.round(origin[2]),".").concat(textureSetId,".").concat(geometryId);var vboInstancingLayer=this._vboInstancingLayers[layerId];if(vboInstancingLayer){return vboInstancingLayer;}var textureSet=cfg.textureSet;var geometry=cfg.geometry;while(!vboInstancingLayer){switch(geometry.primitive){case"triangles":console.info("[SceneModel ".concat(this.id,"]: creating TrianglesInstancingLayer"));vboInstancingLayer=new TrianglesInstancingLayer({model:model,textureSet:textureSet,geometry:geometry,origin:origin,layerIndex:0,solid:false});break;case"solid":console.info("[SceneModel ".concat(this.id,"]: creating TrianglesInstancingLayer"));vboInstancingLayer=new TrianglesInstancingLayer({model:model,textureSet:textureSet,geometry:geometry,origin:origin,layerIndex:0,solid:true});break;case"surface":console.info("[SceneModel ".concat(this.id,"]: creating TrianglesInstancingLayer"));vboInstancingLayer=new TrianglesInstancingLayer({model:model,textureSet:textureSet,geometry:geometry,origin:origin,layerIndex:0,solid:false});break;case"lines":console.info("[SceneModel ".concat(this.id,"]: creating LinesInstancingLayer"));vboInstancingLayer=new LinesInstancingLayer({model:model,textureSet:textureSet,geometry:geometry,origin:origin,layerIndex:0});break;case"points":console.info("[SceneModel ".concat(this.id,"]: creating PointsInstancingLayer"));vboInstancingLayer=new PointsInstancingLayer({model:model,textureSet:textureSet,geometry:geometry,origin:origin,layerIndex:0});break;}// const lenPositions = geometry.positionsCompressed.length;
|
|
19582
19576
|
// if (!vboInstancingLayer.canCreatePortion(lenPositions, geometry.indices.length)) { // FIXME: indices should be optional
|
|
19583
19577
|
// vboInstancingLayer.finalize();
|
|
19584
19578
|
// delete this._vboInstancingLayers[layerId];
|
|
@@ -25361,7 +25355,7 @@ metadata:elements[0],positions:elements[1],normals:elements[2],colors:elements[3
|
|
|
25361
25355
|
matrices:elements[6],reusedGeometriesDecodeMatrix:elements[7],// Geometries
|
|
25362
25356
|
eachGeometryPrimitiveType:elements[8],eachGeometryPositionsPortion:elements[9],eachGeometryNormalsPortion:elements[10],eachGeometryColorsPortion:elements[11],eachGeometryIndicesPortion:elements[12],eachGeometryEdgeIndicesPortion:elements[13],// Meshes are grouped in runs that are shared by the same entities
|
|
25363
25357
|
eachMeshGeometriesPortion:elements[14],eachMeshMatricesPortion:elements[15],eachMeshMaterial:elements[16],// Entity elements in the following arrays are grouped in runs that are shared by the same tiles
|
|
25364
|
-
eachEntityId:elements[17],eachEntityMeshesPortion:elements[18],eachTileAABB:elements[19],eachTileEntitiesPortion:elements[20]};}function inflate$1(deflatedData){function inflate(array,options){return array.length===0?[]:pako$1.inflate(array,options).buffer;}return{metadata:JSON.parse(pako$1.inflate(deflatedData.metadata,{to:'string'})),positions:new Uint16Array(inflate(deflatedData.positions)),normals:new Int8Array(inflate(deflatedData.normals)),colors:new Uint8Array(inflate(deflatedData.colors)),indices:new Uint32Array(inflate(deflatedData.indices)),edgeIndices:new Uint32Array(inflate(deflatedData.edgeIndices)),matrices:new Float32Array(inflate(deflatedData.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(inflate(deflatedData.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(inflate(deflatedData.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(inflate(deflatedData.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(inflate(deflatedData.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(inflate(deflatedData.eachGeometryColorsPortion)),eachGeometryIndicesPortion:new Uint32Array(inflate(deflatedData.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(inflate(deflatedData.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(inflate(deflatedData.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(inflate(deflatedData.eachMeshMatricesPortion)),eachMeshMaterial:new Uint8Array(inflate(deflatedData.eachMeshMaterial)),eachEntityId:JSON.parse(pako$1.inflate(deflatedData.eachEntityId,{to:'string'})),eachEntityMeshesPortion:new Uint32Array(inflate(deflatedData.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(inflate(deflatedData.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(inflate(deflatedData.eachTileEntitiesPortion))};}var decompressColor$1=function(){var floatColor=new Float32Array(3);return function(intColor){floatColor[0]=intColor[0]/255.0;floatColor[1]=intColor[1]/255.0;floatColor[2]=intColor[2]/255.0;return floatColor;};}();function load$1(viewer,options,inflatedData,sceneModel,metaModel,manifestCtx){var modelPartId=manifestCtx.getNextId();var metadata=inflatedData.metadata;var positions=inflatedData.positions;var normals=inflatedData.normals;var colors=inflatedData.colors;var indices=inflatedData.indices;var edgeIndices=inflatedData.edgeIndices;var matrices=inflatedData.matrices;var reusedGeometriesDecodeMatrix=inflatedData.reusedGeometriesDecodeMatrix;var eachGeometryPrimitiveType=inflatedData.eachGeometryPrimitiveType;var eachGeometryPositionsPortion=inflatedData.eachGeometryPositionsPortion;var eachGeometryNormalsPortion=inflatedData.eachGeometryNormalsPortion;var eachGeometryColorsPortion=inflatedData.eachGeometryColorsPortion;var eachGeometryIndicesPortion=inflatedData.eachGeometryIndicesPortion;var eachGeometryEdgeIndicesPortion=inflatedData.eachGeometryEdgeIndicesPortion;var eachMeshGeometriesPortion=inflatedData.eachMeshGeometriesPortion;var eachMeshMatricesPortion=inflatedData.eachMeshMatricesPortion;var eachMeshMaterial=inflatedData.eachMeshMaterial;var eachEntityId=inflatedData.eachEntityId;var eachEntityMeshesPortion=inflatedData.eachEntityMeshesPortion;var eachTileAABB=inflatedData.eachTileAABB;var eachTileEntitiesPortion=inflatedData.eachTileEntitiesPortion;var numGeometries=eachGeometryPositionsPortion.length;var numMeshes=eachMeshGeometriesPortion.length;var numEntities=eachEntityMeshesPortion.length;var numTiles=eachTileEntitiesPortion.length;if(metaModel){metaModel.loadData(metadata);// Can be empty
|
|
25358
|
+
eachEntityId:elements[17],eachEntityMeshesPortion:elements[18],eachTileAABB:elements[19],eachTileEntitiesPortion:elements[20]};}function inflate$1(deflatedData){function inflate(array,options){return array.length===0?[]:pako$1.inflate(array,options).buffer;}return{metadata:JSON.parse(pako$1.inflate(deflatedData.metadata,{to:'string'})),positions:new Uint16Array(inflate(deflatedData.positions)),normals:new Int8Array(inflate(deflatedData.normals)),colors:new Uint8Array(inflate(deflatedData.colors)),indices:new Uint32Array(inflate(deflatedData.indices)),edgeIndices:new Uint32Array(inflate(deflatedData.edgeIndices)),matrices:new Float32Array(inflate(deflatedData.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(inflate(deflatedData.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(inflate(deflatedData.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(inflate(deflatedData.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(inflate(deflatedData.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(inflate(deflatedData.eachGeometryColorsPortion)),eachGeometryIndicesPortion:new Uint32Array(inflate(deflatedData.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(inflate(deflatedData.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(inflate(deflatedData.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(inflate(deflatedData.eachMeshMatricesPortion)),eachMeshMaterial:new Uint8Array(inflate(deflatedData.eachMeshMaterial)),eachEntityId:JSON.parse(pako$1.inflate(deflatedData.eachEntityId,{to:'string'})),eachEntityMeshesPortion:new Uint32Array(inflate(deflatedData.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(inflate(deflatedData.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(inflate(deflatedData.eachTileEntitiesPortion))};}var decompressColor$1=function(){var floatColor=new Float32Array(3);return function(intColor){floatColor[0]=intColor[0]/255.0;floatColor[1]=intColor[1]/255.0;floatColor[2]=intColor[2]/255.0;return floatColor;};}();function load$1(viewer,options,inflatedData,sceneModel,metaModel,manifestCtx){var modelPartId=manifestCtx.getNextId();var metadata=inflatedData.metadata;var positions=inflatedData.positions;var normals=inflatedData.normals;var colors=inflatedData.colors;var indices=inflatedData.indices;var edgeIndices=inflatedData.edgeIndices;var matrices=inflatedData.matrices;var reusedGeometriesDecodeMatrix=inflatedData.reusedGeometriesDecodeMatrix;var eachGeometryPrimitiveType=inflatedData.eachGeometryPrimitiveType;var eachGeometryPositionsPortion=inflatedData.eachGeometryPositionsPortion;var eachGeometryNormalsPortion=inflatedData.eachGeometryNormalsPortion;var eachGeometryColorsPortion=inflatedData.eachGeometryColorsPortion;var eachGeometryIndicesPortion=inflatedData.eachGeometryIndicesPortion;var eachGeometryEdgeIndicesPortion=inflatedData.eachGeometryEdgeIndicesPortion;var eachMeshGeometriesPortion=inflatedData.eachMeshGeometriesPortion;var eachMeshMatricesPortion=inflatedData.eachMeshMatricesPortion;var eachMeshMaterial=inflatedData.eachMeshMaterial;var eachEntityId=inflatedData.eachEntityId;var eachEntityMeshesPortion=inflatedData.eachEntityMeshesPortion;var eachTileAABB=inflatedData.eachTileAABB;var eachTileEntitiesPortion=inflatedData.eachTileEntitiesPortion;var numGeometries=eachGeometryPositionsPortion.length;var numMeshes=eachMeshGeometriesPortion.length;var numEntities=eachEntityMeshesPortion.length;var numTiles=eachTileEntitiesPortion.length;if(metaModel){metaModel.loadData(metadata,{includeTypes:options.includeTypes,excludeTypes:options.excludeTypes,globalizeObjectIds:options.globalizeObjectIds});// Can be empty
|
|
25365
25359
|
}// Count instances of each geometry
|
|
25366
25360
|
var geometryReuseCounts=new Uint32Array(numGeometries);for(var meshIndex=0;meshIndex<numMeshes;meshIndex++){var geometryIndex=eachMeshGeometriesPortion[meshIndex];if(geometryReuseCounts[geometryIndex]!==undefined){geometryReuseCounts[geometryIndex]++;}else{geometryReuseCounts[geometryIndex]=1;}}// Iterate over tiles
|
|
25367
25361
|
var tileCenter=math.vec3();var rtcAABB=math.AABB3();var geometryArraysCache={};for(var tileIndex=0;tileIndex<numTiles;tileIndex++){var lastTileIndex=numTiles-1;var atLastTile=tileIndex===lastTileIndex;var firstTileEntityIndex=eachTileEntitiesPortion[tileIndex];var lastTileEntityIndex=atLastTile?numEntities-1:eachTileEntitiesPortion[tileIndex+1]-1;var tileAABBIndex=tileIndex*6;var tileAABB=eachTileAABB.subarray(tileAABBIndex,tileAABBIndex+6);math.getAABB3Center(tileAABB,tileCenter);rtcAABB[0]=tileAABB[0]-tileCenter[0];rtcAABB[1]=tileAABB[1]-tileCenter[1];rtcAABB[2]=tileAABB[2]-tileCenter[2];rtcAABB[3]=tileAABB[3]-tileCenter[0];rtcAABB[4]=tileAABB[4]-tileCenter[1];rtcAABB[5]=tileAABB[5]-tileCenter[2];var tileDecodeMatrix=geometryCompressionUtils.createPositionsDecodeMatrix(rtcAABB);var geometryCreatedInTile={};// Iterate over each tile's entities
|
|
@@ -25375,7 +25369,7 @@ var geometryArrays=geometryArraysCache[geometryId];if(!geometryArrays){geometryA
|
|
|
25375
25369
|
*/var pako=window.pako||p;if(!pako.inflate){// See https://github.com/nodeca/pako/issues/97
|
|
25376
25370
|
pako=pako["default"];}var tempVec4a=math.vec4();var tempVec4b=math.vec4();var NUM_TEXTURE_ATTRIBUTES=9;function extract(elements){var i=0;return{metadata:elements[i++],textureData:elements[i++],eachTextureDataPortion:elements[i++],eachTextureAttributes:elements[i++],positions:elements[i++],normals:elements[i++],colors:elements[i++],uvs:elements[i++],indices:elements[i++],edgeIndices:elements[i++],eachTextureSetTextures:elements[i++],matrices:elements[i++],reusedGeometriesDecodeMatrix:elements[i++],eachGeometryPrimitiveType:elements[i++],eachGeometryPositionsPortion:elements[i++],eachGeometryNormalsPortion:elements[i++],eachGeometryColorsPortion:elements[i++],eachGeometryUVsPortion:elements[i++],eachGeometryIndicesPortion:elements[i++],eachGeometryEdgeIndicesPortion:elements[i++],eachMeshGeometriesPortion:elements[i++],eachMeshMatricesPortion:elements[i++],eachMeshTextureSet:elements[i++],eachMeshMaterialAttributes:elements[i++],eachEntityId:elements[i++],eachEntityMeshesPortion:elements[i++],eachTileAABB:elements[i++],eachTileEntitiesPortion:elements[i++]};}function inflate(deflatedData){function inflate(array,options){return array.length===0?[]:pako.inflate(array,options).buffer;}return{metadata:JSON.parse(pako.inflate(deflatedData.metadata,{to:'string'})),textureData:new Uint8Array(inflate(deflatedData.textureData)),// <<----------------------------- ??? ZIPPing to blame?
|
|
25377
25371
|
eachTextureDataPortion:new Uint32Array(inflate(deflatedData.eachTextureDataPortion)),eachTextureAttributes:new Uint16Array(inflate(deflatedData.eachTextureAttributes)),positions:new Uint16Array(inflate(deflatedData.positions)),normals:new Int8Array(inflate(deflatedData.normals)),colors:new Uint8Array(inflate(deflatedData.colors)),uvs:new Float32Array(inflate(deflatedData.uvs)),indices:new Uint32Array(inflate(deflatedData.indices)),edgeIndices:new Uint32Array(inflate(deflatedData.edgeIndices)),eachTextureSetTextures:new Int32Array(inflate(deflatedData.eachTextureSetTextures)),matrices:new Float32Array(inflate(deflatedData.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(inflate(deflatedData.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(inflate(deflatedData.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(inflate(deflatedData.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(inflate(deflatedData.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(inflate(deflatedData.eachGeometryColorsPortion)),eachGeometryUVsPortion:new Uint32Array(inflate(deflatedData.eachGeometryUVsPortion)),eachGeometryIndicesPortion:new Uint32Array(inflate(deflatedData.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(inflate(deflatedData.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(inflate(deflatedData.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(inflate(deflatedData.eachMeshMatricesPortion)),eachMeshTextureSet:new Int32Array(inflate(deflatedData.eachMeshTextureSet)),// Can be -1
|
|
25378
|
-
eachMeshMaterialAttributes:new Uint8Array(inflate(deflatedData.eachMeshMaterialAttributes)),eachEntityId:JSON.parse(pako.inflate(deflatedData.eachEntityId,{to:'string'})),eachEntityMeshesPortion:new Uint32Array(inflate(deflatedData.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(inflate(deflatedData.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(inflate(deflatedData.eachTileEntitiesPortion))};}var decompressColor=function(){var floatColor=new Float32Array(3);return function(intColor){floatColor[0]=intColor[0]/255.0;floatColor[1]=intColor[1]/255.0;floatColor[2]=intColor[2]/255.0;return floatColor;};}();(function(){var canvas=document.createElement('canvas');var context=canvas.getContext('2d');return function(imagedata){canvas.width=imagedata.width;canvas.height=imagedata.height;context.putImageData(imagedata,0,0);return canvas.toDataURL();};})();function load(viewer,options,inflatedData,sceneModel,metaModel,manifestCtx){var modelPartId=manifestCtx.getNextId();var metadata=inflatedData.metadata;var textureData=inflatedData.textureData;var eachTextureDataPortion=inflatedData.eachTextureDataPortion;var eachTextureAttributes=inflatedData.eachTextureAttributes;var positions=inflatedData.positions;var normals=inflatedData.normals;var colors=inflatedData.colors;var uvs=inflatedData.uvs;var indices=inflatedData.indices;var edgeIndices=inflatedData.edgeIndices;var eachTextureSetTextures=inflatedData.eachTextureSetTextures;var matrices=inflatedData.matrices;var reusedGeometriesDecodeMatrix=inflatedData.reusedGeometriesDecodeMatrix;var eachGeometryPrimitiveType=inflatedData.eachGeometryPrimitiveType;var eachGeometryPositionsPortion=inflatedData.eachGeometryPositionsPortion;var eachGeometryNormalsPortion=inflatedData.eachGeometryNormalsPortion;var eachGeometryColorsPortion=inflatedData.eachGeometryColorsPortion;var eachGeometryUVsPortion=inflatedData.eachGeometryUVsPortion;var eachGeometryIndicesPortion=inflatedData.eachGeometryIndicesPortion;var eachGeometryEdgeIndicesPortion=inflatedData.eachGeometryEdgeIndicesPortion;var eachMeshGeometriesPortion=inflatedData.eachMeshGeometriesPortion;var eachMeshMatricesPortion=inflatedData.eachMeshMatricesPortion;var eachMeshTextureSet=inflatedData.eachMeshTextureSet;var eachMeshMaterialAttributes=inflatedData.eachMeshMaterialAttributes;var eachEntityId=inflatedData.eachEntityId;var eachEntityMeshesPortion=inflatedData.eachEntityMeshesPortion;var eachTileAABB=inflatedData.eachTileAABB;var eachTileEntitiesPortion=inflatedData.eachTileEntitiesPortion;var numTextures=eachTextureDataPortion.length;var numTextureSets=eachTextureSetTextures.length/5;var numGeometries=eachGeometryPositionsPortion.length;var numMeshes=eachMeshGeometriesPortion.length;var numEntities=eachEntityMeshesPortion.length;var numTiles=eachTileEntitiesPortion.length;if(metaModel){metaModel.loadData(metadata);// Can be empty
|
|
25372
|
+
eachMeshMaterialAttributes:new Uint8Array(inflate(deflatedData.eachMeshMaterialAttributes)),eachEntityId:JSON.parse(pako.inflate(deflatedData.eachEntityId,{to:'string'})),eachEntityMeshesPortion:new Uint32Array(inflate(deflatedData.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(inflate(deflatedData.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(inflate(deflatedData.eachTileEntitiesPortion))};}var decompressColor=function(){var floatColor=new Float32Array(3);return function(intColor){floatColor[0]=intColor[0]/255.0;floatColor[1]=intColor[1]/255.0;floatColor[2]=intColor[2]/255.0;return floatColor;};}();(function(){var canvas=document.createElement('canvas');var context=canvas.getContext('2d');return function(imagedata){canvas.width=imagedata.width;canvas.height=imagedata.height;context.putImageData(imagedata,0,0);return canvas.toDataURL();};})();function load(viewer,options,inflatedData,sceneModel,metaModel,manifestCtx){var modelPartId=manifestCtx.getNextId();var metadata=inflatedData.metadata;var textureData=inflatedData.textureData;var eachTextureDataPortion=inflatedData.eachTextureDataPortion;var eachTextureAttributes=inflatedData.eachTextureAttributes;var positions=inflatedData.positions;var normals=inflatedData.normals;var colors=inflatedData.colors;var uvs=inflatedData.uvs;var indices=inflatedData.indices;var edgeIndices=inflatedData.edgeIndices;var eachTextureSetTextures=inflatedData.eachTextureSetTextures;var matrices=inflatedData.matrices;var reusedGeometriesDecodeMatrix=inflatedData.reusedGeometriesDecodeMatrix;var eachGeometryPrimitiveType=inflatedData.eachGeometryPrimitiveType;var eachGeometryPositionsPortion=inflatedData.eachGeometryPositionsPortion;var eachGeometryNormalsPortion=inflatedData.eachGeometryNormalsPortion;var eachGeometryColorsPortion=inflatedData.eachGeometryColorsPortion;var eachGeometryUVsPortion=inflatedData.eachGeometryUVsPortion;var eachGeometryIndicesPortion=inflatedData.eachGeometryIndicesPortion;var eachGeometryEdgeIndicesPortion=inflatedData.eachGeometryEdgeIndicesPortion;var eachMeshGeometriesPortion=inflatedData.eachMeshGeometriesPortion;var eachMeshMatricesPortion=inflatedData.eachMeshMatricesPortion;var eachMeshTextureSet=inflatedData.eachMeshTextureSet;var eachMeshMaterialAttributes=inflatedData.eachMeshMaterialAttributes;var eachEntityId=inflatedData.eachEntityId;var eachEntityMeshesPortion=inflatedData.eachEntityMeshesPortion;var eachTileAABB=inflatedData.eachTileAABB;var eachTileEntitiesPortion=inflatedData.eachTileEntitiesPortion;var numTextures=eachTextureDataPortion.length;var numTextureSets=eachTextureSetTextures.length/5;var numGeometries=eachGeometryPositionsPortion.length;var numMeshes=eachMeshGeometriesPortion.length;var numEntities=eachEntityMeshesPortion.length;var numTiles=eachTileEntitiesPortion.length;if(metaModel){metaModel.loadData(metadata,{includeTypes:options.includeTypes,excludeTypes:options.excludeTypes,globalizeObjectIds:options.globalizeObjectIds});// Can be empty
|
|
25379
25373
|
}// Create textures
|
|
25380
25374
|
for(var textureIndex=0;textureIndex<numTextures;textureIndex++){var atLastTexture=textureIndex===numTextures-1;var textureDataPortionStart=eachTextureDataPortion[textureIndex];var textureDataPortionEnd=atLastTexture?textureData.length:eachTextureDataPortion[textureIndex+1];var textureDataPortionSize=textureDataPortionEnd-textureDataPortionStart;var textureDataPortionExists=textureDataPortionSize>0;var textureAttrBaseIdx=textureIndex*NUM_TEXTURE_ATTRIBUTES;var compressed=eachTextureAttributes[textureAttrBaseIdx+0]===1;var mediaType=eachTextureAttributes[textureAttrBaseIdx+1];eachTextureAttributes[textureAttrBaseIdx+2];eachTextureAttributes[textureAttrBaseIdx+3];var minFilter=eachTextureAttributes[textureAttrBaseIdx+4];var magFilter=eachTextureAttributes[textureAttrBaseIdx+5];// LinearFilter | NearestFilter
|
|
25381
25375
|
var wrapS=eachTextureAttributes[textureAttrBaseIdx+6];// ClampToEdgeWrapping | MirroredRepeatWrapping | RepeatWrapping
|