Cloud Window

struct CloudWindow

Cloud Window Struct.

Public Functions

CloudWindow()
const CloudWindow &operator=(const CloudWindow&)

assignment operator only copies properties, not state.

void Update(vec3 wind_spd_ms, float dt)
void Reset()

Reset offsets.

void InitWindowCentre(double lat_degrees, double long_degrees, double x_heading_degrees)

Initialize the window.

float UpdateWindowCentre(double lat_degrees, double long_degrees, double heading_degrees)

Returns updated x heading in degrees.

Returns updated x heading in degrees. We pass in the viewpoint lat/long, this is what we want to keep the window centre close to. The cloud volume is offset from the origin by the windOffset.

void MoveCloudWindowGridCentreTexel(int x, int y)

Translate the cloud window by the given x and y.

void MoveCloudWindowInitialTexel(int x, int y)
void CheckForOriginChange(crossplatform::Quaterniond new_origin, const CloudRenderingOptions &opts)

Check if the cloud window origin has changed, and update values if it has.

void SetTrueWindOffset()
void SetAccumulatedWindOffsetKm(vec3 accumulatedWindOffset)
void GetLatitudeLongitudeHeading(vec3 pos, double &lat, double &lon, double &head) const

Get the latitude/longitude referred to by the specified position value.

void GetOriginLatitudeLongitudeHeading(double &lat_deg, double &lon_deg, double &head_deg) const

Get the latitude/longitude referred to by the specified quaternion.

double GetOriginLatitudeDegrees() const

Get the latitude referred to by the origin quaternion.

double GetOriginLongitudeDegrees() const

Get the longitude referred to by the origin quaternion.

double GetOriginHeadingDegrees() const
vec3 GlobalQuaternionToLocalOffsetKm(crossplatform::Quaterniond global_quat) const
vec3 WGS84PositionToLocal(vec3d pos_km) const
vec3 WGS84DirectionToLocal(vec3d dir) const
vec3d LocalPositionToWGS84(vec3d pos) const
vec3d LocalDirectionToWGS84(vec3d dir) const
int2 GetGridOffset(int2 old_ctr) const

Public Members

float MinimumHeightKm
int3 VolumeTextureGrid
vec3 windOffsetKm
vec3 accumulatedWindOffsetKm
crossplatform::Quaterniond origin
int WindowGridX
int WindowGridZ
int PrecipitationGridDivisorX
int PrecipitationGridDivisorZ
vec3 WindowScaleKm
int2 initialCentreTexelPos = int2(0, 0)
int2 WindowGridCentreTexel
unsigned window_checksum
crossplatform::Quaterniond last_origin
vec3 EdgeNoiseOffsetKm
vec3 WorleyOffsetKm
vec3 GridOriginKm
float planetRadiusKm

Public Static Functions

static void GetLatitudeLongitudeHeadingDegrees(crossplatform::Quaterniond new_origin, vec3 pos, float planetRadiusKm, double &lat, double &lon, double &head)
static crossplatform::Quaterniond LatLongHeadingDegreesToQuaternion(double lat_deg, double long_deg, double heading_deg)
static crossplatform::Quaterniond LatLongHeadingToQuaternion(double lat_radians, double long_radians, double heading_radians)
static crossplatform::Quaterniond XYZToQuaternion(vec3d pos)