当前位置: 首页 > news >正文

zhihe网站建设 淘宝北京最新疫情情况

zhihe网站建设 淘宝,北京最新疫情情况,企业营销型网站建设方案,做普通网站需要多少钱基础概念 一个星球(例如地球)的气候系统主要是一些基本参数基于公转周期(年)和自转周期(日)的变化,这其中会有两个变化因素:地理位置(经纬度)和天气变化&…

基础概念

一个星球(例如地球)的气候系统主要是一些基本参数基于公转周期(年)和自转周期(日)的变化,这其中会有两个变化因素:地理位置(经纬度)和天气变化(冷暖空气流动或台风等)。

公转、自转及时间

时间决定于星球的公转周期形成年、星球的自转周期形成日,其下可以更细分出来月、时分秒等。

另外以地球为例,计时还和经度(时区)相关,部分区域可能还有夏令时等。维度决定了日出日落时间的区别,比如会出现极昼极夜等。

基本气候参数

温度:

湿度:

压强:

云量:

日照强度:

风速(方向、强度):

降雨强度:

降雪强度:

雾霾(颜色、强度):

雷暴:打雷闪电出现的频次和强度

另外有些衍生参数:

积水量:

积雪量:

积尘量:

气候影响因素

时间变化(四季和昼夜):

全年随着四季变化,各种基础参数指标会有个变化的曲线;基本所有的气候参数的基础值从这里产生;

极昼太阳远近会有基础气候参数变化,极夜太阳远近也有一些基础气候参数变化(可能比较小),然后中间维度区域在日出和日落事件发生后会逐渐做昼夜切换。

天气变化:

由于随机变化的冷暖气流变化,引起短期和随机的基础气候变化。可以分为:降水天气(雨、雪、冰雹)、雷暴天气、雾霾天气、强风天气(含飓风)。注意部分天气可能会同时发生,比如雷阵雨,同时包含下雨和雷暴甚至同时包含狂风。

游戏逻辑:

由于特殊的技能需要或者BOSS状态等也可能会引起气候参数的变化,此类状态变化独立于自然气候变化并且具有更高优先级,消失后会过渡回自然天气。

系统设计

中间全局管理器ClimateCoordinator用来管理各种基本气候参数,并且会在当前参数值和目标参数值之间做自然过渡。

特定区域内的气候可以根据四季、昼夜等时间变化做变化,另外会有一系列区域内会出现的天气变化,他们应用时也会影响区域内的基础气象参数。游戏逻辑可以在任何时候直接操作ClimateCoordinator来实现从自然天气到游戏逻辑参数的过渡。

对于需要根据气候表现做表演的对象,直接根据ClimateCoordinator中的值来进行对应值修改或者效果表现即可,如果表现参数和气候参数不直接对应可以添加中间对象转换。

方案

中间状态ClimateCoordinator

class CLIMATERUNTIME_API UClimateCoordinator : public UTickableWorldSubsystem
{
...void RegistVolume(AClimateVolume* Volume);void UnRegistVolume(AClimateVolume* Volume);void BindEarthGlobalInfo(UClimateEarthGlobalInfoComponent* Component);void UnbindEarthGlobalInfo(UClimateEarthGlobalInfoComponent* Component);// 0~1: degree of a yearUFUNCTION(BlueprintCallable, Category = "RuntimeClimate|DateTime")const float GetYearDegree() const;// 0~1: degree of a dayUFUNCTION(BlueprintCallable, Category = "RuntimeClimate|DateTime")const float GetDayDegree() const;UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|DateTime")const FDateTime GetDateTime() const { return AreaDateTime; }UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|DateTime")void SetDateTime(const FDateTime& DateTime) { AreaDateTime = DateTime; }UFUNCTION(BlueprintCallable, Category = "RuntimeClimate")const int32 GetTimeScalar() const;UFUNCTION(BlueprintCallable, Category = "RuntimeClimate")void SetTimeScalar(const int32 TimeScalar);UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|Weather")void OverwriteTemperature(bool bOverwirte, const float Temperature, const float FadeDuration);UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|Weather")const float GetTemperature() const;UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|Weather")void OverwriteHumidity(bool bOverwirte, const float Humidity, const float FadeDuration);UFUNCTION(BlueprintCallable, Category = "RuntimeClimate|Weather")const float GetHumidity() const;
...
}

