27 lines
559 B
C++
27 lines
559 B
C++
#include "planet/PlanetFace.h"
|
|
#include "planet/Planet.h"
|
|
|
|
PlanetFace::PlanetFace(Planet* planet, const unsigned int face) :
|
|
m_planet(planet), m_face(face)
|
|
{
|
|
for(int i=0;i<CHUNKS_W;i++)
|
|
{
|
|
for(int j=0;j<CHUNKS_H;j++)
|
|
{
|
|
for(int k=0;k<CHUNKS_D;k++)
|
|
{
|
|
m_chunks[i][j][k] = new Chunk(planet, this, x + i * CHUNK_N, j * CHUNK_N, z + k * CHUNK_N);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
PlanetFace::~PlanetFace()
|
|
{
|
|
for(int i=0;i<CHUNKS_W;i++)
|
|
for(int j=0;j<CHUNKS_H;j++)
|
|
for(int k=0;k<CHUNKS_D;k++)
|
|
if(m_chunks[i][j][k])
|
|
m_chunks[i][j][k]->destroyChunk();
|
|
}
|