KlassischeKeplerKriege/game/state/planet.hpp

36 lines
772 B
C++

#pragma once
#include "object.hpp"
#include <cstdlib>
namespace game {
class Planet : public Object {
public:
/**
* Planets are build out of one material.
* TODO: support mixture or multiple material per planet.
*/
enum class Material { Rock=0, Metal=1, Sand=2, Gas=3, Ice=4, Water=5, Sun=6 };
Planet(const glm::vec2 &pos, int id, float r)
: Planet(pos, id, r, Material::Rock)
{
}
Planet(const glm::vec2 &pos, int id, float r, Material mat)
: Object(pos, r), id(id), material(mat), seed(rand())
{
}
glm::vec3 getColor() const;
int id;
// for rendering and physics (can fly through sun and outer gas planets)
Material material;
// just for rendering variation
int seed;
};
}