35 lines
509 B
C++
35 lines
509 B
C++
#include "planet/Planet.h"
|
|
#include "planet/PlanetFace.h"
|
|
|
|
Planet::Planet(glm::vec3 position, float radius) : m_position(position), m_radius(radius)
|
|
{
|
|
for (int i = 0; i < 6; i++)
|
|
{
|
|
m_faces[i] = new PlanetFace(this, i);
|
|
}
|
|
}
|
|
|
|
Planet::~Planet()
|
|
{
|
|
for (int i = 0; i < 6; i++)
|
|
{
|
|
delete m_faces[i];
|
|
}
|
|
}
|
|
|
|
void Planet::draw(Camera* camera)
|
|
{
|
|
for (int i = 0; i < 6; i++)
|
|
{
|
|
m_faces[i]->draw(camera);
|
|
}
|
|
}
|
|
|
|
void Planet::tick(GLfloat dtime)
|
|
{
|
|
for (int i = 0; i < 6; i++)
|
|
{
|
|
m_faces[i]->tick(dtime);
|
|
}
|
|
}
|