ConstantRotation

Inherits Rotation

This rotation type will cause a scene graph node to rotate about the provided axis at a fixed and constant rotation speed.

Members

Name

Documentation

Type

Description

Optional

RotationAxis

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

Vector3<double>

In range: ( {-1,-1,-1},{1,1,1} )

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

TimeFrame

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

Table

TimeFrame

Yes

Asset Examples

Basic

This asset applies a rotation to a set of coordinate axes that makes them rotate at a constant rate of one revolution around the z-axis every 2 seconds.

 1local Node = {
 2  Identifier = "ConstantRotation_Example",
 3  Transform = {
 4    Rotation = {
 5      Type = "ConstantRotation",
 6      RotationAxis = { 0.0, 0.0, 1.0 },
 7      RotationRate = 0.5
 8    }
 9  },
10  Renderable = {
11    Type = "RenderableCartesianAxes"
12  },
13  GUI = {
14    Name = "ConstantRotation - Basic",
15    Path = "/Examples"
16  }
17}
18
19asset.onInitialize(function()
20  openspace.addSceneGraphNode(Node)
21end)
22
23asset.onDeinitialize(function()
24  openspace.removeSceneGraphNode(Node)
25end)