/apps/demos/scenery: lock movement direction to a plane
This commit is contained in:
parent
6463ac3dd7
commit
b0549612a9
@ -83,6 +83,9 @@ static void process_ground_mode(State *state) {
|
|||||||
DrawCameraFromPrincipalAxesResult dir_and_up =
|
DrawCameraFromPrincipalAxesResult dir_and_up =
|
||||||
draw_camera_from_principal_axes(scn->pos, (float)M_PI_2 * 0.8f, scn->roll, scn->pitch, scn->yaw);
|
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 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 */
|
const float speed = 0.18f; /* TODO: put this in a better place */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user