paysages3d/src/render/software/VegetationRenderer.h

57 lines
1.6 KiB
C
Raw Normal View History

2015-10-18 15:26:19 +00:00
#ifndef VEGETATIONRENDERER_H
#define VEGETATIONRENDERER_H
#include "software_global.h"
#include "LightFilter.h"
namespace paysages {
namespace software {
class SOFTWARESHARED_EXPORT VegetationRenderer : public LightFilter {
public:
2015-10-18 15:26:19 +00:00
VegetationRenderer(SoftwareRenderer *parent);
virtual ~VegetationRenderer();
2015-10-18 15:26:19 +00:00
/**
* Totally enable or disable the vegetation layers rendering.
*/
void setEnabled(bool enabled);
inline SoftwareRenderer *getParent() const {
return parent;
}
2015-10-18 15:26:19 +00:00
/**
* Perform ray casting on a single instance.
2015-10-18 20:15:19 +00:00
*
2016-01-06 18:55:49 +00:00
* If 'only_hit' is true, only care about hitting or not, do not compute the color.
2015-10-18 20:15:19 +00:00
*
2016-01-06 18:55:49 +00:00
* If 'displaced' is true, 'instance' is considered on already displaced terrain, else, terrain displacement is
*applied.
2015-10-18 15:26:19 +00:00
*/
RayCastingResult renderInstance(const SpaceSegment &segment, const VegetationInstance &instance,
bool only_hit = false, bool displaced = false);
2015-10-18 15:26:19 +00:00
/**
* Perform ray casting on a given segment.
*/
RayCastingResult getResult(const SpaceSegment &segment, bool only_hit = false);
2015-10-18 15:26:19 +00:00
/**
* Perform ray casting on a squared region.
*/
RayCastingResult getBoundResult(const SpaceSegment &segment, double x, double z, bool only_hit = false,
double xsize = 1.0, double zsize = 1.0);
2015-10-18 15:26:19 +00:00
virtual bool applyLightFilter(LightComponent &light, const Vector3 &at) override;
private:
2015-10-18 15:26:19 +00:00
SoftwareRenderer *parent;
bool enabled;
2015-10-18 15:26:19 +00:00
};
}
}
#endif // VEGETATIONRENDERER_H