/*! \file light.h \brief Handles Lights. A Light is one of the more important things in a 3D-environment, without it one sees nothing :) It is here for diffuse-, specular- and Bump-Mappings. */ #ifndef _LIGHT_H #define _LIGHT_H #include "world_entity.h" #include "glincl.h" #define NUMBEROFLIGHTS GL_MAX_LIGHTS enum AttenuationType {CONSTANT, LINEAR, QUADRATIC}; // FORWARD DEFINITIONS // class Vector; //! A class that handles Lights /** A Light is a source that emits light rays (photons) */ class Light : public WorldEntity { private: //! A struct that holds information about a Light struct LightValue { int lightNumber; //!< The number of this Light. GLfloat lightPosition[4]; //!< The Position of this Light. GLfloat lmodelAmbient[4]; //!< The general Ambient Color. GLfloat diffuseColor[4]; //!< The Diffuse Color this Light emmits. GLfloat specularColor[4]; //!< The specular Color of this Light. AttenuationType attenuationType;//!< The AttenuationType of this Light. float attenuationFactor; //!< the Factor the attenuation should have. LightValue* next; }; static Light* singletonRef; //!< This is the LightHandlers Reference. GLfloat ambientColor[4]; //!< The ambient Color of the scene. Light(void); void init(int LightNumber); LightValue** lights; LightValue* currentLight; public: static Light* getInstance(); ~Light(void); // set Attributes int addLight(void); int addLight(int lightNumber); void editLightNumber(int lightNumber); void deleteLight(void); void deleteLight(int lightNumber); void setPosition(Vector position); void setPosition(GLfloat x, GLfloat y, GLfloat z); void setDiffuseColor(GLfloat r, GLfloat g, GLfloat b); void setSpecularColor(GLfloat r, GLfloat g, GLfloat b); void setAttenuation(AttenuationType type, float factor); void setAmbientColor(GLfloat r, GLfloat g, GLfloat b); // get Attributes Vector getPosition(void); }; #endif /* _LIGHT_H */