-
Notifications
You must be signed in to change notification settings - Fork 19
/
Satellite.cpp
executable file
·47 lines (38 loc) · 962 Bytes
/
Satellite.cpp
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
#include <Satellite.h>
Satellite::Satellite(const Orbit &orb, const Planet* planet, const Propulsion &prop, const std::string &name, double rx, double ry, double rz)
{
m_orbit = new Orbit(orb);
m_planet = planet;
m_prop = prop;
m_name = name;
m_rx = rx;
m_ry = ry;
m_rz = rz;
}
Satellite::~Satellite()
{
}
void Satellite::update(double dt)
{
// Update orbit
m_orbit->update(dt);
// Update satellite position on its orbit
m_orbit->updatePosition(dt);
return;
}
void Satellite::reset()
{
// Reset position to 0
m_orbit->reset();
// Reset other parameters
//m_prop->reset();
}
const std::string Satellite::toString(void) const
{
std::stringstream output;
output << "----------" << std::endl;
output << "Name: " << m_name << std::endl;
//output << "Propulsion: " << m_prop.toString() << std::endl;
output << m_orbit->toString();
return output.str();
}