// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Library General Public License for more details.
//
-// You should have received a copy of the GNU Library General Public
-// License along with this library; if not, write to the
-// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-// Boston, MA 02111-1307, USA.
-//
-// $Id$
-
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef _SKYDOME_HXX
#define _SKYDOME_HXX
-#ifndef __cplusplus
+#ifndef __cplusplus
# error This library requires C++
-#endif
-
-
-#include <plib/ssg.h> // plib include
-
-
-class SGSkyDome {
- ssgTransform *dome_transform;
- ssgSimpleState *dome_state;
-
- ssgVertexArray *center_disk_vl;
- ssgColourArray *center_disk_cl;
+#endif
- ssgVertexArray *upper_ring_vl;
- ssgColourArray *upper_ring_cl;
+#include <osg/ref_ptr>
+#include <osg/Array>
+#include <osg/MatrixTransform>
- ssgVertexArray *middle_ring_vl;
- ssgColourArray *middle_ring_cl;
+#include <simgear/structure/SGReferenced.hxx>
+#include <simgear/math/SGMath.hxx>
- ssgVertexArray *lower_ring_vl;
- ssgColourArray *lower_ring_cl;
+namespace osg
+{
+class DrawElementsUShort;
+}
- float asl;
+class SGSkyDome : public SGReferenced {
+ osg::ref_ptr<osg::MatrixTransform> dome_transform;
+ double asl;
+ osg::ref_ptr<osg::Vec3Array> dome_vl;
+ osg::ref_ptr<osg::Vec3Array> dome_cl;
public:
// Constructor
// initialize the sky object and connect it into our scene graph
// root
- ssgBranch *build( double hscale = 80000.0, double vscale = 80000.0 );
+ osg::Node *build( double hscale = 80000.0, double vscale = 80000.0 );
// repaint the sky colors based on current value of sun_angle,
// sky, and fog colors. This updates the color arrays for
// 0 degrees = high noon
// 90 degrees = sun rise/set
// 180 degrees = darkest midnight
- bool repaint( sgVec3 sky_color, sgVec3 fog_color, double sun_angle,
- double vis );
+ bool repaint( const SGVec3f& sky_color, const SGVec3f& fog_color,
+ double sun_angle, double vis );
// reposition the sky at the specified origin and orientation
// lon specifies a rotation about the Z axis
// lat specifies a rotation about the new Y axis
// spin specifies a rotation about the new Z axis (and orients the
// sunrise/set effects
- bool reposition( sgVec3 p, double lon, double lat, double spin );
+ bool reposition( const SGVec3f& p, double asl,
+ double lon, double lat, double spin );
+private:
+ void makeDome(int rings, int bands, osg::DrawElementsUShort& elements);
};