#ifndef SPACE_SKY_H
#define SPACE_SKY_H


#include "./renderer/Render.h"
#include "./skybox/SkyBox.h"
#include "./math/Mathematics.h"
#include <cassert>

using namespace GEOMETRY;
using namespace ANALYTICAL_GEOMETRY;
using namespace SKYBOX;

struct SpaceSkyPlanet
{
	CTriCol color;
	float colorMultiplier;
	float colorMultiplierLimits[2];
	float colorChangeSpeed;

	float size;

	float pos[2]; // interval from <-1,1>

	virtual void simulate( float dt );
	virtual void render( Render &render );
};


class SpaceSkyBox: public Sky
{
public:
	
	vector< SpaceSkyPlanet* > skyPlane[6];

	virtual void simulate( float dt );
	virtual void render( Render &render );

	SpaceSkyBox(void) {};
	~SpaceSkyBox(void); //dealocates all resources
};


class SpaceSkyPlane: public Sky
{
public:
	vector< SpaceSkyPlanet* > skyPlane;

	virtual void simulate( float dt );
	virtual void render( Render &render );

	SpaceSkyPlane(void) {};
	~SpaceSkyPlane(void); //dealocates all resources
};

class CloudySkyPlane : public Sky
{
public:
	unsigned int skyTexture;
	Point_3<float> skyRegion[4];
	float offsetDir[2];				// texture coord offset

	float centerTexCoord[2];
	float texCoordSize[2];


	virtual void simulate( float dt );
	virtual void render( Render &render );

	CloudySkyPlane(void);
	~CloudySkyPlane(void) {};
};


void generateSpaceSkyPlanets( unsigned int planetCount, vector< SpaceSkyPlanet* >& dstContainer );


#endif