gamnit: move `Model::uv_sphere` to `UVSphere`
[nit.git] / contrib / model_viewer / src / model_viewer.nit
index 60bc422..0c2cae6 100644 (file)
@@ -30,9 +30,9 @@ redef class App
 
        # All available models
        var models: Array[Model] = [
-               new LeafModel(new Cube, new SmoothMaterial.default),
-               new LeafModel(new Mesh.uv_sphere(4.0, 32, 16), new SmoothMaterial.default),
-               new LeafModel(new Mesh.uv_sphere(4.0, 32, 16), new NormalsMaterial),
+               new LeafModel(new Cube, new Material),
+               new LeafModel(new UVSphere(4.0, 32, 16), new Material),
+               new LeafModel(new UVSphere(4.0, 32, 16), new NormalsMaterial),
                new Model("models/Tree_01.obj"),
                new Model("models/Oak_Fall_01.obj"),
                new Model("models/Quandtum_BA-2_v1_1.obj"),
@@ -128,7 +128,7 @@ redef class App
                        else if event.is_arrow_left then
                                cycle_model -1
                        end
-               else if event isa PointerEvent and event.depressed then
+               else if event isa PointerEvent and not event.is_move and event.depressed then
                        if event.x.to_i > display.width / 2 then
                                cycle_model 1
                        else cycle_model -1