地理信息

class AEarthInfo : public AInfo
{
...float Latitude = 45.0f;float Longitude = -73.0f;float NorthOffset = 0;float BaseElevation = 0;int32 TimeZone = -5.0;int32 Year = 2022;int32 Month = 5;int32 Day = 17;int32 Hours = 12;int32 Minutes = 0;int32 Seconds = 0;uint8 bIsDaylightSavingTime : 1;int32 DSTStartMonth = 6;int32 DSTStartDay = 1;int32 DSTEndMonth = 8;int32 DSTEndDay = 31;int32 TimeScalar = 0;...
}

区域气候盒子

class CLIMATERUNTIME_API AClimateVolume : public AVolume
{
...int32 Priority = 0;uint32 bEnabled : 1;uint32 bUnbound : 1;virtual void PostRegisterAllComponents() override;virtual void PostUnregisterAllComponents() override;virtual void Tick(float DeltaSeconds) override;uint32 bTemperatureValid : 1;float Temperature = 20;float TemperatureUpdateSpeed = 0.01;
...
}

一系列表演辅助类

雾效影响组件:

UCLASS(ClassGroup = (Climate), meta = (BlueprintSpawnableComponent))
class CLIMATERUNTIME_API UClimateFogComponent : public UActorComponent
{GENERATED_UCLASS_BODY()public:virtual void OnRegister() override;virtual void OnUnregister() override;virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;UPROPERTY(EditAnywhere, Category = ExponentialHeightFog)FRuntimeFloatCurve ExponentialHeightFogDensityCurveFloat;UPROPERTY(EditAnywhere, Category = ExponentialHeightFog)FRuntimeCurveLinearColor ExponentialHeightFogScatteringColorCurveFloat;private:UPROPERTY(Transient)class UExponentialHeightFogComponent* ManagedComponent = nullptr;UPROPERTY(Transient)class UClimateCoordinator* ClimateCoordinator = nullptr;
};

根据经纬度、时区等信息计算日出、日落时间的计算函数:

