Sky Keyframer¶
The SkyKeyframer is accessed from the environment instance, and controls the sky and atmospheric state via skykeyframe.
-
class SkyKeyframer : public simul::sky::BaseKeyframer, public simul::sky::BaseSkyInterface¶
A class that maintains sky properties and interpolates them based on keyframe values.
An instance of the SkyKeyframer is kept as a member of the Environment instance. The SkyKeyframer interpolates the sky values, and passes the keyframe and interpolation data to external renderers, e.g. SkyRenderer and AtmosphericsRenderer. The generated tables are calculated for multiple altitudes - specified with SetNumAltitudes. The SunIrradiance value determines the colour and strength of sunlight, and is expressed in physical units. The apparent size of the sun is set using SetSunRadiusArcMinutes.
Public Functions
-
virtual vec3 GetLocalDirectionToSun() const override¶
Get the current direction to the sun.
-
virtual vec3 GetLocalDirectionToSun(double time, double latitudeRadians, double longitudeRadians, double headingRadians) const override¶
Get the direction to the Sun at the given time.
-
virtual vec3 GetLocalDirectionToMoon(uid u = 0) const override¶
Get the current direction to the Moon.
-
virtual vec3 GetLocalDirectionToMoon(uid u, double time, double latitudeRadians, double longitudeRadians, double headingRadians) const override¶
Get the direction to the Moon at the given time.
-
virtual vec3 GetLocalSunIrradiance(double t, float altitude_km) const override¶
Get the sunlight that reaches the altitude altitude_km.
-
virtual BaseKeyframe *InsertKeyframe(float t, bool insertFromFile = false) override¶
Insert a keyframe at the given time and return a pointer to it.
-
void DeleteKeyframe(int i)¶
Delete a skykeyframe with the given ID.
-
virtual BaseKeyframe *GetKeyframe(int index) override¶
Get a pointer to the i’th keyframe.
-
virtual const BaseKeyframe *GetKeyframe(int i) const override¶
Get a pointer to the i’th keyframe.
-
virtual vec3 GetLocalDirectionToSun() const override¶