Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix event trigger #10

Open
wants to merge 6 commits into
base: button
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ 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```

## 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```
Expand Down
7 changes: 6 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down