Select your engine:

class SkyKeyframer

Include: Sky/SkyKeyframer.h

A class that maintains sky properties and interpolates them based on keyframe values.

simul::base::Referenced simul::sky::BaseKeyframer simul::sky::BaseSkyInterface

Functions

void CalcSunIrradianceAtEarth()
void ClearHighlightConstellations()
void DaytimeToClockTime(float t, int d, int h, int m, int s, int ms)
void DeleteKeyframe(int i)
float GetAltitudeTexCoord(float h_km)
vec3 GetDirectionToMoon(int keyframe)
vec3 GetDirectionToSun(int keyframe)
float GetFloat(char name, simul::base::Variant params)
void GetGpuSkyParameters(simul::sky::GpuSkyParameters p, simul::sky::GpuSkyAtmosphereParameters a, simul::sky::GpuSkyInfraredParameters ir, int index)
void GetGpuSkyParameters(simul::sky::GpuSkyParameters p, simul::sky::GpuSkyAtmosphereParameters a, simul::sky::GpuSkyInfraredParameters ir, simul::sky::SkyKeyframe K, float daytime, float complete)
std::set const GetHighlightConstellations()
float GetHorizonElevation(float h_km)
int GetInt(char name, simul::base::Variant params)
simul::sky::SkyKeyframe * GetInterpolatedKeyframe()
simul::sky::LightingState const & GetLightingState()
float GetMultiplier(double t)
simul::sky::SkyKeyframe * GetNextModifiableKeyframe()
void GetStartDate(int y, int m, int d)
unsigned int GetSubdivisionChecksum()
bool HasFloat(char name)
bool HasInt(char name)
void HighlightConstellation(char)
void OverrideMoonDirection(float az, float el)
void OverrideSunDirection(float az, float el)
void Set(char name, simul::base::Variant params)
void SetFloat(char name, float val)
void SetInt(char name, int val)
void SetStartDate(int y, int m, int d)
void SetUniformKeyframes(int Steps, float range)
void UnHighlightConstellation(char)
void Update()
void EnsureSunAndMoonValidity(simul::sky::SkyKeyframe K1)

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. BaseSkyRendererand BaseAtmosphericsRenderer. 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.

Base Classes

simul::base::Referenced simul::sky::BaseKeyframer simul::sky::BaseSkyInterface

Functions

void CalcSunIrradianceAtEarth()

Calculate SunIrradiance using the solar irradiance tables outside Earth’s atmosphere, based on ColourWavelengthsNm.

void ClearHighlightConstellations()

Clear the highlighted constellations

void DaytimeToClockTime(float t, int d, int h, int m, int s, int ms)

Convert a floating-point daytime into hour, minute, second and milliseconds.

void DeleteKeyframe(int i)

Delete a skykeyframe with the given ID

float GetAltitudeTexCoord(float h_km)

Returns the texture coordinate for the given altitude - constant per-frame.

vec3 GetDirectionToMoon(int keyframe)

Get the direction the moon represented as a vector

vec3 GetDirectionToSun(int keyframe)

Get the direction the sun represented as a vector

float GetFloat(char name, simul::base::Variant params)

Get a float with the given, case-insensitive, name

void GetGpuSkyParameters(simul::sky::GpuSkyParameters p, simul::sky::GpuSkyAtmosphereParameters a, simul::sky::GpuSkyInfraredParameters ir, int index)

Get the GPU sky parameters corresponding to the given subdivision triplet index, and factor in eclipses and brightness power modifiers.

void GetGpuSkyParameters(simul::sky::GpuSkyParameters p, simul::sky::GpuSkyAtmosphereParameters a, simul::sky::GpuSkyInfraredParameters ir, simul::sky::SkyKeyframe K, float daytime, float complete)

Get the GPU sky parameters corresponding to the given keyframe at the stated time.

std::set const GetHighlightConstellations()

Get the set of highlighted constellations

float GetHorizonElevation(float h_km)

The elevation of the horizon at this altitude

int GetInt(char name, simul::base::Variant params)

Get an int with the given, case-insensitive, name

simul::sky::SkyKeyframe * GetInterpolatedKeyframe()

Get the current interpolatedkeyframe, which holds the values interpolated from the two surrounding keyframes at any given time.

simul::sky::LightingState const & GetLightingState()

Get the per-frame cached lighting state

float GetMultiplier(double t)

Get the calculated multiplication factor for outputs. SunIrradiance is multiplied by this value to calculate sky colours. Divide local irradiances by this value to get the value in physical units. Divide radiances (i.e. rendered colours) by this value to get the radiance in physical units.

simul::sky::SkyKeyframe * GetNextModifiableKeyframe()

The next keyframe not partially built or being used. This keyframe’s properties can be modified without any pause or rebuild.

void GetStartDate(int y, int m, int d)

What date is referred to as time zero.

unsigned int GetSubdivisionChecksum()

This is a checksum that only changes if an in-use subdivision has modified (cycling does not change it).

bool HasFloat(char name)

Return true if the keyframer has the floating point value with the given, case-insensitive, name; return false otherwise.

These are the properties the SkyKeyframer has:

bool HasInt(char name)

Return true if the keyframer has an integer or true/false value with the given, case-insensitive, name; return false otherwise.

These are the properties the SkyKeyframer has:

void HighlightConstellation(char)

Highlight the named constellation in debug views:

void OverrideMoonDirection(float az, float el)

Set the current direction of the moon by it’s Azimuth and Elevation

void OverrideSunDirection(float az, float el)

Set the current direction of the sun by it’s Azimuth and Elevation

void Set(char name, simul::base::Variant params)

Set a value with the given enum

void SetFloat(char name, float val)

Set a float with the given, case-insensitive, name

void SetInt(char name, int val)

Set an int with the given, case-insensitive, name

void SetStartDate(int y, int m, int d)

Set the date for time=0.

void SetUniformKeyframes(int Steps, float range)

Create a number of evenly spaced keyframes.

void UnHighlightConstellation(char)

Remove the named constellation from the highlighted list

void Update()

Per-frame update call, this function updates the interpolation and the tables.

void EnsureSunAndMoonValidity(simul::sky::SkyKeyframe K1)

Apply any overrides.