added sun
This commit is contained in:
parent
e1eb158f3f
commit
1b3702db8a
1 changed files with 28 additions and 1 deletions
|
@ -2,11 +2,38 @@
|
|||
|
||||
#include "object.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace game {
|
||||
class Planet : public Object {
|
||||
public:
|
||||
Planet(const glm::vec2 &pos, float r) : Object(pos, r)
|
||||
/**
|
||||
* Planets are build out of one material.
|
||||
* TODO: support mixture or multiple material per planet.
|
||||
*/
|
||||
enum class Material {
|
||||
Rock,
|
||||
Metal,
|
||||
Sand,
|
||||
Gas,
|
||||
Ice,
|
||||
Water,
|
||||
Sun
|
||||
};
|
||||
|
||||
Planet(const glm::vec2 &pos, float r) : Planet(pos, r, Material::Rock)
|
||||
{
|
||||
}
|
||||
|
||||
Planet(const glm::vec2 &pos, float r, Material mat)
|
||||
: Object(pos, r)
|
||||
, material(mat)
|
||||
, seed(rand())
|
||||
{
|
||||
}
|
||||
|
||||
// nice for rendering attributes
|
||||
Material material;
|
||||
int seed;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue