cutechicken commited on
Commit
f609e63
ยท
verified ยท
1 Parent(s): a480ae2

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +11 -3
game.js CHANGED
@@ -590,9 +590,17 @@ class Fighter {
590
 
591
  // ๋ฉ”์‹œ ์œ„์น˜ ๋ฐ ํšŒ์ „ ์—…๋ฐ์ดํŠธ
592
  this.mesh.position.copy(this.position);
593
- this.mesh.rotation.x = this.rotation.x;
594
- this.mesh.rotation.y = this.rotation.y + 3 * Math.PI / 2;
595
- this.mesh.rotation.z = this.rotation.z;
 
 
 
 
 
 
 
 
596
 
597
  // ๊ฒฝ๊ณ  ๊นœ๋นก์ž„ ํƒ€์ด๋จธ
598
  this.warningBlinkTimer += deltaTime;
 
590
 
591
  // ๋ฉ”์‹œ ์œ„์น˜ ๋ฐ ํšŒ์ „ ์—…๋ฐ์ดํŠธ
592
  this.mesh.position.copy(this.position);
593
+
594
+ // ์ง๋ฒŒ ๋ฝ์„ ํ”ผํ•˜๊ธฐ ์œ„ํ•ด ์ฟผํ„ฐ๋‹ˆ์–ธ์œผ๋กœ ํšŒ์ „ ์ ์šฉ
595
+ const tempQuaternion = new THREE.Quaternion();
596
+ const rotationEuler = new THREE.Euler(
597
+ this.rotation.x,
598
+ this.rotation.y + 3 * Math.PI / 2,
599
+ this.rotation.z,
600
+ 'YXZ' // ์˜ค์ผ๋Ÿฌ ์ˆœ์„œ ๋ณ€๊ฒฝ์œผ๋กœ ์ง๋ฒŒ ๋ฝ ๋ฐฉ์ง€
601
+ );
602
+ tempQuaternion.setFromEuler(rotationEuler);
603
+ this.mesh.quaternion.copy(tempQuaternion);
604
 
605
  // ๊ฒฝ๊ณ  ๊นœ๋นก์ž„ ํƒ€์ด๋จธ
606
  this.warningBlinkTimer += deltaTime;