summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h1
-rw-r--r--game.c2
-rw-r--r--player.c5
3 files changed, 6 insertions, 2 deletions
diff --git a/config.h b/config.h
index b92b308..7013074 100644
--- a/config.h
+++ b/config.h
@@ -16,6 +16,7 @@
16#define PLAYER_HEIGHT 64.0f 16#define PLAYER_HEIGHT 64.0f
17#define PLAYER_RADIUS 16.0f 17#define PLAYER_RADIUS 16.0f
18#define PLAYER_EYE_HEIGHT 56.0f 18#define PLAYER_EYE_HEIGHT 56.0f
19#define PLAYER_FOV 65.0f
19 20
20#define PLAYER_LEAN_ANGLE 25.0f 21#define PLAYER_LEAN_ANGLE 25.0f
21#define PLAYER_LEAN_SPEED 8.0f 22#define PLAYER_LEAN_SPEED 8.0f
diff --git a/game.c b/game.c
index ad932a8..168cae4 100644
--- a/game.c
+++ b/game.c
@@ -95,7 +95,7 @@ bool LoadMap(const char *filename) {
95 game.camera.position = (Vector3){ 0, 10, 0 }; 95 game.camera.position = (Vector3){ 0, 10, 0 };
96 game.camera.target = (Vector3){ 1, 10, 0 }; 96 game.camera.target = (Vector3){ 1, 10, 0 };
97 game.camera.up = (Vector3){ 0, 1, 0 }; 97 game.camera.up = (Vector3){ 0, 1, 0 };
98 game.camera.fovy = 75.0f; 98 game.camera.fovy = PLAYER_FOV;
99 game.camera.projection = CAMERA_PERSPECTIVE; 99 game.camera.projection = CAMERA_PERSPECTIVE;
100 100
101 int total_brushes = 0; 101 int total_brushes = 0;
diff --git a/player.c b/player.c
index a8c039f..01c56ca 100644
--- a/player.c
+++ b/player.c
@@ -266,11 +266,14 @@ void UpdatePlayer(void) {
266 -sinf(game.pitch), 266 -sinf(game.pitch),
267 cosf(game.pitch) * cosf(game.yaw) 267 cosf(game.pitch) * cosf(game.yaw)
268 }; 268 };
269
270 // Use a stable world-up vector and apply lean roll
269 Vector3 up = { 0, 1, 0 }; 271 Vector3 up = { 0, 1, 0 };
270 up = Vector3RotateByAxisAngle(up, forward, leanAngle); 272 up = Vector3RotateByAxisAngle(up, forward, leanAngle);
271 game.camera.up = up; 273 game.camera.up = up;
272 274
273 game.camera.target = Vector3Add(game.camera.position, forward); 275 // Use a longer target distance for better precision in the projection matrix
276 game.camera.target = Vector3Add(game.camera.position, Vector3Scale(forward, 20.0f));
274 277
275 // Calculate horizontal speed for UI 278 // Calculate horizontal speed for UI
276 if (dt > 0) { 279 if (dt > 0) {