#ifndef EDITSCENE_EDITOR_SKYBOX_SYSTEM_HPP
#define EDITSCENE_EDITOR_SKYBOX_SYSTEM_HPP
#pragma once

#include <flecs.h>
#include <Ogre.h>

/**
 * Skybox system - creates and updates a procedural skybox cube
 * that follows the camera and renders dynamic sky colors.
 */
class EditorSkyboxSystem {
public:
	EditorSkyboxSystem(flecs::world &world, Ogre::SceneManager *sceneMgr);
	~EditorSkyboxSystem();

	// Update skybox position and shader parameters
	void update(Ogre::Camera *camera);

private:
	void rebuildSkybox(flecs::entity entity,
			   struct SkyboxComponent &skybox);
	void cleanupSkybox(SkyboxComponent &skybox);
	void createCube(Ogre::ManualObject *obj, float size);
	void updateShaderParams(SkyboxComponent &skybox,
				float sunElev, const Ogre::Vector3 &sunDir);

	flecs::world &m_world;
	Ogre::SceneManager *m_sceneMgr;
	flecs::query<struct SkyboxComponent> m_query;
};

#endif // EDITSCENE_EDITOR_SKYBOX_SYSTEM_HPP
