diff --git a/demo/celtest/source/app.d b/demo/celtest/source/app.d index b87065b6..155e38e2 100644 --- a/demo/celtest/source/app.d +++ b/demo/celtest/source/app.d @@ -16,6 +16,7 @@ class Game : Core { enum HEIGHT = 540; public static string custom_mdl1_path = null; + public static bool free_look = false; this() { super(WIDTH, HEIGHT, "celtest"); @@ -31,10 +32,14 @@ class Game : Core { int main(string[] args) { bool verbose; - auto help = getopt(args, "verbose|v", &verbose, "model|m", &Game.custom_mdl1_path); + auto help = getopt(args, + "verbose|v", &verbose, + "model|m", &Game.custom_mdl1_path, + "free-cam|f", &Game.free_look, + ); if (help.helpWanted) { - defaultGetoptPrinter("Usage: ./a [--model /path/to/model.glb]", help.options); + defaultGetoptPrinter("Usage: ./a [--model /path/to/model.glb] [-f]", help.options); return 1; } diff --git a/demo/celtest/source/play.d b/demo/celtest/source/play.d index 4abbba97..7cbc6799 100644 --- a/demo/celtest/source/play.d +++ b/demo/celtest/source/play.d @@ -73,7 +73,11 @@ class PlayScene : Scene3D { sphr1_model.effect = new Effect(lights.shader, Colors.WHITE); // add a camera to look at the mdl1 - set_orbit_cam(); + if (Game.free_look) { + set_free_cam(); + } else { + set_orbit_cam(); + } // // draw a grid at the origin // auto grid = create_entity("grid"); @@ -125,7 +129,7 @@ class PlayScene : Scene3D { } // if SPACE is pressed, toggle camera orbit vs free look - if (Input.is_key_pressed(Keys.KEY_SPACE)) { + if (Input.is_key_pressed(Keys.KEY_F)) { if (cam.entity.has_component!CameraOrbit) { cam.entity.remove_component!CameraOrbit; set_free_cam();