00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 // Copyright (C) 2010 Daniele Giannetti 00014 // 00015 // This file is part of VR3Lib. 00016 // The VR3Lib is free software, but is distributed in the static precompiled 00017 // version as it is NOT open source. The VR3Lib may be used in any virtual 00018 // reality application free of charge, but it must be clearly stated that this 00019 // library is used in the application EULA and distribution license 00020 // (for both free and proprietary applications). 00022 00023 #ifndef __VR3LIGHT_H__ 00024 #define __VR3LIGHT_H__ 00025 00027 00031 class VR3Light { 00032 00034 GLfloat m_pos[3]; 00036 GLfloat m_ambient[3]; 00038 GLfloat m_diffuse[3]; 00040 GLfloat m_specular[3]; 00042 bool m_active; 00043 00045 VR3Light(const VR3Light&); 00047 VR3Light& operator = (const VR3Light&); 00048 00049 public: 00050 00052 00055 VR3Light(); 00056 00057 // ------------------------- Get and Set Functions ---------------------------// 00058 00060 00061 00063 00067 void SetPosition(GLfloat x, GLfloat y, GLfloat z); 00068 00070 00073 void SetPosition(const GLfloat *point); 00074 00076 00079 void GetPosition(GLfloat *point); 00080 00082 00086 void SetAmbient(GLfloat r, GLfloat g, GLfloat b); 00087 00089 00092 void SetAmbient(const GLfloat *color); 00093 00095 00099 void GetAmbient(GLfloat *color); 00100 00102 00106 void SetDiffuse(GLfloat r, GLfloat g, GLfloat b); 00107 00109 00112 void SetDiffuse(const GLfloat *color); 00113 00115 00119 void GetDiffuse(GLfloat *color); 00120 00122 00126 void SetSpecular(GLfloat r, GLfloat g, GLfloat b); 00127 00129 00132 void SetSpecular(const GLfloat *color); 00133 00135 00139 void GetSpecular(GLfloat *color); 00140 00142 00143 // ----------------------- Light Switching Functions -------------------------// 00144 00146 00147 00149 void SwitchOn() { m_active = true; } 00150 00152 void SwitchOff() { m_active = false; } 00153 00155 bool IsOn() { return m_active; } 00156 00158 }; 00159 00160 #endif