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>
26 #include <simgear/math/SGMath.hxx>
28 #include <osg/Drawable>
29 #include <osg/Version>
31 class SGVasiDrawable : public osg::Drawable {
34 META_Object(SimGear, SGVasiDrawable);
35 SGVasiDrawable(const SGVasiDrawable&, const osg::CopyOp&);
36 SGVasiDrawable(const SGVec4f& red = SGVec4f(1, 0, 0, 1),
37 const SGVec4f& white = SGVec4f(1, 1, 1, 1));
39 /// Add a red/white switching light pointing into the direction that
40 /// is computed to point in about the given normal with the given
41 /// azimut angle upwards. The up direction is the world up direction
42 /// that defines the horizontal plane.
43 void addLight(const SGVec3f& position, const SGVec3f& normal,
44 const SGVec3f& up, float azimutDeg);
46 /// add a red/white switching light pointing towards normal
47 /// at the given position with the given up vector. The up direction
48 /// is the world up direction that defines the horizontal plane.
49 void addLight(const SGVec3f& position, const SGVec3f& normal,
52 virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
53 virtual osg::BoundingBox
54 #if OSG_VERSION_LESS_THAN(3,3,2)
62 SGVec4f getColor(float angleDeg) const;
63 void draw(const SGVec3f& eyePoint, const LightData& light) const;
65 std::vector<LightData> _lights;
70 #endif // _SG_VASI_LIGHT_HXX