RenderableDisc
Inherits Renderable
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The path to a file with a one-dimensional texture to be used for the disc color. The leftmost color will be innermost color when rendering the disc, and the rightmost color will be the outermost color. |
|
Value of type ‘File’ |
No |
|
The outer radius of the disc, in meters. |
|
Value of type ‘Double’ |
Yes |
|
The disc width, given as a ratio of the full disc radius. For example, a value of 1 results in a full circle, while 0.5 results in a disc where the inner radius is half of the full radius. |
|
In range: ( 0,1 ) |
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
1-- @TODO (emmbr 2020-02-03) Potential threading issue later on? This will run on the main thread
2local cyanTexture = openspace.createSingleColorImage("example_disc_color1", { 0.0, 1.0, 1.0 })
3local purpleTexture = openspace.createSingleColorImage("example_disc_color2", { 0.5, 0.0, 0.5 })
4
5local BasicDisc = {
6 Identifier = "BasicDisc",
7 Renderable = {
8 Type = "RenderableDisc",
9 Texture = cyanTexture,
10 Size = 1e10,
11 Width = 0.5
12 },
13 GUI = {
14 Name = "Basic Disc",
15 Path = "/Examples/Discs"
16 }
17}
18
19-- Elliptic discs can be created using a non-uniform scaling
20-- For a full disc, use a width of 1.0
21local FullEllipticDisc = {
22 Identifier = "FullEllipticDisc",
23 Transform = {
24 Scale = {
25 Type = "NonUniformStaticScale",
26 Scale = { 2.0, 1.0, 1.0 }
27 }
28 },
29 Renderable = {
30 Type = "RenderableDisc",
31 Texture = purpleTexture,
32 Size = 2e10,
33 Width = 1.0
34 },
35 GUI = {
36 Name = "Full Elliptic Disc",
37 Path = "/Examples/Discs"
38 }
39}
40
41
42asset.onInitialize(function()
43 openspace.addSceneGraphNode(BasicDisc)
44 openspace.addSceneGraphNode(FullEllipticDisc)
45end)
46
47asset.onDeinitialize(function()
48 openspace.removeSceneGraphNode(FullEllipticDisc)
49 openspace.removeSceneGraphNode(BasicDisc)
50end)
51
52asset.export(BasicDisc)
53asset.export(FullEllipticDisc)
54
55
56
57asset.meta = {
58 Name = "Example Discs",
59 Description = [[Examples of different types of rendered discs.]],
60 Author = "OpenSpace Team",
61 URL = "http://openspaceproject.com",
62 License = "MIT license"
63}