summaryrefslogtreecommitdiff
path: root/gltfview/src
diff options
context:
space:
mode:
Diffstat (limited to 'gltfview/src')
-rw-r--r--gltfview/src/game.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gltfview/src/game.c b/gltfview/src/game.c
index 54e498b..224200d 100644
--- a/gltfview/src/game.c
+++ b/gltfview/src/game.c
@@ -189,8 +189,8 @@ static bool load_texture_debugger_scene(Game* game) {
189 189
190bool game_new(Game* game, int argc, const char** argv) { 190bool game_new(Game* game, int argc, const char** argv) {
191 // TODO: getopt() to implement proper argument parsing. 191 // TODO: getopt() to implement proper argument parsing.
192 const char* view_mode = argc > 1 ? argv[1] : ""; 192 const char* scene_filepath = argc > 1 ? argv[1] : DEFAULT_SCENE_FILE;
193 const char* scene_filepath = argc > 2 ? argv[2] : DEFAULT_SCENE_FILE; 193 const char* view_mode = argc > 2 ? argv[2] : "";
194 194
195 game->gfx = gfx_init(); 195 game->gfx = gfx_init();
196 if (!game->gfx) { 196 if (!game->gfx) {
@@ -234,12 +234,15 @@ void game_update(Game* game, double t, double dt) {
234 usleep(1000); 234 usleep(1000);
235 game->elapsed -= 1.0; 235 game->elapsed -= 1.0;
236 } 236 }
237 Camera* camera = gfx_get_camera_camera(game->camera); 237 // TODO: Compute bounding boxes to then find a good orbit point and radius
238 // for each scene.
239 const vec3 orbit_point = vec3_make(0, 2, 0);
240 Camera* camera = gfx_get_camera_camera(game->camera);
238 spatial3_orbit( 241 spatial3_orbit(
239 &camera->spatial, vec3_make(0, 0, 0), 242 &camera->spatial, orbit_point,
240 /*radius=*/2, 243 /*radius=*/2.5,
241 /*azimuth=*/t * 0.5, /*zenith=*/0); 244 /*azimuth=*/t * 0.5, /*zenith=*/0);
242 spatial3_lookat(&camera->spatial, vec3_make(0, 0, 0)); 245 spatial3_lookat(&camera->spatial, orbit_point);
243} 246}
244 247
245void game_render(const Game* game) { 248void game_render(const Game* game) {