#include <osg/Group>
#include <osg/Matrix>
-#include <simgear/math/SGMath.hxx>
+#include <simgear/scene/util/OsgMath.hxx>
namespace simgear
{
class TreeBin {
public:
struct Tree {
- Tree(const SGVec3f& p, int t, float s) :
- position(p), texture_index(t), scale(s)
+ Tree(const SGVec3f& p) :
+ position(p)
{ }
SGVec3f position;
- int texture_index;
- float scale;
};
typedef std::vector<Tree> TreeList;
float height;
float width;
std::string texture;
-
+
void insert(const Tree& t)
{ _trees.push_back(t); }
void insert(const SGVec3f& p, int t, float s)
- { insert(Tree(p, t, s)); }
+ { insert(Tree(p)); }
unsigned getNumTrees() const
{ return _trees.size(); }
const Tree& getTree(unsigned i) const
{ return _trees[i]; }
TreeList _trees;
+
+ ~TreeBin() {
+ _trees.clear();
+ }
};
-osg::Geometry* createOrthQuads(float w, float h, const osg::Matrix& rotate);
-osg::Group* createForest(TreeBin& forest, const osg::Matrix& transform);
+typedef std::list<TreeBin*> SGTreeBinList;
+
+osg::Group* createForest(SGTreeBinList& forestList, const osg::Matrix& transform,
+ const SGReaderWriterOptions* options);
}
#endif