ludic.character: the look goes up and down to 89 degrees (was -55..35), and the orbit's heading holds when the camera is straight over or under the pivot; ludic.aim: aim_ahead, whether a point is before the view

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 12:14:04 +03:00
parent 765d800842
commit 0b35f810b6
3 changed files with 21 additions and 2 deletions

View file

@ -55,7 +55,9 @@ function chr_gait(character_st: mut CharacterState, dist: float, dyaw: float, dp
}
}
# as far up and down as a view goes, a degree short of straight (where the heading would flip)
const CHR_PITCH_MAX: float = 1.553
function chr_look(character_st: mut CharacterState, dyaw: float, dpitch: float) -> void {
character_st.chr_cam_yaw = character_st.chr_cam_yaw + dyaw
character_st.chr_cam_pitch = Math.clamp(character_st.chr_cam_pitch + dpitch, -0.96, 0.61)
character_st.chr_cam_pitch = Math.clamp(character_st.chr_cam_pitch + dpitch, -CHR_PITCH_MAX, CHR_PITCH_MAX)
}