KlassischeKeplerKriege/game/state/trace.hpp

35 lines
894 B
C++
Raw Normal View History

2016-09-27 17:32:12 +00:00
#pragma once
#include <glm/vec2.hpp>
2016-09-27 17:43:40 +00:00
#include <vector>
2016-09-27 17:32:12 +00:00
namespace game {
2016-09-27 17:43:40 +00:00
class Missile;
2016-09-27 17:32:12 +00:00
/*
* Trace of a missile through the space.
* Useful for rendering sth. like a smoke trail to follow the rocket.
*/
class Trace {
public:
2016-09-27 17:43:40 +00:00
Trace(const Missile *missile);
// TODO: add velocity of the rocket or age at the points too becasue
// that enables nice rendering of speed etc. at different points
// TODO: give missile to this
void addPointFromMissile(const Missile *missile);
/*
* Trace point data to be used when rendering.
*/
struct TracePoint {
TracePoint(const Missile *missile);
2016-09-27 17:32:12 +00:00
2016-09-27 17:43:40 +00:00
const glm::vec2 position;
const float speed;
};
2016-09-27 17:32:12 +00:00
2016-09-27 17:43:40 +00:00
std::vector<TracePoint> points;
2016-09-27 17:32:12 +00:00
};
}