载入中...
搜索中...
未找到
EnvironmentWeatherRuntime.cpp
浏览该文件的文档.
8double component(const EditorValue::Array& values, size_t index) { return *values[index].getIf<double>(); }
15 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.environment.weather-required"),
19 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.environment.mode-mismatch"),
28 environment->setIntensity(static_cast<float>(*document.value("weather.intensity")->getIf<double>()));
29 environment->setWindSpeed(static_cast<float>(*document.value("weather.wind-speed")->getIf<double>()));
30 environment->setWindDirection(static_cast<float>(*document.value("weather.wind-direction")->getIf<double>()));
32 environment->setSkyColor(static_cast<float>(component(sky, 0)), static_cast<float>(component(sky, 1)),
34 environment->setFogColor(static_cast<float>(component(fog, 0)), static_cast<float>(component(fog, 1)),
36 environment->setFogDensity(static_cast<float>(*document.value("weather.fog-density")->getIf<double>()));
37 environment->setEnvironmentEnabled(*document.value("weather.environment-enabled")->getIf<bool>());
A structured explanation of a failed, degraded, or noteworthy result.
Definition Diagnostic.h:94
Serializable shared environment target for static, DayNight and Weather modes.
Definition LightingTarget.h:110
std::vector< EditorDiagnostic > validate() const
Validate mode-dependent atmosphere and weather settings.
Definition LightingTarget.cpp:295
Result< void > applyWeather(const EnvironmentDocumentTarget &document, weather::Weather *environment) const
Applies weather.
Definition EnvironmentWeatherRuntime.cpp:12
const EditorValue * value(const std::string &path) const
Read a typed runtime-neutral property value by path.
Definition LightingTarget.cpp:241
Weather module — real-time precipitation / lightning / wind system.
Definition Weather.h:36
void setEnvironmentEnabled(bool enabled)
Enable legacy weather-owned sky and directional lighting.
Definition Weather.cpp:578
void setWindDirection(float degrees)
Wind direction in degrees; 0 = toward +Z, 90 = toward -X.
Definition Weather.cpp:497