Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

ExCLight.h

Go to the documentation of this file.
00001 /*
00002  * ExNihilo 3D Engine
00003  * 
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  *
00018  * Please read AUTHORS file !!!
00019  * 
00020  * $Id: ExCLight.h,v 1.5 2002/07/02 13:48:46 data Exp $
00021  *
00022  */
00023 
00024 #ifndef __EXCLIGHT_H__
00025 #define __EXCLIGHT_H__
00026 //--------------------------------
00027 // File to include
00028 //--------------------------------
00029 #include "ExDefine.h"
00030 #include "ExMath.h"
00031 #include "ExCObject.h"
00032 //--------------------------------
00033 class ExCLight : public ExCObject
00034 {
00035 protected:
00036 //--------------------------------
00037 // Variable
00038 //--------------------------------
00039         GLenum m_LightNumber;   //Light number for opengl GL_LIGHT0 for ex.
00040         bool m_State;                   //State if Light is on or off
00041         float m_ambiant[4] ;    //Ambiant  Param R,G,B,A
00042         float m_diffuse[4] ;    //Diffuse  Param R,G,B,A
00043         float m_specular[4];    //Specular Param R,G,B,A
00044                 
00045         float m_spotExponent[1];
00046         float m_spotCutOff[1];
00047         
00048         float m_spotConstentAtt[1];
00049         float m_spotLinearAtt[1];
00050         float m_spotQuadraticAtt[1];
00051 public:
00052 //--------------------------------
00053 // Constructor // Destructor
00054 //--------------------------------
00055         ExCLight(void);
00056         ExCLight(GLenum Number);
00057         ~ExCLight(void);
00058 //--------------------------------
00059 // Methode
00060 //--------------------------------
00061         void Reset(void);
00062 
00063         void SetLightNumber(GLenum light);
00064         void TurnOn(void);
00065         void TurnOff(void);
00066         inline bool GetState(void){return m_State;}
00067 
00068         void  SetAmbiant(float R,float G,float B,float A);
00069         void  SetAmbiantR(float R);
00070         void  SetAmbiantG(float G);
00071         void  SetAmbiantB(float B);
00072         void  SetAmbiantA(float A);
00073         float GetAmbiantR(void);
00074         float GetAmbiantG(void);
00075         float GetAmbiantB(void);
00076         float GetAmbiantA(void);
00077         void  IncAmbiantR(float inc);
00078         void  IncAmbiantG(float inc);
00079         void  IncAmbiantB(float inc);
00080         void  IncAmbiantA(float inc);
00081         
00082         void  SetDiffuse(float R,float G,float B,float A);
00083         void  SetDiffuseR(float R);
00084         void  SetDiffuseG(float G);
00085         void  SetDiffuseB(float B);
00086         void  SetDiffuseA(float A);
00087         float GetDiffuseR(void);
00088         float GetDiffuseG(void);
00089         float GetDiffuseB(void);
00090         float GetDiffuseA(void);
00091         void  IncDiffuseR(float inc);
00092         void  IncDiffuseG(float inc);
00093         void  IncDiffuseB(float inc);
00094         void  IncDiffuseA(float inc);
00095 
00096         void  SetSpecular(float R,float G,float B,float A);
00097         void  SetSpecularR(float R);
00098         void  SetSpecularG(float G);
00099         void  SetSpecularB(float B);
00100         void  SetSpecularA(float A);
00101         float GetSpecularR(void);
00102         float GetSpecularG(void);
00103         float GetSpecularB(void);
00104         float GetSpecularA(void);
00105         void  IncSpecularR(float inc);
00106         void  IncSpecularG(float inc);
00107         void  IncSpecularB(float inc);
00108         void  IncSpecularA(float inc);
00109 
00110         void  SetPosition(double X,double Y,double Z);
00111         void  SetPosition(double X,double Y,double Z,double W);
00112         void  SetPositionX(double X);
00113         void  SetPositionY(double Y);
00114         void  SetPositionZ(double Z);
00115         void  SetPositionW(double W);
00116         inline float GetPositionX(void){return m_Position.GetX();}
00117         inline float GetPositionY(void){return m_Position.GetY();}
00118         inline float GetPositionZ(void){return m_Position.GetZ();}
00119         inline void  IncPositionX(float inc){SetPositionX(GetPositionX()+inc);}
00120         inline void  IncPositionY(float inc){SetPositionY(GetPositionY()+inc);}
00121         inline void  IncPositionZ(float inc){SetPositionZ(GetPositionZ()+inc);}
00122         
00123         void  SetTarget(double X,double Y,double Z);
00124         void  SetTargetX(double X);
00125         void  SetTargetY(double Y);
00126         void  SetTargetZ(double Z);
00127         inline float GetTargetX(void){return m_Target.GetX();}
00128         inline float GetTargetY(void){return m_Target.GetY();}
00129         inline float GetTargetZ(void){return m_Target.GetZ();}
00130         inline void  IncTargetX(float inc){SetTargetX(GetTargetX()+inc);}
00131         inline void  IncTargetY(float inc){SetTargetY(GetTargetY()+inc);}
00132         inline void  IncTargetnZ(float inc){SetTargetZ(GetTargetZ()+inc);}
00133         
00134         void  SetSpotExponent(float Exponent);
00135         void  IncSpotExponent(float inc);
00136         float GetSpotExponent(void);
00137 
00138         void  SetSpotCutOff(float cut);
00139         void  IncSpotCutOff(float inc);
00140         float GetSpotCutOff(void);
00141 
00142         void  SetConstantAttenuation(float att);
00143         void  IncConstantAttenuation(float inc);
00144         float GetConstantAttenuation(void);
00145 
00146         void  SetLinearAttenuation(float att);
00147         void  IncLinearAttenuation(float inc);
00148         float GetLinearAttenuation(void);
00149 
00150         void  SetQuadraticAttenuation(float att);
00151         void  IncQuadraticAttenuation(float inc);
00152         float GetQuadraticAttenuation(void);
00153 };
00154 #endif //__EXCLIGHT_H__

Generated on Tue Aug 6 20:27:07 2002 for ExNihilo by doxygen1.2.17