-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobjects.h
More file actions
98 lines (71 loc) · 2.49 KB
/
objects.h
File metadata and controls
98 lines (71 loc) · 2.49 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "MathEngine\Vector2.cpp"
#include "MathEngine\line.cpp"
#include <iostream>
#include <math.h>
class object;
class square;
class rectangle;
class circle;
class hitbox;
class object {
public:
mtn::Vector2 position;
mtn::Vector2 velocity;
mtn::Vector2 acceleration;
mtn::Vector2 corners[2][2];
mtn::Vector2 min = corners[1][0];
mtn::Vector2 max = corners[0][1];
mtn::line vertex[4];
mtn::Vector2 momentum;
std::string type;
float mass;
float theta;
object();
object(mtn::Vector2 pos, mtn::Vector2 vel, mtn::Vector2 acc, float mass);
object(const object& obj);
~object();
//come back here
void changePosition(mtn::Vector2 pos);
void changeVelocity(mtn::Vector2 vel);
void changeAcceleration(mtn::Vector2 acc);
void applyForce(mtn::Vector2 force);
object& operator = (const object& v);
bool operator == (const object& v);
bool collide(object& obj);
void update();
bool isOnPoint(mtn::Vector2 point);
//mtn::Vector2 collided(object& obj);
};
class square : public object {
public:
float length;
square();
square(float l, mtn::Vector2 pos = mtn::Vector2(), mtn::Vector2 vel = mtn::Vector2(), mtn::Vector2 acc = mtn::Vector2(), mtn::Vector2 frc = mtn::Vector2(), float mass = 1.0);
square(float l, object& obj);
square(const square& v);
~square();
square& operator = (const square& v);
};
class rectangle : public object {
public:
float height;
float width;
//hitbox hb;
rectangle();
rectangle(float h, float w, mtn::Vector2 pos = mtn::Vector2(), mtn::Vector2 vel = mtn::Vector2(), mtn::Vector2 acc = mtn::Vector2(), mtn::Vector2 frc = mtn::Vector2(), float mass = 1.0);
rectangle(float h, float w, object& obj);
rectangle(const rectangle& v);
~rectangle();
rectangle& operator = (const rectangle& v);
};
class circle : public object {
public:
float radius;
//hitbox hb;
circle();
circle(float radius, mtn::Vector2 pos = mtn::Vector2(), mtn::Vector2 vel = mtn::Vector2(), mtn::Vector2 acc = mtn::Vector2(), mtn::Vector2 frc = mtn::Vector2(), float m = 1.0);
circle(float radius, object& obj);
circle(const circle& v);
~circle();
circle& operator = (const circle& v);
};