Skip to content

Commit

Permalink
Update based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
azrogers committed Jan 31, 2025
1 parent 2864059 commit 7cec6da
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
##### Additions :tada:

- Added `CesiumUrlTemplateRasterOverlay`, allowing a raster overlay to be added using tiles requested based on a specified URL template.
- Added `UpdateTimeZoneFromLongitude` method to `ACesiumSunSky` to naively update the `ACesiumSunSky`'s `TimeZone` property based on a given longitude.
- The "Place Georeference Origin Here" button on `ACesiumGeoreference` will now update the time zone of any `ACesiumSunSky` instances using that georeference based on the new origin's longitude.
- Added `EstimateTimeZoneForLongitude` method to `ACesiumSunSky` to set a reasonable `TimeZone` value at the given longitude.
- The "Place Georeference Origin Here" button on `ACesiumGeoreference` will now adjust the time zone of the `ACesiumSunSky` instances that reference it, based on the new origin's longitude. This improves user experience when moving the origin to locations where it would be nighttime in the current time zone.
- Added `RequestHeaders` property to `Cesium3DTileset`, allowing per-tileset headers to be specified.
- Added `RequestHeaders` properties to `CesiumTileMapServiceRasterOverlay`, `CesiumUrlTemplateRasterOverlay`, `CesiumWebMapServiceRasterOverlay`,
and `CesiumWebMapTileServiceRasterOverlay`, allowing per-raster-overlay HTTP headers to be specified.
Expand Down
8 changes: 5 additions & 3 deletions Source/CesiumRuntime/Private/CesiumGeoreference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,10 @@ void ACesiumGeoreference::PlaceGeoreferenceOriginHere() {

const double NewLongitude = this->GetOriginLongitude();

// Find all CesiumSunSky instances using this georeference and update their
// time zones based on the new origin.
// The georeference origin may have moved to a location across the world
// where it is nighttime in the currently set time zone. To improve user
// experience, we update the timezones of all the CesiumSunSky instances using
// this georeference so that the view is not completely dark.
for (TActorIterator<ACesiumSunSky> It(pWorld); It; ++It) {
if (!IsValid(It->GlobeAnchor)) {
continue;
Expand All @@ -441,7 +443,7 @@ void ACesiumGeoreference::PlaceGeoreferenceOriginHere() {
ACesiumGeoreference* ResolvedGeoreference =
It->GlobeAnchor->GetResolvedGeoreference();
if (IsValid(ResolvedGeoreference) && ResolvedGeoreference == this) {
It->UpdateTimeZoneFromLongitude(NewLongitude);
It->EstimateTimeZoneForLongitude(NewLongitude);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/CesiumRuntime/Private/CesiumSunSky.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ void ACesiumSunSky::UpdateAtmosphereRadius() {
}
}

void ACesiumSunSky::UpdateTimeZoneFromLongitude(double InLongitude) {
void ACesiumSunSky::EstimateTimeZoneForLongitude(double InLongitude) {
this->TimeZone = FMath::Clamp(InLongitude, -180.0, 180.0) / 15.0;
this->UpdateSun();
}
Expand Down
11 changes: 6 additions & 5 deletions Source/CesiumRuntime/Public/CesiumSunSky.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,19 +445,20 @@ class CESIUMRUNTIME_API ACesiumSunSky : public AActor {
void UpdateAtmosphereRadius();

/**
* Updates the time zone of this CesiumSunSky based on the given longitude.
* Adjusts the time zone of this CesiumSunSky to an estimate based on the
* given longitude.
*
* The time zone calculated here is naively based on the longitude, where
* every 15 degrees longitude equals 1 hour. This won't necessarily line up
* with the officially designated time zone at the location given.
* The time zone is naively calculated from the longitude, where every
* 15 degrees equals 1 hour. This may not necessarily match the official
* time zone at a given location within that longitude.
*
* This method will call @ref UpdateSun automatically.
*
* @param InLongitude The longitude that the calculated time zone will be
* based on in degrees in the range [-180, 180].
*/
UFUNCTION(CallInEditor, BlueprintCallable, Category = "Cesium")
void UpdateTimeZoneFromLongitude(double InLongitude);
void EstimateTimeZoneForLongitude(double InLongitude);

/**
* Convert solar time to Hours:Minutes:Seconds. Copied the implementation
Expand Down

0 comments on commit 7cec6da

Please sign in to comment.