void CalcSunPositionByLocationAndDateTime(float Latitude, float Longitude, float TimeZone, bool bIsDaylightSavingTime, const FDateTime& CalcTime, FClimateSunPosition& SunPositionData)
{float TimeOffset = TimeZone;if (bIsDaylightSavingTime){TimeOffset += 1.0f;}double LatitudeRad = FMath::DegreesToRadians(Latitude);// Get the julian day (number of days since Jan 1st of the year 4713 BC)double JulianDay = CalcTime.GetJulianDay() + (CalcTime.GetTimeOfDay().GetTotalHours() - TimeOffset) / 24.0;double JulianCentury = (JulianDay - 2451545.0) / 36525.0;// Get the sun's mean longitude , referred to the mean equinox of julian datedouble GeomMeanLongSunDeg = FMath::Fmod(280.46646 + JulianCentury * (36000.76983 + JulianCentury * 0.0003032), 360.0);double GeomMeanLongSunRad = FMath::DegreesToRadians(GeomMeanLongSunDeg);// Get the sun's mean anomalydouble GeomMeanAnomSunDeg = 357.52911 + JulianCentury * (35999.05029 - 0.0001537 * JulianCentury);double GeomMeanAnomSunRad = FMath::DegreesToRadians(GeomMeanAnomSunDeg);// Get the earth's orbit eccentricitydouble EccentEarthOrbit = 0.016708634 - JulianCentury * (0.000042037 + 0.0000001267 * JulianCentury);// Get the sun's equation of the centerdouble SunEqOfCtr = FMath::Sin(GeomMeanAnomSunRad) * (1.914602 - JulianCentury * (0.004817 + 0.000014 * JulianCentury))+ FMath::Sin(2.0 * GeomMeanAnomSunRad) * (0.019993 - 0.000101 * JulianCentury)+ FMath::Sin(3.0 * GeomMeanAnomSunRad) * 0.000289;// Get the sun's true longitudedouble SunTrueLongDeg = GeomMeanLongSunDeg + SunEqOfCtr;// Get the sun's true anomaly//	double SunTrueAnomDeg = GeomMeanAnomSunDeg + SunEqOfCtr;//	double SunTrueAnomRad = FMath::DegreesToRadians(SunTrueAnomDeg);// Get the earth's distance from the sun//	double SunRadVectorAUs = (1.000001018*(1.0 - EccentEarthOrbit*EccentEarthOrbit)) / (1.0 + EccentEarthOrbit*FMath::Cos(SunTrueAnomRad));// Get the sun's apparent longitudedouble SunAppLongDeg = SunTrueLongDeg - 0.00569 - 0.00478 * FMath::Sin(FMath::DegreesToRadians(125.04 - 1934.136 * JulianCentury));double SunAppLongRad = FMath::DegreesToRadians(SunAppLongDeg);// Get the earth's mean obliquity of the eclipticdouble MeanObliqEclipticDeg = 23.0 + (26.0 + ((21.448 - JulianCentury * (46.815 + JulianCentury * (0.00059 - JulianCentury * 0.001813)))) / 60.0) / 60.0;// Get the oblique correctiondouble ObliqCorrDeg = MeanObliqEclipticDeg + 0.00256 * FMath::Cos(FMath::DegreesToRadians(125.04 - 1934.136 * JulianCentury));double ObliqCorrRad = FMath::DegreesToRadians(ObliqCorrDeg);// Get the sun's right ascensiondouble SunRtAscenRad = FMath::Atan2(FMath::Cos(ObliqCorrRad) * FMath::Sin(SunAppLongRad), FMath::Cos(SunAppLongRad));double SunRtAscenDeg = FMath::RadiansToDegrees(SunRtAscenRad);// Get the sun's declinationdouble SunDeclinRad = FMath::Asin(FMath::Sin(ObliqCorrRad) * FMath::Sin(SunAppLongRad));double SunDeclinDeg = FMath::RadiansToDegrees(SunDeclinRad);double VarY = FMath::Pow(FMath::Tan(ObliqCorrRad / 2.0), 2.0);// Get the equation of timedouble EqOfTimeMinutes = 4.0 * FMath::RadiansToDegrees(VarY * FMath::Sin(2.0 * GeomMeanLongSunRad) - 2.0 * EccentEarthOrbit * FMath::Sin(GeomMeanAnomSunRad) + 4.0 * EccentEarthOrbit * VarY * FMath::Sin(GeomMeanAnomSunRad) * FMath::Cos(2.0 * GeomMeanLongSunRad) - 0.5 * VarY * VarY * FMath::Sin(4.0 * GeomMeanLongSunRad) - 1.25 * EccentEarthOrbit * EccentEarthOrbit * FMath::Sin(2.0 * GeomMeanAnomSunRad));// Get the hour angle of the sunrisedouble HASunriseDeg = FMath::RadiansToDegrees(FMath::Acos(FMath::Cos(FMath::DegreesToRadians(90.833)) / (FMath::Cos(LatitudeRad) * FMath::Cos(SunDeclinRad)) - FMath::Tan(LatitudeRad) * FMath::Tan(SunDeclinRad)));//	double SunlightDurationMinutes = 8.0 * HASunriseDeg;// Get the local time of the sun's rise and setdouble SolarNoonLST = (720.0 - 4.0 * Longitude - EqOfTimeMinutes + TimeOffset * 60.0) / 1440.0;double SunriseTimeLST = SolarNoonLST - HASunriseDeg * 4.0 / 1440.0;double SunsetTimeLST = SolarNoonLST + HASunriseDeg * 4.0 / 1440.0;// Get the true solar timedouble TrueSolarTimeMinutes = FMath::Fmod(CalcTime.GetTimeOfDay().GetTotalMinutes() + EqOfTimeMinutes + 4.0 * Longitude - 60.0 * TimeOffset, 1440.0);// Get the hour angle of current timedouble HourAngleDeg = TrueSolarTimeMinutes < 0 ? TrueSolarTimeMinutes / 4.0 + 180 : TrueSolarTimeMinutes / 4.0 - 180.0;double HourAngleRad = FMath::DegreesToRadians(HourAngleDeg);// Get the solar zenith angledouble SolarZenithAngleRad = FMath::Acos(FMath::Sin(LatitudeRad) * FMath::Sin(SunDeclinRad) + FMath::Cos(LatitudeRad) * FMath::Cos(SunDeclinRad) * FMath::Cos(HourAngleRad));double SolarZenithAngleDeg = FMath::RadiansToDegrees(SolarZenithAngleRad);// Get the sun elevationdouble SolarElevationAngleDeg = 90.0 - SolarZenithAngleDeg;double SolarElevationAngleRad = FMath::DegreesToRadians(SolarElevationAngleDeg);double TanOfSolarElevationAngle = FMath::Tan(SolarElevationAngleRad);// Get the approximated atmospheric refractiondouble ApproxAtmosphericRefractionDeg = 0.0;if (SolarElevationAngleDeg <= 85.0){if (SolarElevationAngleDeg > 5.0){ApproxAtmosphericRefractionDeg = 58.1 / TanOfSolarElevationAngle - 0.07 / FMath::Pow(TanOfSolarElevationAngle, 3) + 0.000086 / FMath::Pow(TanOfSolarElevationAngle, 5) / 3600.0;}else{if (SolarElevationAngleDeg > -0.575){ApproxAtmosphericRefractionDeg = 1735.0 + SolarElevationAngleDeg * (-518.2 + SolarElevationAngleDeg * (103.4 + SolarElevationAngleDeg * (-12.79 + SolarElevationAngleDeg * 0.711)));}else{ApproxAtmosphericRefractionDeg = -20.772 / TanOfSolarElevationAngle;}}ApproxAtmosphericRefractionDeg /= 3600.0;}// Get the corrected solar elevationdouble SolarElevationcorrectedforatmrefractionDeg = SolarElevationAngleDeg + ApproxAtmosphericRefractionDeg;// Get the solar azimuth double tmp = FMath::RadiansToDegrees(FMath::Acos(((FMath::Sin(LatitudeRad) * FMath::Cos(SolarZenithAngleRad)) - FMath::Sin(SunDeclinRad)) / (FMath::Cos(LatitudeRad) * FMath::Sin(SolarZenithAngleRad))));double SolarAzimuthAngleDegcwfromN = HourAngleDeg > 0.0 ? FMath::Fmod(tmp + 180.0, 360.0) : FMath::Fmod(540.0 - tmp, 360.0);// offset elevation angle to fit with UE coords systemSunPositionData.Elevation = 180.0f + SolarElevationAngleDeg;SunPositionData.CorrectedElevation = 180.0f + SolarElevationcorrectedforatmrefractionDeg;SunPositionData.Azimuth = SolarAzimuthAngleDegcwfromN;SunPositionData.SolarNoon = FTimespan::FromDays(SolarNoonLST);SunPositionData.SunriseTime = FTimespan::FromDays(SunriseTimeLST);SunPositionData.SunsetTime = FTimespan::FromDays(SunsetTimeLST);
}

