-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMobile.cpp
More file actions
29 lines (24 loc) · 739 Bytes
/
Mobile.cpp
File metadata and controls
29 lines (24 loc) · 739 Bytes
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
#include "Ent.hpp"
#include "Mobile.hpp"
Mobile::Mobile(std::string name, Triple pos, double ang, Triple vel, double vrot):
Ent(name, pos, ang),
vel(vel),
vrot(vrot),
new_vel(vel),
new_vrot(vrot),
active(true)
{}
void Mobile::update() {
this->Ent::update();
this->vel = this->new_vel;
this->vrot = this->new_vrot;
}
std::tuple<Triple, Triple> points(Ent *e, Mobile *m) {
return points(e, static_cast<Ent *>(m));
}
std::tuple<Triple, Triple> points(Mobile *m, Ent *e) {
return points(static_cast<Ent *>(m), e);
}
std::tuple<Triple, Triple> points(Mobile *m1, Mobile *m2) {
return points(static_cast<Ent *>(m1), static_cast<Ent *>(m2));
}