#include <simgear/math/SGMath.hxx>
#include <osg/ref_ptr>
-#include <osgDB/ReaderWriter>
namespace osg
{
class StateSet;
}
+#include <simgear/scene/model/SGReaderWriterXMLOptions.hxx>
#include <simgear/props/props.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
#include <simgear/scene/util/SGSceneFeatures.hxx>
namespace simgear
{
class Effect;
+void reload_shaders();
}
class SGMaterialGlyph;
*/
SGMaterial( const osgDB::ReaderWriter::Options*, const SGPropertyNode *props);
+ SGMaterial(const simgear::SGReaderWriterXMLOptions*,
+ const SGPropertyNode *props);
/**
* Destructor.
*/
inline double get_light_coverage () const { return light_coverage; }
/**
- * Get the forest coverage.
+ * Get the wood coverage.
*
- * A smaller number means more generated forest canopy.
+ * A smaller number means more generated woods within the forest.
*
- * @return The area (m^2) covered by each canopy.
+ * @return The area (m^2) covered by each wood.
*/
- inline double get_tree_coverage () const { return tree_coverage; }
+ inline double get_wood_coverage () const { return wood_coverage; }
/**
- * Get the forest height.
+ * Get the density of the wood
+ *
+ * @return The area (m^2) covered by each tree in the wood.
+ */
+ inline double get_tree_density () const { return tree_density; }
+
+ /**
+ * Get the size of each wood
+ *
+ * @return the average area (m^2) of each wood
+ */
+ inline double get_wood_size () const { return wood_size; }
+
+ /**
+ * Get the tree height.
*
* @return The average height of the trees.
*/
inline double get_tree_height () const { return tree_height; }
/**
- * Get the forest width.
+ * Get the tree width.
*
* @return The average width of the trees.
*/
protected:
struct _internal_state {
+ _internal_state(simgear::Effect *e, bool l,
+ const simgear::SGReaderWriterXMLOptions *o);
_internal_state(simgear::Effect *e, const std::string &t, bool l,
- const osgDB::ReaderWriter::Options *o);
+ const simgear::SGReaderWriterXMLOptions *o);
+ void add_texture(const std::string &t, int i);
osg::ref_ptr<simgear::Effect> effect;
- std::string texture_path;
+ std::vector<std::pair<std::string,int> > texture_paths;
bool effect_realized;
- osg::ref_ptr<const osgDB::ReaderWriter::Options> options;
+ osg::ref_ptr<const simgear::SGReaderWriterXMLOptions> options;
};
private:
// coverage of night lighting.
double light_coverage;
- // coverage of trees
- double tree_coverage;
-
+ // coverage of woods
+ double wood_coverage;
+
+ // The size of each wood
+ double wood_size;
+
+ // Tree density within the wood
+ double tree_density;
+
// Range at which trees become visible
double tree_range;
// Internal constructors and methods.
////////////////////////////////////////////////////////////////////
- void read_properties(const osgDB::ReaderWriter::Options* options,
+ void read_properties(const simgear::SGReaderWriterXMLOptions* options,
const SGPropertyNode *props);
- void buildEffectProperties(const osgDB::ReaderWriter::Options* options);
+ void buildEffectProperties(const simgear::SGReaderWriterXMLOptions* options);
};