Skip to content

Commit 500494f

Browse files
committed
Update core_3d_fps_controller.c
1 parent 1d17be6 commit 500494f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

examples/core/core_3d_fps_controller.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ int main(void)
106106
{
107107
// Update
108108
//----------------------------------------------------------------------------------
109-
Vector2 mouse_delta = GetMouseDelta();
110-
lookRotation.x -= mouse_delta.x*sensitivity.x;
111-
lookRotation.y += mouse_delta.y*sensitivity.y;
109+
Vector2 mouseDelta = GetMouseDelta();
110+
lookRotation.x -= mouseDelta.x*sensitivity.x;
111+
lookRotation.y += mouseDelta.y*sensitivity.y;
112112

113113
char sideway = (IsKeyDown(KEY_D) - IsKeyDown(KEY_A));
114114
char forward = (IsKeyDown(KEY_W) - IsKeyDown(KEY_S));
@@ -261,7 +261,8 @@ static void UpdateCameraAngle(Camera *camera)
261261
Vector3 right = Vector3Normalize(Vector3CrossProduct(yaw, up));
262262

263263
// Rotate view vector around right axis
264-
float pitchAngle = -player.body.lookRotation.y - player.lean.y;
264+
float pitchAngle = -lookRotation.y -
265+
lean.y;
265266
pitchAngle = Clamp(pitchAngle, -PI / 2 + 0.0001f, PI / 2 - 0.0001f); // Clamp angle so it doesn't go past straight up or straight down
266267
Vector3 pitch = Vector3RotateByAxisAngle(yaw, right, pitchAngle);
267268

0 commit comments

Comments
 (0)