@xeokit/xeokit-sdk 2.4.0-alpha-82 → 2.4.0-alpha-83

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.
@@ -121108,7 +121108,11 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
121108
121108
  const numTiles = eachTileEntitiesPortion.length;
121109
121109
 
121110
121110
  if (metaModel) {
121111
- metaModel.loadData(metadata); // Can be empty
121111
+ metaModel.loadData(metadata, {
121112
+ includeTypes: options.includeTypes,
121113
+ excludeTypes: options.excludeTypes,
121114
+ globalizeObjectIds: options.globalizeObjectIds
121115
+ }); // Can be empty
121112
121116
  }
121113
121117
 
121114
121118
  // Count instances of each geometry
@@ -121104,7 +121104,11 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
121104
121104
  const numTiles = eachTileEntitiesPortion.length;
121105
121105
 
121106
121106
  if (metaModel) {
121107
- metaModel.loadData(metadata); // Can be empty
121107
+ metaModel.loadData(metadata, {
121108
+ includeTypes: options.includeTypes,
121109
+ excludeTypes: options.excludeTypes,
121110
+ globalizeObjectIds: options.globalizeObjectIds
121111
+ }); // Can be empty
121108
121112
  }
121109
121113
 
121110
121114
  // Count instances of each geometry
@@ -25361,7 +25361,7 @@ metadata:elements[0],positions:elements[1],normals:elements[2],colors:elements[3
25361
25361
  matrices:elements[6],reusedGeometriesDecodeMatrix:elements[7],// Geometries
25362
25362
  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
25363
  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
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,{includeTypes:options.includeTypes,excludeTypes:options.excludeTypes,globalizeObjectIds:options.globalizeObjectIds});// Can be empty
25365
25365
  }// Count instances of each geometry
25366
25366
  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
25367
  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