TimeDependentScale
Inherits Scale
This Scale type provides the ability to scale an object dynamically as time in the simulation passes. The provided ReferenceDate
, specifies when the total scale should be equal to 0 and the scales grows by Speed
meters for every second in the simulation. If ClampToPositive
is specified as true
, then the resulting scale will always be positive or 0 if the simulation time is before the ReferenceDate
.
A common use-case for this Scale type would be to represent the Radiosphere, which grows at the speed of light.
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The date at which this scale will be 0. The current value of the scale is computed by taking the difference between the current time and the reference date and multiplying it by the speed. This field must be formatted as: YYYY-MM-DDThh:mm:ss.uuu where h is a 24h clock and u microseconds. |
|
Value of type ‘Date and time’ |
No |
|
If this value is true, the velocity computation will be clamped to a positive value if the current simulation time is before the |
|
Value of type ‘Boolean’ |
Yes |
|
The speed at which the value grows or shrinks. The units for this are meters per second. The default value is 1 m/s. |
|
Greater or equal to: 0 |
Yes |
Inherited members from Scale
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The type of the scaling that is described in this element. The available types of scaling depend on the configuration of the application and can be written to disk on application startup into the FactoryDocumentation |
|
Must name a valid Scale type |
No |
Asset Examples
Basic
This asset creates a SceneGraphNode that only displays coordinate axes, which grow at a speed of 1 m/s starting on January 1st, 2000 00:00:00. This means that on that date, the coordinate axes will disappear and, for example, on January 1st, 2000 12:00:00, the coordinate axes will be 43200 meters long.
1local Node = {
2 Identifier = "TimeDependentScale_Example",
3 Transform = {
4 Scale = {
5 Type = "TimeDependentScale",
6 ReferenceDate = "2000 JAN 01 00:00:00"
7 }
8 },
9 Renderable = {
10 Type = "RenderableCartesianAxes"
11 },
12 GUI = {
13 Name = "TimeDependentScale - Basic",
14 Path = "/Examples"
15 }
16}
17
18asset.onInitialize(function()
19 openspace.addSceneGraphNode(Node)
20end)
21
22asset.onDeinitialize(function()
23 openspace.removeSceneGraphNode(Node)
24end)
with Speed
This asset creates a SceneGraphNode that only displays coordinate axes, which grow at a speed of 12 km/s starting on August 8th, 1969 12:00:00. This means that on that date, the coordinate axes will disappear and, for example, on August 8th, 1969 23:00:00, the coordinate axes will be 475200 km long.
1local Node = {
2 Identifier = "TimeDependentScale_Example_Speed",
3 Transform = {
4 Scale = {
5 Type = "TimeDependentScale",
6 ReferenceDate = "1969 AUG 08 12:00:00",
7 Speed = 12000
8 }
9 },
10 Renderable = {
11 Type = "RenderableCartesianAxes"
12 },
13 GUI = {
14 Name = "TimeDependentScale - With Speed",
15 Path = "/Examples"
16 }
17}
18
19asset.onInitialize(function()
20 openspace.addSceneGraphNode(Node)
21end)
22
23asset.onDeinitialize(function()
24 openspace.removeSceneGraphNode(Node)
25end)