Spaces:
Running
Running
cutechicken
commited on
Commit
โข
c3185e4
1
Parent(s):
accbf92
Update game.js
Browse files
game.js
CHANGED
@@ -374,8 +374,8 @@ class Game {
|
|
374 |
}
|
375 |
|
376 |
// FPS ์นด๋ฉ๋ผ ์ค์
|
377 |
-
this.camera.position.set(
|
378 |
-
this.
|
379 |
|
380 |
// ๋ก๋ฉ ์๋ฃ
|
381 |
this.isLoading = false;
|
@@ -465,9 +465,10 @@ class Game {
|
|
465 |
|
466 |
// ์นด๋ฉ๋ผ์ ํฑํฌ ๋๊ธฐํ
|
467 |
const tankPos = this.tank.getPosition();
|
468 |
-
|
469 |
-
this.
|
470 |
-
this.camera.position.
|
|
|
471 |
|
472 |
// ํฌํ ํ์ ์ ์นด๋ฉ๋ผ์ ๋๊ธฐํ
|
473 |
if (this.tank.turret) {
|
|
|
374 |
}
|
375 |
|
376 |
// FPS ์นด๋ฉ๋ผ ์ค์
|
377 |
+
this.camera.position.set(-15, 10, -15);
|
378 |
+
this.camera.lookAt(new THREE.Vector3(0, 0, 0));
|
379 |
|
380 |
// ๋ก๋ฉ ์๋ฃ
|
381 |
this.isLoading = false;
|
|
|
465 |
|
466 |
// ์นด๋ฉ๋ผ์ ํฑํฌ ๋๊ธฐํ
|
467 |
const tankPos = this.tank.getPosition();
|
468 |
+
const cameraOffset = new THREE.Vector3(-15, 10, -15);
|
469 |
+
cameraOffset.applyQuaternion(this.tank.body.quaternion);
|
470 |
+
this.camera.position.copy(tankPos).add(cameraOffset);
|
471 |
+
this.camera.lookAt(tankPos);
|
472 |
|
473 |
// ํฌํ ํ์ ์ ์นด๋ฉ๋ผ์ ๋๊ธฐํ
|
474 |
if (this.tank.turret) {
|