00001
00002
00003
00005
00006
00011
00016
00021
00023
00024 #ifndef SPOTLIGHT
00025 #define SPOTLIGHT
00026
00027 #include "X3DTypes.h"
00028 #include "X3DLightNode.h"
00029
00030 namespace X3DTK {
00031 namespace X3D {
00032
00037
00038 class SpotLight : public X3DLightNode
00039 {
00040 public:
00042 SpotLight();
00044 SpotLight(SFFloat ambientIntensity,
00045 const SFVec3f &attenuation,
00046 SFFloat beamWidth,
00047 const SFColor &color,
00048 SFFloat cutOffAngle,
00049 const SFVec3f &direction,
00050 SFFloat intensity,
00051 const SFVec3f &location,
00052 SFBool on,
00053 SFFloat radius);
00055 virtual SFNode clone() const;
00057 virtual ~SpotLight();
00058
00060 void setAttenuation(const SFVec3f &attenuation);
00062 void setBeamWidth(SFFloat beamWidth);
00064 void setCutOffAngle(SFFloat cutOffAngle);
00066 void setDirection(const SFVec3f &direction);
00068 void setLocation(const SFVec3f &location);
00070 void setRadius(SFFloat radius);
00071
00073 inline const SFVec3f &getAttenuation() const {return _attenuation;};
00075 inline SFFloat getBeamWidth() const {return _beamWidth;};
00077 inline SFFloat getCutOffAngle() const {return _cutOffAngle;};
00079 inline const SFVec3f &getDirection() const {return _direction;};
00081 inline const SFVec3f &getLocation() const {return _location;};
00083 inline SFFloat getRadius() const {return _radius;};
00084
00086 virtual void load(const X3DFileElement *element);
00088 virtual SFString write() const;
00089
00090 protected:
00092 SpotLight(const SpotLight &N);
00093
00094 private:
00096 SFVec3f _attenuation;
00098 SFFloat _beamWidth;
00100 SFFloat _cutOffAngle;
00102 SFVec3f _direction;
00104 SFVec3f _location;
00106 SFFloat _radius;
00107 };
00108
00109 }
00110 }
00111
00112 #endif