Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Sep 6, 2024
1 parent 167efe1 commit 9a323a8
Show file tree
Hide file tree
Showing 9 changed files with 39,897 additions and 37,567 deletions.
30 changes: 21 additions & 9 deletions dist/convert2xkt.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -16135,6 +16135,7 @@ function parseGLTFIntoXKTModel({
includeTextures: (includeTextures !== false),
geometryCreated: {},
nextId: 0,
geometriesCreated : {},
stats
};

Expand Down Expand Up @@ -16423,7 +16424,7 @@ function parseScene(ctx, scene) {
}
}

function countMeshUsage(ctx, node, level=0) {
function countMeshUsage(ctx, node, level = 0) {
if (!node) {
return;
}
Expand All @@ -16439,12 +16440,12 @@ function countMeshUsage(ctx, node, level=0) {
ctx.error("Node not found: " + i);
continue;
}
countMeshUsage(ctx, childNode, level+1);
countMeshUsage(ctx, childNode, level + 1);
}
}
}

function testIfNodesHaveNames(node, level=0) {
function testIfNodesHaveNames(node, level = 0) {
if (!node) {
return;
}
Expand All @@ -16455,7 +16456,7 @@ function testIfNodesHaveNames(node, level=0) {
const children = node.children;
for (let i = 0, len = children.length; i < len; i++) {
const childNode = children[i];
if (testIfNodesHaveNames(childNode, level+1)) {
if (testIfNodesHaveNames(childNode, level + 1)) {
return true;
}
}
Expand Down Expand Up @@ -16609,6 +16610,17 @@ function parseNodeMatrix(node, matrix) {
return matrix;
}

function createPrimitiveHash(primitive) {
const hash = [];
const attributes = primitive.attributes;
if (attributes) {
for (let key in attributes) {
hash.push(attributes[key].id);
}
}
return hash.join(".");
}

/**
* Parses primitives referenced by the mesh belonging to the given node, creating XKTMeshes in the XKTModel.
*
Expand All @@ -16630,10 +16642,10 @@ function parseNodeMesh(node, ctx, matrix, meshIds) {
for (let i = 0; i < numPrimitives; i++) {
try {
const primitive = mesh.primitives[i];
if (!primitive._xktGeometryId) {
const xktGeometryId = "geometry-" + ctx.nextId++;
const geometryId = createPrimitiveHash(primitive);
if (!ctx.geometriesCreated[geometryId]) {
const geometryCfg = {
geometryId: xktGeometryId
geometryId
};
switch (primitive.mode) {
case 0: // POINTS
Expand Down Expand Up @@ -16688,13 +16700,13 @@ function parseNodeMesh(node, ctx, matrix, meshIds) {
}
}
ctx.xktModel.createGeometry(geometryCfg);
primitive._xktGeometryId = xktGeometryId;
ctx.geometriesCreated[geometryId] = true;
ctx.stats.numGeometries++;
}
const xktMeshId = ctx.nextId++;
const meshCfg = {
meshId: xktMeshId,
geometryId: primitive._xktGeometryId,
geometryId,
matrix: matrix ? matrix.slice() : math.identityMat4()
};
const material = primitive.material;
Expand Down
21 changes: 16 additions & 5 deletions dist/xeokit-convert.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10461,6 +10461,7 @@ function parseGLTFIntoXKTModel(_ref) {
includeTextures: includeTextures !== false,
geometryCreated: {},
nextId: 0,
geometriesCreated: {},
stats: stats
};
ctx.log("Using parser: parseGLTFIntoXKTModel");
Expand Down Expand Up @@ -10914,6 +10915,16 @@ function parseNodeMatrix(node, matrix) {
}
return matrix;
}
function createPrimitiveHash(primitive) {
var hash = [];
var attributes = primitive.attributes;
if (attributes) {
for (var key in attributes) {
hash.push(attributes[key].id);
}
}
return hash.join(".");
}

/**
* Parses primitives referenced by the mesh belonging to the given node, creating XKTMeshes in the XKTModel.
Expand All @@ -10936,10 +10947,10 @@ function parseNodeMesh(node, ctx, matrix, meshIds) {
for (var i = 0; i < numPrimitives; i++) {
try {
var primitive = mesh.primitives[i];
if (!primitive._xktGeometryId) {
var xktGeometryId = "geometry-" + ctx.nextId++;
var geometryId = createPrimitiveHash(primitive);
if (!ctx.geometriesCreated[geometryId]) {
var geometryCfg = {
geometryId: xktGeometryId
geometryId: geometryId
};
switch (primitive.mode) {
case 0:
Expand Down Expand Up @@ -11001,13 +11012,13 @@ function parseNodeMesh(node, ctx, matrix, meshIds) {
}
}
ctx.xktModel.createGeometry(geometryCfg);
primitive._xktGeometryId = xktGeometryId;
ctx.geometriesCreated[geometryId] = true;
ctx.stats.numGeometries++;
}
var xktMeshId = ctx.nextId++;
var meshCfg = {
meshId: xktMeshId,
geometryId: primitive._xktGeometryId,
geometryId: geometryId,
matrix: matrix ? matrix.slice() : _lib_math_js__WEBPACK_IMPORTED_MODULE_1__.math.identityMat4()
};
var material = primitive.material;
Expand Down
2 changes: 1 addition & 1 deletion dist/xeokit-convert.cjs.js.map

Large diffs are not rendered by default.

30 changes: 21 additions & 9 deletions dist/xeokit-convert.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -23492,6 +23492,7 @@ function parseGLTFIntoXKTModel({
includeTextures: (includeTextures !== false),
geometryCreated: {},
nextId: 0,
geometriesCreated : {},
stats
};

Expand Down Expand Up @@ -23780,7 +23781,7 @@ function parseScene$1(ctx, scene) {
}
}

function countMeshUsage(ctx, node, level=0) {
function countMeshUsage(ctx, node, level = 0) {
if (!node) {
return;
}
Expand All @@ -23796,12 +23797,12 @@ function countMeshUsage(ctx, node, level=0) {
ctx.error("Node not found: " + i);
continue;
}
countMeshUsage(ctx, childNode, level+1);
countMeshUsage(ctx, childNode, level + 1);
}
}
}

function testIfNodesHaveNames(node, level=0) {
function testIfNodesHaveNames(node, level = 0) {
if (!node) {
return;
}
Expand All @@ -23812,7 +23813,7 @@ function testIfNodesHaveNames(node, level=0) {
const children = node.children;
for (let i = 0, len = children.length; i < len; i++) {
const childNode = children[i];
if (testIfNodesHaveNames(childNode, level+1)) {
if (testIfNodesHaveNames(childNode, level + 1)) {
return true;
}
}
Expand Down Expand Up @@ -23966,6 +23967,17 @@ function parseNodeMatrix(node, matrix) {
return matrix;
}

function createPrimitiveHash(primitive) {
const hash = [];
const attributes = primitive.attributes;
if (attributes) {
for (let key in attributes) {
hash.push(attributes[key].id);
}
}
return hash.join(".");
}

/**
* Parses primitives referenced by the mesh belonging to the given node, creating XKTMeshes in the XKTModel.
*
Expand All @@ -23987,10 +23999,10 @@ function parseNodeMesh(node, ctx, matrix, meshIds) {
for (let i = 0; i < numPrimitives; i++) {
try {
const primitive = mesh.primitives[i];
if (!primitive._xktGeometryId) {
const xktGeometryId = "geometry-" + ctx.nextId++;
const geometryId = createPrimitiveHash(primitive);
if (!ctx.geometriesCreated[geometryId]) {
const geometryCfg = {
geometryId: xktGeometryId
geometryId
};
switch (primitive.mode) {
case 0: // POINTS
Expand Down Expand Up @@ -24045,13 +24057,13 @@ function parseNodeMesh(node, ctx, matrix, meshIds) {
}
}
ctx.xktModel.createGeometry(geometryCfg);
primitive._xktGeometryId = xktGeometryId;
ctx.geometriesCreated[geometryId] = true;
ctx.stats.numGeometries++;
}
const xktMeshId = ctx.nextId++;
const meshCfg = {
meshId: xktMeshId,
geometryId: primitive._xktGeometryId,
geometryId,
matrix: matrix ? matrix.slice() : math.identityMat4()
};
const material = primitive.material;
Expand Down
Loading

0 comments on commit 9a323a8

Please sign in to comment.