00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _SG_VASI_DRAWABLE_HXX
00023 #define _SG_VASI_DRAWABLE_HXX
00024
00025 #include <simgear/compiler.h>
00026
00027 #include <osg/Drawable>
00028 #include <simgear/math/SGMath.hxx>
00029
00030 class SGVasiDrawable : public osg::Drawable {
00031 struct LightData;
00032 public:
00033 META_Object(SimGear, SGVasiDrawable);
00034 SGVasiDrawable(const SGVasiDrawable&, const osg::CopyOp&);
00035 SGVasiDrawable(const SGVec4f& red = SGVec4f(1, 0, 0, 1),
00036 const SGVec4f& white = SGVec4f(1, 1, 1, 1));
00037
00042 void addLight(const SGVec3f& position, const SGVec3f& normal,
00043 const SGVec3f& up, float azimutDeg);
00044
00048 void addLight(const SGVec3f& position, const SGVec3f& normal,
00049 const SGVec3f& up);
00050
00051 virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
00052 virtual osg::BoundingBox computeBound() const;
00053
00054 private:
00055 SGVec4f getColor(float angleDeg) const;
00056 void draw(const SGVec3f& eyePoint, const LightData& light) const;
00057
00058 std::vector<LightData> _lights;
00059 SGVec4f _red;
00060 SGVec4f _white;
00061 };
00062
00063 #endif // _SG_VASI_LIGHT_HXX