RenderableTravelSpeed
Inherits Renderable
This renderable can be used to visualize a certain travel speed using a line that moves at the provided speed from a start object to a target. The start position will be set from the Parent
of this scene graph node, and the end position is set from the provided Target
scene graph node. Per default, the speed is set to the speed of light.
The length of the traveling line is set based on the travel speed and can be used to show more information related to the distance traveled. For example, a length of 1 shows how far an object would move over a duration of one second based on the selected speed.
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The identifier of the scene graph node to target with the speed indicator. The speed indicator will travel from the parent node to this scene graph node. |
|
An identifier string. May not contain ‘.’, spaces, newlines, or tabs |
No |
|
An RGB color for the line. |
|
Value of type ‘Color3’ |
Yes |
|
The length of the faded tail of the speed indicator, given in seconds. The length of the tail will be computed as the speed times this value. For example, a value of 1 will make it as long as the distance it would travel over one second. A linear fade will be applied over this distance to create the tail. |
|
Greater than: 0 |
Yes |
|
The length of the speed indicator line, given in seconds. The length will be computed as the speed times this value. For example, a value of 1 will make it as long as the distance it would travel over one second with the specified speed. |
|
Greater than: 0 |
Yes |
|
This value specifies the line width. |
|
Greater than: 0 |
Yes |
|
A value for how fast the speed indicator should travel, in meters per second. The default value is the speed of light. |
|
Greater than: 0 |
Yes |
Inherited members from Renderable
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether this object will be visible or not. |
|
Value of type ‘Boolean’ |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent |
|
In range: ( 0,1 ) |
Yes |
|
A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step. |
|
In list { Background, Opaque, PreDeferredTransparent, PostDeferredTransparent, Overlay } |
Yes |
|
A single tag or a list of tags that this renderable will respond to when setting properties |
|
Value of type ‘Table’, or Value of type ‘String’ |
Yes |
|
The type of the renderable. |
|
Value of type ‘String’ |
Yes |
Asset Examples
Light Speed Indicator
This example creates a speed indicator; a line that travels with the speed of light from the parent node (Earth) to the target node (the Moon). By default, the length of the line is set to match the distance traveled over 1 second.
1local earthAsset = asset.require("scene/solarsystem/planets/earth/earth")
2local moonAsset = asset.require("scene/solarsystem/planets/earth/moon/moon")
3
4local Node = {
5 Identifier = "RenderableTravelSpeed_Example",
6 Parent = earthAsset.Earth.Identifier,
7 Renderable = {
8 Type = "RenderableTravelSpeed",
9 Target = moonAsset.Moon.Identifier
10 },
11 GUI = {
12 Name = "RenderableTravelSpeed - Light Speed Indicator",
13 Path = "/Examples"
14 }
15}
16
17asset.onInitialize(function()
18 openspace.addSceneGraphNode(Node)
19end)
20
21asset.onDeinitialize(function()
22 openspace.removeSceneGraphNode(Node)
23end)