2013-12-26 14:36:15 +00:00
|
|
|
#ifndef NIGHTSKY_H
|
|
|
|
#define NIGHTSKY_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
2015-09-24 22:12:31 +00:00
|
|
|
#include "LightSource.h"
|
|
|
|
|
2013-12-26 14:36:15 +00:00
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
2016-01-03 18:21:23 +00:00
|
|
|
/**
|
|
|
|
* Night sky renderer.
|
2013-12-26 14:36:15 +00:00
|
|
|
*/
|
2015-11-09 21:30:46 +00:00
|
|
|
class SOFTWARESHARED_EXPORT NightSky : public LightSource {
|
|
|
|
public:
|
|
|
|
NightSky(SoftwareRenderer *renderer);
|
2013-12-26 14:36:15 +00:00
|
|
|
virtual ~NightSky();
|
|
|
|
|
2016-01-03 18:21:23 +00:00
|
|
|
/**
|
|
|
|
* Update the night sky renderer, when the scenery or parent renderer changed.
|
2013-12-26 14:36:15 +00:00
|
|
|
*/
|
|
|
|
void update();
|
|
|
|
|
2016-01-03 18:21:23 +00:00
|
|
|
/**
|
|
|
|
* Get the color of the night sky at a given direction.
|
|
|
|
*
|
2016-01-06 18:55:49 +00:00
|
|
|
* 'altitude' is above water level, in coordinate units (not kilometers).
|
2013-12-26 14:36:15 +00:00
|
|
|
*/
|
|
|
|
virtual const Color getColor(double altitude, const Vector3 &direction);
|
|
|
|
|
2015-12-10 23:36:50 +00:00
|
|
|
virtual bool getLightsAt(vector<LightComponent> &result, const Vector3 &location) const override;
|
2013-12-26 17:28:25 +00:00
|
|
|
|
2015-11-09 21:30:46 +00:00
|
|
|
private:
|
|
|
|
SoftwareRenderer *renderer;
|
2013-12-26 14:36:15 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // NIGHTSKY_H
|