c

class Environment

Include: Clouds/Environment.h

The main class that manages environment data. Usually, you will create a single instance of Environment, which will persist while your 3D game or simulation world is active.

If you use environment directly and not via TrueSkyRenderer, you must call the following each frame:

SetRealTime(time_seconds); skyKeyframer->TimeStep(step_days); Update();

Functions

  Environment(simul::base::MemoryInterface mem)
  ~Environment()
simul::clouds::Environment * Create(simul::base::MemoryInterface m)
simul::clouds::CloudKeyframer * CreateCloudKeyframer(simul::base::MemoryInterface m, bool make2d, int id)
void CreateSubObjects()
bool DeleteCloudKeyframer(int uid)
void Destroy(simul::clouds::Environment env)
simul::clouds::CloudKeyframer * GetCloudKeyframer(int uid)
unsigned int GetKeyframersChecksum()
void Load(simul::sky::Input is)
void LoadFromText(simul::crossplatform::TextInput input)
void New()
void Reset()
void Save(simul::sky::Output os)
void SaveToText(simul::crossplatform::TextOutput output)
void SetRealTime(double rt_sec)
void Update()
simul::sky::SkyKeyframer * CreateSkyKeyframer(simul::base::MemoryInterface m, int NumElevations, int NumDistances, float MaxFadeDistanceKm)

The main class that manages environment data. Usually, you will create a single instance of Environment, which will persist while your 3D game or simulation world is active.

If you use environment directly and not via TrueSkyRenderer, you must call the following each frame:

SetRealTime(time_seconds); skyKeyframer->TimeStep(step_days); Update();

Functions

Environment(simul::base::MemoryInterface mem)

Constructor - initialize with an optional memory allocator.

~Environment()

Destructor

simul::clouds::Environment * Create(simul::base::MemoryInterface m)

Create an Environment.

simul::clouds::CloudKeyframer * CreateCloudKeyframer(simul::base::MemoryInterface m, bool make2d, int id)

Override this to create a custom derived keyframer. Valid id’s are anything greater than zero.

void CreateSubObjects()

Call this to create the keyframer sub-objects. If not called before the first Update(), it will be called from there.

bool DeleteCloudKeyframer(int uid)

Delete the specified cloud layer.

void Destroy(simul::clouds::Environment env)

Destroy an Environment .

simul::clouds::CloudKeyframer * GetCloudKeyframer(int uid)

Get the cloud keyframer with the specified uid.

unsigned int GetKeyframersChecksum()

A checksum for the keyframer setup.

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

Load a sequence from the binary .seq format.

void LoadFromText(simul::crossplatform::TextInput input)

Load a sequence from the text .sq format.

void New()

Clear the sequence.

void Reset()

Force recalculation of any cached values.

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

Save a sky sequence as binary (the .seq file format); this is a low-overhead method of storing and retrieving sequences, but is subject to format changes, so sequences should generally be stored as text (see

void SaveToText(simul::crossplatform::TextOutput output)

Save a sky sequence as text (the .sq file format). This is the standard means of storing sequences.

void SetRealTime(double rt_sec)

Call this once per frame before Update() if you use real-time updates for clouds, rain, lightning, sky keyframes etc.

void Update()

Call this once per-frame

simul::sky::SkyKeyframer * CreateSkyKeyframer(simul::base::MemoryInterface m, int NumElevations, int NumDistances, float MaxFadeDistanceKm)

Override this to create a custom derived keyframer.

Fields

cloudKeyframers The main 3D cloud layer.

skyKeyframer The atmosphere/sky keyframer.