Cesium for Unreal 2.12.0
|
A globe-aware sun sky actor. More...
#include <CesiumSunSky.h>
Public Member Functions | |
ACesiumSunSky () | |
void | UpdateSun () |
void | UpdateSun_Implementation () |
void | UpdateAtmosphereRadius () |
bool | IsDST (bool DSTEnable, int32 InDSTStartMonth, int32 InDSTStartDay, int32 InDSTEndMonth, int32 InDSTEndDay, int32 InDSTSwitchHour) const |
Check whether the current time and date (based on this class instance's properties) falls within Daylight Savings Time. | |
virtual void | OnConstruction (const FTransform &Transform) override |
Gets called when the actor is first created, and when properties are changed at edit-time. | |
Static Public Member Functions | |
static void | GetHMSFromSolarTime (double InSolarTime, int32 &Hour, int32 &Minute, int32 &Second) |
Convert solar time to Hours:Minutes:Seconds. | |
Public Attributes | |
USceneComponent * | Scene |
USkyLightComponent * | SkyLight |
UDirectionalLightComponent * | DirectionalLight |
USkyAtmosphereComponent * | SkyAtmosphere |
UCesiumGlobeAnchorComponent * | GlobeAnchor |
The Globe Anchor Component that precisely ties this Actor to the Globe. | |
double | TimeZone = -5.0 |
Gets the time zone, represented as hours offset from GMT. | |
double | SolarTime = 13.0 |
The current solar time represented as hours from midnight. | |
int32 | Day = 21 |
The day of the month. | |
int32 | Month = 9 |
The month of the year, where 1 is January and 12 is December. | |
int32 | Year = 2019 |
The year. | |
double | NorthOffset = -90.0 |
Offset in the sun's position. | |
bool | UseDaylightSavingTime = true |
Enables adjustment of the Solar Time for Daylight Saving Time (DST). | |
Protected Member Functions | |
ACesiumGeoreference * | GetGeoreference () const |
Gets the Georeference Actor associated with this instance. | |
void | SetSkyAtmosphereGroundRadius (USkyAtmosphereComponent *Sky, double Radius) |
Modifies the sky atmosphere's ground radius, which represents the Earth's radius in the SkyAtmosphere rendering model. | |
void | UpdateSkySphere () |
Update MobileSkySphere by calling its RefreshMaterial function. | |
virtual void | BeginPlay () override |
virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
virtual void | Serialize (FArchive &Ar) override |
virtual void | Tick (float DeltaSeconds) override |
virtual void | PostLoad () override |
virtual bool | ShouldTickIfViewportsOnly () const override |
Protected Attributes | |
ACesiumGeoreference * | Georeference_DEPRECATED |
THIS PROPERTY IS DEPRECATED. | |
meta | |
bool | UpdateAtmosphereAtRuntime = true |
Updates the atmosphere automatically given current player pawn's longitude, latitude, and height. | |
Category | |
float | AtmosphereHeight = 60.0f |
The height of the atmosphere layer above the ground, in kilometers. | |
float | AerialPerspectiveViewDistanceScale = 1.0f |
Makes the aerial perspective look thicker by scaling distances from view to surfaces (opaque and translucent). | |
float | RayleighExponentialDistribution = 8.0f |
The altitude in kilometers at which Rayleigh scattering effect is reduced to 40%. | |
float | MieExponentialDistribution = 1.2f |
The altitude in kilometers at which Mie effects are reduced to 40%. | |
bool | UseLevelDirectionalLight = false |
False: Use Directional Light component inside CesiumSunSky. | |
ADirectionalLight * | LevelDirectionalLight |
Reference to a manually assigned Directional Light in the level. | |
double | Elevation = 0.f |
The current sun elevation in degrees above the horizontal, as viewed from the Georeference origin. | |
double | CorrectedElevation = 0.f |
The current sun elevation, corrected for atmospheric diffraction, in degrees above the horizontal, as viewed from the Georeference origin. | |
double | Azimuth = 0.f |
The current sun azimuth in degrees clockwise from North toward East, as viewed from the Georeference origin. | |
bool | UseMobileRendering |
A switch to toggle between desktop and mobile rendering code paths. | |
TSubclassOf< AActor > | SkySphereClass |
Mobile platforms currently do not support the SkyAtmosphereComponent. | |
AActor * | SkySphereActor |
Reference to BP_Sky_Sphere or similar actor (mobile only) | |
double | MobileDirectionalLightIntensity = 6.f |
Default intensity of directional light that's spawned for mobile rendering. | |
A globe-aware sun sky actor.
If the georeference is set to CartographicOrigin (aka Longitude/Latitude/Height) mode, then this actor will automatically sync its longitude and latitude properties with the georeference's, and recalculate the sun position whenever those properties change.
Note: because we use Planet Center at Component Transform
for the SkyAtmosphere transform mode, this actor's location will be forced to the Earth's center if the georeference is set to CartographicOrigin.
Definition at line 29 of file CesiumSunSky.h.
ACesiumSunSky::ACesiumSunSky | ( | ) |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
protected |
Gets the Georeference Actor associated with this instance.
It is obtained from the Globe Anchor Component.
|
static |
Convert solar time to Hours:Minutes:Seconds.
Copied the implementation from the engine SunSkyBP class.
bool ACesiumSunSky::IsDST | ( | bool | DSTEnable, |
int32 | InDSTStartMonth, | ||
int32 | InDSTStartDay, | ||
int32 | InDSTEndMonth, | ||
int32 | InDSTEndDay, | ||
int32 | InDSTSwitchHour ) const |
Check whether the current time and date (based on this class instance's properties) falls within Daylight Savings Time.
Copied the implementation from the engine SunSkyBP class.
|
overridevirtual |
Gets called when the actor is first created, and when properties are changed at edit-time.
Refreshes the actor's position w/r/t the georeference and handles mobile-specific setup if needed.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
protected |
Modifies the sky atmosphere's ground radius, which represents the Earth's radius in the SkyAtmosphere rendering model.
Only changes if there's a >0.1 difference, to reduce redraws.
Sky | A pointer to the SkyAtmosphereComponent |
Radius | The radius in kilometers. |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
void ACesiumSunSky::UpdateAtmosphereRadius | ( | ) |
|
protected |
Update MobileSkySphere by calling its RefreshMaterial function.
void ACesiumSunSky::UpdateSun | ( | ) |
void ACesiumSunSky::UpdateSun_Implementation | ( | ) |
|
protected |
Makes the aerial perspective look thicker by scaling distances from view to surfaces (opaque and translucent).
This value is automatically scaled according to the CesiumGeoreference Scale and the Actor scale.
Definition at line 344 of file CesiumSunSky.h.
|
protected |
The height of the atmosphere layer above the ground, in kilometers.
This value is automatically scaled according to the CesiumGeoreference Scale and the Actor scale. However, Unreal Engine's SkyAtmosphere has a hard-coded minimum effective value of 0.1, so the atmosphere will look too thick when the globe is scaled down drastically.
Definition at line 326 of file CesiumSunSky.h.
|
protected |
The current sun azimuth in degrees clockwise from North toward East, as viewed from the Georeference origin.
Definition at line 406 of file CesiumSunSky.h.
|
protected |
Definition at line 268 of file CesiumSunSky.h.
|
protected |
The current sun elevation, corrected for atmospheric diffraction, in degrees above the horizontal, as viewed from the Georeference origin.
Definition at line 399 of file CesiumSunSky.h.
int32 ACesiumSunSky::Day = 21 |
The day of the month.
After changing this value from Blueprints or C++, you must call UpdateSun for it to take effect.
Definition at line 91 of file CesiumSunSky.h.
UDirectionalLightComponent* ACesiumSunSky::DirectionalLight |
Definition at line 43 of file CesiumSunSky.h.
|
protected |
The current sun elevation in degrees above the horizontal, as viewed from the Georeference origin.
Definition at line 392 of file CesiumSunSky.h.
|
protected |
THIS PROPERTY IS DEPRECATED.
Get the Georeference instance from the Globe Anchor Component instead.
Definition at line 158 of file CesiumSunSky.h.
UCesiumGlobeAnchorComponent* ACesiumSunSky::GlobeAnchor |
The Globe Anchor Component that precisely ties this Actor to the Globe.
Definition at line 52 of file CesiumSunSky.h.
|
protected |
Reference to a manually assigned Directional Light in the level.
Definition at line 385 of file CesiumSunSky.h.
|
protected |
Definition at line 178 of file CesiumSunSky.h.
|
protected |
The altitude in kilometers at which Mie effects are reduced to 40%.
This value is automatically scaled according to the CesiumGeoreference Scale and the Actor scale.
Definition at line 372 of file CesiumSunSky.h.
|
protected |
Default intensity of directional light that's spawned for mobile rendering.
Definition at line 433 of file CesiumSunSky.h.
int32 ACesiumSunSky::Month = 9 |
The month of the year, where 1 is January and 12 is December.
After changing this value from Blueprints or C++, you must call UpdateSun for it to take effect.
Definition at line 104 of file CesiumSunSky.h.
double ACesiumSunSky::NorthOffset = -90.0 |
Offset in the sun's position.
Should be set to -90 for the sun's position to be accurate in the Unreal reference frame.
After changing this value from Blueprints or C++, you must call UpdateSun for it to take effect.
Definition at line 130 of file CesiumSunSky.h.
|
protected |
The altitude in kilometers at which Rayleigh scattering effect is reduced to 40%.
This value is automatically scaled according to the CesiumGeoreference Scale and the Actor scale.
Definition at line 358 of file CesiumSunSky.h.
USceneComponent* ACesiumSunSky::Scene |
Definition at line 37 of file CesiumSunSky.h.
USkyAtmosphereComponent* ACesiumSunSky::SkyAtmosphere |
Definition at line 46 of file CesiumSunSky.h.
USkyLightComponent* ACesiumSunSky::SkyLight |
Definition at line 40 of file CesiumSunSky.h.
|
protected |
Reference to BP_Sky_Sphere or similar actor (mobile only)
Definition at line 427 of file CesiumSunSky.h.
|
protected |
Mobile platforms currently do not support the SkyAtmosphereComponent.
In lieu of that, use the engine BP_Sky_Sphere class, or a derived class.
Definition at line 421 of file CesiumSunSky.h.
double ACesiumSunSky::SolarTime = 13.0 |
The current solar time represented as hours from midnight.
After changing this value from Blueprints or C++, you must call UpdateSun for it to take effect.
Definition at line 78 of file CesiumSunSky.h.
double ACesiumSunSky::TimeZone = -5.0 |
Gets the time zone, represented as hours offset from GMT.
After changing this value from Blueprints or C++, you must call UpdateSun for it to take effect.
Definition at line 65 of file CesiumSunSky.h.
|
protected |
Updates the atmosphere automatically given current player pawn's longitude, latitude, and height.
Fixes artifacts seen with the atmosphere rendering when flying high above the surface, or low to the ground in high latitudes.
Definition at line 243 of file CesiumSunSky.h.
bool ACesiumSunSky::UseDaylightSavingTime = true |
Enables adjustment of the Solar Time for Daylight Saving Time (DST).
After changing this value from Blueprints or C++, you must call UpdateSun for it to take effect.
Definition at line 142 of file CesiumSunSky.h.
|
protected |
False: Use Directional Light component inside CesiumSunSky.
True: Use the assigned Directional Light in the level.
Definition at line 379 of file CesiumSunSky.h.
|
protected |
A switch to toggle between desktop and mobile rendering code paths.
This will NOT be automatically set when running on mobile, so make sure to check this setting before building on mobile platforms.
Definition at line 414 of file CesiumSunSky.h.
int32 ACesiumSunSky::Year = 2019 |
The year.
After changing this value from Blueprints or C++, you must call UpdateSun for it to take effect.
Definition at line 117 of file CesiumSunSky.h.