SpiceRotation

Inherits Rotation

Members

Name

Documentation

Type

Description

Optional

SourceFrame

This value specifies the source frame that is used as the basis for the coordinate transformation. This has to be a valid SPICE name.

String

A valid SPICE NAIF name or integer

No

DestinationFrame

This value specifies the destination frame that is used for the coordinate transformation. This has to be a valid SPICE name. If this value is not specified, a reference frame of ‘GALACTIC’ is used instead

String

Value of type ‘String’

Yes

FixedDate

A time to lock the rotation to. Setting this to an empty string will unlock the time and return to rotation based on current simulation time.

String

A time to lock the rotation to

Yes

TimeFrame

The time frame in which the spice kernels are valid.

Table

TimeFrame

Yes

Inherited members from Rotation

Name

Documentation

Type

Description

Optional

Type

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

String

Must name a valid Rotation type

No

Asset Examples

TimeFrame

This asset creates a rotation provided by a SPICE kernel and applies it to a SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes are determined by SPICE, in this case pretending that the coordinate axes are rotating at the same rate as Earth. In this example, the rotation is only calculated between 2000 JAN 01 and 2002 JAN 01 to exemplify a use-case in which the data from the SPICE kernel is not available for the whole duration.

 1-- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel
 2asset.require("spice/core")
 3
 4local Node = {
 5  Identifier = "SpiceRotation_Example_TimeFrame",
 6  Transform = {
 7    Rotation = {
 8      Type = "SpiceRotation",
 9      SourceFrame = "IAU_EARTH",
10      DestinationFrame = "GALACTIC",
11      TimeFrame = {
12        Type = "TimeFrameInterval",
13        Start = "2000 JAN 01",
14        End = "2002 JAN 01"
15      }
16    }
17  },
18  Renderable = {
19    Type = "RenderableCartesianAxes"
20  },
21  GUI = {
22    Name = "SpiceRotation - TimeFrame",
23    Path = "/Examples"
24  }
25}
26
27asset.onInitialize(function()
28  openspace.addSceneGraphNode(Node)
29end)
30
31asset.onDeinitialize(function()
32  openspace.removeSceneGraphNode(Node)
33end)
Basic

This asset creates a rotation provided by a SPICE kernel and applies it to a SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes are determined by SPICE, in this case pretending that the coordinate axes are rotating at the same rate as 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 = "SpiceRotation_Example",
 6  Transform = {
 7    Rotation = {
 8      Type = "SpiceRotation",
 9      SourceFrame = "IAU_EARTH",
10      DestinationFrame = "GALACTIC"
11    }
12  },
13  Renderable = {
14    Type = "RenderableCartesianAxes"
15  },
16  GUI = {
17    Name = "SpiceRotation - 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 rotation provided by a SPICE kernel and applies it to a SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes are determined by SPICE, in this case pretending that the coordinate axes are rotating at the same rate as Earth. In this specific example, the orientation is independent of the actual in-game time in OpenSpace and only uses a fixed date of 2000 JAN 01 instead.

 1-- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel
 2asset.require("spice/core")
 3
 4local Node = {
 5  Identifier = "SpiceRotation_Example_FixedDate",
 6  Transform = {
 7    Rotation = {
 8      Type = "SpiceRotation",
 9      SourceFrame = "IAU_EARTH",
10      DestinationFrame = "GALACTIC",
11      FixedDate = "2000 JAN 01 00:00:00.000"
12    }
13  },
14  Renderable = {
15    Type = "RenderableCartesianAxes"
16  },
17  GUI = {
18    Name = "SpiceRotation - 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)