paysages3d/src/definition/VegetationInstance.h
Michaël Lemaire 9a096ec329 Merge branch 'master' into vegetation
Conflicts:
	src/basics/Disk.cpp
	src/basics/Disk.h
	src/basics/SpaceSegment.cpp
	src/definition/DefinitionNode.cpp
	src/definition/DefinitionNode.h
	src/definition/Scenery.cpp
	src/definition/Scenery.h
	src/definition/SurfaceMaterial.cpp
	src/definition/SurfaceMaterial.h
	src/definition/TextureLayerDefinition.cpp
	src/definition/definition_global.h
	src/interface/commandline/tests.cpp
	src/render/opengl/OpenGLRenderer.cpp
	src/render/software/SoftwareCanvasRenderer.cpp
	src/render/software/SoftwareCanvasRenderer.h
	src/render/software/SoftwareRenderer.h
	src/render/software/TerrainRasterizer.cpp
	src/render/software/TerrainRasterizer.h
	src/render/software/TerrainRenderer.h
	src/render/software/software_global.h
2015-11-09 22:38:00 +01:00

45 lines
1 KiB
C++

#ifndef VEGETATIONINSTANCE_H
#define VEGETATIONINSTANCE_H
#include "definition_global.h"
#include "Vector3.h"
namespace paysages {
namespace definition {
/**
* 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;
}
/**
* Return a copy of this instance, with terrain displacement applied.
*/
VegetationInstance displace(const Vector3 &location, const Vector3 &normal) const;
private:
const VegetationModelDefinition &model;
Vector3 base;
double size;
double angle;
};
}
}
#endif // VEGETATIONINSTANCE_H