make yaw = 0 result in (0, 0, 1) target vector

This commit is contained in:
veclavtalica 2025-02-02 05:32:18 +03:00
parent 87b33c2e0c
commit 7284bb726a

View File

@ -454,8 +454,9 @@ DrawCameraFromPrincipalAxesResult draw_camera_from_principal_axes(Vec3 position,
(void)roll;
/* rotate so that yaw = 0 results in (0, 0, 1) target vector */
float yawc, yaws, pitchc, pitchs;
sincosf(yaw, &yaws, &yawc);
sincosf(yaw + (float)M_PI, &yaws, &yawc);
sincosf(pitch, &pitchs, &pitchc);
Camera const camera = {