KlassischeKeplerKriege/game/state/explosion.hpp
2016-10-02 21:06:02 +02:00

28 lines
867 B
C++

#pragma once
#include <glm/vec2.hpp>
#include "util.hpp"
#include "missile_hit_type.hpp"
namespace game {
/**
* Explosion: just an effect which looks good.
*/
class Explosion {
public:
Explosion(size_t id, const glm::vec2 &pos, const glm::vec2 &missileVelocity, Hit hit, float maxAge=1.0);
const size_t id;
const Hit hit; // kind of the explosion depends on the hit type
const glm::vec2 position; // position where it starts
const glm::vec2 missileVelocity; // impact velocity of the missile
float age; // age (in seconsd) of the explosion
// age (in seconds) when the explosion is not visible
// anymore and will disappear afterwards
const float maxAge;
const float maxRadius; // current radius depends on time.
};
}