Skip to content

Commit

Permalink
Improvements from review.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Sep 11, 2023
1 parent b4ce9f4 commit adf0d15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Source/CesiumRuntime/Private/CesiumGeoreference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down
16 changes: 10 additions & 6 deletions Source/CesiumRuntime/Public/CesiumGeoreference.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit adf0d15

Please sign in to comment.