-
Notifications
You must be signed in to change notification settings - Fork 0
/
body.hpp
67 lines (48 loc) · 1.14 KB
/
body.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
#pragma once
//#ifndef BODY_HPP
//#define BODY_HPP
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include "vector3.hpp"
#include "geometry.hpp"
#include <vector>
#define USE_MODELS 0
class Body
{
public:
Body();
Body(vector3 position, vector3 speed, float mass, float radius, std::vector<triangle> hull, float color[4], bool isStar);
void applyImpulse(vector3 impulse);
void move(float timestep);
void draw();
vector3 getPosition();
void setPosition(vector3 value);
vector3 getSpeed();
void setSpeed(vector3 value);
float getMass() const;
void setMass(float value);
float getRadius() const;
void setRadius(float value);
std::vector<triangle> getHull() const;
void setHull(const std::vector<triangle> &value);
float* getColor();
void setColor(float value[4]);
protected:
// m
vector3 position;
// m/s
vector3 speed;
// kg
float mass;
// m
float radius;
std::vector<triangle> hull;
float color[4];
bool isStar;
GLenum lightid;
static int numLights;
static int maxLights;
void initLight();
};
//#endif // BODY_HPP