1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-06-02 04:24:17 +02:00

Update engine.ts

This commit is contained in:
syuilo
2026-04-20 20:50:52 +09:00
parent 2040827615
commit b7b3c07a96

View File

@@ -58,6 +58,10 @@ function mergeMeshes(meshes: BABYLON.Mesh[], root: BABYLON.Mesh, hasTexture: boo
} }
} }
if (toMerge.length <= 1) {
return null;
}
for (const mesh of toMerge) { for (const mesh of toMerge) {
if (hasTexture) { if (hasTexture) {
if (mesh.getVerticesData(BABYLON.VertexBuffer.UVKind) == null) { if (mesh.getVerticesData(BABYLON.VertexBuffer.UVKind) == null) {
@@ -802,6 +806,7 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
if (def.canPreMeshesMerging) { if (def.canPreMeshesMerging) {
const merged = mergeMeshes(loaderResult.meshes, subRoot, def.hasTexture); const merged = mergeMeshes(loaderResult.meshes, subRoot, def.hasTexture);
if (merged != null) {
merged.setParent(subRoot); merged.setParent(subRoot);
merged.name = 'preMerged'; merged.name = 'preMerged';
merged.material.freeze(); merged.material.freeze();
@@ -818,6 +823,7 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
} }
} }
} }
}
if (BAKE_TRANSFORM) { if (BAKE_TRANSFORM) {
subRoot.scaling = new BABYLON.Vector3(1, 1, 1); subRoot.scaling = new BABYLON.Vector3(1, 1, 1);