diff --git a/Source/CesiumRuntime/Private/CesiumGeoreference.cpp b/Source/CesiumRuntime/Private/CesiumGeoreference.cpp index 82adc8c41..0a198fb0d 100644 --- a/Source/CesiumRuntime/Private/CesiumGeoreference.cpp +++ b/Source/CesiumRuntime/Private/CesiumGeoreference.cpp @@ -38,6 +38,8 @@ #include "Slate/SceneViewport.h" #endif +/*static*/ const double ACesiumGeoreference::kMinimumScale = 1.0e-6; + /*static*/ ACesiumGeoreference* ACesiumGeoreference::GetDefaultGeoreference(const UObject* WorldContextObject) { UWorld* world = WorldContextObject->GetWorld(); @@ -177,8 +179,8 @@ void ACesiumGeoreference::SetOriginHeight(double NewValue) { double ACesiumGeoreference::GetScale() const { return this->Scale; } void ACesiumGeoreference::SetScale(double NewValue) { - if (NewValue < 1e-6) { - this->Scale = 1e-6; + if (NewValue < ACesiumGeoreference::kMinimumScale) { + this->Scale = ACesiumGeoreference::kMinimumScale; } else { this->Scale = NewValue; } diff --git a/Source/CesiumRuntime/Public/CesiumGeoreference.h b/Source/CesiumRuntime/Public/CesiumGeoreference.h index de9359562..11a26efa6 100644 --- a/Source/CesiumRuntime/Public/CesiumGeoreference.h +++ b/Source/CesiumRuntime/Public/CesiumGeoreference.h @@ -36,6 +36,11 @@ UCLASS() class CESIUMRUNTIME_API ACesiumGeoreference : public AActor { GENERATED_BODY() public: + /** + * The minimum allowed value for the Scale property, 1e-6. + */ + static const double kMinimumScale; + /** * Finds and returns the actor labeled `CesiumGeoreferenceDefault` in the * persistent level of the calling object's world. If not found, it creates a @@ -681,12 +686,6 @@ class CESIUMRUNTIME_API ACesiumGeoreference : public AActor { public: ACesiumGeoreference(); - /** - * Recomputes all world georeference transforms. Usually there is no need to - * explicitly call this from external code. - */ - void UpdateGeoreference(); - /** * Returns the GeoTransforms that offers the same conversion * functions as this class, but performs the computations @@ -697,6 +696,11 @@ class CESIUMRUNTIME_API ACesiumGeoreference : public AActor { } private: + /** + * Recomputes all world georeference transforms. + */ + void UpdateGeoreference(); + /** * A tag that is assigned to Georeferences when they are created * as the "default" Georeference for a certain world.