c

class CloudKeyframer

Include: Clouds/BaseWeatherRenderer.h

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

Classes and Structures

struct Storm  

Functions

  CloudKeyframer(simul::base::MemoryInterface mem, bool make2d)
  ~CloudKeyframer()
simul::clouds::CloudKeyframer::Storm * AddStorm(float t0, float t1, vec2 centre_km, float r_km)
void DeleteKeyframe(int i)
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)
float GetFloat(char name, simul::base::Variant params)
simul::math::Vector3 GetGridOrigin()
simul::math::Vector3 GetInitialOffset()
int GetInt(char name, simul::base::Variant params)
simul::clouds::CloudKeyframe & GetInterpolatedKeyframe()
float GetInterpolation()
unsigned int GetInterpolationChecksum()
simul::sky::BaseKeyframe * GetKeyframe(int i)
simul::clouds::LightningProperties GetLightningProperties(float game_time, float real_time)
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::math::Vector3 GetWindOffsetKm()
bool HasFloat(char name)
bool HasInt(char name)
simul::clouds::CloudKeyframe * InsertKeyframe(float t)
void Load(simul::sky::Input is)
void LoadFromText(simul::crossplatform::TextInput input)
void New()
simul::clouds::CloudKeyframer const & operator=(simul::clouds::CloudKeyframer SK)
void RecalculateOffsets()
void Relocate(pos_before, pos_after)
void RemoveVolume(int id)
void Reset()
void Save(simul::sky::Output os)
void SaveToText(simul::crossplatform::TextOutput output, bool include_keyframes)
void SetFloat(char name, float val)
void SetInt(char name, int val)
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()

Base Classes

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

Functions

CloudKeyframer(simul::base::MemoryInterface mem, bool make2d)

Constructor

~CloudKeyframer()

Destructor

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 DeleteKeyframe(int i)

Remove a keyframe

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 int 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.

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

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

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().

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

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

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.

simul::sky::BaseKeyframe * GetKeyframe(int i)

Get a pointer to the keyframe with the given ID

simul::clouds::LightningProperties GetLightningProperties(float game_time, float real_time)

Get the properties of the currently active lightning strike

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::math::Vector3 GetWindOffsetKm()

Get the current offset of the cloud window due to wind.

bool HasFloat(char name)

Return true if the keyframe has a float value with the given, case-insensitive, name; return false otherwise.

bool HasInt(char name)

Return true if the keyframe has an int value with the given, case-insensitive, name; return false otherwise.

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 LoadFromText(simul::crossplatform::TextInput input)

Load from a text file

void New()

Clear keyframes.

simul::clouds::CloudKeyframer const & operator=(simul::clouds::CloudKeyframer SK)

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

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 RemoveVolume(int id)

Remove a custom cloud volume

void Reset()

Force recalculation of the per-keyframe tables.

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

Save to a binary stream:

void SaveToText(simul::crossplatform::TextOutput output, bool include_keyframes)

Save to a text file

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 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