mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-22 01:05:40 +02:00
wall snap
This commit is contained in:
@@ -606,7 +606,6 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
const hit = this.scene.pickWithRay(ray, (m) => isCollisionTarget(m) && (m.name.includes('__ROOM_WALL__') || m.name.includes('__SIDE__')));
|
const hit = this.scene.pickWithRay(ray, (m) => isCollisionTarget(m) && (m.name.includes('__ROOM_WALL__') || m.name.includes('__SIDE__')));
|
||||||
if (hit != null && hit.pickedPoint != null && hit.pickedMesh != null) {
|
if (hit != null && hit.pickedPoint != null && hit.pickedMesh != null) {
|
||||||
newPos.x = hit.pickedPoint.x;
|
newPos.x = hit.pickedPoint.x;
|
||||||
newPos.y = hit.pickedPoint.y;
|
|
||||||
newPos.z = hit.pickedPoint.z;
|
newPos.z = hit.pickedPoint.z;
|
||||||
const pickedMeshNormal = hit.getNormal(true, true);
|
const pickedMeshNormal = hit.getNormal(true, true);
|
||||||
const targetRotationY = Math.atan2(pickedMeshNormal.x, pickedMeshNormal.z);
|
const targetRotationY = Math.atan2(pickedMeshNormal.x, pickedMeshNormal.z);
|
||||||
@@ -627,7 +626,6 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
const hit = this.scene.pickWithRay(ray, (m) => isCollisionTarget(m) && (m.name.includes('__ROOM_WALL__')));
|
const hit = this.scene.pickWithRay(ray, (m) => isCollisionTarget(m) && (m.name.includes('__ROOM_WALL__')));
|
||||||
if (hit != null && hit.pickedPoint != null && hit.pickedMesh != null) {
|
if (hit != null && hit.pickedPoint != null && hit.pickedMesh != null) {
|
||||||
newPos.x = hit.pickedPoint.x;
|
newPos.x = hit.pickedPoint.x;
|
||||||
newPos.y = hit.pickedPoint.y;
|
|
||||||
newPos.z = hit.pickedPoint.z;
|
newPos.z = hit.pickedPoint.z;
|
||||||
const pickedMeshNormal = hit.getNormal(true, true);
|
const pickedMeshNormal = hit.getNormal(true, true);
|
||||||
const targetRotationY = Math.atan2(pickedMeshNormal.x, pickedMeshNormal.z);
|
const targetRotationY = Math.atan2(pickedMeshNormal.x, pickedMeshNormal.z);
|
||||||
|
|||||||
Reference in New Issue
Block a user