This commit is contained in:
syuilo 2026-05-21 21:23:05 +09:00
commit 73d6764a0b
13 changed files with 19 additions and 3 deletions

View file

@ -243,6 +243,7 @@ export class ObjectContainer {
this.model = null;
this.subRoot?.dispose();
this.root.removeChild(this.subRoot);
this.scene.removeTransformNode(this.subRoot);
this.timer = new Timer();
@ -263,10 +264,12 @@ export class ObjectContainer {
}
public destroy() {
this.sr.disableSnapshotRendering();
this.timer.dispose();
this.instance?.dispose?.();
this.subRoot?.dispose();
this.root.dispose(true);
this.subRoot.dispose();
this.root.dispose();
this.scene.removeTransformNode(this.root);
this.sr.enableSnapshotRendering();
}
}

View file

@ -145,6 +145,7 @@ export const allInOnePc = defineObject({
dispose: () => {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
},
};
},

View file

@ -33,6 +33,7 @@ export const beamLamp = defineObject({
dispose: () => {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
},
};
},

View file

@ -134,6 +134,8 @@ export const desktopPc = defineObject({
lc.removeLight(light1);
lc.removeLight(light2);
}
scene.removeLight(light1); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
scene.removeLight(light2); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
},
};
},

View file

@ -130,6 +130,7 @@ export const ductRailSpotLights = defineObject({
for (const light of lights) {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
}
},
};

View file

@ -170,6 +170,7 @@ export const laptopPc = defineObject({
dispose: () => {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
},
};
},

View file

@ -157,6 +157,7 @@ export const lavaLamp = defineObject({
dispose: () => {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
if (animationObserver != null) {
scene.onAfterAnimationsObservable.remove(animationObserver);
}

View file

@ -133,6 +133,7 @@ export const monitor = defineObject({
dispose: () => {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
},
};
},

View file

@ -115,6 +115,7 @@ export const spotLight = defineObject({
dispose: () => {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
},
};
},

View file

@ -99,6 +99,7 @@ export const tv = defineObject({
dispose: () => {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
},
};
},

View file

@ -116,6 +116,7 @@ export const wallMountSpotLight = defineObject({
dispose: () => {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
},
};
},

View file

@ -109,8 +109,9 @@ export const woodRingFloorLamp = defineObject({
for (const light of lights) {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
}
}
},
};
},
});

View file

@ -129,6 +129,7 @@ export const woodRingsPendantLight = defineObject({
dispose: () => {
light.dispose();
if (lc != null) lc.removeLight(light);
scene.removeLight(light); // lc使用時はsceneには追加してないはずだが、これがないとクラッシュする babylonのバグ
},
};
},