ConstantRotation

Inherits Rotation

Members

Name

Documentation

Type

Description

Optional

RotationAxis

This value is the rotation axis around which the object will rotate

Vector3<double>

Value of type ‘Vector3

Yes

RotationRate

This value determines the number of revolutions per in-game second

Double

Value of type ‘Double’

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

 1local transforms = asset.require("./transforms")
 2
 3
 4
 5local Planet = {
 6  Identifier = "SednaGlobe",
 7  Parent = transforms.Position.Identifier,
 8  Transform = {
 9    Rotation = {
10      Type = "ConstantRotation",
11      RotationAxis = { 0.0, 0.0, 1.0 },
12      RotationRate = 1.0 / (10.273 * 60.0 * 60.0)
13    }
14  },
15  Renderable = {
16    Type = "RenderableGlobe",
17    Radii = { 995000, 1060000, 1025000 },
18    SegmentsPerPatch = 64,
19    Layers = {}
20  },
21  GUI = {
22    Name = "Sedna",
23    Path = "/Solar System/Dwarf Planets/Sedna",
24    Description = "Globe of Sedna"
25  }
26}
27
28
29asset.onInitialize(function()
30  openspace.addSceneGraphNode(Planet)
31end)
32
33asset.onDeinitialize(function()
34  openspace.removeSceneGraphNode(Planet)
35end)
36
37asset.export("Planet", Planet)
38
39
40
41asset.meta = {
42  Name = "Sedna Globe",
43  Version = "1.0",
44  Description = [[Globe of Sedna]],
45  Author = "OpenSpace Team",
46  URL = "https://www.openspaceproject.com",
47  License = "MIT"
48}