Skip to content

Commit

Permalink
fix: small mistake in camera
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeek committed Jan 22, 2023
1 parent 1854f1d commit 6a0bea5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/render/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void camera_set_far_plane(Perspective_Camera* camera, r64 far_plane) {
void camera_rotate_x(Perspective_Camera* camera, r64 x_difference) {
Quaternion y_axis = quaternion_new((vec3) { 0.0, 1.0, 0.0 }, x_difference);
camera->yrotation = quaternion_product(&y_axis, &camera->yrotation);
quaternion_normalize(&camera->yrotation);
camera->yrotation = quaternion_normalize(&camera->yrotation);
recalculate_view_matrix(camera);
}

Expand All @@ -83,7 +83,7 @@ void camera_rotate_y(Perspective_Camera* camera, r64 y_difference) {
right = gm_vec3_normalize(right);
Quaternion x_axis = quaternion_new(right, y_difference);
camera->rotation = quaternion_product(&camera->rotation, &x_axis);
quaternion_normalize(&camera->rotation);
camera->rotation = quaternion_normalize(&camera->rotation);
recalculate_view_matrix(camera);
}

Expand Down

0 comments on commit 6a0bea5

Please sign in to comment.