Cesium for Unreal 2.12.0
|
This component can be added to a movable actor to anchor it to the globe and maintain precise placement. More...
#include <CesiumGlobeAnchorComponent.h>
Public Member Functions | |
TSoftObjectPtr< ACesiumGeoreference > | GetGeoreference () const |
Gets the designated georeference actor controlling how the owning actor's coordinate system relates to the coordinate system in this Unreal Engine level. | |
void | SetGeoreference (TSoftObjectPtr< ACesiumGeoreference > NewGeoreference) |
Sets the designated georeference actor controlling how the owning actor's coordinate system relates to the coordinate system in this Unreal Engine level. | |
ACesiumGeoreference * | GetResolvedGeoreference () const |
Gets the resolved georeference used by this component. | |
ACesiumGeoreference * | ResolveGeoreference (bool bForceReresolve=false) |
Resolves the Cesium Georeference to use with this Component. | |
UCesiumEllipsoid * | GetEllipsoid () const |
Obtains the UCesiumEllipsoid set on the georeference used by this component. | |
FMatrix | GetActorToEarthCenteredEarthFixedMatrix () const |
Gets the 4x4 transformation matrix from the Actors's local coordinate system to the Earth-Centered, Earth-Fixed (ECEF) coordinate system. | |
void | SetActorToEarthCenteredEarthFixedMatrix (const FMatrix &Value) |
Sets the 4x4 transformation matrix from the Actors's local coordinate system to the Earth-Centered, Earth-Fixed (ECEF) coordinate system. | |
bool | GetTeleportWhenUpdatingTransform () const |
Gets a flag indicating whether to move objects to the updated transform immediately and without affecting their velocity. | |
void | SetTeleportWhenUpdatingTransform (bool Value) |
Sets a flag indicating whether to move objects to the updated transform immediately and without affecting their velocity. | |
bool | GetAdjustOrientationForGlobeWhenMoving () const |
Gets a flag indicating whether to adjust the Actor's orientation based on globe curvature as the Actor moves. | |
void | SetAdjustOrientationForGlobeWhenMoving (bool Value) |
Sets a flag indicating whether to adjust the Actor's orientation based on globe curvature as the Actor moves. | |
FVector | GetLongitudeLatitudeHeight () const |
Gets the longitude in degrees (X), latitude in degrees (Y), and height in meters above the ellipsoid (Z) of the actor. | |
double | GetLongitude () const |
Gets the longitude in degrees. | |
double | GetLatitude () const |
Gets the latitude in degrees. | |
double | GetHeight () const |
Gets the height in meters above the ellipsoid. | |
void | MoveToLongitudeLatitudeHeight (const FVector &LongitudeLatitudeHeight) |
Moves the Actor to which this component is attached to a given longitude in degrees (X), latitude in degrees (Y), and height in meters (Z). | |
FVector | GetEarthCenteredEarthFixedPosition () const |
Gets the Earth-Centered, Earth-Fixed (ECEF) coordinates of the Actor in meters. | |
void | MoveToEarthCenteredEarthFixedPosition (const FVector &EarthCenteredEarthFixedPosition) |
Moves the Actor to which this component is attached to a given globe position in Earth-Centered, Earth-Fixed coordinates in meters. | |
FQuat | GetEastSouthUpRotation () const |
Gets the rotation of the Actor relative to a local coordinate system centered on this object where the +X points in the local East direction, the +Y axis points in the local South direction, and the +Z axis points in the local Up direction. | |
void | SetEastSouthUpRotation (const FQuat &EastSouthUpRotation) |
Sets the rotation of the Actor relative to a local coordinate system centered on this object where the +X points in the local East direction, the +Y axis points in the local South direction, and the +Z axis points in the local Up direction. | |
FQuat | GetEarthCenteredEarthFixedRotation () const |
Gets the rotation of the Actor relative to the Earth-Centered, Earth-Fixed (ECEF) coordinate system. | |
void | SetEarthCenteredEarthFixedRotation (const FQuat &EarthCenteredEarthFixedRotation) |
Sets the rotation of the Actor relative to the Earth-Centered, Earth-Fixed (ECEF) coordinate system. | |
void | SnapLocalUpToEllipsoidNormal () |
Rotates the Actor so that its local +Z axis is aligned with the ellipsoid surface normal at its current location. | |
void | SnapToEastSouthUp () |
Rotates the Actor so that its +X axis points in the local East direction, its +Y axis points in the local South direction, and its +Z axis points in the local Up direction. | |
void | Sync () |
Synchronizes the properties of this globe anchor. | |
void | InvalidateResolvedGeoreference () |
DEPRECATED. | |
Protected Member Functions | |
virtual void | Serialize (FArchive &Ar) override |
Handles reading, writing, and reference collecting using FArchive. | |
virtual void | OnComponentCreated () override |
Called when a component is created (not loaded). | |
virtual void | OnRegister () override |
Called when a component is registered. | |
virtual void | OnUnregister () override |
Called when a component is unregistered. | |
Friends | |
class | FCesiumGlobeAnchorCustomization |
This component can be added to a movable actor to anchor it to the globe and maintain precise placement.
When the owning actor is transformed through normal Unreal Engine mechanisms, the internal geospatial coordinates will be automatically updated. The actor position can also be set in terms of Earth-Centered, Earth-Fixed coordinates (ECEF) or Longitude, Latitude, and Height relative to the ellipsoid.
Definition at line 21 of file CesiumGlobeAnchorComponent.h.
FMatrix UCesiumGlobeAnchorComponent::GetActorToEarthCenteredEarthFixedMatrix | ( | ) | const |
Gets the 4x4 transformation matrix from the Actors's local coordinate system to the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
The ECEF coordinate system is a right-handed system located at the center of the Earth. The +X axis points to the intersection of the Equator and Prime Meridian (zero degrees longitude). The +Y axis points to the intersection of the Equator and +90 degrees longitude. The +Z axis points up through the North Pole.
bool UCesiumGlobeAnchorComponent::GetAdjustOrientationForGlobeWhenMoving | ( | ) | const |
Gets a flag indicating whether to adjust the Actor's orientation based on globe curvature as the Actor moves.
The Earth is not flat, so as we move across its surface, the direction of "up" changes. If we ignore this fact and leave an object's orientation unchanged as it moves over the globe surface, the object will become increasingly tilted and eventually be completely upside-down when we arrive at the opposite side of the globe.
When this setting is enabled, this Component will automatically apply a rotation to the Actor to account for globe curvature any time the Actor's position on the globe changes.
This property should usually be enabled, but it may be useful to disable it when your application already accounts for globe curvature itself when it updates an Actor's position and orientation, because in that case the Actor would be over-rotated.
FVector UCesiumGlobeAnchorComponent::GetEarthCenteredEarthFixedPosition | ( | ) | const |
Gets the Earth-Centered, Earth-Fixed (ECEF) coordinates of the Actor in meters.
FQuat UCesiumGlobeAnchorComponent::GetEarthCenteredEarthFixedRotation | ( | ) | const |
Gets the rotation of the Actor relative to the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
The ECEF coordinate system is a right-handed system located at the center of the Earth. The +X axis points from there to the intersection of the Equator and Prime Meridian (zero degrees longitude). The +Y axis points to the intersection of the Equator and +90 degrees longitude. The +Z axis points up through the North Pole.
FQuat UCesiumGlobeAnchorComponent::GetEastSouthUpRotation | ( | ) | const |
Gets the rotation of the Actor relative to a local coordinate system centered on this object where the +X points in the local East direction, the +Y axis points in the local South direction, and the +Z axis points in the local Up direction.
UCesiumEllipsoid * UCesiumGlobeAnchorComponent::GetEllipsoid | ( | ) | const |
Obtains the UCesiumEllipsoid
set on the georeference used by this component.
TSoftObjectPtr< ACesiumGeoreference > UCesiumGlobeAnchorComponent::GetGeoreference | ( | ) | const |
Gets the designated georeference actor controlling how the owning actor's coordinate system relates to the coordinate system in this Unreal Engine level.
If this is null, the Component will find and use the first Georeference Actor in the level, or create one if necessary. To get the active/effective Georeference from Blueprints or C++, use ResolvedGeoreference instead.
|
inline |
Gets the height in meters above the ellipsoid.
Do not confuse the ellipsoid height with a geoid height or height above mean sea level, which can be tens of meters higher or lower depending on where in the world the object is located.
Definition at line 327 of file CesiumGlobeAnchorComponent.h.
|
inline |
Gets the latitude in degrees.
Definition at line 314 of file CesiumGlobeAnchorComponent.h.
|
inline |
Gets the longitude in degrees.
Definition at line 305 of file CesiumGlobeAnchorComponent.h.
FVector UCesiumGlobeAnchorComponent::GetLongitudeLatitudeHeight | ( | ) | const |
Gets the longitude in degrees (X), latitude in degrees (Y), and height in meters above the ellipsoid (Z) of the actor.
Do not confuse the ellipsoid height with a geoid height or height above mean sea level, which can be tens of meters higher or lower depending on where in the world the object is located.
ACesiumGeoreference * UCesiumGlobeAnchorComponent::GetResolvedGeoreference | ( | ) | const |
Gets the resolved georeference used by this component.
This is not serialized because it may point to a Georeference in the PersistentLevel while this component is in a sub-level. If the Georeference property is manually specified, however, then this property will have the same value.
This property will be null before ResolveGeoreference is called, which happens automatically when the component is registered.
bool UCesiumGlobeAnchorComponent::GetTeleportWhenUpdatingTransform | ( | ) | const |
Gets a flag indicating whether to move objects to the updated transform immediately and without affecting their velocity.
This is useful when working with physics actors that maintain an internal velocity which we do not want to change when updating location.
void UCesiumGlobeAnchorComponent::InvalidateResolvedGeoreference | ( | ) |
DEPRECATED.
void UCesiumGlobeAnchorComponent::MoveToEarthCenteredEarthFixedPosition | ( | const FVector & | EarthCenteredEarthFixedPosition | ) |
Moves the Actor to which this component is attached to a given globe position in Earth-Centered, Earth-Fixed coordinates in meters.
If AdjustOrientationForGlobeWhenMoving is enabled, this method will also update the orientation based on the globe curvature.
EarthCenteredEarthFixedPosition | The new position. |
void UCesiumGlobeAnchorComponent::MoveToLongitudeLatitudeHeight | ( | const FVector & | LongitudeLatitudeHeight | ) |
Moves the Actor to which this component is attached to a given longitude in degrees (X), latitude in degrees (Y), and height in meters (Z).
The Height (Z) is measured in meters above the ellipsoid. Do not confused an ellipsoidal height with a geoid height or height above mean sea level, which can be tens of meters higher or lower depending on where in the world the object is located.
If AdjustOrientationForGlobeWhenMoving
is enabled, the Actor's orientation will also be adjusted to account for globe curvature.
|
overrideprotectedvirtual |
Called when a component is created (not loaded).
This can happen in the editor or during gameplay.
This method is invoked after this component is pasted and just prior to registration. We mark the globe transform invalid here because we can't assume the globe transform is still valid when the component is pasted into another Actor, or even if the Actor was changed since the Component was copied.
|
overrideprotectedvirtual |
Called when a component is registered.
This can be viewed as "enabling" this Component on the Actor to which it is attached.
In the Editor, this is called in a many different situations, such as on changes to properties.
|
overrideprotectedvirtual |
Called when a component is unregistered.
This can be viewed as "disabling" this Component on the Actor to which it is attached.
In the Editor, this is called in a many different situations, such as on changes to properties.
ACesiumGeoreference * UCesiumGlobeAnchorComponent::ResolveGeoreference | ( | bool | bForceReresolve = false | ) |
Resolves the Cesium Georeference to use with this Component.
Returns the value of the Georeference property if it is set. Otherwise, finds a Georeference in the World and returns it, creating it if necessary. The resolved Georeference is cached so subsequent calls to this function will return the same instance, unless ForceReresolve is true.
|
overrideprotectedvirtual |
Handles reading, writing, and reference collecting using FArchive.
This implementation handles all FProperty serialization, but can be overridden for native variables.
This class overrides this method to ensure internal variables are immediately synchronized with newly-loaded values.
void UCesiumGlobeAnchorComponent::SetActorToEarthCenteredEarthFixedMatrix | ( | const FMatrix & | Value | ) |
Sets the 4x4 transformation matrix from the Actors's local coordinate system to the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
The ECEF coordinate system is a right-handed system located at the center of the Earth. The +X axis points to the intersection of the Equator and Prime Meridian (zero degrees longitude). The +Y axis points to the intersection of the Equator and +90 degrees longitude. The +Z axis points up through the North Pole.
If AdjustOrientationForGlobeWhenMoving
is enabled, the Actor's orientation will also be adjusted to account for globe curvature.
void UCesiumGlobeAnchorComponent::SetAdjustOrientationForGlobeWhenMoving | ( | bool | Value | ) |
Sets a flag indicating whether to adjust the Actor's orientation based on globe curvature as the Actor moves.
The Earth is not flat, so as we move across its surface, the direction of "up" changes. If we ignore this fact and leave an object's orientation unchanged as it moves over the globe surface, the object will become increasingly tilted and eventually be completely upside-down when we arrive at the opposite side of the globe.
When this setting is enabled, this Component will automatically apply a rotation to the Actor to account for globe curvature any time the Actor's position on the globe changes.
This property should usually be enabled, but it may be useful to disable it when your application already accounts for globe curvature itself when it updates an Actor's position and orientation, because in that case the Actor would be over-rotated.
void UCesiumGlobeAnchorComponent::SetEarthCenteredEarthFixedRotation | ( | const FQuat & | EarthCenteredEarthFixedRotation | ) |
Sets the rotation of the Actor relative to the Earth-Centered, Earth-Fixed (ECEF) coordinate system.
The ECEF coordinate system is a right-handed system located at the center of the Earth. The +X axis points from there to the intersection of the Equator and Prime Meridian (zero degrees longitude). The +Y axis points to the intersection of the Equator and +90 degrees longitude. The +Z axis points up through the North Pole.
void UCesiumGlobeAnchorComponent::SetEastSouthUpRotation | ( | const FQuat & | EastSouthUpRotation | ) |
Sets the rotation of the Actor relative to a local coordinate system centered on this object where the +X points in the local East direction, the +Y axis points in the local South direction, and the +Z axis points in the local Up direction.
When the rotation is set via this method, it is internally converted to and stored in the ActorToEarthCenteredEarthFixedMatrix property. As a result, getting this property will not necessarily return the exact value that was set.
void UCesiumGlobeAnchorComponent::SetGeoreference | ( | TSoftObjectPtr< ACesiumGeoreference > | NewGeoreference | ) |
Sets the designated georeference actor controlling how the owning actor's coordinate system relates to the coordinate system in this Unreal Engine level.
If this is null, the Component will find and use the first Georeference Actor in the level, or create one if necessary. To get the active/effective Georeference from Blueprints or C++, use ResolvedGeoreference instead.
void UCesiumGlobeAnchorComponent::SetTeleportWhenUpdatingTransform | ( | bool | Value | ) |
Sets a flag indicating whether to move objects to the updated transform immediately and without affecting their velocity.
This is useful when working with physics actors that maintain an internal velocity which we do not want to change when updating location.
void UCesiumGlobeAnchorComponent::SnapLocalUpToEllipsoidNormal | ( | ) |
Rotates the Actor so that its local +Z axis is aligned with the ellipsoid surface normal at its current location.
void UCesiumGlobeAnchorComponent::SnapToEastSouthUp | ( | ) |
Rotates the Actor so that its +X axis points in the local East direction, its +Y axis points in the local South direction, and its +Z axis points in the local Up direction.
void UCesiumGlobeAnchorComponent::Sync | ( | ) |
Synchronizes the properties of this globe anchor.
It is usually not necessary to call this method because it is called automatically when needed.
This method performs the following actions:
|
friend |
Definition at line 599 of file CesiumGlobeAnchorComponent.h.