paysages3d/src/definition/VegetationInstance.h

46 lines
1 KiB
C
Raw Normal View History

2015-10-18 15:26:19 +00:00
#ifndef VEGETATIONINSTANCE_H
#define VEGETATIONINSTANCE_H
2015-10-18 20:15:19 +00:00
#include "definition_global.h"
2015-10-18 15:26:19 +00:00
#include "Vector3.h"
namespace paysages {
2015-10-18 20:15:19 +00:00
namespace definition {
2015-10-18 15:26:19 +00:00
/**
* Single instance of a vegetation layer (e.g. a single tree).
*
* This is used as potential hit on vegetation lookup.
*/
class DEFINITIONSHARED_EXPORT VegetationInstance {
public:
VegetationInstance(const VegetationModelDefinition &model, const Vector3 &base, double size = 1.0,
double angle = 0.0);
inline const VegetationModelDefinition &getModel() const {
return model;
}
inline const Vector3 &getBase() const {
return base;
}
inline double getSize() const {
return size;
}
2015-10-18 15:26:19 +00:00
2015-10-18 20:15:19 +00:00
/**
* Return a copy of this instance, with terrain displacement applied.
*/
VegetationInstance displace(const Vector3 &location, const Vector3 &normal) const;
private:
2015-10-18 15:26:19 +00:00
const VegetationModelDefinition &model;
Vector3 base;
double size;
double angle;
};
}
}
#endif // VEGETATIONINSTANCE_H