Add "is_plantation" property to materials definitions.

This commit is contained in:
James.Hester
2019-11-16 11:02:35 +11:00
parent 0919f5bf9c
commit 56933067c0
2 changed files with 11 additions and 0 deletions

View File

@@ -328,6 +328,7 @@ SGMaterial::read_properties(const SGReaderWriterOptions* options,
// Random vegetation properties
wood_coverage = props->getDoubleValue("wood-coverage", 0.0);
is_plantation = props->getBoolValue("plantation",false);
tree_effect = props->getStringValue("tree-effect", "Effects/tree");
tree_height = props->getDoubleValue("tree-height-m", 0.0);
tree_width = props->getDoubleValue("tree-width-m", 0.0);

View File

@@ -244,6 +244,13 @@ public:
*/
inline double get_wood_coverage () const { return wood_coverage; }
/**
* Get whether or not vegetation is regularly spaced
*
* @return flag: if true, vegetation is regularly spaced.
*/
inline bool get_is_plantation () const { return is_plantation; }
/**
* Get the tree height.
*
@@ -455,6 +462,9 @@ private:
// coverage of woods
double wood_coverage;
// are trees regularly planted?
bool is_plantation;
// Range at which trees become visible
double tree_range;