00001
00002
00004
00005 #ifndef SPOTLIGHT
00006 #define SPOTLIGHT
00007
00008 #include "X3DTypes.h"
00009 #include "X3D_X3DLightNode.h"
00010
00011 namespace X3DTK {
00012 namespace X3D {
00013
00018
00019 class SpotLight : public X3DLightNode
00020 {
00021 public:
00023 SpotLight();
00025 SpotLight(const SFFloat &ambientIntensity,
00026 const SFVec3f &attenuation,
00027 const SFFloat &beamWidth,
00028 const SFColor &color,
00029 const SFFloat &cutOffAngle,
00030 const SFVec3f &direction,
00031 const SFFloat &intensity,
00032 const SFVec3f &location,
00033 const SFBool &on,
00034 const SFFloat &radius);
00036 virtual SFAbstractNode clone() const;
00038 virtual ~SpotLight();
00039
00041 void setAttenuation(const SFVec3f &attenuation);
00043 void setBeamWidth(const SFFloat &beamWidth);
00045 void setCutOffAngle(const SFFloat &cutOffAngle);
00047 void setDirection(const SFVec3f &direction);
00049 void setLocation(const SFVec3f &location);
00051 void setRadius(const SFFloat &radius);
00052
00054 inline const SFVec3f &getAttenuation() const {return _attenuation;};
00056 inline const SFFloat &getBeamWidth() const {return _beamWidth;};
00058 inline const SFFloat &getCutOffAngle() const {return _cutOffAngle;};
00060 inline const SFVec3f &getDirection() const {return _direction;};
00062 inline const SFVec3f &getLocation() const {return _location;};
00064 inline const SFFloat &getRadius() const {return _radius;};
00065
00067 virtual void load(const X3DFileElement *element);
00069 virtual SFString &write(SFString &output) const;
00070
00071 protected:
00073 SpotLight(const SpotLight &N);
00074
00075 private:
00077 SFVec3f _attenuation;
00079 SFFloat _beamWidth;
00081 SFFloat _cutOffAngle;
00083 SFVec3f _direction;
00085 SFVec3f _location;
00087 SFFloat _radius;
00088 };
00089
00090 }
00091 }
00092
00093 #endif