2016-09-27 16:23:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "object.hpp"
|
|
|
|
|
2016-09-27 21:29:26 +00:00
|
|
|
#include <cstdlib>
|
|
|
|
|
2016-09-27 16:23:58 +00:00
|
|
|
namespace game {
|
2016-09-29 00:50:51 +00:00
|
|
|
class Planet : public Object {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Planets are build out of one material.
|
|
|
|
* TODO: support mixture or multiple material per planet.
|
|
|
|
*/
|
2016-09-30 20:47:28 +00:00
|
|
|
enum class Material { Rock=0, Metal=1, Sand=2, Gas=3, Ice=4, Water=5, Sun=6 };
|
2016-09-27 21:29:26 +00:00
|
|
|
|
2016-10-03 11:37:49 +00:00
|
|
|
Planet(size_t id, const glm::vec2 &pos, float r, Material mat=Material::Rock)
|
|
|
|
: Object(id, pos), material(mat), radius(r), seed(rand())
|
2016-09-30 20:47:28 +00:00
|
|
|
{
|
2016-09-29 00:50:51 +00:00
|
|
|
}
|
2016-09-27 21:29:26 +00:00
|
|
|
|
2016-09-30 20:47:28 +00:00
|
|
|
glm::vec3 getColor() const;
|
|
|
|
|
|
|
|
// for rendering and physics (can fly through sun and outer gas planets)
|
|
|
|
Material material;
|
|
|
|
|
|
|
|
// just for rendering variation
|
2016-10-03 11:37:49 +00:00
|
|
|
float radius;
|
|
|
|
int seed;
|
2016-09-29 00:50:51 +00:00
|
|
|
};
|
2016-09-27 16:23:58 +00:00
|
|
|
}
|