Cesium for Unreal 2.12.0
|
Controls how global geospatial coordinates are mapped to coordinates in the Unreal Engine level. More...
#include <CesiumGeoreference.h>
Public Member Functions | |
FVector | GetOriginLongitudeLatitudeHeight () const |
Returns the georeference origin position as an FVector where X is longitude (degrees), Y is latitude (degrees), and Z is height above the ellipsoid (meters). | |
void | SetOriginLongitudeLatitudeHeight (const FVector &TargetLongitudeLatitudeHeight) |
This aligns the specified longitude in degrees (X), latitude in degrees (Y), and height above the ellipsoid in meters (Z) to the Unreal origin. | |
FVector | GetOriginEarthCenteredEarthFixed () const |
Returns the georeference origin position as an FVector in Earth-Centerd, Earth-Fixed (ECEF) coordinates. | |
void | SetOriginEarthCenteredEarthFixed (const FVector &TargetEarthCenteredEarthFixed) |
This aligns the specified Earth-Centered, Earth-Fixed (ECEF) coordinates to the Unreal origin. | |
EOriginPlacement | GetOriginPlacement () const |
Gets the placement of this Actor's origin (coordinate 0,0,0) within the tileset. | |
void | SetOriginPlacement (EOriginPlacement NewValue) |
Sets the placement of this Actor's origin (coordinate 0,0,0) within the tileset. | |
double | GetOriginLatitude () const |
Gets the latitude of the custom origin placement in degrees, in the range [-90, 90]. | |
void | SetOriginLatitude (double NewValue) |
Sets the latitude of the custom origin placement in degrees, in the range [-90, 90]. | |
double | GetOriginLongitude () const |
Gets the longitude of the custom origin placement in degrees, in the range [-180, 180]. | |
void | SetOriginLongitude (double NewValue) |
Sets the longitude of the custom origin placement in degrees, in the range [-180, 180]. | |
double | GetOriginHeight () const |
Gets the height of the custom origin placement in meters above the ellipsoid. | |
void | SetOriginHeight (double NewValue) |
Sets the height of the custom origin placement in meters above the ellipsoid. | |
double | GetScale () const |
Gets the percentage scale of the globe in the Unreal world. | |
void | SetScale (double NewValue) |
Sets the percentage scale of the globe in the Unreal world. | |
APlayerCameraManager * | GetSubLevelCamera () const |
Gets the camera to use to determine which sub-level is closest, so that one can be activated and all others deactivated. | |
void | SetSubLevelCamera (APlayerCameraManager *NewValue) |
Sets the camera to use to determine which sub-level is closest, so that one can be activated and all others deactivated. | |
UCesiumSubLevelSwitcherComponent * | GetSubLevelSwitcher () const |
Gets the component that allows switching between different sub-levels registered with this georeference. | |
UCesiumEllipsoid * | GetEllipsoid () const |
Returns a pointer to the UCesiumEllipsoid currently being used by this georeference. | |
void | SetEllipsoid (UCesiumEllipsoid *NewEllipsoid) |
Sets the UCesiumEllipsoid used by this georeference. | |
FVector | TransformLongitudeLatitudeHeightPositionToUnreal (const FVector &LongitudeLatitudeHeight) const |
Transforms the given longitude in degrees (x), latitude in degrees (y), and height above the ellipsoid in meters (z) into Unreal coordinates. | |
FVector | TransformUnrealPositionToLongitudeLatitudeHeight (const FVector &UnrealPosition) const |
Transforms a position in Unreal coordinates into longitude in degrees (x), latitude in degrees (y), and height above the ellipsoid in meters (z). | |
FVector | TransformEarthCenteredEarthFixedPositionToUnreal (const FVector &EarthCenteredEarthFixedPosition) const |
Transforms a position in Earth-Centered, Earth-Fixed (ECEF) coordinates into Unreal coordinates. | |
FVector | TransformUnrealPositionToEarthCenteredEarthFixed (const FVector &UnrealPosition) const |
Transforms the given position from Unreal coordinates to Earth-Centered, Earth-Fixed (ECEF). | |
FVector | TransformEarthCenteredEarthFixedDirectionToUnreal (const FVector &EarthCenteredEarthFixedDirection) const |
Transforms a direction vector in Earth-Centered, Earth-Fixed (ECEF) coordinates into Unreal coordinates. | |
FVector | TransformUnrealDirectionToEarthCenteredEarthFixed (const FVector &UnrealDirection) const |
Transforms the given direction vector from Unreal coordinates to Earth-Centered, Earth-Fixed (ECEF) coordinates. | |
FRotator | TransformUnrealRotatorToEastSouthUp (const FRotator &UnrealRotator, const FVector &UnrealLocation) const |
Given a Rotator that transforms an object into the Unreal coordinate system, returns a new Rotator that transforms that object into an East-South-Up frame centered at a given location. | |
FRotator | TransformEastSouthUpRotatorToUnreal (const FRotator &EastSouthUpRotator, const FVector &UnrealLocation) const |
Given a Rotator that transforms an object into the East-South-Up frame centered at a given location, returns a new Rotator that transforms that object into Unreal coordinates. | |
FMatrix | ComputeUnrealToEarthCenteredEarthFixedTransformation () const |
Computes the transformation matrix from the Unreal coordinate system to the Earth-Centered, Earth-Fixed (ECEF) coordinate system. | |
FMatrix | ComputeEarthCenteredEarthFixedToUnrealTransformation () const |
Computes the transformation matrix from the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the Unreal coordinate system. | |
FMatrix | ComputeEastSouthUpToUnrealTransformation (const FVector &UnrealLocation) const |
Computes the matrix that transforms from an East-South-Up frame centered at a given location to the Unreal frame. | |
FMatrix | ComputeEastSouthUpAtEarthCenteredEarthFixedPositionToUnrealTransformation (const FVector &EarthCenteredEarthFixedPosition) const |
Computes the matrix that transforms from an East-South-Up frame centered at a given location to the Unreal frame. | |
FMatrix | ComputeUnrealToEastSouthUpTransformation (const FVector &UnrealLocation) const |
Computes the matrix that transforms from the Unreal frame to an East-South-Up frame centered at a given location. | |
GeoTransforms | GetGeoTransforms () const noexcept |
ACesiumGeoreference () | |
const CesiumGeospatial::LocalHorizontalCoordinateSystem & | GetCoordinateSystem () const noexcept |
Static Public Member Functions | |
static ACesiumGeoreference * | GetDefaultGeoreference (const UObject *WorldContextObject) |
Finds and returns a CesiumGeoreference in the world. | |
static ACesiumGeoreference * | GetDefaultGeoreferenceForActor (AActor *Actor) |
Finds and returns the CesiumGeoreference suitable for use with the given Actor. | |
Public Attributes | |
FGeoreferenceUpdated | OnGeoreferenceUpdated |
A delegate that will be called whenever the Georeference is modified in a way that affects its computations. | |
FGeoreferenceEllipsoidChanged | OnEllipsoidChanged |
An event that will be called whenever the georeference's ellipsoid has been modified. | |
Static Public Attributes | |
static const double | kMinimumScale |
The minimum allowed value for the Scale property, 1e-6. | |
Protected Member Functions | |
virtual bool | ShouldTickIfViewportsOnly () const override |
virtual void | Tick (float DeltaTime) override |
virtual void | Serialize (FArchive &Ar) override |
virtual void | BeginPlay () override |
virtual void | OnConstruction (const FTransform &Transform) override |
virtual void | PostLoad () override |
Friends | |
class | FCesiumGeoreferenceCustomization |
Controls how global geospatial coordinates are mapped to coordinates in the Unreal Engine level.
Internally, Cesium uses a global Earth-centered, Earth-fixed (ECEF) ellipsoid-centered coordinate system, where the ellipsoid is usually the World Geodetic System 1984 (WGS84) ellipsoid. This is a right-handed system centered at the Earth's center of mass, where +X is in the direction of the intersection of the Equator and the Prime Meridian (zero degrees longitude), +Y is in the direction of the intersection of the Equator and +90 degrees longitude, and +Z is through the North Pole. This Actor is used by other Cesium Actors and components to control how this coordinate system is mapped into an Unreal Engine world and level.
Definition at line 49 of file CesiumGeoreference.h.
ACesiumGeoreference::ACesiumGeoreference | ( | ) |
|
overrideprotectedvirtual |
FMatrix ACesiumGeoreference::ComputeEarthCenteredEarthFixedToUnrealTransformation | ( | ) | const |
Computes the transformation matrix from the Earth-Centered, Earth-Fixed (ECEF) coordinate system to the Unreal coordinate system.
The Unreal coordinates should generally not be interpreted as Unreal world coordinates, but rather a coordinate system based on some parent Actor's reference frame as defined by its transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FMatrix ACesiumGeoreference::ComputeEastSouthUpAtEarthCenteredEarthFixedPositionToUnrealTransformation | ( | const FVector & | EarthCenteredEarthFixedPosition | ) | const |
Computes the matrix that transforms from an East-South-Up frame centered at a given location to the Unreal frame.
The location is expressed as an Earth-Centered, Earth-Fixed (ECEF) position. To use an Unreal position instead, use ComputeUnrealToEastSouthUpTransformation.
In an East-South-Up frame, +X points East, +Y points South, and +Z points Up. However, the directions of "East", "South", and "Up" in Unreal or ECEF coordinates vary depending on where on the globe we are talking about. That is why this function takes a location, expressed in ECEF coordinates, that defines the origin of the East-South-Up frame of interest.
The resulting matrix should generally not be relative to the Unreal world, but rather be expressed in some parent Actor's reference frame as defined by its Transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FMatrix ACesiumGeoreference::ComputeEastSouthUpToUnrealTransformation | ( | const FVector & | UnrealLocation | ) | const |
Computes the matrix that transforms from an East-South-Up frame centered at a given location to the Unreal frame.
In an East-South-Up frame, +X points East, +Y points South, and +Z points Up. However, the directions of "East", "South", and "Up" in Unreal or ECEF coordinates vary depending on where on the globe we are talking about. That is why this function takes a location, expressed in Unreal coordinates, that defines the origin of the East-South-Up frame of interest.
The Unreal location and the resulting matrix should generally not be relative to the Unreal world, but rather be expressed in some parent Actor's reference frame as defined by its Transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FMatrix ACesiumGeoreference::ComputeUnrealToEarthCenteredEarthFixedTransformation | ( | ) | const |
Computes the transformation matrix from the Unreal coordinate system to the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
The Unreal coordinates should generally not be interpreted as Unreal world coordinates, but rather a coordinate system based on some parent Actor's reference frame as defined by its transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FMatrix ACesiumGeoreference::ComputeUnrealToEastSouthUpTransformation | ( | const FVector & | UnrealLocation | ) | const |
Computes the matrix that transforms from the Unreal frame to an East-South-Up frame centered at a given location.
The location is expressed in Unreal coordinates. To use an Earth-Centered, Earth-Fixed position instead, use ComputeEastSouthUpAtEarthCenteredEarthFixedPositionToUnrealTransformation.
In an East-South-Up frame, +X points East, +Y points South, and +Z points Up. However, the directions of "East", "South", and "Up" in Unreal or ECEF coordinates vary depending on where on the globe we are talking about. That is why this function takes a location, expressed in Unreal coordinates, that defines the origin of the East-South-Up frame of interest.
The Unreal location and the resulting matrix should generally not be relative to the Unreal world, but rather be expressed in some parent Actor's reference frame as defined by its Transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
|
inlinenoexcept |
Definition at line 841 of file CesiumGeoreference.h.
|
static |
Finds and returns a CesiumGeoreference in the world.
It searches in the following order:
If no CesiumGeoreference is found with this search, a new one is created in the persistent level and given the "DEFAULT_GEOREFERENCE" tag.
|
static |
Finds and returns the CesiumGeoreference suitable for use with the given Actor.
It searches in the following order:
If no CesiumGeoreference is found with this search, a new one is created in the persistent level and given the "DEFAULT_GEOREFERENCE" tag.
UCesiumEllipsoid * ACesiumGeoreference::GetEllipsoid | ( | ) | const |
Returns a pointer to the UCesiumEllipsoid currently being used by this georeference.
|
noexcept |
FVector ACesiumGeoreference::GetOriginEarthCenteredEarthFixed | ( | ) | const |
Returns the georeference origin position as an FVector in Earth-Centerd, Earth-Fixed (ECEF) coordinates.
Only valid if the placement type is Cartographic Origin (i.e. Longitude / Latitude / Height).
double ACesiumGeoreference::GetOriginHeight | ( | ) | const |
Gets the height of the custom origin placement in meters above the ellipsoid.
double ACesiumGeoreference::GetOriginLatitude | ( | ) | const |
Gets the latitude of the custom origin placement in degrees, in the range [-90, 90].
double ACesiumGeoreference::GetOriginLongitude | ( | ) | const |
Gets the longitude of the custom origin placement in degrees, in the range [-180, 180].
FVector ACesiumGeoreference::GetOriginLongitudeLatitudeHeight | ( | ) | const |
Returns the georeference origin position as an FVector where X
is longitude (degrees), Y
is latitude (degrees), and Z
is height above the ellipsoid (meters).
Only valid if the placement type is Cartographic Origin (i.e. Longitude / Latitude / Height).
EOriginPlacement ACesiumGeoreference::GetOriginPlacement | ( | ) | const |
Gets the placement of this Actor's origin (coordinate 0,0,0) within the tileset.
3D Tiles tilesets often use Earth-centered, Earth-fixed coordinates, such that the tileset content is in a small bounding volume 6-7 million meters (the radius of the Earth) away from the coordinate system origin. This property allows an alternative position, other then the tileset's true origin, to be treated as the origin for the purpose of this Actor. Using this property will preserve vertex precision (and thus avoid jittering) much better than setting the Actor's Transform property.
double ACesiumGeoreference::GetScale | ( | ) | const |
Gets the percentage scale of the globe in the Unreal world.
If this value is 50, for example, one meter on the globe occupies half a meter in the Unreal world.
APlayerCameraManager * ACesiumGeoreference::GetSubLevelCamera | ( | ) | const |
Gets the camera to use to determine which sub-level is closest, so that one can be activated and all others deactivated.
|
inline |
Gets the component that allows switching between different sub-levels registered with this georeference.
Definition at line 415 of file CesiumGeoreference.h.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
void ACesiumGeoreference::SetEllipsoid | ( | UCesiumEllipsoid * | NewEllipsoid | ) |
Sets the UCesiumEllipsoid used by this georeference.
Calling this will cause all tilesets under this georeference to be reloaded.
void ACesiumGeoreference::SetOriginEarthCenteredEarthFixed | ( | const FVector & | TargetEarthCenteredEarthFixed | ) |
This aligns the specified Earth-Centered, Earth-Fixed (ECEF) coordinates to the Unreal origin.
That is, it moves the globe so that these coordinates exactly fall on the origin. Only valid if the placement type is Cartographic Origin (i.e. Longitude / Latitude / Height). Note that if the provided ECEF coordiantes are near the center of the Earth so that Longitude, Latitude, and Height are undefined, this function will instead place the origin at 0 degrees longitude, 0 degrees latitude, and 0 meters height about the ellipsoid.
void ACesiumGeoreference::SetOriginHeight | ( | double | NewValue | ) |
Sets the height of the custom origin placement in meters above the ellipsoid.
void ACesiumGeoreference::SetOriginLatitude | ( | double | NewValue | ) |
Sets the latitude of the custom origin placement in degrees, in the range [-90, 90].
void ACesiumGeoreference::SetOriginLongitude | ( | double | NewValue | ) |
Sets the longitude of the custom origin placement in degrees, in the range [-180, 180].
void ACesiumGeoreference::SetOriginLongitudeLatitudeHeight | ( | const FVector & | TargetLongitudeLatitudeHeight | ) |
This aligns the specified longitude in degrees (X), latitude in degrees (Y), and height above the ellipsoid in meters (Z) to the Unreal origin.
That is, it moves the globe so that these coordinates exactly fall on the origin. Only valid if the placement type is Cartographic Origin (i.e. Longitude / Latitude / Height).
void ACesiumGeoreference::SetOriginPlacement | ( | EOriginPlacement | NewValue | ) |
Sets the placement of this Actor's origin (coordinate 0,0,0) within the tileset.
3D Tiles tilesets often use Earth-centered, Earth-fixed coordinates, such that the tileset content is in a small bounding volume 6-7 million meters (the radius of the Earth) away from the coordinate system origin. This property allows an alternative position, other then the tileset's true origin, to be treated as the origin for the purpose of this Actor. Using this property will preserve vertex precision (and thus avoid jittering) much better than setting the Actor's Transform property.
void ACesiumGeoreference::SetScale | ( | double | NewValue | ) |
Sets the percentage scale of the globe in the Unreal world.
If this value is 50, for example, one meter on the globe occupies half a meter in the Unreal world.
void ACesiumGeoreference::SetSubLevelCamera | ( | APlayerCameraManager * | NewValue | ) |
Sets the camera to use to determine which sub-level is closest, so that one can be activated and all others deactivated.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
FVector ACesiumGeoreference::TransformEarthCenteredEarthFixedDirectionToUnreal | ( | const FVector & | EarthCenteredEarthFixedDirection | ) | const |
Transforms a direction vector in Earth-Centered, Earth-Fixed (ECEF) coordinates into Unreal coordinates.
The resulting direction vector should generally not be interpreted as an Unreal world vector, but rather a vector expressed in some parent Actor's reference frame as defined by its transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FVector ACesiumGeoreference::TransformEarthCenteredEarthFixedPositionToUnreal | ( | const FVector & | EarthCenteredEarthFixedPosition | ) | const |
Transforms a position in Earth-Centered, Earth-Fixed (ECEF) coordinates into Unreal coordinates.
The resulting position should generally not be interpreted as an Unreal world position, but rather a position expressed in some parent Actor's reference frame as defined by its transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FRotator ACesiumGeoreference::TransformEastSouthUpRotatorToUnreal | ( | const FRotator & | EastSouthUpRotator, |
const FVector & | UnrealLocation ) const |
Given a Rotator that transforms an object into the East-South-Up frame centered at a given location, returns a new Rotator that transforms that object into Unreal coordinates.
In an East-South-Up frame, +X points East, +Y points South, and +Z points Up. However, the directions of "East", "South", and "Up" in Unreal or ECEF coordinates vary depending on where on the globe we are talking about. That is why this function takes a location, expressed in Unreal coordinates, that defines the origin of the East-South-Up frame of interest.
The Unreal location and the resulting Rotator should generally not be relative to the Unreal world, but rather be expressed in some parent Actor's reference frame as defined by its Transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FVector ACesiumGeoreference::TransformLongitudeLatitudeHeightPositionToUnreal | ( | const FVector & | LongitudeLatitudeHeight | ) | const |
Transforms the given longitude in degrees (x), latitude in degrees (y), and height above the ellipsoid in meters (z) into Unreal coordinates.
The resulting position should generally not be interpreted as an Unreal world position, but rather a position expressed in some parent Actor's reference frame as defined by its transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FVector ACesiumGeoreference::TransformUnrealDirectionToEarthCenteredEarthFixed | ( | const FVector & | UnrealDirection | ) | const |
Transforms the given direction vector from Unreal coordinates to Earth-Centered, Earth-Fixed (ECEF) coordinates.
The direction vector should generally not be an Unreal world vector, but rather a vector expressed in some parent Actor's reference frame as defined by its transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FVector ACesiumGeoreference::TransformUnrealPositionToEarthCenteredEarthFixed | ( | const FVector & | UnrealPosition | ) | const |
Transforms the given position from Unreal coordinates to Earth-Centered, Earth-Fixed (ECEF).
The position should generally not be an Unreal world position, but rather a position expressed in some parent Actor's reference frame as defined by its transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FVector ACesiumGeoreference::TransformUnrealPositionToLongitudeLatitudeHeight | ( | const FVector & | UnrealPosition | ) | const |
Transforms a position in Unreal coordinates into longitude in degrees (x), latitude in degrees (y), and height above the ellipsoid in meters (z).
The position should generally not be an Unreal world position, but rather a position expressed in some parent Actor's reference frame as defined by its transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
FRotator ACesiumGeoreference::TransformUnrealRotatorToEastSouthUp | ( | const FRotator & | UnrealRotator, |
const FVector & | UnrealLocation ) const |
Given a Rotator that transforms an object into the Unreal coordinate system, returns a new Rotator that transforms that object into an East-South-Up frame centered at a given location.
In an East-South-Up frame, +X points East, +Y points South, and +Z points Up. However, the directions of "East", "South", and "Up" in Unreal or ECEF coordinates vary depending on where on the globe we are talking about. That is why this function takes a location, expressed in Unreal coordinates, that defines the origin of the East-South-Up frame of interest.
The Unreal location and the resulting Rotator should generally not be relative to the Unreal world, but rather be expressed in some parent Actor's reference frame as defined by its Transform. This way, the chain of Unreal transforms places and orients the "globe" in the Unreal world.
|
friend |
Definition at line 866 of file CesiumGeoreference.h.
|
static |
The minimum allowed value for the Scale property, 1e-6.
Definition at line 55 of file CesiumGeoreference.h.
FGeoreferenceEllipsoidChanged ACesiumGeoreference::OnEllipsoidChanged |
An event that will be called whenever the georeference's ellipsoid has been modified.
Definition at line 106 of file CesiumGeoreference.h.
FGeoreferenceUpdated ACesiumGeoreference::OnGeoreferenceUpdated |
A delegate that will be called whenever the Georeference is modified in a way that affects its computations.
Definition at line 99 of file CesiumGeoreference.h.