-
Notifications
You must be signed in to change notification settings - Fork 1
/
Object.h
59 lines (51 loc) · 1.27 KB
/
Object.h
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
#ifndef OBJECT_H_INCLUDED
#define OBJECT_H_INCLUDED
#include <iostream>
#include <SFML/OpenGL.hpp>
class Point {
public:
Point();
Point(float, float, float);
float &operator[](const int);
Point &operator=(const Point &);
float x, y, z;
friend Point &operator*(const Point &, const Point &);
friend Point &operator*(const Point &, const float &);
friend std::ostream & operator<<(std::ostream &, const Point &);
};
class Poly {
//Probably not the most optimised solution.
public:
Poly();
Poly(Point, Point, Point, Point, float, float, float, float);
void Render();
private:
Point points[3];
float col[4];
Point normal;
};
class Object
{
// A generic object that is affected by physics.
public:
Object();
Point toWorld(Point);
Point GetVector();
Point GetHeading();
Point aroundAxis(Point, Point, float);
Point GetUpVector();
virtual void Render(float); // Renders the geometry at the current local coords.
Point a; // Accel, vel, pos
Point v;
Point r;
Point ra; // Rotational accel, vel, pos
Point rv;
Point rr; //x = pitch
Point forward;
Point left;
Point up;
int geo_size;
Poly *geo;
GLfloat max[16], rex[16];
};
#endif // OBJECT_H_INCLUDED