diff --git a/src/Core/Camera.ts b/src/Core/Camera.ts index fcd30201..cb1d375d 100644 --- a/src/Core/Camera.ts +++ b/src/Core/Camera.ts @@ -230,7 +230,7 @@ class Camera { * Update the distance. */ updateDistance() { - this.distance = this.getThreeCamera().position.distanceTo(this.targetPosition); + this.getThreeCamera().position.normalize().multiplyScalar(this.distance); } /** diff --git a/src/Core/Land.ts b/src/Core/Land.ts index 910b8f44..2c469a38 100644 --- a/src/Core/Land.ts +++ b/src/Core/Land.ts @@ -123,7 +123,7 @@ export class Land extends MapElement { objCollision = { p: position, l: localPosition, - b: [a + rect.x, b + 0.5, c + rect.y, rect.width, rect.height, 1, 0], + b: [a + rect.x + rect.width / 2 - Data.Systems.SQUARE_SIZE / 2, b + 0.5, c + rect.y + rect.height / 2 - Data.Systems.SQUARE_SIZE / 2, rect.width, rect.height, 1, 0], cs: null, }; }