RenderableNodeArrow
Inherits Renderable
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The identifier of the node the arrow should point towards |
|
Value of type ‘String’ |
No |
|
The identifier of the node the arrow starts from |
|
Value of type ‘String’ |
No |
|
A multiplier for ambient lighting for the shading of the arrow |
|
Greater or equal to: 0 |
Yes |
|
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 |
|
Greater or equal to: 0 |
Yes |
|
A factor that is multiplied with the width, or the arrow itself, to determine the width of the base of the arrow head |
|
Greater or equal to: 0 |
Yes |
|
This value determines the RGB color for the arrow |
|
Value of type ‘Color3’ |
Yes |
|
A multiplier for diffuse lighting for the shading of the arrow |
|
Greater or equal to: 0 |
Yes |
|
If set to true, the arrow direction is inverted so that it points to the start node instead of the end node |
|
Value of type ‘Boolean’ |
Yes |
|
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) |
|
Greater or equal to: 0 |
Yes |
|
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 |
|
Value of type ‘Double’ |
Yes |
|
This value determines whether shading should be applied to the arrow model |
|
Value of type ‘Double’ |
Yes |
|
This value specifies the number of segments that the shapes for the arrow are separated in. A higher number leads to a higher resolution |
|
Greater or equal to: 3 |
Yes |
|
A multiplier for specular lighting for the shading of the arrow |
|
Greater or equal to: 0 |
Yes |
|
Decide whether to use relative size (in units of start node bounding sphere) for the length of the arrow. If false, meters is used |
|
Value of type ‘Boolean’ |
Yes |
|
Decide whether to use relative distances (in units of start node bounding sphere) for the offset distance. If false, meters is used |
|
Value of type ‘Boolean’ |
Yes |
|
This value specifies the width of the arrow shape |
|
Greater or equal to: 0 |
Yes |
Inherited members from Renderable
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
Enables/Disables if the object should be dimmed when the camera is in the sunny part of an atmosphere |
|
Value of type ‘Boolean’ |
Yes |
|
This setting 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 |
|
This value specifies if the renderable should be rendered in the Background,Opaque, Pre/PostDeferredTransparency, or Overlay 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 |
|
This tells the type of the renderable |
|
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}