@babylonjs/core 8.49.0 → 8.49.2
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/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +7 -5
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/geometry.js +15 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.js +23 -21
- package/Meshes/mesh.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +2 -2
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/package.json +1 -1
package/Meshes/mesh.js
CHANGED
|
@@ -4007,41 +4007,43 @@ export class Mesh extends AbstractMesh {
|
|
|
4007
4007
|
Logger.Warn("Cannot merge meshes with different sideOrientation values.");
|
|
4008
4008
|
return null;
|
|
4009
4009
|
}
|
|
4010
|
-
if (subdivideWithSubMeshes) {
|
|
4011
|
-
indiceArray.push({ start: 0, count: mesh.getTotalIndices() });
|
|
4012
|
-
}
|
|
4013
|
-
if (multiMultiMaterials) {
|
|
4010
|
+
if (subdivideWithSubMeshes || multiMultiMaterials) {
|
|
4014
4011
|
const indexOffset = indiceArray.reduce((accumulator, currentValue) => {
|
|
4015
4012
|
return Math.max(accumulator, currentValue.start + currentValue.count);
|
|
4016
4013
|
}, 0);
|
|
4017
|
-
if (
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
materialArray.
|
|
4014
|
+
if (multiMultiMaterials) {
|
|
4015
|
+
if (mesh.material) {
|
|
4016
|
+
const material = mesh.material;
|
|
4017
|
+
if (material instanceof MultiMaterial) {
|
|
4018
|
+
for (let matIndex = 0; matIndex < material.subMaterials.length; matIndex++) {
|
|
4019
|
+
if (materialArray.indexOf(material.subMaterials[matIndex]) < 0) {
|
|
4020
|
+
materialArray.push(material.subMaterials[matIndex]);
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
for (let subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
|
|
4024
|
+
materialIndexArray.push(materialArray.indexOf(material.subMaterials[mesh.subMeshes[subIndex].materialIndex]));
|
|
4025
|
+
indiceArray.push({ start: indexOffset + mesh.subMeshes[subIndex].indexStart, count: mesh.subMeshes[subIndex].indexCount });
|
|
4023
4026
|
}
|
|
4024
4027
|
}
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
+
else {
|
|
4029
|
+
if (materialArray.indexOf(material) < 0) {
|
|
4030
|
+
materialArray.push(material);
|
|
4031
|
+
}
|
|
4032
|
+
for (let subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
|
|
4033
|
+
materialIndexArray.push(materialArray.indexOf(material));
|
|
4034
|
+
indiceArray.push({ start: indexOffset + mesh.subMeshes[subIndex].indexStart, count: mesh.subMeshes[subIndex].indexCount });
|
|
4035
|
+
}
|
|
4028
4036
|
}
|
|
4029
4037
|
}
|
|
4030
4038
|
else {
|
|
4031
|
-
if (materialArray.indexOf(material) < 0) {
|
|
4032
|
-
materialArray.push(material);
|
|
4033
|
-
}
|
|
4034
4039
|
for (let subIndex = 0; subIndex < mesh.subMeshes.length; subIndex++) {
|
|
4035
|
-
materialIndexArray.push(
|
|
4040
|
+
materialIndexArray.push(0);
|
|
4036
4041
|
indiceArray.push({ start: indexOffset + mesh.subMeshes[subIndex].indexStart, count: mesh.subMeshes[subIndex].indexCount });
|
|
4037
4042
|
}
|
|
4038
4043
|
}
|
|
4039
4044
|
}
|
|
4040
4045
|
else {
|
|
4041
|
-
|
|
4042
|
-
materialIndexArray.push(0);
|
|
4043
|
-
indiceArray.push({ start: indexOffset + mesh.subMeshes[subIndex].indexStart, count: mesh.subMeshes[subIndex].indexCount });
|
|
4044
|
-
}
|
|
4046
|
+
indiceArray.push({ start: indexOffset, count: mesh.getTotalIndices() });
|
|
4045
4047
|
}
|
|
4046
4048
|
}
|
|
4047
4049
|
}
|