GeographicTransform (Class)
Namespace: Wrld.Space
A GeographicTransform behaviour is used to place a GameObject somewhere on the globe. It will keep the object correctly positioned and oriented regardless of the coordinate system or camera location used by the map. This GameObject can then serve as a coordinate frame for its children which can be placed and moved as normal. In order for a GeographicTransform’s position to be updated, the API must be made aware of it via the GeographicApi.RegisterGeographicTransform method. This is called automatically OnEnable, but can also be called manually if more control over updating is required.
Methods
void SetPosition (LatLong latLong)
Set the location of this transform on the map to the specified latitude and longitude.
Argument | Type | Description |
---|---|---|
latLong | LatLong | The new position of the transform. |
LatLong GetLatLong ()
Get the current latitude and longitude of this object.
Returns: A LatLong representing this object’s location.
LatLong GetPosition ()
Get the current latitude and longitude of this object.
Returns: A LatLong representing this object’s location.
void SetHeading (float headingInDegrees)
Set the heading in degrees of this transform, relative to north.
Argument | Type | Description |
---|---|---|
headingInDegrees | float | The new heading of the transform. |
void SetElevation (double elevation)
Set the desired elevation of this transform, in meters. The behaviour of this depends on the ElevationMode.
Argument | Type | Description |
---|---|---|
elevation | double | The desired elevation of the transform, in meters. |
double GetElevation ()
Get the elevation of this transform, in meters.
Returns: The elevation of this transform, in meters.
void SetElevationMode (ElevationMode elevationMode)
Set the desired ElevationMode of this transform. See the ElevationMode documentation for details.
Argument | Type | Description |
---|---|---|
elevationMode | ElevationMode | The desired ElevationMode of the transform. |
ElevationMode GetElevationMode ()
Get the ElevationMode of this transform.
Returns: The ElevationMode of this transform.
void SetIndoorMap (String indoorMapId, int indoorMapFloorId)
Sets the Indoor Map of this transform. If this is unset, the transform will be outside instead.
Argument | Type | Description |
---|---|---|
indoorMapId | String | The Indoor Map id string for the desired Indoor Map. See the IndoorMapApi documentation for more details. |
indoorMapFloorId | int | The floor of the Indoor Map that this transform should be placed upon. |
String GetIndoorMapId ()
Get the Indoor Map Id string of this transform.
Returns: The Indoor Map Id, as a string.
int GetIndoorMapFloorId ()
Get the Indoor Map Floor Id of this transform.
Returns: The Indoor Map Floor Id of this transform.
bool TryGetLatLongAltitude (out LatLongAltitude out_latLongAlt)
Try to get the transformed position as a LatLongAltitude of this GeographicTransform. This can be used with SpacesApi.GeographicToWorldPoint to calculate a Vector3 translation for this GeographicTransform.
Returns: Whether or not this function was successful.
Argument | Type | Description |
---|---|---|
out_latLongAlt | LatLongAltitude | The LatLongAltitude that represents the GeographicTransform’s position with the desired elevation and ElevationMode applied. The value is only valid if this function returns true. |
bool TryGetScreenPoint (out Vector3 out_screenPoint)
Try to get the on-screen position of this GeographicTransform.
Returns: True if the GeographicTransform’s screen point could be determined, false otherwise.
Argument | Type | Description |
---|---|---|
out_screenPoint | Vector3 | The screen point of this GeographicTransform. The value is only valid if the returned result is true. |
bool IsBehindGlobeHorizon ()
Returns true if the screen projection of this GeographicTransform would appear beyond the horizon for the current viewpoint. For example, when viewing the map zoomed out so that the entire globe is visible, calling this method on a GeographicTransform that is located on the opposite side of the Earth from the camera would return true.
Returns: Whether or not this GeographicTransform is beyond the horizon.