paysages3d/src/render/software/VegetationRenderer.h

53 lines
1.4 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:
VegetationRenderer(SoftwareRenderer *parent);
/**
* Totally enable or disable the vegetation layers rendering.
*/
void setEnabled(bool enabled);
2015-10-18 15:26:19 +00:00
inline SoftwareRenderer *getParent() const {return parent;}
/**
* Perform ray casting on a single instance.
2015-10-18 20:15:19 +00:00
*
* If *only_hit* is true, only care about hitting or not, do not compute the color.
*
* If *displaced* is true, *instance* is considered on already displaced terrain, else, terrain displacement is applied.
2015-10-18 15:26:19 +00:00
*/
2015-10-18 20:15: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);
/**
* 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:
SoftwareRenderer *parent;
bool enabled;
2015-10-18 15:26:19 +00:00
};
}
}
#endif // VEGETATIONRENDERER_H