-
Notifications
You must be signed in to change notification settings - Fork 0
/
Simulation.hpp
68 lines (54 loc) · 2.06 KB
/
Simulation.hpp
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <random>
#include <map>
#include "bvh-loader/BVHReader.h"
#include "Camera.hpp"
#include "bvh-loader/GlHelper/DrawHelper.h"
using namespace std;
class Simulation {
public:
static vector<string> splitString(string str);
static Simulation *current();
static void setCurrent(Simulation *window);
void activateConsole();
bool readFile(string filename);
void initialize();
void loadGlobalCoord();
void drawGridPlane();
static void DisplayEvent();
static void KeyboardEvent(unsigned char key,int x,int y);
static void MouseEvent(int button, int state, int x, int y);
static void MotionEvent(int x, int y);
static void ReshapeEvent(int w, int h);
static void TimerEvent(int value);
static Simulation *curr;
private:
std::unique_ptr<BVHReader> bvh = nullptr;
GLfloat mousePosX, mousePosY;
Camera *currView;
Segment *toMove;
map<string, double> flexibility;
std::vector<std::vector<Segment *>> endSites;
void getJoints();
int currEndSite;
void prevSite();
void nextSite();
void nextFrame();
void reload();
void jointOptions(string args);
unsigned timeStep = 30;
bool moveObject = false;
int width, height;
bool leftButton = false;
const Eigen::Vector3f initPos = Eigen::Vector3f(-300.0f, 200.0f, -300.0f);
Camera mainCamera = Camera(initPos, Eigen::Vector3f(1.0f, 0.0f, 1.0f), Eigen::Vector3f(0.0f, 1.0f, 0.0f));
Camera goalCamera = Camera(Eigen::Vector3f(0.0f, 100.0f, 0.0f), Eigen::Vector3f(-1.0f, 0.0f, -1.0f), Eigen::Vector3f(0.0f, 1.0f, 0.0f));
void drawGoal();
Eigen::Vector3f goalPosition();
Eigen::Vector3f goalOrientation();
void motion(int x, int y);
void mouse(int button, int state, int x, int y);
void display();
void reshape(int w, int h);
void timer(int unused);
void keyboard(unsigned char key, int x, int y);
};