mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-05 11:44:08 +02:00
Update engine.ts
This commit is contained in:
@@ -1333,8 +1333,13 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
public endGrabbing(cancel = false) {
|
public endGrabbing(cancel = false) {
|
||||||
if (this.grabbingCtx == null) return;
|
if (this.grabbingCtx == null) return;
|
||||||
|
|
||||||
//this.grabbing.ghost.dispose(false, true);
|
// 一度に子までdisposeしようとするとなぜか照明系の家具の場合エンジンがクラッシュする(消しちゃまずいものが子に混じっている?)ので、まず子からちびちび消していく
|
||||||
this.grabbingCtx.ghost.dispose(false, false);
|
//this.grabbingCtx.ghost.dispose(false, false);
|
||||||
|
for (const m of this.grabbingCtx.ghost.getChildMeshes()) {
|
||||||
|
m.dispose(true, false);
|
||||||
|
}
|
||||||
|
this.grabbingCtx.ghost.dispose(true, false);
|
||||||
|
|
||||||
if (cancel) {
|
if (cancel) {
|
||||||
this.grabbingCtx.onCancel?.();
|
this.grabbingCtx.onCancel?.();
|
||||||
} else {
|
} else {
|
||||||
@@ -1403,6 +1408,8 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private createGhost(mesh: BABYLON.Mesh): BABYLON.Mesh {
|
private createGhost(mesh: BABYLON.Mesh): BABYLON.Mesh {
|
||||||
|
// 対象のメッシュの子に、「子にlightを持つメッシュ」が含まれているとエンジンがクラッシュするので、とりあえず適当なメッシュを使う
|
||||||
|
/*
|
||||||
const ghost = mesh.clone('ghost', null, false)!;
|
const ghost = mesh.clone('ghost', null, false)!;
|
||||||
ghost.metadata = { isGhost: true };
|
ghost.metadata = { isGhost: true };
|
||||||
ghost.checkCollisions = false;
|
ghost.checkCollisions = false;
|
||||||
@@ -1442,6 +1449,13 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ghost;
|
||||||
|
*/
|
||||||
|
|
||||||
|
const ghost = new BABYLON.Mesh('ghost', this.scene);
|
||||||
|
ghost.metadata = { isGhost: true };
|
||||||
|
ghost.checkCollisions = false;
|
||||||
|
|
||||||
return ghost;
|
return ghost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user