]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/tgdb/ShaderGeometry.hxx
Replace SG_USE_STD() by using std::
[simgear.git] / simgear / scene / tgdb / ShaderGeometry.hxx
index 78eb1d4f75f1fbb47b09bbf78bd1198dc59b57e4..9814af28c46bb7da847dca9a3c7cdb94bd0898a9 100644 (file)
@@ -32,6 +32,8 @@
 #include <osg/Vec3>
 #include <osg/Vec4>
 
+#include "TreeBin.hxx"
+
 namespace simgear
 {
 
@@ -42,12 +44,18 @@ class ShaderGeometry : public osg::Drawable
         { 
           setUseDisplayList(false); 
         }
+
+        ShaderGeometry(int v) :
+          varieties(v)
+        { 
+          setUseDisplayList(false); 
+        }
         
         /** Copy constructor using CopyOp to manage deep vs shallow copy.*/
         ShaderGeometry(const ShaderGeometry& ShaderGeometry,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
             osg::Drawable(ShaderGeometry,copyop) {}
 
-        META_Object(osg,ShaderGeometry);
+        META_Object(flightgear, ShaderGeometry);
         
         typedef std::vector<osg::Vec4> PositionSizeList;
         
@@ -55,19 +63,20 @@ class ShaderGeometry : public osg::Drawable
         virtual osg::BoundingBox computeBound() const;
     
         
-        void setGeometry(osg::Geometry* geometry)
+        void setGeometry(osg::Drawable* geometry)
         {
             _geometry = geometry;
         }
         
-    void addTree(const osg::Vec3& position, float scale)
+        void addTree(TreeBin::Tree tree)
         {
-            _trees.push_back(osg::Vec4(position, scale));
+            _trees.push_back(tree);
         }
         
-        osg::ref_ptr<osg::Geometry> _geometry;
+        osg::ref_ptr<osg::Drawable> _geometry;
 
-        PositionSizeList _trees;
+        TreeBin::TreeList _trees;
+        int varieties;
 
     protected: