TimelineRotation

Inherits Rotation

Members

Name

Documentation

Type

Description

Optional

Keyframes

A table of keyframes, with keys formatted as YYYY-MM-DDTHH:MM:SS and values that are valid Rotation objects

Table

Table parameters

No

ShouldInterpolate

If this value is set to ‘true’, an interpolation is applied between the given keyframes. If this value is set to ‘false’, the interpolation is not applied.

Boolean

Value of type ‘Boolean’

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

Table parameters for Keyframes

A table of keyframes, with keys formatted as YYYY-MM-DDTHH:MM:SS and values that are valid Rotation objects

  • Optional: No

Name

Documentation

Type

Description

Optional

*

Table

Rotation

No

Asset Examples

No Interpolation

This asset creates a SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes are determined by a timeline of individual rotations that are used without interpolating between the timeline entries. These rotations are keyframes that are used to change between different orientations. This example transitions between three rotations. In this example, the interpolation between entries is disabled, which will cause the coordinate axes to change their orientation abruptly when the rotation changes. If the interpolation were enabled, the orientation of the coordinate axes would transition seamlessly instead at the provided times. This example will only work if the in-game time is set to January 1st, 2000.

 1local Node = {
 2  Identifier = "TimelineRotation_Example_NoInterpolation",
 3  Transform = {
 4    Rotation = {
 5      Type = "TimelineRotation",
 6      Keyframes = {
 7        -- The first timeline entry
 8        ["2000 JAN 01 00:00:00"] = {
 9          Type = "StaticRotation",
10          Rotation = { math.pi, 0.0, 0.0 }
11        },
12        -- The second timeline entry
13        ["2000 JAN 01 12:00:00"] = {
14          Type = "StaticRotation",
15          Rotation = { 0.0, 0.0, 0.0 }
16        },
17        -- The third timeline entry
18        ["2000 JAN 01 23:59:59"] = {
19          Type = "StaticRotation",
20          Rotation = { 0.0, 0.0, math.pi }
21        }
22      },
23      ShouldInterpolate = false
24    }
25  },
26  Renderable = {
27    Type = "RenderableCartesianAxes"
28  },
29  GUI = {
30    Name = "TimelineRotation - No Interpolation",
31    Path = "/Examples"
32  }
33}
34
35asset.onInitialize(function()
36  openspace.addSceneGraphNode(Node)
37end)
38
39asset.onDeinitialize(function()
40  openspace.removeSceneGraphNode(Node)
41end)
Basic

This asset creates a SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes are determined by a timeline of individual rotations. These rotations are keyframes that are used to seamlessly change between different orientations. This example transitions between three rotations over a long time span. This example will only work if the in-game time is set to January 1st, 2000.

 1local Node = {
 2  Identifier = "TimelineRotation_Example",
 3  Transform = {
 4    Rotation = {
 5      Type = "TimelineRotation",
 6      Keyframes = {
 7        -- The first timeline entry
 8        ["2000 JAN 01 00:00:00"] = {
 9          Type = "StaticRotation",
10          Rotation = { math.pi, 0.0, 0.0 }
11        },
12        -- The second timeline entry
13        ["2000 JAN 01 12:00:00"] = {
14          Type = "StaticRotation",
15          Rotation = { 0.0, 0.0, 0.0 }
16        },
17        -- The third timeline entry
18        ["2000 JAN 01 23:59:59"] = {
19          Type = "StaticRotation",
20          Rotation = { 0.0, 0.0, math.pi }
21        }
22      }
23    }
24  },
25  Renderable = {
26    Type = "RenderableCartesianAxes"
27  },
28  GUI = {
29    Name = "TimelineRotation - Basic",
30    Path = "/Examples"
31  }
32}
33
34asset.onInitialize(function()
35  openspace.addSceneGraphNode(Node)
36end)
37
38asset.onDeinitialize(function()
39  openspace.removeSceneGraphNode(Node)
40end)