47 m_rgb_wavelengths_nm = wavelengths;
48 m_rgb_wavelengths_m = m_rgb_wavelengths_nm * 1
e-9;
51 m_rgb_ozone_cross_sections =
53 physics::gas::ozone::cross_section_293k<double>(m_rgb_wavelengths_nm.
x()),
54 physics::gas::ozone::cross_section_293k<double>(m_rgb_wavelengths_nm.
y()),
55 physics::gas::ozone::cross_section_293k<double>(m_rgb_wavelengths_nm.
z())
63 update_atmosphere(entity_id);
76 if (entity_id != m_active_atmosphere_eid)
78 m_active_atmosphere_eid = entity_id;
83 void atmosphere_system::update_atmosphere(
entity::id entity_id)
120 if (entity_id == m_active_atmosphere_eid)
126 void atmosphere_system::update_sky_pass()
135 if (!
registry.valid(m_active_atmosphere_eid))
158 update_atmosphere(entity_id);
163 update_atmosphere(entity_id);
168 if (entity_id == m_active_atmosphere_eid)
170 m_active_atmosphere_eid = entt::null;
void set_rgb_wavelengths(const math::dvec3 &wavelengths)
Sets the wavelengths of red, green, and blue light.
void set_active_atmosphere(entity::id entity_id)
Sets the entity ID of the active atmosphere.
atmosphere_system(entity::registry ®istry)
virtual void update(float t, float dt)
Perform's a system's update() function.
void set_sky_pass(::render::sky_pass *pass)
void set_mie_parameters(float scale_height, float scattering, float extinction, float anisotropy)
void set_rayleigh_parameters(float scale_height, const math::fvec3 &scattering)
void set_ozone_parameters(float lower_limit, float upper_limit, float mode, const math::fvec3 &absorption)
void set_airglow_luminance(const math::fvec3 &luminance)
void set_atmosphere_upper_limit(float limit)
Abstract base class for updatable systems.
entity::registry & registry
Registry on which the system operate.
entt::registry registry
Component registry type.
entt::entity id
Entity ID type.
T extinction(T scattering, T albedo)
Calculates an extinction coefficient.
T scattering(T density, T polarization, T wavelength)
Calculates a wavelength-dependent scattering coefficient.
T polarization(T ior, T density)
Calculates a particle polarizability factor.
T absorption(T cross_section, T density)
Calculates an ozone absorption coefficient (wavelength-dependent).
T number_density(T c)
Calculates the number density of a substance.
double mie_albedo
Mie single-scattering albedo.
double ozone_mode
Elevation of the mode of the triangular distribution of ozone particles, in meters.
double upper_limit
Elevation of the upper limit of the atmosphere, in meters.
math::dvec3 airglow_luminance
Airglow luminance, in cd/m^2.
double mie_concentration
Molar concentration of Mie particles at sea level, in mol/m-3.
double mie_extinction
(Dependent) Mie extinction coefficient.
double rayleigh_concentration
Molar concentration of Rayleigh particles at sea level, in mol/m-3.
double ozone_upper_limit
Elevation of the upper limit of the triangular distribution of ozone particles, in meters.
double ozone_lower_limit
Elevation of the lower limit of the triangular distribution of ozone particles, in meters.
double mie_anisotropy
Mie phase function anisotropy factor.
double ozone_concentration
Concentration of ozone in the atmosphere, unitless.
double mie_scattering
(Dependent) Mie scattering coefficient.
math::dvec3 ozone_absorption
(Dependent) Ozone absorption coefficients.
math::dvec3 rayleigh_scattering
(Dependent) Rayleigh scattering coefficients.
double index_of_refraction
Index of refraction of air at sea level.
double rayleigh_scale_height
Scale height of the exponential distribution of Rayleigh particles, in meters.
double mie_scale_height
Scale height of the exponential distribution of Mie particles, in meters.
constexpr element_type & x() noexcept
Returns a reference to the first element.
constexpr element_type & y() noexcept
Returns a reference to the second element.
constexpr element_type & z() noexcept
Returns a reference to the third element.