-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplication.h
More file actions
44 lines (34 loc) · 1.25 KB
/
Application.h
File metadata and controls
44 lines (34 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// Created by wojkly on 5/29/21.
//
#ifndef DOUBLE_PENDULUM_SIMULATION_APPLICATION_H
#define DOUBLE_PENDULUM_SIMULATION_APPLICATION_H
#include "SFML/include/SFML/Graphics.hpp"
#include "SFML/include/SFML/Window.hpp"
#include "DoublePendulum.h"
#include "Simulation.h"
#include "ArgumentParser.h"
#include <iostream>
#include <unistd.h>
#include <cmath>
using namespace std;
using namespace sf;
class Application {
unsigned int simDims;
unsigned int mouseYoffset;
unsigned int mouseGrabThreshhold;
double middleX;
double middleY;
double L1Scaled;
double L2Scaled;
public:
explicit Application(ArgumentParser argumentParser);
void initApp(Simulation simulation) const;
void drawPendulums(RenderWindow &window, Simulation &simulation) const;
int pendulumGrabbed(RenderWindow &window, Simulation &simulation) const;
double getMouseTheta(double x, double y, double xRelativeTo, double yRelativeTo) const;
void pendulumMove(RenderWindow &window, Simulation &simulation, unsigned int grabbed_id) const;
void handleMouse(RenderWindow &window, Simulation &simulation) const;
Vector2f getPendulumCoords(double theta, Vector2f relativeTo, bool firstArm) const;
};
#endif //DOUBLE_PENDULUM_SIMULATION_APPLICATION_H