GlobeTranslation

Inherits Translation

This Translation places the scene graph node at a specific location relative to another scene graph node. The position is identified via the longitude, latitude, and altitude parameters. If the provided scene graph node is a globe, the positions correspond to the native coordinate frame of that object. If it is a node without a renderable or a non-globe renderable, the latitude/longitude grid used is the node’s interaction sphere. This class is useful in conjunction with the GlobeRotation rotation to orient a scene graph node away from the center of the body.

If the UseCamera value is set, the object’s position automatically updates based on the current camera location.

Members

Name

Documentation

Type

Description

Optional

Globe

The node on which the longitude/latitude is specified. If the node is a globe, the correct height information for the globe is used. Otherwise, the position is specified based on the longitude and latitude on the node’s interaction sphere

Identifier

An identifier string. May not contain ‘.’, spaces, newlines, or tabs

No

Altitude

The altitude in meters. If the ‘UseHeightmap’ property is ‘true’, this is an offset from the actual surface of the globe. If not, this is an offset from the reference ellipsoid. The default value is 0.0.

Double

Value of type ‘Double’

Yes

Latitude

The latitude of the location on the globe’s surface. The value can range from -90 to 90, with negative values representing the southern hemisphere of the globe. The default value is 0.0.

Double

Value of type ‘Double’

Yes

Longitude

The longitude of the location on the globe’s surface. The value can range from -180 to 180, with negative values representing the western hemisphere of the globe. The default value is 0.0.

Double

Value of type ‘Double’

Yes

UseCamera

If this value is ‘true’, the lat and lon are updated to match the camera.

Boolean

Value of type ‘Boolean’

Yes

UseCameraAltitude

If this value is ‘true’, the altitude is updated to match the camera.

Boolean

Value of type ‘Boolean’

Yes

UseHeightmap

If this value is ‘true’, the altitude specified in ‘Altitude’ will be treated as an offset from the heightmap. Otherwise, it will be an offset from the globe’s reference ellipsoid. The default value is ‘false’.

Boolean

Value of type ‘Boolean’

Yes

Inherited members from Translation

Name

Documentation

Type

Description

Optional

Type

The type of translation that is described in this element. The available types of translations depend on the configuration of the application and can be written to disk on application startup into the FactoryDocumentation

String

Must name a valid Translation type

No

TimeFrame

The time frame in which this Translation is applied. If the in-game time is outside this range, no translation will be applied.

Table

TimeFrame

Yes

Asset Examples

 1-- Basic
 2-- This asset creates a rotation that places a coordinate axes on the surface of a
 3-- planetary body. The rotation causes the coordinate axes to remain fixed to the surface
 4-- of the globe.
 5--
 6-- In order for this feature to work properly, the coordinate axes need to be located at
 7-- the same place as well, so this example also needs a `GlobeTranslation` applied.
 8
 9-- The example needs a `RenderableGlobe` as a parent to function
10local Globe = {
11  Identifier = "GlobeRotation_Example_Globe",
12  Renderable = {
13    Type = "RenderableGlobe"
14  },
15  GUI = {
16    Name = "GlobeRotation - Basic (Globe)",
17    Path = "/Examples"
18  }
19}
20
21local Node = {
22  Identifier = "GlobeRotation_Example",
23  Parent = "GlobeRotation_Example_Globe",
24  Transform = {
25    Translation = {
26      Type = "GlobeTranslation",
27      Globe = "GlobeRotation_Example_Globe",
28      Latitude = 20.0,
29      Longitude = -45.0
30    },
31    Rotation = {
32      Type = "GlobeRotation",
33      Globe = "GlobeRotation_Example_Globe",
34      Latitude = 20.0,
35      Longitude = -45.0
36    }
37  },
38  Renderable = {
39    Type = "RenderableCartesianAxes"
40  },
41  GUI = {
42    Name = "GlobeRotation - Basic",
43    Path = "/Examples"
44  }
45}
46
47asset.onInitialize(function()
48  openspace.addSceneGraphNode(Globe)
49  openspace.addSceneGraphNode(Node)
50end)
51
52asset.onDeinitialize(function()
53  openspace.removeSceneGraphNode(Node)
54  openspace.removeSceneGraphNode(Globe)
55end)