Skip to content

Commit

Permalink
Merge pull request #32 from Crazy-Cow/CD-79
Browse files Browse the repository at this point in the history
Feature: angleRad range set
  • Loading branch information
seven05 authored Nov 15, 2024
2 parents 6027d61 + 9c55b0b commit 8a964a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/game/server/index.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const MAX_SPEED = 10

const handleMove = (character: Character, directions: Directions) => {
if (character && character.cannonBody) {
const angleRad = character.angleRad || 0
let angleRad = character.angleRad || 0

// -π ~ π 범위로 각도를 제한
angleRad = ((angleRad + Math.PI) % (2 * Math.PI)) - Math.PI

// 카메라 각도에 따른 방향 벡터 계산
const forwardX = Math.sin(angleRad)
Expand Down

0 comments on commit 8a964a0

Please sign in to comment.