00001 00002 00003 00004 00005 // ChangeLog is at the implementation file 00006 00007 #ifndef __VPLIGHT_H 00008 #define __VPLIGHT_H 00009 00010 #include "vppoint3d.h" 00011 #include "vppoint4d.h" 00012 #include "vpvector3d.h" 00013 #include "vpcolor.h" 00014 #include "vpscenenode.h" 00015 #include <string> 00016 00022 class VPLight : public VPSceneNode { 00023 public: 00024 VPLight(); 00025 VPLight(const VPLight& light); 00026 VPLight(float i, float ai, VPColor c, bool o); 00027 VPLight(const std::string& newDescription, float newIntensity, 00028 float newAmbientIntensity, const VPColor& newColor, 00029 const VPPoint4D& newLocation); 00030 virtual ~VPLight(); 00031 VPLight& operator=(const VPLight& light); 00032 void SetIntensity(float i); 00033 float GetIntensity() const; 00034 void SetAmbientIntensity(float ai); 00035 float GetAmbientIntensity() const; 00036 void SetColor(const VPColor& c); 00037 VPColor GetColor() const; 00039 void Turn(bool on_off); 00040 bool IsOn() const; 00041 00043 00046 void SetLocation(const VPPoint4D& newLocation); 00047 00048 VPPoint4D GetLocation() const { return location; } 00052 bool DrawOGL(unsigned int oglLightID) const; 00053 // CLASS CONSTANT INITIALIZERS 00055 static const VPLight& SUN(); 00057 static const VPLight& BRIGHT_AMBIENT(); 00058 private: 00059 float intensity; 00060 float ambientIntensity; 00061 VPColor color; 00062 bool on; 00063 VPPoint4D location; //unified representation of location/direction. 00064 }; 00065 00066 #endif // __VPLIGHT_H