00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _CIvfOldLight_h_
00027 #define _CIvfOldLight_h_
00028
00029 #include <ivf/IvfObject.h>
00030
00031 IvfSmartPointer(CIvfOldLight);
00032
00033 static size_t IVF_MAX_LIGHTS = 8;
00034
00044 class IVF_API CIvfOldLight : public CIvfObject {
00045 public:
00046 enum TLightType {
00047 LT_POINT,
00048 LT_DIRECTIONAL,
00049 LT_SPOT
00050 };
00051 public:
00053 CIvfOldLight();
00054
00056 virtual ~CIvfOldLight();
00057
00059 CIvfOldLight& operator = ( const CIvfOldLight& );
00060
00062 operator void*();
00063
00064 IvfClassInfo("CIvfOldLight",CIvfObject);
00065
00067 void setAmbient( const GLfloat r, const GLfloat g,
00068 const GLfloat b, const GLfloat a );
00070 void setDiffuse( const GLfloat r, const GLfloat g,
00071 const GLfloat b, const GLfloat a );
00073 void setSpecular( const GLfloat r, const GLfloat g,
00074 const GLfloat b, const GLfloat a );
00075
00084 void setPosition( const GLfloat x, const GLfloat y, const GLfloat z, const GLfloat w );
00085 void setPosition( const GLfloat x, const GLfloat y, const GLfloat z);
00086 void setDirection( const GLfloat x, const GLfloat y, const GLfloat z);
00087
00089 void setConstAtt( const GLint a );
00090
00092 void setLinAtt( const GLint a );
00093
00095 void setQuadAtt( const GLint a );
00096
00098 void getAmbient( GLfloat &r, GLfloat &g, GLfloat &b, GLfloat &a ) const;
00099
00101 void getDiffuse( GLfloat &r, GLfloat &g, GLfloat &b, GLfloat &a ) const;
00102
00104 void getSpecular( GLfloat &r, GLfloat &g, GLfloat &b, GLfloat &a ) const;
00105
00107 void getPosition( GLfloat &x, GLfloat &y, GLfloat &z, GLfloat &w ) const;
00108
00110 void getConstAtt( GLint &a ) const;
00111
00113 void getLinAtt( GLint &a ) const;
00114
00116 void getQuadAtt( GLint &a ) const;
00117
00119 void render();
00120
00122 void setSpotExponent(float exponent);
00123
00125 float getSpotExponent();
00126
00128 void setSpotCutoff(float cutoff);
00129
00131 float getSpotCutoff();
00132
00134 void setSpotDirection(float ex, float ey, float ez);
00135
00137 void getSpotDirection(float &ex, float &ey, float &ez);
00138
00146 void setType(TLightType lightType);
00147
00149 TLightType getType();
00150
00157 void activate();
00158
00165 void deactivate();
00166
00167 protected:
00168
00169 CIvfOldLight( const CIvfOldLight& );
00170
00171 static long lightmask;
00172
00173 private:
00174 int m_lightn;
00175
00176 GLfloat m_ambient[4];
00177 GLfloat m_diffuse[4];
00178 GLfloat m_specular[4];
00179 GLfloat m_position[4];
00180 GLint m_constatt;
00181 GLint m_linatt;
00182 GLint m_quadatt;
00183
00184 GLfloat m_spotCutoff;
00185 GLfloat m_spotDirection[3];
00186 GLfloat m_spotExponent;
00187
00188 TLightType m_lightType;
00189 bool m_active;
00190 };
00195 #endif