#ifndef EDITSCENE_LIGHT_HPP
#define EDITSCENE_LIGHT_HPP
#pragma once

#include <Ogre.h>

/**
 * Light component - attaches an Ogre::Light to the entity's SceneNode
 */
struct LightComponent {
	enum class LightType {
		Point,       // Omnidirectional light
		Directional, // Parallel rays (sun/moon)
		Spotlight    // Cone-shaped light
	};

	LightType lightType = LightType::Point;
	
	// Common properties
	Ogre::ColourValue diffuseColor{0.8f, 0.8f, 0.8f};
	Ogre::ColourValue specularColor{0.5f, 0.5f, 0.5f};
	float intensity = 1.0f;
	
	// Attenuation (for Point and Spot)
	float range = 100.0f;
	float constantAttenuation = 1.0f;
	float linearAttenuation = 0.0f;
	float quadraticAttenuation = 0.0f;
	
	// Spotlight specific
	float spotlightInnerAngle = 30.0f;  // Degrees
	float spotlightOuterAngle = 45.0f;  // Degrees
	float spotlightFalloff = 1.0f;
	
	// Direction (for Directional and Spot, relative to node orientation)
	Ogre::Vector3 direction{0, -1, 0};
	
	// Cast shadows
	bool castShadows = true;
	
	// The Ogre light object (created by LightSystem)
	Ogre::Light* light = nullptr;
	
	void markDirty() { needsRebuild = true; }
	bool needsRebuild = true;
};

#endif // EDITSCENE_LIGHT_HPP
