1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-24 11:34:10 +02:00

Update engine.ts

This commit is contained in:
syuilo
2026-04-04 21:54:26 +09:00
parent fdd360f490
commit ca49618fdb

View File

@@ -378,7 +378,7 @@ export class RoomEngine {
private grabbingCtx: { private grabbingCtx: {
objectId: string; objectId: string;
objectType: string; objectType: string;
mesh: BABYLON.Mesh; mesh: BABYLON.TransformNode;
originalDiffOfPosition: BABYLON.Vector3; originalDiffOfPosition: BABYLON.Vector3;
originalDiffOfRotationY: number; originalDiffOfRotationY: number;
distance: number; distance: number;
@@ -1285,14 +1285,16 @@ export class RoomEngine {
private createGhost(mesh: BABYLON.Mesh): BABYLON.Mesh { private createGhost(mesh: BABYLON.Mesh): BABYLON.Mesh {
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;
for (const m of ghost.getChildMeshes()) {
m.metadata = { isGhost: true };
m.checkCollisions = false;
}
/* なんかエラーになる /* なんかエラーになる
const materials = new WeakMap<BABYLON.Material, BABYLON.Material>(); const materials = new WeakMap<BABYLON.Material, BABYLON.Material>();
for (const m of ghost.getChildMeshes() as BABYLON.Mesh[]) { for (const m of ghost.getChildMeshes() as BABYLON.Mesh[]) {
m.metadata = { isGhost: true };
m.checkCollisions = false;
if (m.material == null) continue; if (m.material == null) continue;
if (materials.has(m.material)) { if (materials.has(m.material)) {
@@ -1347,6 +1349,11 @@ export class RoomEngine {
options, options,
}); });
root.unfreezeWorldMatrix();
for (const m of root.getChildMeshes()) {
m.unfreezeWorldMatrix();
}
const ghost = this.createGhost(root); const ghost = this.createGhost(root);
let sticky: string | null; let sticky: string | null;