2018-04-15 15:49:03 +00:00
|
|
|
#include "planet/Planet.h"
|
|
|
|
#include "planet/PlanetFace.h"
|
|
|
|
|
|
|
|
Planet::Planet(glm::vec3 position, float radius) : m_position(position), m_radius(radius)
|
|
|
|
{
|
2018-06-05 11:40:39 +00:00
|
|
|
for (int i = 0; i < 6; i++)
|
|
|
|
{
|
|
|
|
m_faces[i] = new PlanetFace(this, i);
|
|
|
|
}
|
2018-04-15 15:49:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Planet::~Planet()
|
|
|
|
{
|
2018-06-05 11:40:39 +00:00
|
|
|
for (int i = 0; i < 6; i++)
|
|
|
|
{
|
|
|
|
delete m_faces[i];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-06-06 18:11:17 +00:00
|
|
|
void Planet::draw(Camera* camera, Shader* shader)
|
2018-06-05 11:40:39 +00:00
|
|
|
{
|
2020-03-21 15:58:23 +00:00
|
|
|
for (int i = 0; i < 6; i++)
|
|
|
|
{
|
|
|
|
m_faces[i]->draw(camera, shader);
|
|
|
|
}
|
2018-06-05 11:40:39 +00:00
|
|
|
}
|
2018-04-15 15:49:03 +00:00
|
|
|
|
2018-06-06 18:11:17 +00:00
|
|
|
void Planet::tick(Camera* camera, GLfloat dtime)
|
2018-06-05 11:40:39 +00:00
|
|
|
{
|
2020-03-21 15:58:23 +00:00
|
|
|
for (int i = 0; i < 6; i++)
|
|
|
|
{
|
|
|
|
m_faces[i]->tick(camera, dtime);
|
|
|
|
}
|
2018-04-15 15:49:03 +00:00
|
|
|
}
|