Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Aug 9, 2022
1 parent 32369c0 commit 1fc9d02
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 39 deletions.
40 changes: 21 additions & 19 deletions dist/convert2xkt.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -25387,28 +25387,13 @@ function getModelData(xktModel, stats) {
data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.occlusionTexture ? textureSet.occlusionTexture.textureIndex : -1; // Occlusion map
}

// Meshes

for (let meshIndex = 0, matricesIndex = 0, eachMeshMaterialAttributesIndex = 0; meshIndex < numMeshes; meshIndex++) {
const mesh = meshesList [meshIndex];
if (mesh.geometry.numInstances > 1) {
data.matrices.set(mesh.matrix, matricesIndex);
data.eachMeshMatricesPortion [meshIndex] = matricesIndex;
matricesIndex += 16;
}
data.eachMeshTextureSet[meshIndex] = mesh.textureSet ? mesh.textureSet.textureSetIndex : -1;
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[0] * 255); // Color RGB
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[1] * 255);
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[2] * 255);
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.opacity * 255); // Opacity
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.metallic * 255); // Metallic
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.roughness * 255); // Roughness
}

// Entities, geometry instances, and tiles
// Tiles -> Entities -> Meshes

let entityIndex = 0;
let countEntityMeshesPortion = 0;
let eachMeshMaterialAttributesIndex = 0;
let matricesIndex = 0;
let meshIndex= 0;

for (let tileIndex = 0; tileIndex < numTiles; tileIndex++) {

Expand Down Expand Up @@ -25437,6 +25422,23 @@ function getModelData(xktModel, stats) {
const geometryIndex = geometry.geometryIndex;

data.eachMeshGeometriesPortion [countEntityMeshesPortion + k] = geometryIndex;

if (mesh.geometry.numInstances > 1) {
data.matrices.set(mesh.matrix, matricesIndex);
data.eachMeshMatricesPortion [meshIndex] = matricesIndex;
matricesIndex += 16;
}

data.eachMeshTextureSet[meshIndex] = mesh.textureSet ? mesh.textureSet.textureSetIndex : -1;

data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[0] * 255); // Color RGB
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[1] * 255);
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[2] * 255);
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.opacity * 255); // Opacity
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.metallic * 255); // Metallic
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.roughness * 255); // Roughness

meshIndex++;
}

data.eachEntityId [entityIndex] = entity.entityId;
Expand Down
2 changes: 1 addition & 1 deletion dist/xeokit-convert.cjs.js

Large diffs are not rendered by default.

40 changes: 21 additions & 19 deletions dist/xeokit-convert.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -17273,28 +17273,13 @@ function getModelData(xktModel, stats) {
data.eachTextureSetTextures[eachTextureSetTexturesIndex++] = textureSet.occlusionTexture ? textureSet.occlusionTexture.textureIndex : -1; // Occlusion map
}

// Meshes

for (let meshIndex = 0, matricesIndex = 0, eachMeshMaterialAttributesIndex = 0; meshIndex < numMeshes; meshIndex++) {
const mesh = meshesList [meshIndex];
if (mesh.geometry.numInstances > 1) {
data.matrices.set(mesh.matrix, matricesIndex);
data.eachMeshMatricesPortion [meshIndex] = matricesIndex;
matricesIndex += 16;
}
data.eachMeshTextureSet[meshIndex] = mesh.textureSet ? mesh.textureSet.textureSetIndex : -1;
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[0] * 255); // Color RGB
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[1] * 255);
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[2] * 255);
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.opacity * 255); // Opacity
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.metallic * 255); // Metallic
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.roughness * 255); // Roughness
}

// Entities, geometry instances, and tiles
// Tiles -> Entities -> Meshes

let entityIndex = 0;
let countEntityMeshesPortion = 0;
let eachMeshMaterialAttributesIndex = 0;
let matricesIndex = 0;
let meshIndex= 0;

for (let tileIndex = 0; tileIndex < numTiles; tileIndex++) {

Expand Down Expand Up @@ -17323,6 +17308,23 @@ function getModelData(xktModel, stats) {
const geometryIndex = geometry.geometryIndex;

data.eachMeshGeometriesPortion [countEntityMeshesPortion + k] = geometryIndex;

if (mesh.geometry.numInstances > 1) {
data.matrices.set(mesh.matrix, matricesIndex);
data.eachMeshMatricesPortion [meshIndex] = matricesIndex;
matricesIndex += 16;
}

data.eachMeshTextureSet[meshIndex] = mesh.textureSet ? mesh.textureSet.textureSetIndex : -1;

data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[0] * 255); // Color RGB
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[1] * 255);
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.color[2] * 255);
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.opacity * 255); // Opacity
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.metallic * 255); // Metallic
data.eachMeshMaterialAttributes[eachMeshMaterialAttributesIndex++] = (mesh.roughness * 255); // Roughness

meshIndex++;
}

data.eachEntityId [entityIndex] = entity.entityId;
Expand Down

0 comments on commit 1fc9d02

Please sign in to comment.