diff options
author | 3gg <3gg@shellblade.net> | 2024-02-13 18:26:47 -0800 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2024-02-13 18:26:47 -0800 |
commit | 090f91787b3f4e4711e4aada5ffc232d984b8ce1 (patch) | |
tree | 3e8ac4a17d75b5cf33e41f6d17dcc13dff098cc2 /game | |
parent | 4f34ef2042f0eb22ce0b51b50c8b3ac7d53a7805 (diff) |
Adjust camera field of view.
Diffstat (limited to 'game')
-rw-r--r-- | game/src/plugins/viewer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/game/src/plugins/viewer.c b/game/src/plugins/viewer.c index 1ed3b9d..3000b30 100644 --- a/game/src/plugins/viewer.c +++ b/game/src/plugins/viewer.c | |||
@@ -119,6 +119,7 @@ bool init(Game* game, State** pp_state) { | |||
119 | if (!node) { | 119 | if (!node) { |
120 | goto cleanup; | 120 | goto cleanup; |
121 | } | 121 | } |
122 | |||
122 | Anima* anima = gfx_get_node_anima(node); | 123 | Anima* anima = gfx_get_node_anima(node); |
123 | gfx_play_animation( | 124 | gfx_play_animation( |
124 | anima, &(AnimationPlaySettings){.name = "Walk", .loop = true}); | 125 | anima, &(AnimationPlaySettings){.name = "Walk", .loop = true}); |
@@ -159,7 +160,7 @@ void update(Game* game, State* state, double t, double dt) { | |||
159 | Camera* camera = gfx_get_camera_camera(state->camera); | 160 | Camera* camera = gfx_get_camera_camera(state->camera); |
160 | spatial3_orbit( | 161 | spatial3_orbit( |
161 | &camera->spatial, orbit_point, | 162 | &camera->spatial, orbit_point, |
162 | /*radius=*/2.5, | 163 | /*radius=*/5, |
163 | /*azimuth=*/t * 0.5, /*zenith=*/0); | 164 | /*azimuth=*/t * 0.5, /*zenith=*/0); |
164 | spatial3_lookat(&camera->spatial, orbit_point); | 165 | spatial3_lookat(&camera->spatial, orbit_point); |
165 | } | 166 | } |
@@ -246,7 +247,7 @@ void resize(Game* game, State* state, int width, int height) { | |||
246 | assert(game); | 247 | assert(game); |
247 | assert(state); | 248 | assert(state); |
248 | 249 | ||
249 | const R fovy = 90 * TO_RAD; | 250 | const R fovy = 60 * TO_RAD; |
250 | const R aspect = (R)width / (R)height; | 251 | const R aspect = (R)width / (R)height; |
251 | const R near = 0.1; | 252 | const R near = 0.1; |
252 | const R far = 1000; | 253 | const R far = 1000; |