3 * Copyright (C) 2006-2007 Mathias Froehlich
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 #ifndef _SG_VASI_DRAWABLE_HXX
23 #define _SG_VASI_DRAWABLE_HXX
25 #include <simgear/compiler.h>
27 #include <osg/Drawable>
28 #include <simgear/math/SGMath.hxx>
30 class SGVasiDrawable : public osg::Drawable {
33 META_Object(SimGear, SGVasiDrawable);
34 SGVasiDrawable(const SGVasiDrawable&, const osg::CopyOp&);
35 SGVasiDrawable(const SGVec4f& red = SGVec4f(1, 0, 0, 1),
36 const SGVec4f& white = SGVec4f(1, 1, 1, 1));
38 /// Add a red/white switching light pointing into the direction that
39 /// is computed to point in about the given normal with the given
40 /// azimut angle upwards. The up direction is the world up direction
41 /// that defines the horizontal plane.
42 void addLight(const SGVec3f& position, const SGVec3f& normal,
43 const SGVec3f& up, float azimutDeg);
45 /// add a red/white switching light pointing towards normal
46 /// at the given position with the given up vector. The up direction
47 /// is the world up direction that defines the horizontal plane.
48 void addLight(const SGVec3f& position, const SGVec3f& normal,
51 virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
52 virtual osg::BoundingBox computeBound() const;
55 SGVec4f getColor(float angleDeg) const;
56 void draw(const SGVec3f& eyePoint, const LightData& light) const;
58 std::vector<LightData> _lights;
63 #endif // _SG_VASI_LIGHT_HXX