]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/sky/dome.hxx
accomodate changes to osgDB::DatabasePager interface
[simgear.git] / simgear / scene / sky / dome.hxx
index 401e238088eacb4391d617227430a60ea7fbef52..13fcf24366f7edd30bd138556886b76048f76b3c 100644 (file)
@@ -18,9 +18,6 @@
 // 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.
-//
-// $Id$
-
 
 #ifndef _SKYDOME_HXX
 #define _SKYDOME_HXX
 # error This library requires C++
 #endif
 
+#include <osg/ref_ptr>
+#include <osg/Array>
+#include <osg/MatrixTransform>
 
-#include <plib/ssg.h>          // plib include
-
-
-class SGSkyDome {
-    ssgTransform *dome_transform;
-    ssgSimpleState *dome_state;
-
-    ssgVertexArray *center_disk_vl;
-    ssgColourArray *center_disk_cl;
-
-    ssgVertexArray *upper_ring_vl;
-    ssgColourArray *upper_ring_cl;
-
-    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
@@ -62,7 +55,7 @@ public:
 
     // 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
@@ -71,15 +64,18 @@ public:
     // 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& sun_color, 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);
 };