参考

http://www.rdtb.cn/news/17120.html

相关文章:

  • 与狗狗做网站优化大师安卓版
  • 兰州市做网站的公司有哪些汽车行业网站建设
  • 衢州专业做网站谷歌手机版浏览器官网
  • 广州做护肤品的网站浏览器谷歌手机版下载
  • 网站页面打开速度慢网络软文推广网站
  • 网站域名到期不续费会怎么样武汉网站搜索引擎优化
  • 怎么用链接进自己做的网站近期新闻大事
  • 做公司网站棋牌网站排名提升软件
  • 网站建设工作策划方案百度竞价广告投放
  • 福州市建网站公司小红书关键词搜索量查询
  • 上海天权信息科技有限公司济南seo网站排名优化工具
  • 宝应网站建设快速排名软件seo系统
  • 广州网站建设泸州重庆seo网站推广优化
  • js获取网站域名百度官方客服平台
  • 信用网站建设标准最常用的搜索引擎有哪些
  • 做甲方去哪个网站应聘seo网站推广软件 快排
  • 做医药代表去什么招聘网站搜索量查询
  • 烟台外贸网站建设网站推广工作
  • 自己网站做问卷调查问卷seo站
  • [8dvd]flash网站源文件 flash整站源码杭州线上推广
  • 织梦网站会员上传图片淘宝运营
  • 做阿里还是网站裂变营销五种模式十六种方法
  • 男女做暖暖免费网站aso优化什么意思是
  • 忘了网站链接怎么做网站推广营销运营方式
  • 男女直接做视频网站深圳抖音推广公司
  • 做娃衣的布料去哪个网站全网营销平台
  • 上海网站建设推营销型网站的类型
  • 互联网公司网站建设ppt模板下载百度seo查询系统
  • 网站设计背景怎么写网站建设哪家好
  • wordpress 网站地图网络推广费用一般多少