RenderableNodeArrow

Inherits Renderable

Members

Name

Documentation

Type

Description

Optional

EndNode

The identifier of the node the arrow should point towards

String

Value of type ‘String’

No

StartNode

The identifier of the node the arrow starts from

String

Value of type ‘String’

No

AmbientIntensity

A multiplier for ambient lighting for the shading of the arrow

Double

Greater or equal to: 0

Yes

ArrowHeadSize

This size of the arrow head, given in relative value of the entire length of the arrow. For example, 0.1 makes the arrow head length be 10% of the full arrow length

Double

Greater or equal to: 0

Yes

ArrowHeadWidthFactor

A factor that is multiplied with the width, or the arrow itself, to determine the width of the base of the arrow head

Double

Greater or equal to: 0

Yes

Color

This value determines the RGB color for the arrow

Color3

Value of type ‘Color3’

Yes

DiffuseIntensity

A multiplier for diffuse lighting for the shading of the arrow

Double

Greater or equal to: 0

Yes

Invert

If set to true, the arrow direction is inverted so that it points to the start node instead of the end node

Boolean

Value of type ‘Boolean’

Yes

Length

The length of the arrow, given either in meters or as a factor to be multiplied with the bounding sphere of the start node (if ‘UseRelativeLength’ is true)

Double

Greater or equal to: 0

Yes

Offset

The distance from the center of the start node where the arrow starts. If ‘UseRelativeOffset’ is true, the value should be given as a factor to multiply with the bounding sphere of the node. Otherwise, the value is specified in meters

Double

Value of type ‘Double’

Yes

PerformShading

This value determines whether shading should be applied to the arrow model

Double

Value of type ‘Double’

Yes

Segments

This value specifies the number of segments that the shapes for the arrow are separated in. A higher number leads to a higher resolution

Integer

Greater or equal to: 3

Yes

SpecularIntensity

A multiplier for specular lighting for the shading of the arrow

Double

Greater or equal to: 0

Yes

UseRelativeLength

Decide whether to use relative size (in units of start node bounding sphere) for the length of the arrow. If false, meters is used

Boolean

Value of type ‘Boolean’

Yes

UseRelativeOffset

Decide whether to use relative distances (in units of start node bounding sphere) for the offset distance. If false, meters is used

Boolean

Value of type ‘Boolean’

Yes

Width

This value specifies the width of the arrow shape

Double

Greater or equal to: 0

Yes

Inherited members from Renderable

Name

Documentation

Type

Description

Optional

DimInAtmosphere

Enables/Disables if the object should be dimmed when the camera is in the sunny part of an atmosphere

Boolean

Value of type ‘Boolean’

Yes

Enabled

This setting 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

This value specifies if the renderable should be rendered in the Background,Opaque, Pre/PostDeferredTransparency, or Overlay rendering step

String

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

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

This tells the type of the renderable

String

Value of type ‘String’

Yes

Asset Examples

 1local earth = asset.require("scene/solarsystem/planets/earth/earth")
 2local moon = asset.require("scene/solarsystem/planets/earth/moon/moon")
 3local mars = asset.require("scene/solarsystem/planets/mars/mars")
 4
 5
 6
 7local EarthRadius = 6371000.0
 8
 9local ArrowExample = {
10  Identifier = "RenderableNodeArrowExample",
11  Parent = earth.Earth.Identifier,
12  Renderable = {
13    Type = "RenderableNodeArrow",
14    StartNode = earth.Earth.Identifier,
15    EndNode = mars.Mars.Identifier,
16    Color = { 0.8, 1.0, 0.8 },
17    Offset = 2 * EarthRadius,
18    Length = 5 * EarthRadius,
19    Width = 900000.0
20  },
21  GUI = {
22    Name = "Node Arrow Example",
23    Path = "/Example",
24    Description = [[Example node direction arrow, using absolute sizes]]
25  }
26}
27
28-- Relative values: Multiplied with bounding sphere
29local ArrowExample_RelativeUnits = {
30  Identifier = "RenderableNodeArrowExample_Relative",
31  Parent = earth.Earth.Identifier,
32  Renderable = {
33    Type = "RenderableNodeArrow",
34    StartNode = earth.Earth.Identifier,
35    EndNode = moon.Moon.Identifier,
36    Color = { 0.78, 0.0, 1.0 },
37    UseRelativeOffset = true,
38    UseRelativeLength = true,
39    Offset = 2.0,
40    Length = 5.0,
41    Width = 900000.0,
42    Invert = true -- Point to start node instead of end node
43  },
44  GUI = {
45    Name = "Node Arrow Example (relative units)",
46    Path = "/Example",
47    Description = [[Example node direction arrow, using relative sizes]]
48  }
49}
50
51
52asset.onInitialize(function()
53  openspace.addSceneGraphNode(ArrowExample)
54  openspace.addSceneGraphNode(ArrowExample_RelativeUnits)
55end)
56
57asset.onDeinitialize(function()
58  openspace.removeSceneGraphNode(ArrowExample_RelativeUnits)
59  openspace.removeSceneGraphNode(ArrowExample)
60end)
61
62asset.export(ArrowExample)
63asset.export(ArrowExample_RelativeUnits)
64
65
66
67asset.meta = {
68  Name = "RenderableNodeArrow Example asset",
69  Version = "1.0",
70  Description = [[Examples of the RenderableNodeArrow renderable, that can be used to draw
71    an arrow pointing from one scene graph node in the direction of another. Note that
72    the arrows are generated as objects in 3D space and need to have a size that is
73    suitable for their 3D context.]],
74  Author = "OpenSpace Team",
75  URL = "http://openspaceproject.com",
76  License = "MIT license"
77}