diff options
| author | 3gg <3gg@shellblade.net> | 2023-06-02 15:11:36 -0700 | 
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2023-06-02 15:11:36 -0700 | 
| commit | 97668e5b8e28adb9d3dcd361952197ec62c00833 (patch) | |
| tree | 18d9bc7d295d7dd341d2780c040a54df746d3964 /gltfview/src | |
| parent | 6ba8b628bf72c14372b70247e2f12df2bcd1c34e (diff) | |
Cleanup.
Diffstat (limited to 'gltfview/src')
| -rw-r--r-- | gltfview/src/game.c | 21 | 
1 files changed, 2 insertions, 19 deletions
| diff --git a/gltfview/src/game.c b/gltfview/src/game.c index 9709ea5..c80a1b5 100644 --- a/gltfview/src/game.c +++ b/gltfview/src/game.c | |||
| @@ -208,13 +208,9 @@ bool game_new(Game* game, int argc, const char** argv) { | |||
| 208 | }*/ | 208 | }*/ | 
| 209 | 209 | ||
| 210 | Anima* anima = gfx_get_node_anima(game->root_node); | 210 | Anima* anima = gfx_get_node_anima(game->root_node); | 
| 211 | 211 | ||
| 212 | // const bool play_result = gfx_play_animation( | 212 | gfx_play_animation( | 
| 213 | // anima, &(AnimationPlaySettings){.name = "Defiant stance", .loop = | ||
| 214 | // false}); | ||
| 215 | const bool play_result = gfx_play_animation( | ||
| 216 | anima, &(AnimationPlaySettings){.name = "Walk", .loop = true}); | 213 | anima, &(AnimationPlaySettings){.name = "Walk", .loop = true}); | 
| 217 | // assert(play_result); | ||
| 218 | 214 | ||
| 219 | return true; | 215 | return true; | 
| 220 | 216 | ||
| @@ -229,12 +225,8 @@ cleanup: | |||
| 229 | void game_end(Game* game) { gfx_destroy(&game->gfx); } | 225 | void game_end(Game* game) { gfx_destroy(&game->gfx); } | 
| 230 | 226 | ||
| 231 | void game_update(Game* game, double t, double dt) { | 227 | void game_update(Game* game, double t, double dt) { | 
| 232 | // LOGD("Tick"); | ||
| 233 | |||
| 234 | gfx_animate_scene(game->scene, (R)t); | 228 | gfx_animate_scene(game->scene, (R)t); | 
| 235 | 229 | ||
| 236 | // TODO: Compute bounding boxes to then find a good orbit point and radius | ||
| 237 | // for each scene. | ||
| 238 | const vec3 orbit_point = vec3_make(0, 2, 0); | 230 | const vec3 orbit_point = vec3_make(0, 2, 0); | 
| 239 | Camera* camera = gfx_get_camera_camera(game->camera); | 231 | Camera* camera = gfx_get_camera_camera(game->camera); | 
| 240 | spatial3_orbit( | 232 | spatial3_orbit( | 
| @@ -242,15 +234,6 @@ void game_update(Game* game, double t, double dt) { | |||
| 242 | /*radius=*/2.5, | 234 | /*radius=*/2.5, | 
| 243 | /*azimuth=*/t * 0.5, /*zenith=*/0); | 235 | /*azimuth=*/t * 0.5, /*zenith=*/0); | 
| 244 | spatial3_lookat(&camera->spatial, orbit_point); | 236 | spatial3_lookat(&camera->spatial, orbit_point); | 
| 245 | |||
| 246 | // spatial3_set_position(&camera->spatial, vec3_make(0, 0, 2)); | ||
| 247 | // spatial3_lookat(&camera->spatial, vec3_make(0, 0, -1)); | ||
| 248 | |||
| 249 | // spatial3_orbit( | ||
| 250 | // &camera->spatial, vec3_make(0, 0, 0), | ||
| 251 | // /*radius=*/2.5, | ||
| 252 | // /*azimuth=*/t * 0.2, /*zenith=*/0); | ||
| 253 | // spatial3_lookat(&camera->spatial, vec3_make(0, 0, 0)); | ||
| 254 | } | 237 | } | 
| 255 | 238 | ||
| 256 | void game_render(const Game* game) { | 239 | void game_render(const Game* game) { | 
