RenderableNodeLine

Inherits Renderable

This Renderable connects two scene graph nodes by drawing a line between them. The line will update dynamically if the position of the nodes change.

One use case for the RenderableNodeLine is to visualize the distance between two objects. For this, a RenderableDistanceLabel can also be added to show the distance as a number. That renderable is designed to show the distance between the start and end node for a given RenderableNodeLine.

Members

Name

Documentation

Type

Description

Optional

Color

The RGB color for the line.

Color3

Value of type ‘Color3’

Yes

EndNode

The identifier of the node the line ends at. Defaults to ‘Root’ if not specified.

Identifier

An identifier string. May not contain ‘.’, spaces, newlines, or tabs

Yes

EndOffset

A distance to the end node at which the rendered line should end. By default it takes a value in meters, but if ‘UseRelativeOffsets’ is set to true it is read as a multiplier times the bounding sphere of the node.

Double

Value of type ‘Double’

Yes

LineWidth

The width of the line. The larger number, the thicker the line.

Double

Value of type ‘Double’

Yes

StartNode

The identifier of the node the line starts from. Defaults to ‘Root’ if not specified.

Identifier

An identifier string. May not contain ‘.’, spaces, newlines, or tabs

Yes

StartOffset

A distance from the start node at which the rendered line should begin. By default it takes a value in meters, but if ‘UseRelativeOffsets’ is set to true it is read as a multiplier times the bounding sphere of the node.

Double

Value of type ‘Double’

Yes

UseRelativeOffsets

If true, the offset values are interpreted as relative values to be multiplied with the bounding sphere of the start/end node. If false, the value is interpreted as a distance in meters.

Boolean

Value of type ‘Boolean’

Yes

Inherited members from Renderable

Name

Documentation

Type

Description

Optional

DimInAtmosphere

Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere.

Boolean

Value of type ‘Boolean’

Yes

Enabled

Determines whether this object will be visible or not.

Boolean

Value of type ‘Boolean’

Yes

Opacity

This value determines the opacity of this renderable. A value of 0 means completely transparent.

Double

In range: ( 0,1 )

Yes

RenderBinMode

A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step.

String

In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker }

Yes

Tag

A single tag or a list of tags that this renderable will respond to when setting properties.

Table, or String

Value of type ‘Table’, or Value of type ‘String’

Yes

Type

The type of the renderable.

String

Value of type ‘String’

Yes

Asset Examples

Basic

This example draws a line between two nodes in the scene, in this case the planets Earth and Mars.

Note that this example asset is used in another example, for RenderableDistanceLabel. Due to this, we export the Node table so we can access and refer to its identifier in the other example, the same way as we do for Earth and Mars in this asset.

 1local earth = asset.require("scene/solarsystem/planets/earth/earth")
 2local mars = asset.require("scene/solarsystem/planets/mars/mars")
 3
 4local Node = {
 5  Identifier = "RenderableNodeLine_Example",
 6  Renderable = {
 7    Type = "RenderableNodeLine",
 8    StartNode = earth.Earth.Identifier,
 9    EndNode = mars.Mars.Identifier
10  },
11  GUI = {
12    Name = "RenderableNodeLine - Basic",
13    Path = "/Examples"
14  }
15}
16
17asset.onInitialize(function()
18  openspace.addSceneGraphNode(Node)
19end)
20
21asset.onDeinitialize(function()
22  openspace.removeSceneGraphNode(Node)
23end)
24
25-- Export the Node table so it can be used in another example
26asset.export("NodeLine", Node)