From 4ce145a80f4b52ec63a412997454e2309c4c99ac Mon Sep 17 00:00:00 2001 From: Colin Gravill <1099725+cgravill@users.noreply.github.com> Date: Mon, 22 Jul 2019 20:26:41 +0100 Subject: [PATCH 1/4] Add complete apt-get command --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9bc0582..77d1177 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ More about the project can be found [here](http://ian-r-rose.github.io/interacti An introduction to the underlying science can be found [here](http://ian-r-rose.github.io/interactive_earth/explanation.html). ## Compiling on Ubuntu Linux -- Install ```fftw3```, ```SDL2```, and ```GLEW``` using ```apt-get``` +- Install ```fftw3```, ```SDL2```, and ```GLEW``` using ```apt-get install libfftw3-dev libsdl2-dev libglew-dev``` - Rename ```Makefile.linux``` to ```makefile``` - Run ```make``` on the command line to compile the project - run the program by typing its path and name in the command line: ```./interactive_earth``` From efea895538ec8e843ac2d583d47339a364a074fb Mon Sep 17 00:00:00 2001 From: sannecottaar Date: Mon, 12 Aug 2019 13:56:57 +0100 Subject: [PATCH 2/4] fix spuriously triggered events --- main.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 45791be..3840b62 100644 --- a/main.cpp +++ b/main.cpp @@ -182,7 +182,6 @@ inline void handle_mouse_or_finger_motion(float x, float y) float theta, r; compute_simulator_location( x, y, &theta, &r); - press_theta = ltheta * theta / 2. / M_PI; press_r = lr*(r-r_inner)/(1.0f-r_inner); } @@ -202,6 +201,9 @@ inline void handle_mouse_motion(SDL_MouseMotionEvent *event) //Update where to add heat inline void handle_finger_motion(SDL_TouchFingerEvent *event) { + if (SDL_GetTouchDevice(event->touchId)==0) { + return; + } float x = event->x - 0.5f; float y = 0.5f - event->y; handle_mouse_or_finger_motion(x, y); @@ -257,6 +259,9 @@ inline void handle_finger_down(SDL_TouchFingerEvent *event) { if(event->type==SDL_FINGERDOWN) { + if (SDL_GetTouchDevice(event->touchId)==0) { + return; + } pressing = true; float x = event->x - 0.5f; float y = 0.5f - event->y; @@ -393,7 +398,9 @@ void timestep() { //Make earthquakes if(pressing && !alt_press && in_domain(press_theta,press_r) ) - simulator.earthquake(press_theta, press_r); + { + simulator.earthquake(press_theta, press_r); + } else if(pressing && alt_press && in_domain(press_theta,press_r) ) simulator.place_seismometer(press_theta, press_r); //Propagate waves From 8dec71494238a291629309735f13550445f50ea1 Mon Sep 17 00:00:00 2001 From: sannecottaar Date: Mon, 12 Aug 2019 14:02:27 +0100 Subject: [PATCH 3/4] remove extra brackets --- main.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 3840b62..0478bcf 100644 --- a/main.cpp +++ b/main.cpp @@ -398,9 +398,7 @@ void timestep() { //Make earthquakes if(pressing && !alt_press && in_domain(press_theta,press_r) ) - { - simulator.earthquake(press_theta, press_r); - } + simulator.earthquake(press_theta, press_r); else if(pressing && alt_press && in_domain(press_theta,press_r) ) simulator.place_seismometer(press_theta, press_r); //Propagate waves From 6ab008c80c273285c0af6d7f77256804f2aa34b5 Mon Sep 17 00:00:00 2001 From: sannecottaar Date: Mon, 12 Aug 2019 14:03:18 +0100 Subject: [PATCH 4/4] fix install instructions for mac --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77d1177..4f72df2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ An introduction to the underlying science can be found [here](http://ian-r-rose. - run the program by typing its path and name in the command line: ```./interactive_earth``` ## Compiling on a Mac -- brew install the following dependencies: ```fftw3```, ```SDL2```, ```GLEW``` +- brew install the following dependencies: ```fftw```, ```SDL2```, ```GLEW``` - rename ```Makefile.osx``` to ```makefile``` - run the command ```make``` in the command line - run the program by typing its path and name in the command line: ```./interactive_earth```