From b1bb07542a1c70803652e654b9b89e0f51728c66 Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Mon, 16 Feb 2026 12:14:54 +0900 Subject: [PATCH] Update engine.ts --- packages/frontend/src/utility/room/engine.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/utility/room/engine.ts b/packages/frontend/src/utility/room/engine.ts index 67df1874fd..6d535eb91f 100644 --- a/packages/frontend/src/utility/room/engine.ts +++ b/packages/frontend/src/utility/room/engine.ts @@ -613,8 +613,25 @@ export class RoomEngine { this.def.objects.find(o => o.id === grabbing.objectId)!.sticky = null; } - grabbing.mesh.position = newPos; grabbing.mesh.rotation = newRotation; + grabbing.mesh.position = newPos; + + //const pos = new BABYLON.Vector3(this.camera.position.x, this.camera.position.y, this.camera.position.z); + //const _dir = newPos.subtract(pos).normalize(); + //for (let i = 0; i < grabbing.distance; i++) { + // // posを1cmずつnewPosの方向に動かす + // pos.addInPlace(_dir.scale(1/*cm*/)); + // // 前方に向かってレイを飛ばして衝突チェック + // const ray = new BABYLON.Ray(this.camera.position, dir, i); + // const hit = this.scene.pickWithRay(ray, (m) => isCollisionTarget(m)); + // if (hit != null && hit.pickedPoint != null && hit.pickedMesh != null) { + // //const isCollided = grabbing.mesh.intersectsMesh(hit.pickedMesh, false); + // //if (isCollided) { + // break; + // //} + // } + // grabbing.mesh.position = pos.clone(); + //} //const ray = new BABYLON.Ray(this.camera.position, this.camera.getDirection(BABYLON.Axis.Z), 1000/*cm*/); //const hit = this.scene.pickWithRay(ray, (m) => m.name.includes('__COLLISION_WALL__'))!;