cutechicken commited on
Commit
826b2b8
ยท
verified ยท
1 Parent(s): 62b3ee2

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +16 -10
index.html CHANGED
@@ -632,10 +632,12 @@
632
  }
633
 
634
  updateMouseInput(deltaX, deltaY) {
635
- // ์›Œ์ฌ๋” ์Šคํƒ€์ผ: ๋งˆ์šฐ์Šค X์ถ• -> ๋กค(๋‚ ๊ฐœ ๊ธฐ์šธ์ด๊ธฐ), Y์ถ• -> ํ”ผ์น˜
636
  const sensitivity = GAME_CONSTANTS.MOUSE_SENSITIVITY * 2.0;
637
 
638
- // X์ถ• (์ขŒ/์šฐ) -> ๋กค (๋‚ ๊ฐœ ๊ธฐ์šธ์ด๊ธฐ)
 
 
639
  this.targetRoll += deltaX * sensitivity;
640
 
641
  // Y์ถ• (์œ„/์•„๋ž˜) -> ํ”ผ์น˜ (๊ธฐ์ˆ˜ ์ƒํ•˜)
@@ -643,7 +645,7 @@
643
 
644
  // ๊ฐ๋„ ์ œํ•œ
645
  const maxPitchAngle = Math.PI / 3; // 60๋„
646
- const maxRollAngle = Math.PI * 0.75; // 135๋„ (์™„์ „ ๋’ค์ง‘๊ธฐ๋Š” ๋ถˆ๊ฐ€)
647
 
648
  this.targetPitch = Math.max(-maxPitchAngle, Math.min(maxPitchAngle, this.targetPitch));
649
  this.targetRoll = Math.max(-maxRollAngle, Math.min(maxRollAngle, this.targetRoll));
@@ -673,14 +675,18 @@
673
  // ๋ถ€๋“œ๋Ÿฌ์šด ํšŒ์ „ ๋ณด๊ฐ„
674
  const rotationSpeed = deltaTime * 3.0;
675
  this.rotation.x = THREE.MathUtils.lerp(this.rotation.x, this.targetPitch, rotationSpeed);
676
- this.rotation.y = THREE.MathUtils.lerp(this.rotation.y, this.targetYaw, rotationSpeed);
677
  this.rotation.z = THREE.MathUtils.lerp(this.rotation.z, this.targetRoll, rotationSpeed);
678
 
679
- // ์›Œ์ฌ๋” ์Šคํƒ€์ผ: ๋กค์— ๋”ฐ๋ฅธ ์ž์—ฐ์Šค๋Ÿฌ์šด ์„ ํšŒ
680
- // ๋‚ ๊ฐœ๊ฐ€ ๊ธฐ์šธ์–ด์ง€๋ฉด ์ž๋™์œผ๋กœ ์š” ํšŒ์ „ ๋ฐœ์ƒ
681
- const bankAngle = this.rotation.z;
682
- const bankTurnRate = Math.sin(bankAngle) * deltaTime * 0.5;
683
- this.targetYaw += bankTurnRate;
 
 
 
 
 
684
 
685
  // ๊ธฐ๋ณธ ์†๋„ ๊ณ„์‚ฐ
686
  const minSpeed = 100;
@@ -699,7 +705,7 @@
699
  // ์Šคํ†จ ๊ฒฝ๊ณ 
700
  this.stallWarning = this.speed < GAME_CONSTANTS.STALL_SPEED;
701
 
702
- // ์†๋„ ๋ฒกํ„ฐ ๊ณ„์‚ฐ
703
  const noseDirection = new THREE.Vector3(0, 0, 1);
704
  noseDirection.applyEuler(this.rotation);
705
  this.velocity = noseDirection.multiplyScalar(this.speed);
 
632
  }
633
 
