c

class CloudKeyframer

Include: Clouds/CloudRenderer.h

A class to manage interpolation between cloud states over time. Typically, a CloudKeyframer is created and updated by its Environment and Environment.

If time and daytime are linked in the SkyKeyframer, time is in days, otherwise the timescale is in arbitrary units.

simul::sky::OvercastCallback simul::sky::BaseKeyframer

Classes and Structures

struct Storm  

Functions

simul::clouds::CloudKeyframer::Storm * AddStorm(float t0, float t1, vec2 centre_km, float r_km)
void DeleteStorm(int i)
void DeleteStormByUniqueId(unsigned int uid)
void ForceRelight()
simul::clouds::CloudInterface * GetCloudInterface()
float GetDefaultFloat(char name)
int GetDefaultInt(char name)
int GetExportLightningStrikes(simul::clouds::ExportLightningStrike strikes, int max_s, float game_time, float real_time)
simul::math::Vector3 GetGridOrigin()
simul::math::Vector3 GetInitialOffset()
simul::clouds::CloudKeyframe & GetInterpolatedKeyframe()
float GetInterpolation()
unsigned int GetInterpolationChecksum()
float GetMaximumLocalPrecipitation(pos)
simul::clouds::CloudKeyframe * GetNextModifiableKeyframe()
int GetNumKeyframes()
int GetNumStorms()
simul::clouds::CloudKeyframer::Storm const * GetStorm(float t)
simul::clouds::CloudKeyframer::Storm * GetStorm(float t)
simul::clouds::CloudKeyframer::Storm * GetStorm(int i)
simul::clouds::CloudKeyframer::Storm * GetStormByUniqueId(unsigned int uid)
simul::clouds::CloudKeyframer::Storm const * GetStormByUniqueId(unsigned int uid)
unsigned int GetSubdivisionChecksum()
int3 GetTextureSizes()
simul::clouds::CloudKeyframe * InsertKeyframe(float t)
void Load(simul::sky::Input is)
void New()
void RecalculateOffsets()
void Relocate(pos_before, pos_after)
void Reset()
void Save(simul::sky::Output os)
void SetLoopWind()
void SetRecalculate()
void SetSkyInterface(simul::sky::BaseSkyInterface si)
void SetUniformKeyframes(int StepsPerDay, float range)
void SetVolume(int id, simul::clouds::CloudVolumeType type, simul::crossplatform::Quaterniond orig, vec3 scale, vec2 rake)
void Synchronize()
void Update(float new_time)
unsigned int GetOffsetChecksum()

A class to manage interpolation between cloud states over time. Typically, a CloudKeyframer is created and updated by its Environment and Environment.

If time and daytime are linked in the SkyKeyframer, time is in days, otherwise the timescale is in arbitrary units.

Base Classes

simul::sky::OvercastCallback simul::sky::BaseKeyframer

Functions

simul::clouds::CloudKeyframer::Storm * AddStorm(float t0, float t1, vec2 centre_km, float r_km)

Add a storm between the times specified, at the given centre c, with horizontal radius r (km).

void DeleteStorm(int i)

Remove the storm with index i.

void DeleteStormByUniqueId(unsigned int uid)

Remove the storm with unique id uid.

void ForceRelight()

For debugging purposes only.

simul::clouds::CloudInterface * GetCloudInterface()

Set the cloud interface. As the constructor needs a CloudInterface, it is not usually necessary to call this.

float GetDefaultFloat(char name)

Return the default float value with the given, case-insensitive, name.

int GetDefaultInt(char name)

Return the default float value with the given, case-insensitive, name.

int GetExportLightningStrikes(simul::clouds::ExportLightningStrike strikes, int max_s, float game_time, float real_time)

Fills the strikes array and returns how many active strikes in the storm NOTE: right now we only consider 1 strike.

simul::math::Vector3 GetGridOrigin()

Get the origin of the render grid; this is adjusted internally when Relocate() is called.

simul::math::Vector3 GetInitialOffset()

Get the offset of the first keyframe, a mutable property determined by Relocate().

simul::clouds::CloudKeyframe & GetInterpolatedKeyframe()

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

float GetInterpolation()

Get the interpolation - between zero and one. This is based on InterpStepTime and the sky’s Daytime property. When the interpolation reaches one, the textures will be cycled.

unsigned int GetInterpolationChecksum()

Checksum for the interpolated state.

float GetMaximumLocalPrecipitation(pos)

How much precipitation there is at this point. This value is only approximate - it does not account for the actual cloud cover generated on GPU, so it only gives the maximum precipitation that is possible at this point.

simul::clouds::CloudKeyframe * GetNextModifiableKeyframe()

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

int GetNumKeyframes()

Number of keyframes.

int GetNumStorms()

The number of storms on the timeline.

simul::clouds::CloudKeyframer::Storm const * GetStorm(float t)

Get the storm, if any, that is active at time t.

simul::clouds::CloudKeyframer::Storm * GetStorm(float t)

Get the storm, if any, that is active at time t.

simul::clouds::CloudKeyframer::Storm * GetStorm(int i)

Return the storm with index i.

simul::clouds::CloudKeyframer::Storm * GetStormByUniqueId(unsigned int uid)

Return the storm with unique identifier uid.

simul::clouds::CloudKeyframer::Storm const * GetStormByUniqueId(unsigned int uid)

Return the storm with unique identifier uid.

unsigned int GetSubdivisionChecksum()

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

int3 GetTextureSizes()

// REPLACING CALLBACK SEMANTICS WITH ITERATOR MODEL:

simul::clouds::CloudKeyframe * InsertKeyframe(float t)

Insert a new keyframe at time t, sorting in between the existing keyframes if needed, and return a pointer to it.

void Load(simul::sky::Input is)

Load from a binary stream:

void New()

Clear keyframes.

void RecalculateOffsets()

Check for changed offsets and recalculate.

void Relocate(pos_before, pos_after)

Relocate: to avoid numerical precision problems, relocation can be performed. Specify any position, before and after relocation.

void Reset()

Force recalculation of the per-keyframe tables.

void Save(simul::sky::Output os)

Save to a binary stream:

void SetLoopWind()

Make the wind offsets loop based on the loop time.

void SetRecalculate()

Force clouds to regenerate.

void SetSkyInterface(simul::sky::BaseSkyInterface si)

Set the sky - this is used to light the clouds over time.

void SetUniformKeyframes(int StepsPerDay, float range)

Apply the cloud’s properties to all keyframes. Create a number of evenly spaced keyframes.

void SetVolume(int id, simul::clouds::CloudVolumeType type, simul::crossplatform::Quaterniond orig, vec3 scale, vec2 rake)

Set the properties of a custom cloud volume:

void Synchronize()

Restart all the frame-dependent values (mainly wind offsets), for example in order to synchronize rendering across several channels.

void Update(float new_time)

Once-per-frame update for the keyframer, call this with an absolute time value (not a time step).

unsigned int GetOffsetChecksum()

Checksum to determine whether any keyframe has altered its position due to wind speed or direction.

Enums