/apps/demos/scenery: lock movement direction to a plane

This commit is contained in:
veclavtalica 2025-01-06 15:38:40 +03:00
parent 6463ac3dd7
commit b0549612a9

View File

@ -83,6 +83,9 @@ static void process_ground_mode(State *state) {
DrawCameraFromPrincipalAxesResult dir_and_up =
draw_camera_from_principal_axes(scn->pos, (float)M_PI_2 * 0.8f, scn->roll, scn->pitch, scn->yaw);
dir_and_up.direction.y = 0;
dir_and_up.direction = vec3_norm(dir_and_up.direction);
const Vec3 right = m_vec_norm(m_vec_cross(dir_and_up.direction, dir_and_up.up));
const float speed = 0.18f; /* TODO: put this in a better place */