634
  updateMouseInput(deltaX, deltaY) {
635
+ // ์›Œ์ฌ๋” ์Šคํƒ€์ผ: ๋งˆ์šฐ์Šค X์ถ• -> ๋กค(๋‚ ๊ฐœ ๊ธฐ์šธ์ด๊ธฐ)๋งŒ, Y์ถ• -> ํ”ผ์น˜
636
  const sensitivity = GAME_CONSTANTS.MOUSE_SENSITIVITY * 2.0;
637
 
638
+ // X์ถ• (์ขŒ/์šฐ) -> ๋กค (๋‚ ๊ฐœ ๊ธฐ์šธ์ด๊ธฐ๋งŒ)
639
+ // ๋งˆ์šฐ์Šค๋ฅผ ์˜ค๋ฅธ์ชฝ์œผ๋กœ ์ด๋™ = ์˜ค๋ฅธ์ชฝ ๋‚ ๊ฐœ ์•„๋ž˜๋กœ (์–‘์˜ ๋กค)
640
+ // ๋งˆ์šฐ์Šค๋ฅผ ์™ผ์ชฝ์œผ๋กœ ์ด๋™ = ์™ผ์ชฝ ๋‚ ๊ฐœ ์•„๋ž˜๋กœ (์Œ์˜ ๋กค)
641
  this.targetRoll += deltaX * sensitivity;
642
 
643
  // Y์ถ• (์œ„/์•„๋ž˜) -> ํ”ผ์น˜ (๊ธฐ์ˆ˜ ์ƒํ•˜)
 
645
 
646
  // ๊ฐ๋„ ์ œํ•œ
647
  const maxPitchAngle = Math.PI / 3; // 60๋„
648
+ const maxRollAngle = Math.PI; // 180๋„ (์™„์ „ ๋’ค์ง‘๊ธฐ ๊ฐ€๋Šฅ)
649
 
650
  this.targetPitch = Math.max(-maxPitchAngle, Math.min(maxPitchAngle, this.targetPitch));
651
  this.targetRoll = Math.max(-maxRollAngle, Math.min(maxRollAngle, this.targetRoll));
 
675
  // ๋ถ€๋“œ๋Ÿฌ์šด ํšŒ์ „ ๋ณด๊ฐ„
676
  const rotationSpeed = deltaTime * 3.0;
677
  this.rotation.x = THREE.MathUtils.lerp(this.rotation.x, this.targetPitch, rotationSpeed);
 
678
  this.rotation.z = THREE.MathUtils.lerp(this.rotation.z, this.targetRoll, rotationSpeed);
679
 
680
+ // ์›Œ์ฌ๋” ์Šคํƒ€์ผ: ๋กค์— ๋”ฐ๋ฅธ ์ž์—ฐ์Šค๋Ÿฌ์šด ์š”(Yaw) ํšŒ์ „
681
+ // ๋‚ ๊ฐœ๊ฐ€ ๊ธฐ์šธ์–ด์ง€๋ฉด ์ž๋™์œผ๋กœ ๊ทธ ๋ฐฉํ–ฅ์œผ๋กœ ์„ ํšŒ
682
+ if (Math.abs(this.rotation.z) > 0.1) { // ์•ฝ๊ฐ„์˜ ๋ฐ๋“œ์กด
683
+ const bankAngle = this.rotation.z;
684
+ const bankTurnRate = Math.sin(bankAngle) * deltaTime * 0.7; // ์„ ํšŒ์œจ
685
+ this.targetYaw += bankTurnRate;
686
+ }
687
+
688
+ // ์š” ํšŒ์ „ ์ ์šฉ (A/D ํ‚ค ์ž…๋ ฅ + ์ž๋™ ์„ ํšŒ)
689
+ this.rotation.y = THREE.MathUtils.lerp(this.rotation.y, this.targetYaw, rotationSpeed);
690
 
691
  // ๊ธฐ๋ณธ ์†๋„ ๊ณ„์‚ฐ
692
  const minSpeed = 100;
 
705
  // ์Šคํ†จ ๊ฒฝ๊ณ 
706
  this.stallWarning = this.speed < GAME_CONSTANTS.STALL_SPEED;
707
 
708
+ // ์†๋„ ๋ฒกํ„ฐ ๊ณ„์‚ฐ - ์ „ํˆฌ๊ธฐ๊ฐ€ ํ–ฅํ•˜๋Š” ๋ฐฉํ–ฅ์œผ๋กœ ์ด๋™
709
  const noseDirection = new THREE.Vector3(0, 0, 1);
710
  noseDirection.applyEuler(this.rotation);
711
  this.velocity = noseDirection.multiplyScalar(this.speed);