00001
00002
00003
00004
00005
00006 #ifndef LIGHT_H
00007 #define LIGHT_H
00008
00009 #include<DynamicObject.h>
00010
00011 #include<ObjectFile.h>
00012 #include<Color4.h>
00013 #include<Vertex3.h>
00014
00017 class Light : public DynamicObject
00018 {
00019 DYNAMIC_OBJECT;
00020 public:
00021 Light(Vertex3 p = Vertex3(0.0, 0.0, 1.0));
00022
00023 const Vertex3 &getPosition() {
00024 return position;
00025 }
00026 const Color4 getAmbient() {
00027 return ambient;
00028 }
00029 const Color4 getDiffuse() {
00030 return diffuse;
00031 }
00032 const Color4 getSpecular() {
00033 return specular;
00034 }
00035 virtual real illuminationFactor(const Vertex3 &v);
00036
00037
00038 void parseSymbol(Token &t, ObjectFile &file);
00039 void writeParams(ostream &stream);
00040
00041 protected:
00042
00043 void createSymbols();
00044
00045 Vertex3 position;
00046 Color4 ambient;
00047 Color4 diffuse;
00048 Color4 specular;
00049 Vertex3 attenuation;
00050 Vertex3 direction;
00051 real density;
00052 real cutoff;
00053
00054 private:
00055 typedef DynamicObject super;
00056 };
00057 #endif