SpiceTranslation

Inherits Translation

This Translation type uses SPICE kernels to provide translational information for the attached scene graph node. SPICE is a library used by scientists and engineers to, among other tasks, plan space missions. If you are unfamiliar with SPICE, their webpage has both extensive Tutorials as well as Lessions that explain the system deeper. This class provides access to the spkpos_c function of the Spice library.

Members

Name

Documentation

Type

Description

Optional

Observer

This is the SPICE name for the parent of the body whose translation is to be computed by the SpiceTranslation. It can either be a fully qualified name (such as ‘SOLAR SYSTEM BARYCENTER’) or a NAIF integer id code (such as ‘0’). The resulting translation will be a vector leading from the Target to the Observer.

String, or Integer

Value of type ‘String’, or Value of type ‘Integer’

No

Target

This is the SPICE name for the body whose translation is to be computed by the SpiceTranslation. It can either be a fully qualified name (such as ‘EARTH’) or a NAIF integer id code (such as ‘399’). The resulting translation will be a vector leading from the Target to the Observer.

String, or Integer

Value of type ‘String’, or Value of type ‘Integer’

No

FixedDate

If this value is specified, the position will be locked to a specific time rather than following the in-game in the system. Setting this to an empty string will unlock the time and return to position based on current simulation time.

Date and time

Value of type ‘Date and time’

Yes

Frame

String

A valid SPICE NAIF name for a reference frame

Yes

TimeOffset

A time offset, in seconds, added to the simulation time (or Fixed Date if any), at which to compute the rotation.

Double

Value of type ‘Double’

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

Basic

This asset creates a time-varying translation with information from a SPICE kernel and applies it to a scene graph node that only displays coordinate axes. The position of the coordinate axes are determined by SPICE, in this case pretending that the axes are orbiting the same way the Moon does around Earth. For more information about SPICE see: https://naif.jpl.nasa.gov/naif/

 1-- Load the default SPICE kernels, which are the planetary constants and the DE430 kernel
 2asset.require("spice/core")
 3
 4local Node = {
 5  Identifier = "SpiceTranslation_Example",
 6  Transform = {
 7    Translation = {
 8      Type = "SpiceTranslation",
 9      Target = "MOON",
10      Observer = "EARTH"
11    }
12  },
13  Renderable = {
14    Type = "RenderableCartesianAxes"
15  },
16  GUI = {
17    Name = "SpiceTranslation - Basic",
18    Path = "/Examples"
19  }
20}
21
22asset.onInitialize(function()
23  openspace.addSceneGraphNode(Node)
24end)
25
26asset.onDeinitialize(function()
27  openspace.removeSceneGraphNode(Node)
28end)
Fixed Date

This asset creates a time-varying translation with information from a SPICE kernel and applies it to a scene graph node that only displays coordinate axes. The position of the coordinate axes are determined by SPICE, in this case pretending that the axes are orbiting the same way the Moon does around Earth. In this specific example, the position is independent of the actual in-game time in OpenSpace and only uses a fixed date of 2000 JAN 01 instead. For more information about SPICE see: https://naif.jpl.nasa.gov/naif/

 1-- Load the default SPICE kernels, which are the planetary constants and the DE430 kernel
 2asset.require("spice/core")
 3
 4local Node = {
 5  Identifier = "SpiceTranslation_Example_FixedDate",
 6  Transform = {
 7    Translation = {
 8      Type = "SpiceTranslation",
 9      Target = "MOON",
10      Observer = "EARTH",
11      FixedDate = "2000 JAN 01 00:00:00.000"
12    }
13  },
14  Renderable = {
15    Type = "RenderableCartesianAxes"
16  },
17  GUI = {
18    Name = "SpiceTranslation - Fixed Date",
19    Path = "/Examples"
20  }
21}
22
23asset.onInitialize(function()
24  openspace.addSceneGraphNode(Node)
25end)
26
27asset.onDeinitialize(function()
28  openspace.removeSceneGraphNode(Node)
29end)
Fixed Date

This asset creates a time-varying translation with information from a SPICE kernel and applies it to a scene graph node that only displays coordinate axes. The position of the coordinate axes are determined by SPICE, in this case pretending that the axes are orbiting the same way the Moon does around Earth. In this specific example, the position is offset 8h back compared to the actual in-game time in OpenSpace. For more information about SPICE see: https://naif.jpl.nasa.gov/naif/

 1-- Load the default SPICE kernels, which are the planetary constants and the DE430 kernel
 2asset.require("spice/core")
 3
 4local Node = {
 5  Identifier = "SpiceTranslation_Example_TimeOffset",
 6  Transform = {
 7    Translation = {
 8      Type = "SpiceTranslation",
 9      Target = "MOON",
10      Observer = "EARTH",
11      TimeOffset = -8 * 60 * 60
12    }
13  },
14  Renderable = {
15    Type = "RenderableCartesianAxes"
16  },
17  GUI = {
18    Name = "SpiceTranslation - Time Offset",
19    Path = "/Examples"
20  }
21}
22
23asset.onInitialize(function()
24  openspace.addSceneGraphNode(Node)
25end)
26
27asset.onDeinitialize(function()
28  openspace.removeSceneGraphNode(Node)
29end)
Reference Frame

This asset creates a time-varying translation with information from a SPICE kernel and applies it to a scene graph node that only displays coordinate axes. The position of the coordinate axes are determined by SPICE, in this case pretending that the axes are orbiting the same way the Moon does around Earth. The calculated position will be provided in the rotating coordinate system of Earth itself. For more information about SPICE see: https://naif.jpl.nasa.gov/naif/

 1-- Load the default SPICE kernels, which are the planetary constants and the DE430 kernel
 2asset.require("spice/core")
 3
 4local Node = {
 5  Identifier = "SpiceTranslation_Example_ReferenceFrame",
 6  Transform = {
 7    Translation = {
 8      Type = "SpiceTranslation",
 9      Target = "MOON",
10      Observer = "EARTH",
11      Frame = "IAU_EARTH"
12    }
13  },
14  Renderable = {
15    Type = "RenderableCartesianAxes"
16  },
17  GUI = {
18    Name = "SpiceTranslation - Reference Frame",
19    Path = "/Examples"
20  }
21}
22
23asset.onInitialize(function()
24  openspace.addSceneGraphNode(Node)
25end)
26
27asset.onDeinitialize(function()
28  openspace.removeSceneGraphNode(Node)
29end)