1 // dome.hxx -- model sky with an upside down "bowl"
3 // Written by Curtis Olson, started December 1997.
4 // SSG-ified by Curtis Olson, February 2000.
6 // Copyright (C) 1997-2000 Curtis L. Olson - http://www.flightgear.org/~curt
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
30 # error This library requires C++
33 #include <osg/ref_ptr>
35 #include <osg/MatrixTransform>
37 #include <simgear/structure/SGReferenced.hxx>
38 #include <simgear/math/SGMath.hxx>
40 class SGSkyDome : public SGReferenced {
41 osg::ref_ptr<osg::MatrixTransform> dome_transform;
43 osg::ref_ptr<osg::Vec3Array> center_disk_vl;
44 osg::ref_ptr<osg::Vec3Array> center_disk_cl;
46 osg::ref_ptr<osg::Vec3Array> upper_ring_vl;
47 osg::ref_ptr<osg::Vec3Array> upper_ring_cl;
49 osg::ref_ptr<osg::Vec3Array> middle_ring_vl;
50 osg::ref_ptr<osg::Vec3Array> middle_ring_cl;
52 osg::ref_ptr<osg::Vec3Array> lower_ring_vl;
53 osg::ref_ptr<osg::Vec3Array> lower_ring_cl;
65 // initialize the sky object and connect it into our scene graph
67 osg::Node *build( double hscale = 80000.0, double vscale = 80000.0 );
69 // repaint the sky colors based on current value of sun_angle,
70 // sky, and fog colors. This updates the color arrays for
72 // sun angle in degrees relative to verticle
73 // 0 degrees = high noon
74 // 90 degrees = sun rise/set
75 // 180 degrees = darkest midnight
76 bool repaint( const SGVec3f& sky_color, const SGVec3f& fog_color,
77 double sun_angle, double vis );
79 // reposition the sky at the specified origin and orientation
80 // lon specifies a rotation about the Z axis
81 // lat specifies a rotation about the new Y axis
82 // spin specifies a rotation about the new Z axis (and orients the
83 // sunrise/set effects
84 bool reposition( const SGVec3f& p, double asl,
85 double lon, double lat, double spin );
89 #endif // _SKYDOME_HXX