mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-21 18:38:20 -05:00
Feature/numeric slider updates (#1609)
* Remove Logarithmic ViewOption and instead always use exponent of NumericalProperty + set exponent of some renderables' properties * Add MinMaxRange ViewOption for Vec2 properties * Add MinMaxRange viewoption to some existing vec2 properties and combine some other related properties to be able to utilize it. For example Min and Max label sizes, fade in/out distances, inner and outer radius. OBS! Includes renaming several properties (**breaking change**) * Refactor and document labels code. OBS! Includes renaming several properties (**breaking change**) * Add comments for some assets that have labels that are not working correctly Renderables with rename properties: RenderableLabels , GlobeLabelsComponent, RenderableBillboardsCloud, RenderableDUMeshes, RenderableRadialGrid )
This commit is contained in:
@@ -17,8 +17,7 @@ local radialGrid = {
|
||||
Color = { 0.6, 1.0, 0.7 },
|
||||
LineWidth = 3.0,
|
||||
GridSegments = { 3, 4 },
|
||||
OuterRadius = 1.0,
|
||||
InnerRadius = 0.2,
|
||||
Radii = { 0.2, 1.0 },
|
||||
Enabled = false
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -16,7 +16,7 @@ local circle = {
|
||||
LineWidth = 3.0,
|
||||
GridSegments = { 1, 1 },
|
||||
CircleSegments = 64,
|
||||
OuterRadius = 1.0
|
||||
Radii = { 0.0, 1.0 }
|
||||
},
|
||||
GUI = {
|
||||
Name = "Example Circle",
|
||||
@@ -29,7 +29,7 @@ local ellipse = {
|
||||
Transform = {
|
||||
Scale = {
|
||||
Type = "NonUniformStaticScale",
|
||||
Scale = {1.5, 1.0, 1.0}
|
||||
Scale = { 1.5, 1.0, 1.0 }
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
@@ -38,7 +38,7 @@ local ellipse = {
|
||||
LineWidth = 3.0,
|
||||
GridSegments = { 1, 1 },
|
||||
CircleSegments = 64,
|
||||
OuterRadius = scale
|
||||
Radii = { 0.0, scale }
|
||||
},
|
||||
GUI = {
|
||||
Name = "Example Ellipse",
|
||||
|
||||
@@ -24,13 +24,13 @@ local object = {
|
||||
Color = { 1.0, 1.0, 1.0 },
|
||||
Opacity = 1.0,
|
||||
File = speck .. "/2dF.speck",
|
||||
Unit = "Mpc",
|
||||
Texture = textures .. "/point3A.png",
|
||||
ColorMap = speck .. "/2dF.cmap",
|
||||
ColorOption = { "redshift", "proximity" },
|
||||
ColorRange = { { 0.0, 0.075 }, { 1.0, 25.0 } },
|
||||
Unit = "Mpc",
|
||||
ScaleFactor = 520.0,
|
||||
BillboardMaxSize = 4.7,
|
||||
BillboardMinMaxSize = { 0.0, 4.7 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -24,15 +24,15 @@ local object = {
|
||||
Color = { 1.0, 0.4, 0.2 },
|
||||
Opacity = 1.0,
|
||||
File = speck .. "/2MASS.speck",
|
||||
Unit = "Mpc",
|
||||
Texture = textures .. "/point3A.png",
|
||||
ColorMap = speck .. "/lss.cmap",
|
||||
ColorOption = { "redshift", "prox5Mpc" },
|
||||
ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } },
|
||||
Unit = "Mpc",
|
||||
CorrectionSizeEndDistance = 20.6,
|
||||
CorrectionSizeFactor = 15.0,
|
||||
ScaleFactor = 510.78,
|
||||
BillboardMaxSize = 11.15,
|
||||
BillboardMinMaxSize = { 0.0, 11.15 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -24,14 +24,14 @@ local object = {
|
||||
Color = { 1.0, 1.0, 0.0 },
|
||||
Opacity = 1.0,
|
||||
File = speck .. "/6dF.speck",
|
||||
Unit = "Mpc",
|
||||
Texture = textures .. "/point3A.png",
|
||||
ColorMap = speck .. "/6dF.cmap",
|
||||
ColorOption = { "redshift", "proximity" },
|
||||
ColorRange = { { 0.0, 0.075 }, { 1.0, 10.0 } },
|
||||
Unit = "Mpc",
|
||||
ScaleFactor = 534.0,
|
||||
BillboardMaxSize = 9.0,
|
||||
EnablePixelSizeControl = true,
|
||||
BillboardMinMaxSize = { 0.0, 9.0 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
Name = "6dF Galaxies",
|
||||
|
||||
@@ -27,10 +27,10 @@ local object = {
|
||||
File = speck .. "/abell.speck",
|
||||
Texture = textures .. "/point3A.png",
|
||||
LabelFile = speck .. "/abell.label",
|
||||
Unit = "Mpc",
|
||||
TextColor = { 0.0, 0.8, 0.0 },
|
||||
TextSize = 22,
|
||||
TextMinSize = 10.0,
|
||||
Unit = "Mpc",
|
||||
TextMinMaxSize = { 10, 12 },
|
||||
TransformationMatrix = {
|
||||
-0.7357425748, 0.67726129641, 0.0, 0.0,
|
||||
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
|
||||
@@ -38,7 +38,7 @@ local object = {
|
||||
0.0, 0.0, 0.0, 1.0
|
||||
},
|
||||
ScaleFactor = 520.0,
|
||||
BillboardMaxSize = 7.0,
|
||||
BillboardMinMaxSize = { 0.0, 7.0 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -17,11 +17,11 @@ local object = {
|
||||
Color = { 1.0, 1.0, 1.0 },
|
||||
Opacity = 0.65,
|
||||
LabelFile = speck .. "/stars-altlbl.label",
|
||||
Unit = "pc",
|
||||
TextColor = { 0.4, 0.4, 0.4 },
|
||||
DrawLabels = true,
|
||||
TextSize = 14.7,
|
||||
TextMinSize = 6.0,
|
||||
Unit = "pc"
|
||||
TextMinMaxSize = { 6, 20 }
|
||||
},
|
||||
GUI = {
|
||||
Name = "Stars Labels - Alternate",
|
||||
|
||||
@@ -17,11 +17,11 @@ local object = {
|
||||
Color = { 1.0, 1.0, 1.0 },
|
||||
Opacity = 0.65,
|
||||
LabelFile = speck .. "/galclust.label",
|
||||
Unit = "Mpc",
|
||||
TextColor = { 1.0, 0.44, 0.0 },
|
||||
DrawLabels = true,
|
||||
TextSize = 22,
|
||||
TextMinSize = 8.0,
|
||||
Unit = "Mpc",
|
||||
TextMinMaxSize = { 8, 20 },
|
||||
TransformationMatrix = {
|
||||
-0.7357425748, 0.67726129641, 0.0, 0.0,
|
||||
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
|
||||
|
||||
@@ -20,8 +20,7 @@ local constellationsExtragalactic = {
|
||||
TextColor = { 0.8, 0.8, 0.8 },
|
||||
TextOpacity = 0.4,
|
||||
TextSize = 20.0,
|
||||
TextMinSize = 20.0,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 20, 30 },
|
||||
MeshColor = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } },
|
||||
Unit = "Mpc"
|
||||
},
|
||||
@@ -42,8 +41,7 @@ local constellations = {
|
||||
TextColor = { 0.8, 0.8, 0.8 },
|
||||
TextOpacity = 0.3,
|
||||
TextSize = 14.5,
|
||||
TextMaxSize = 170.0,
|
||||
TextMinSize = 8.0,
|
||||
TextMinMaxSize = { 8, 170 },
|
||||
MeshColor = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } },
|
||||
Unit = "pc"
|
||||
},
|
||||
|
||||
@@ -30,15 +30,12 @@ local deepSkyPoints = {
|
||||
--ColorOption = { "prox5Mpc" },
|
||||
--ColorRange = { { 1.0, 30.0 } },
|
||||
LabelFile = speck .. "/dso.label",
|
||||
Unit = "pc",
|
||||
TextColor = { 0.1, 0.4, 0.6 },
|
||||
TextSize = 20.50,
|
||||
TextMinSize = 16.0,
|
||||
Unit = "pc",
|
||||
-- Fade in value in the same unit as "Unit"
|
||||
--FadeInDistances = { 0.05, 1.0 },
|
||||
-- Max size in pixels
|
||||
BillboardMaxSize = 8.22,
|
||||
BillboardMinSize = 0.0,
|
||||
TextMinMaxSize = { 16, 20 },
|
||||
--FadeInDistances = { 0.05, 1.0 }, -- Fade in value in the same unit as "Unit"
|
||||
BillboardMinMaxSize = { 0.0, 8.22 }, -- in pixels
|
||||
--CorrectionSizeEndDistance = 22.0,
|
||||
--CorrectionSizeFactor = 10.45
|
||||
EnablePixelSizeControl = true
|
||||
|
||||
@@ -26,18 +26,18 @@ local object = {
|
||||
File = speck .. "/dwarfs.speck",
|
||||
Texture = textures .. "/point3.png",
|
||||
LabelFile = speck .. "/dwarfs.label",
|
||||
Unit = "pc",
|
||||
ColorMap = speck .. "/dwarfs.cmap",
|
||||
ColorOption = { "typeindex" },
|
||||
--ColorRange = { { 1.0, 4.0} },
|
||||
TextColor = { 0.5, 0.1, 0.2 },
|
||||
TextSize = 14.6,
|
||||
TextMinSize = 10.0,
|
||||
TextMinMaxSize = { 10, 20 },
|
||||
ScaleFactor = 372.1,
|
||||
--CorrectionSizeEndDistance = 16.1,
|
||||
--CorrectionSizeFactor = 7.75,
|
||||
BillboardMaxSize = 20.0,
|
||||
EnablePixelSizeControl = true,
|
||||
Unit = "pc"
|
||||
BillboardMinMaxSize = { 0.0, 20.0 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
Name = "Brown Dwarfs",
|
||||
|
||||
@@ -27,15 +27,14 @@ local object = {
|
||||
Texture = textures .. "/target-blue.png",
|
||||
File = speck .. "/expl.speck",
|
||||
LabelFile = speck .. "/expl.label",
|
||||
Unit = "pc",
|
||||
ScaleFactor = 388.67923,
|
||||
TextColor = { 0.3, 0.3, 0.8 },
|
||||
TextSize = 14.8,
|
||||
TextMaxSize = 200.0,
|
||||
TextMinSize = 10.0,
|
||||
TextMinMaxSize = { 10, 100 },
|
||||
CorrectionSizeEndDistance = 15.23,
|
||||
CorrectionSizeFactor = 13.3,
|
||||
Unit = "pc",
|
||||
BillboardMaxSize = 75.0,
|
||||
BillboardMinMaxSize = { 0.0, 75.0 },
|
||||
EnablePixelSizeControl = true,
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -27,13 +27,12 @@ local object = {
|
||||
Texture = textures .. "/point4.png",
|
||||
PolygonSides = 5,
|
||||
LabelFile = speck .. "/gc.label",
|
||||
Unit = "pc",
|
||||
TextColor = { 0.5, 0.5, 0.0 },
|
||||
ScaleFactor = 431.0,
|
||||
TextSize = 16.7,
|
||||
TextMinSize = 4.0,
|
||||
TextMaxSize = 20,
|
||||
Unit = "pc",
|
||||
BillboardMaxSize = 500,
|
||||
TextMinMaxSize = { 4, 20 },
|
||||
BillboardMinMaxSize = { 0.0, 500.0 },
|
||||
EnablePixelSizeControl = true,
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -110,12 +110,11 @@ local eclipticLabels = {
|
||||
Color = { 1.0, 1.0, 1.0 },
|
||||
Opacity = 0.65,
|
||||
LabelFile = speck .. "/eclip.label",
|
||||
Unit = "pc",
|
||||
DrawLabels = true,
|
||||
TextColor = { 0.5, 0.5, 0.5 },
|
||||
TextSize = 14.75,
|
||||
TextMinSize = 1.3,
|
||||
TextMaxSize = 50.0,
|
||||
Unit = "pc",
|
||||
TextMinMaxSize = { 1, 50 },
|
||||
TransformationMatrix = {
|
||||
-0.05487554, 0.4941095, -0.8676661, 0.0,
|
||||
-0.9938214 , -0.1109906, -0.0003515167, 0.0,
|
||||
@@ -164,12 +163,11 @@ local equatorialLabels = {
|
||||
Color = { 1.0, 1.0, 1.0 },
|
||||
Opacity = 0.65,
|
||||
LabelFile = speck .. "/radec.label",
|
||||
Unit = "pc",
|
||||
DrawLabels = true,
|
||||
TextColor = { 0.5, 0.5, 0.5 },
|
||||
TextSize = 14.5,
|
||||
TextMinSize = 1.7,
|
||||
TextMaxSize = 70.0,
|
||||
Unit = "pc",
|
||||
TextMinMaxSize = { 2, 70 },
|
||||
TransformationMatrix = {
|
||||
-0.05487554, 0.4941095, -0.8676661, 0.0,
|
||||
-0.8734371 , -0.4448296, -0.1980764, 0.0,
|
||||
@@ -214,12 +212,11 @@ local galacticLabels = {
|
||||
Color = { 1.0, 1.0, 1.0 },
|
||||
Opacity = 0.65,
|
||||
LabelFile = speck .. "/galac.label",
|
||||
Unit = "pc",
|
||||
DrawLabels = true,
|
||||
TextColor = { 0.5, 0.5, 0.5 },
|
||||
TextSize = 15.8,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 100.0,
|
||||
Unit = "pc"
|
||||
TextMinMaxSize = { 1, 100 }
|
||||
},
|
||||
GUI = {
|
||||
Name = "Galactic Sphere Labels",
|
||||
@@ -245,8 +242,7 @@ local plane1ld = {
|
||||
LabelFile = speck .. "/1ld.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 10.3,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "Km"
|
||||
},
|
||||
GUI = {
|
||||
@@ -273,8 +269,7 @@ local plane1lm = {
|
||||
LabelFile = speck .. "/1lm.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 11.8,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -301,8 +296,7 @@ local plane1ly = {
|
||||
LabelFile = speck .. "/1ly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 13.0,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -329,8 +323,7 @@ local plane10ly = {
|
||||
LabelFile = speck .. "/10ly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 14.17,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -357,8 +350,7 @@ local plane100ly = {
|
||||
LabelFile = speck .. "/100ly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 15.0,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -385,8 +377,7 @@ local plane1kly = {
|
||||
LabelFile = speck .. "/1kly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 16.0,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -413,8 +404,7 @@ local plane10kly = {
|
||||
LabelFile = speck .. "/10kly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 17.25,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -434,8 +424,7 @@ local plane100kly = {
|
||||
LabelFile = speck .. "/100kly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 18.6,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "Mpc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -455,8 +444,7 @@ local plane1Mly = {
|
||||
LabelFile = speck .. "/1Mly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 19.6,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "Mpc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -476,8 +464,7 @@ local plane10Mly = {
|
||||
LabelFile = speck .. "/10Mly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 20.6,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "Mpc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -497,8 +484,7 @@ local plane100Mly = {
|
||||
LabelFile = speck .. "/100Mly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 21.6,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "Mpc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -518,8 +504,7 @@ local plane20Gly = {
|
||||
LabelFile = speck .. "/20Gly.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 23.6,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
TextMinMaxSize = { 0, 30 },
|
||||
Unit = "Mpc"
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -18,10 +18,10 @@ local object = {
|
||||
Opacity = 0.65,
|
||||
--ScaleFactor = 10.0,
|
||||
LabelFile = speck .. "/groups.label",
|
||||
Unit = "Mpc",
|
||||
TextColor = { 0.1, 0.6, 0.2 },
|
||||
TextSize = 21.5,
|
||||
TextMinSize = 8.0,
|
||||
Unit = "Mpc",
|
||||
TextMinMaxSize = { 8, 20 },
|
||||
DrawLabels = true,
|
||||
TransformationMatrix = {
|
||||
-0.7357425748, 0.67726129641, 0.0, 0.0,
|
||||
|
||||
@@ -27,13 +27,12 @@ local object = {
|
||||
Texture = textures .."/point4.png",
|
||||
PolygonSides = 6,
|
||||
LabelFile = speck .. "/h2.label",
|
||||
Unit = "pc",
|
||||
TextColor = { 0.5, 0.5, 0.5 },
|
||||
ScaleFactor = 420,
|
||||
TextSize = 16.24,
|
||||
TextMinSize = 4.0,
|
||||
TextMaxSize = 20.0,
|
||||
Unit = "pc",
|
||||
BillboardMaxSize = 300.0,
|
||||
TextMinMaxSize = { 4, 20 },
|
||||
BillboardMinMaxSize = { 0.0, 300.0 },
|
||||
EnablePixelSizeControl = false
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -25,11 +25,11 @@ local object = {
|
||||
Opacity = 0.99,
|
||||
ScaleFactor = 410.0,
|
||||
File = speck .. "/kepler.speck",
|
||||
Unit = "pc",
|
||||
Texture = textures .. "/halo.png",
|
||||
CorrectionSizeEndDistance = 15.86,
|
||||
CorrectionSizeFactor = 8.59,
|
||||
Unit = "pc",
|
||||
BillboardMaxSize = 30.0,
|
||||
BillboardMinMaxSize = { 0.0, 30.0 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -29,12 +29,12 @@ local object = {
|
||||
Texture = textures .. "/point4.png",
|
||||
PolygonSides = 12,
|
||||
LabelFile = speck .. "/localgroup.label",
|
||||
Unit = "Mpc",
|
||||
TextColor = { 0.3, 0.3, 1.0 },
|
||||
ScaleFactor = 465,
|
||||
TextSize = 18.3,
|
||||
TextMinSize = 7.3,
|
||||
Unit = "Mpc",
|
||||
BillboardMaxSize = 20.0,
|
||||
TextMinMaxSize = { 7, 20 },
|
||||
BillboardMinMaxSize = { 0.0, 20.0 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -20,19 +20,18 @@ local homeLabel = {
|
||||
ScaleFactor = 500.0,
|
||||
DrawLabels = true,
|
||||
LabelFile = homespeck .. "/home.label",
|
||||
Unit = "Mpc",
|
||||
TextColor = { 0.8, 0.8, 0.8 },
|
||||
TextSize = 20.50,
|
||||
TextMinSize = 16.0,
|
||||
TextMinMaxSize = { 16, 20 },
|
||||
TransformationMatrix = {
|
||||
-0.7357425748, 0.67726129641, 0.0, 0.0,
|
||||
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
|
||||
0.67314530211, 0.73127116582, 0.11008126223, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0
|
||||
},
|
||||
Unit = "Mpc",
|
||||
FadeInDistances = { 0.05, 1.0 },
|
||||
BillboardMaxSize = 8.22,
|
||||
BillboardMinSize = 0.0,
|
||||
BillboardMinMaxSize = { 0.0, 8.22 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -24,20 +24,19 @@ local object = {
|
||||
Color = { 1.0, 1.0, 1.0 },
|
||||
ColorMap = speck .. "/ob.cmap",
|
||||
ColorOption = { "arm" },
|
||||
SizeOption = {"diameter"},
|
||||
SizeOption = { "diameter" },
|
||||
ExactColorMap = true,
|
||||
Opacity = 0.7,
|
||||
File = speck .. "/ob.speck",
|
||||
Unit = "pc",
|
||||
Texture = textures .. "/point4.png",
|
||||
PolygonSides = 7,
|
||||
LabelFile = speck .. "/ob.label",
|
||||
TextColor = { 0.4, 0.5, 1.0 },
|
||||
ScaleFactor = 390.0,
|
||||
TextSize = 16.24,
|
||||
TextMinSize = 4.50,
|
||||
TextMaxSize = 25,
|
||||
Unit = "pc",
|
||||
BillboardMaxSize = 450.0,
|
||||
TextMinMaxSize = { 4, 25 },
|
||||
BillboardMinMaxSize = { 0.0, 450.0 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -24,16 +24,15 @@ local object = {
|
||||
Color = { 0.1, 0.8, 0.4 },
|
||||
Opacity = 0.5,
|
||||
File = speck .. "/oc.speck",
|
||||
Unit = "pc",
|
||||
Texture = textures .. "/point4.png",
|
||||
PolygonSides = 12,
|
||||
TextColor = { 0.05, 0.4, 0.2 },
|
||||
LabelFile = speck .. "/oc.label",
|
||||
ScaleFactor = 405.75,
|
||||
TextSize = 15.5,
|
||||
TextMinSize = 4.5,
|
||||
TextMaxSize = 30.0,
|
||||
Unit = "pc",
|
||||
BillboardMaxSize = 604,
|
||||
TextMinMaxSize = { 4, 30 },
|
||||
BillboardMinMaxSize = { 0.0, 604.0 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -27,13 +27,12 @@ local object = {
|
||||
Texture = textures .. "/point4.png",
|
||||
PolygonSides = 3,
|
||||
LabelFile = speck .. "/pn.label",
|
||||
Unit = "pc",
|
||||
TextColor = { 0.25, 0.25, 0.65 },
|
||||
ScaleFactor = 425.0,
|
||||
TextSize = 16.24,
|
||||
TextMinSize = 4.5,
|
||||
TextMaxSize = 25.0,
|
||||
Unit = "pc",
|
||||
BillboardMaxSize = 500,
|
||||
TextMinMaxSize = { 4, 25 },
|
||||
BillboardMinMaxSize = { 0.0, 500.0 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -27,13 +27,12 @@ local object = {
|
||||
Texture = textures .. "/point4.png",
|
||||
PolygonSides = 4,
|
||||
LabelFile = speck .. "/pulsar.label",
|
||||
Unit = "pc",
|
||||
TextColor = { 0.7, 0.2, 0.2 },
|
||||
ScaleFactor = 424,
|
||||
TextSize = 15.77,
|
||||
TextMinSize = 4,
|
||||
TextMaxSize = 20.0,
|
||||
Unit = "pc",
|
||||
BillboardMaxSize = 500,
|
||||
TextMinMaxSize = { 4, 20 },
|
||||
BillboardMinMaxSize = { 0.0, 500.0 },
|
||||
EnablePixelSizeControl = false
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -27,11 +27,8 @@ local object = {
|
||||
Texture = textures .. "/point3A.png",
|
||||
Unit = "Mpc",
|
||||
ScaleFactor = 540.9,
|
||||
-- Fade in value in the same unit as "Unit"
|
||||
FadeInDistances = { 1000.0, 10000.0 },
|
||||
BillboardMaxSize = 30.0,
|
||||
BillboardMinSize = 0.0,
|
||||
BillboardMaxSize = 11.1,
|
||||
FadeInDistances = { 1000.0, 10000.0 }, -- Fade in value in the same unit as "Unit"
|
||||
BillboardMinMaxSize = { 0.0, 11.1 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -30,16 +30,12 @@ local object = {
|
||||
ColorRange = { { 0.0, 0.075 }, { 1.0, 50.0 } },
|
||||
Texture = textures .. "/point3A.png",
|
||||
Unit = "Mpc",
|
||||
-- Fade in value in the same unit as "Unit"
|
||||
FadeInDistances = { 220.0, 650.0 },
|
||||
BillboardMaxSize = 50.0,
|
||||
BillboardMinSize = 0.0,
|
||||
FadeInDistances = { 220.0, 650.0 }, -- Fade in value in the same unit as "Unit"
|
||||
BillboardMinMaxSize = { 0.0, 5.5 },
|
||||
CorrectionSizeEndDistance = 20.65,
|
||||
CorrectionSizeFactor = 10.41,
|
||||
TextSize = 14.8,
|
||||
TextMinSize = 10.0,
|
||||
TextMaxSize = 50.0,
|
||||
BillboardMaxSize = 5.5,
|
||||
TextMinMaxSize = { 10, 50 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -17,12 +17,11 @@ local object = {
|
||||
Color = { 1.0, 1.0, 1.0 },
|
||||
Opacity = 0.65,
|
||||
LabelFile = speck .. "/stars.label",
|
||||
Unit = "pc",
|
||||
TextColor = { 0.4, 0.4, 0.4 },
|
||||
DrawLabels = true,
|
||||
TextSize = 14.7,
|
||||
TextMinSize = 6.0,
|
||||
TextMaxSize = 50.0,
|
||||
Unit = "pc"
|
||||
TextMinMaxSize = { 6, 50 }
|
||||
},
|
||||
GUI = {
|
||||
Name = "Stars Labels",
|
||||
|
||||
@@ -20,10 +20,8 @@ local sunOrbit = {
|
||||
File = speck .. "/starorbits-Sun.speck",
|
||||
MeshColor = {{ 1.0, 0.65, 0.0 }},
|
||||
--LabelFile = speck .. "/1ld.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 10.3,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
-- TextColor = { 0.0, 0.2, 0.5 },
|
||||
-- TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -43,10 +41,9 @@ local barnardsOrbit = {
|
||||
File = speck .. "/starorbits-BarnardsStar.speck",
|
||||
MeshColor = {{0.39, 0.58, 0.93}},
|
||||
--LabelFile = speck .. "/1ld.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 10.3,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
-- TextColor = { 0.0, 0.2, 0.5 },
|
||||
-- TextSize = 10.3,
|
||||
-- TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -66,10 +63,9 @@ local kapteynsOrbit = {
|
||||
File = speck .. "/starorbits-KapteynsStar.speck",
|
||||
MeshColor = {{0.6, 0.6, 0.6}},
|
||||
--LabelFile = speck .. "/1ld.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 10.3,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
-- TextColor = { 0.0, 0.2, 0.5 },
|
||||
-- TextSize = 10.3,
|
||||
-- TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -89,10 +85,9 @@ local lacaille9352Orbit = {
|
||||
File = speck .. "/starorbits-Lacaille9352.speck",
|
||||
MeshColor = {{0.58, 0.0, 0.83}},
|
||||
--LabelFile = speck .. "/1ld.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 10.3,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
-- TextColor = { 0.0, 0.2, 0.5 },
|
||||
-- TextSize = 10.3,
|
||||
-- TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -112,10 +107,9 @@ local lSR1826Orbit = {
|
||||
File = speck .. "/starorbits-LSR1826+3014.speck",
|
||||
MeshColor = {{0.0, 0.39, 0.0}},
|
||||
--LabelFile = speck .. "/1ld.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 10.3,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
-- TextColor = { 0.0, 0.2, 0.5 },
|
||||
-- TextSize = 10.3,
|
||||
-- TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -135,10 +129,9 @@ local lSRJ0822Orbit = {
|
||||
File = speck .. "/starorbits-LSRJ0822+1700.speck",
|
||||
MeshColor = {{0.5, 1.0, 0.0}},
|
||||
--LabelFile = speck .. "/1ld.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 10.3,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
-- TextColor = { 0.0, 0.2, 0.5 },
|
||||
-- TextSize = 10.3,
|
||||
-- TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
@@ -158,10 +151,9 @@ local pM_J13420Orbit = {
|
||||
File = speck .. "/starorbits-PM_J13420-3415.speck",
|
||||
MeshColor = {{0.70, 0.13, 0.13}},
|
||||
--LabelFile = speck .. "/1ld.label",
|
||||
TextColor = { 0.0, 0.2, 0.5 },
|
||||
TextSize = 10.3,
|
||||
TextMinSize = 0.5,
|
||||
TextMaxSize = 30.0,
|
||||
-- TextColor = { 0.0, 0.2, 0.5 },
|
||||
-- TextSize = 10.3,
|
||||
-- TextMinMaxSize = { 0, 30 },
|
||||
Unit = "pc"
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -27,13 +27,13 @@ local object = {
|
||||
File = speck .. "/superclust.speck",
|
||||
Texture = textures .. "/point3A.png",
|
||||
LabelFile = speck .. "/superclust.label",
|
||||
Unit = "Mpc",
|
||||
TextColor = { 0.9, 0.9, 0.9 },
|
||||
ScaleFactor = 531.0,
|
||||
TextSize = 22.44,
|
||||
TextMinSize = 8.0,
|
||||
Unit = "Mpc",
|
||||
TextMinMaxSize = { 8, 20 },
|
||||
DrawLabels = true,
|
||||
--BillboardMaxSize = 7.2,
|
||||
--BillboardMinMaxSize = { 0.0, 7.2 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -27,15 +27,14 @@ local object = {
|
||||
Texture = textures .. "/point4.png",
|
||||
PolygonSides = 7,
|
||||
LabelFile = speck .. "/snr.label",
|
||||
Unit = "pc",
|
||||
TextColor = { 0.6, 0.46, 0.0 },
|
||||
ScaleFactor = 424,
|
||||
TextSize = 16.44,
|
||||
TextMinSize = 4.0,
|
||||
TextMaxSize = 200.0,
|
||||
TextMinMaxSize = { 4, 100 },
|
||||
--CorrectionSizeEndDistance = 17.5,
|
||||
--CorrectionSizeFactor = 13.96,
|
||||
Unit = "pc",
|
||||
BillboardMaxSize = 500,
|
||||
BillboardMinMaxSize = { 0.0, 500.0 },
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -33,21 +33,18 @@ local tullyPoints = {
|
||||
ColorRange = { { 1.0, 30.0 } },
|
||||
LabelFile = speck .. "/tully.label",
|
||||
DrawLabels = false,
|
||||
Unit = "Mpc",
|
||||
TextColor = { 0.7, 0.7, 0.7 },
|
||||
TextSize = 19.36,
|
||||
TextMinSize = 8.2,
|
||||
TextMinMaxSize = { 8, 20 },
|
||||
TransformationMatrix = {
|
||||
-0.7357425748, 0.67726129641, 0.0, 0.0,
|
||||
-0.074553778365, -0.080991471307, 0.9939225904, 0.0,
|
||||
0.67314530211, 0.73127116582, 0.11008126223, 0.0,
|
||||
0.0, 0.0, 0.0, 1.0
|
||||
},
|
||||
Unit = "Mpc",
|
||||
-- Fade in value in the same unit as "Unit"
|
||||
FadeInDistances = { 0.001, 1.0 },
|
||||
-- Max size in pixels
|
||||
BillboardMaxSize = 7,
|
||||
BillboardMinSize = 0,
|
||||
FadeInDistances = { 0.001, 1.0 }, -- Fade in value in the same unit as "Unit"
|
||||
BillboardMinMaxSize = { 0.0, 7.0 }, -- in pixels
|
||||
--CorrectionSizeEndDistance = 22.0,
|
||||
--CorrectionSizeFactor = 10.45
|
||||
EnablePixelSizeControl = true
|
||||
|
||||
@@ -19,10 +19,10 @@ local object = {
|
||||
Color = { 1.0, 1.0, 1.0 },
|
||||
Opacity = 0.65,
|
||||
LabelFile = speck .. "/voids.label",
|
||||
Unit = "Mpc",
|
||||
TextColor = { 0.296, 0.629, 1.0 },
|
||||
TextSize = 20.9,
|
||||
TextMinSize = 8.0,
|
||||
Unit = "Mpc"
|
||||
TextMinMaxSize = { 8, 20 }
|
||||
},
|
||||
GUI = {
|
||||
Name = "Voids",
|
||||
|
||||
@@ -27,21 +27,16 @@ local Charon = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/charon.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 40.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 2000000.0,
|
||||
FadeOutStartingDistance = 800000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 250000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 40.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
Distances = { 800000.0, 2000000.0 },
|
||||
DistanceEPS = 250000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "planet_solarSystem", "planet_terrestrial" },
|
||||
|
||||
@@ -27,21 +27,16 @@ local Pluto = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/pluto.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 28.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 4000000.0,
|
||||
FadeOutStartingDistance = 650000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 500000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 28.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 650000.0, 4000000.0 },
|
||||
DistanceEPS = 500000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "planet_solarSystem", "planet_terrestrial" },
|
||||
@@ -56,13 +51,12 @@ local PlutoLabel = {
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Pluto",
|
||||
Size = "Pluto",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 8.9,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
Size = 8.9,
|
||||
MinMaxSize = { 1, 100 },
|
||||
BlendMode = "Additive",
|
||||
LabelOrientationOption = "Camera View Direction"
|
||||
OrientationOption = "Camera View Direction"
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
|
||||
@@ -23,21 +23,16 @@ local Earth = {
|
||||
}
|
||||
},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/Earth.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 40.0,
|
||||
LabelsSize = 4.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 300000.0,
|
||||
FadeOutStartingDistance = 10000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 1500000.0,
|
||||
LabelsColor = { 1.0, 0.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 40.0,
|
||||
Size = 4.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 10000.0, 300000.0 },
|
||||
DistanceEPS = 1500000.0,
|
||||
Color = { 1.0, 0.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "planet_solarSystem", "planet_terrestrial" },
|
||||
@@ -54,20 +49,16 @@ local EarthLabel = {
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Earth",
|
||||
Text = "Earth",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 8.6,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
Size = 8.6,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
EnableFading = true,
|
||||
FadeStartUnit = "au",
|
||||
FadeStartDistance = 1.5,
|
||||
FadeStartSpeed = 1.0,
|
||||
FadeEndUnit = "au",
|
||||
FadeEndDistance = 15.0,
|
||||
FadeEndSpeed = 25.0
|
||||
FadeUnit = "au",
|
||||
FadeDistances = { 1.5, 15.0 },
|
||||
FadeWidths = { 1.0, 25.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
|
||||
@@ -34,21 +34,16 @@ local Moon = {
|
||||
}
|
||||
},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/moon.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 14.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 500000.0,
|
||||
FadeOutStartingDistance = 100000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 1350000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 14.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 100000.0, 500000.0 },
|
||||
DistanceEPS = 1350000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -103,6 +103,7 @@ local initializeAndAddNodes = function()
|
||||
}
|
||||
}
|
||||
|
||||
-- @TODO (emmbr, 2021-05-27) add to scene when label rendering issues have been fixed
|
||||
local IssLabel = {
|
||||
Identifier = "IssLabel",
|
||||
Parent = iss.Identifier,
|
||||
@@ -110,27 +111,22 @@ local initializeAndAddNodes = function()
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "ISS",
|
||||
Text = "ISS",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 3.4,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
Size = 3.4,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
EnableFading = true,
|
||||
FadeStartUnit = "au",
|
||||
FadeStartDistance = 0.15,
|
||||
FadeStartSpeed = 1.0,
|
||||
FadeEndUnit = "au",
|
||||
FadeEndDistance = 15.0,
|
||||
FadeEndSpeed = 25.0
|
||||
FadeDistances = { 0.15, 15.0 },
|
||||
FadeWidths = { 1.0, 25.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "ISS Label",
|
||||
Path = "/Solar System/Planets/Earth/Satellites"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { iss, parentNode, issTrail }
|
||||
end
|
||||
|
||||
@@ -59,38 +59,35 @@ asset.onInitialize(function ()
|
||||
},
|
||||
Tag = { "earth_satellite", "Aqua" },
|
||||
GUI = {
|
||||
Name = "Terra Trail",
|
||||
Name = "Aqua Trail",
|
||||
Path = "/Solar System/Planets/Earth/Satellites/Aqua"
|
||||
}
|
||||
}
|
||||
|
||||
-- @TODO (emmbr, 2021-05-27) this label is not visible. Too large fade distances?
|
||||
-- Might also be affected by the rendering issues for labels
|
||||
local AquaLabel = {
|
||||
Identifier = "AquaLabel",
|
||||
Parent = Aqua.Identifier,
|
||||
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "SNPP",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 4.0,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
EnableFading = true,
|
||||
FadeStartUnit = "au",
|
||||
FadeStartDistance = 0.15,
|
||||
FadeStartSpeed = 1.0,
|
||||
FadeEndUnit = "au",
|
||||
FadeEndDistance = 15.0,
|
||||
FadeEndSpeed = 25.0
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "Aqua Label",
|
||||
Path = "/Solar System/Planets/Earth"
|
||||
}
|
||||
Identifier = "AquaLabel",
|
||||
Parent = Aqua.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
Text = "Aqua",
|
||||
FontSize = 100.0,
|
||||
Size = 4.0,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
EnableFading = true,
|
||||
FadeUnit = "au",
|
||||
FadeDistances = { 1.5, 15.0 },
|
||||
FadeWidths = { 1.0, 25.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "Aqua Label",
|
||||
Path = "/Solar System/Planets/Earth"
|
||||
}
|
||||
}
|
||||
|
||||
table.insert(nodes, Aqua)
|
||||
|
||||
@@ -67,32 +67,28 @@ asset.onInitialize(function ()
|
||||
}
|
||||
|
||||
local SNPPLabel = {
|
||||
Identifier = "SNPPLabel",
|
||||
Parent = SNPP.Identifier,
|
||||
Identifier = "SNPPLabel",
|
||||
Parent = SNPP.Identifier,
|
||||
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "SNPP",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 4.0,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
EnableFading = true,
|
||||
FadeStartUnit = "au",
|
||||
FadeStartDistance = 0.15,
|
||||
FadeStartSpeed = 1.0,
|
||||
FadeEndUnit = "au",
|
||||
FadeEndDistance = 15.0,
|
||||
FadeEndSpeed = 25.0
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "SNPP Label",
|
||||
Path = "/Solar System/Planets/Earth"
|
||||
}
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
Text = "SNPP",
|
||||
FontSize = 100.0,
|
||||
Size = 4.0,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
EnableFading = true,
|
||||
FadeUnit = "au",
|
||||
FadeDistances = { 1.5, 15.0 },
|
||||
FadeWidths = { 1.0, 25.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "SNPP Label",
|
||||
Path = "/Solar System/Planets/Earth"
|
||||
}
|
||||
}
|
||||
|
||||
table.insert(nodes, SNPP)
|
||||
|
||||
@@ -66,33 +66,30 @@ asset.onInitialize(function ()
|
||||
}
|
||||
}
|
||||
|
||||
-- @TODO (emmbr, 2021-05-27) this label is not visible. Too large fade distances?
|
||||
-- Might also be affected by the rendering issues for labels
|
||||
local TerraLabel = {
|
||||
Identifier = "TerraLabel",
|
||||
Parent = Terra.Identifier,
|
||||
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "SNPP",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 4.0,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
EnableFading = true,
|
||||
FadeStartUnit = "au",
|
||||
FadeStartDistance = 0.15,
|
||||
FadeStartSpeed = 1.0,
|
||||
FadeEndUnit = "au",
|
||||
FadeEndDistance = 15.0,
|
||||
FadeEndSpeed = 25.0
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "Terra Label",
|
||||
Path = "/Solar System/Planets/Earth"
|
||||
}
|
||||
Identifier = "TerraLabel",
|
||||
Parent = Terra.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
Text = "Terra",
|
||||
FontSize = 100.0,
|
||||
Size = 4.0,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
EnableFading = true,
|
||||
FadeUnit = "au",
|
||||
FadeDistances = { 1.5, 15.0 },
|
||||
FadeWidths = { 1.0, 25.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "Terra Label",
|
||||
Path = "/Solar System/Planets/Earth"
|
||||
}
|
||||
}
|
||||
|
||||
table.insert(nodes, Terra)
|
||||
|
||||
@@ -28,21 +28,17 @@ local Callisto = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/callisto.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 40.0,
|
||||
LabelsSize = 10.5,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 15000000.0,
|
||||
FadeOutStartingDistance = 5000000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 1350000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 40.0,
|
||||
Size = 10.5,
|
||||
MinMaxSize = { 1, 100 },
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 5000000.0, 15000000.0 },
|
||||
DistanceEPS = 1350000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" },
|
||||
|
||||
@@ -28,21 +28,16 @@ local Europa = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/europa.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 40.0,
|
||||
LabelsSize = 10.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 8000000.0,
|
||||
FadeOutStartingDistance = 5000000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 700000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 40.0,
|
||||
Size = 10.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 500000.0, 8000000.0 },
|
||||
DistanceEPS = 700000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" },
|
||||
|
||||
@@ -28,21 +28,16 @@ local Ganymede = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/ganymede.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 40.0,
|
||||
LabelsSize = 10.5,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 8000000.0,
|
||||
FadeOutStartingDistance = 2250000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 1750000.0,
|
||||
LabelsColor = {1.0, 1.0, 0.0}
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 40.0,
|
||||
Size = 10.5,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 2250000.0, 8000000.0 },
|
||||
DistanceEPS = 1750000.0,
|
||||
Color = {1.0, 1.0, 0.0}
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" },
|
||||
|
||||
@@ -28,21 +28,16 @@ local Io = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/io.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 40.0,
|
||||
LabelsSize = 10.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 8500000.0,
|
||||
FadeOutStartingDistance = 4000000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 1000000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 40.0,
|
||||
Size = 10.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 4000000.0, 8500000.0 },
|
||||
DistanceEPS = 1000000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_jupiter" },
|
||||
|
||||
@@ -42,12 +42,11 @@ local JupiterLabel = {
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Jupiter",
|
||||
Text = "Jupiter",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 8.6,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
Size = 8.6,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive"
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
|
||||
@@ -23,21 +23,16 @@ local Mars = {
|
||||
SegmentsPerPatch = 90,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/mars.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 14.0,
|
||||
LabelsSize = 9.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 2000000.0,
|
||||
FadeOutStartingDistance = 750000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 2500000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 14.0,
|
||||
Size = 9.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 750000.0, 2000000.0 },
|
||||
DistanceEPS = 2500000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "planet_solarSystem", "planet_terrestrial" },
|
||||
@@ -54,12 +49,11 @@ local MarsLabel = {
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Mars",
|
||||
Text = "Mars",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 8.5,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
Size = 8.5,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
TransformationMatrix = {
|
||||
1.0, 0.0, 0.0, -8.0E6,
|
||||
|
||||
@@ -24,21 +24,16 @@ local Mercury = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/Mercury.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 22.0,
|
||||
LabelsSize = 10.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 5000000.0,
|
||||
FadeOutStartingDistance = 1800000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 1500000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 22.0,
|
||||
Size = 10.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 1800000.0, 5000000.0 },
|
||||
DistanceEPS = 1500000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "planet_solarSystem", "planet_terrestrial" },
|
||||
@@ -53,12 +48,11 @@ local MercuryLabel = {
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Mercury",
|
||||
Text = "Mercury",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 8.3,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
Size = 8.3,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive"
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
|
||||
@@ -33,12 +33,11 @@ local NeptuneLabel = {
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Neptune",
|
||||
Text = "Neptune",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 8.8,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
Size = 8.8,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive"
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
|
||||
@@ -26,21 +26,16 @@ local Dione = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/dione.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 32.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 3500000.0,
|
||||
FadeOutStartingDistance = 1000000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 200000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 32.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 500000.0, 3500000.0 },
|
||||
DistanceEPS = 200000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
|
||||
|
||||
@@ -26,21 +26,16 @@ local Enceladus = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/enceladus.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 22.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 1000000.0,
|
||||
FadeOutStartingDistance = 500000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 100000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 22.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 300000.0, 1000000.0 },
|
||||
DistanceEPS = 100000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
|
||||
|
||||
@@ -26,20 +26,16 @@ local Hyperion = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
-- @TODO (2021-05-21, emmbr26) These labels do not seem to be visible
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/hyperion.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 14.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
FadeInStartingDistance = 500000.0,
|
||||
FadeOutStartingDistance = 1000000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 1350000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 14.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeDistances = { 500000.0, 1000000.0 },
|
||||
DistanceEPS = 1350000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
|
||||
|
||||
@@ -26,21 +26,16 @@ local Iapetus = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/iapetus.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 30.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 3500000.0,
|
||||
FadeOutStartingDistance = 600000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 250000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 30.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 600000.0, 3500000.0 },
|
||||
DistanceEPS = 250000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
|
||||
|
||||
@@ -26,21 +26,16 @@ local Mimas = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = { },
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/mimas.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 14.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 1000000.0,
|
||||
FadeOutStartingDistance = 400000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 25000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 14.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 400000.0, 1000000.0 },
|
||||
DistanceEPS = 25000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
|
||||
|
||||
@@ -26,21 +26,16 @@ local Rhea = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/rhea.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 40.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 2500000.0,
|
||||
FadeOutStartingDistance = 1000000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 250000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 40.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 500000.0, 2500000.0 },
|
||||
DistanceEPS = 250000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
|
||||
|
||||
@@ -56,13 +56,12 @@ local SaturnLabel = {
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Saturn",
|
||||
Text = "Saturn",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 8.7,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
Size = 8.7,
|
||||
MinMaxSize = { 1, 100 },
|
||||
BlendMode = "Additive",
|
||||
LabelOrientationOption = "Camera View Direction"
|
||||
OrientationOption = "Camera View Direction"
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
|
||||
@@ -26,21 +26,16 @@ local Tethys = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/tethys.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 24.0,
|
||||
LabelsSize = 8.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 1500000.0,
|
||||
FadeOutStartingDistance = 500000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 200000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 24.0,
|
||||
Size = 8.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 500000.0, 1500000.0 },
|
||||
DistanceEPS = 200000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
|
||||
|
||||
@@ -26,21 +26,16 @@ local Titan = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/titan.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 14.0,
|
||||
LabelsSize = 10.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 7500000.0,
|
||||
FadeOutStartingDistance = 6000000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 1350000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 14.0,
|
||||
Size = 10.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 6000000.0, 7500000.0 },
|
||||
DistanceEPS = 1350000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "moon_solarSystem", "moon_giants", "moon_saturn" },
|
||||
|
||||
@@ -33,12 +33,11 @@ local UranusLabel = {
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Uranus",
|
||||
Text = "Uranus",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 8.7,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
Size = 8.7,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive"
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
|
||||
@@ -26,22 +26,16 @@ local Venus = {
|
||||
SegmentsPerPatch = 64,
|
||||
Layers = {},
|
||||
Labels = {
|
||||
Enable = false,
|
||||
Enabled = false,
|
||||
FileName = labelsPath .. "/venus.labels",
|
||||
LabelAlignmentOption = "Horizontally", -- or Circularly
|
||||
LabelsFontSize = 40.0,
|
||||
LabelsSize = 10.0,
|
||||
LabelsMinSize = 1.0,
|
||||
LabelsMaxSize = 1500.0,
|
||||
ProximityEnabled = false,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeInEnabled = true,
|
||||
LabelsFadeOutEnabled = true,
|
||||
FadeInStartingDistance = 7000000.0,
|
||||
FadeOutStartingDistance = 2000000.0,
|
||||
LabelsForceDomeRendering = true,
|
||||
LabelsDistanceEPS = 4000000.0,
|
||||
LabelsColor = { 1.0, 1.0, 0.0 }
|
||||
AlignmentOption = "Horizontally", -- or Circularly
|
||||
FontSize = 40.0,
|
||||
Size = 10.0,
|
||||
FadeInEnabled = true,
|
||||
FadeOutEnabled = true,
|
||||
FadeDistances = { 2000000.0, 7000000.0 },
|
||||
DistanceEPS = 4000000.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Tag = { "planet_solarSystem", "planet_terrestrial" },
|
||||
@@ -53,25 +47,24 @@ local Venus = {
|
||||
}
|
||||
|
||||
local VenusLabel = {
|
||||
Identifier = "VenusLabel",
|
||||
Parent = Venus.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Venus",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 8.4,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive"
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "Venus Label",
|
||||
Path = "/Solar System/Planets/Venus",
|
||||
Description = "Label for Venus, viewable within the solar system."
|
||||
}
|
||||
Identifier = "VenusLabel",
|
||||
Parent = Venus.Identifier,
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
Text = "Venus",
|
||||
FontSize = 100.0,
|
||||
Size = 8.4,
|
||||
MinMaxSize = { 1, 100 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive"
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
Name = "Venus Label",
|
||||
Path = "/Solar System/Planets/Venus",
|
||||
Description = "Label for Venus, viewable within the solar system."
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { Venus, VenusLabel })
|
||||
|
||||
@@ -26,20 +26,16 @@ local SunLabel = {
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableLabels",
|
||||
LabelText = "Sun",
|
||||
Text = "Sun",
|
||||
FontSize = 100.0,
|
||||
LabelSize = 13.127,
|
||||
LabelMaxSize = 100.0,
|
||||
LabelMinSize = 1.0,
|
||||
LabelOrientationOption = "Camera View Direction",
|
||||
Size = 14.0,
|
||||
MinMaxSize = { 1, 50 },
|
||||
OrientationOption = "Camera View Direction",
|
||||
BlendMode = "Additive",
|
||||
EnableFading = true,
|
||||
FadeStartUnit = "Pm",
|
||||
FadeStartDistance = 2.841,
|
||||
FadeStartSpeed = 1.375,
|
||||
FadeEndUnit = "pc",
|
||||
FadeEndDistance = 1.326,
|
||||
FadeEndSpeed = 1.0
|
||||
FadeUnit = "pc",
|
||||
FadeDistances = { 1.33, 15.0 },
|
||||
FadeWidths = { 1.0, 20.0 }
|
||||
},
|
||||
Tag = { "solarsystem_labels" },
|
||||
GUI = {
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <openspace/util/json_helper.h>
|
||||
#include <ghoul/lua/ghoul_lua.h>
|
||||
#include <glm/ext/matrix_common.hpp>
|
||||
#include <cmath>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
@@ -88,6 +89,7 @@ float NumericalProperty<T>::exponent() const {
|
||||
|
||||
template <typename T>
|
||||
void NumericalProperty<T>::setExponent(float exponent) {
|
||||
ghoul_assert(std::abs(exponent) > 0.f, "Exponent for property input cannot be zero");
|
||||
_exponent = exponent;
|
||||
}
|
||||
|
||||
|
||||
@@ -381,12 +381,13 @@ public:
|
||||
|
||||
/**
|
||||
* Default view options that can be used in the Property::setViewOption method. The
|
||||
* values are: Property::ViewOptions::Color = \c Color,
|
||||
* Property::ViewOptions::Logarithmic = \c Logarithmic
|
||||
* values are:
|
||||
* - Property::ViewOptions::Color = \c Color (Intended for Vec3 and Vec4),
|
||||
* - Property::ViewOptions::MinMaxRange = \c MinMaxRange (Intended for Vec2)
|
||||
*/
|
||||
struct ViewOptions {
|
||||
static const char* Color;
|
||||
static const char* Logarithmic;
|
||||
static const char* MinMaxRange;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -90,7 +90,7 @@ RenderableGrid::RenderableGrid(const ghoul::Dictionary& dictionary)
|
||||
, _color(ColorInfo, glm::vec3(0.5f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, _segments(SegmentsInfo, glm::uvec2(10), glm::uvec2(1), glm::uvec2(200))
|
||||
, _lineWidth(LineWidthInfo, 0.5f, 1.f, 20.f)
|
||||
, _size(SizeInfo, glm::vec2(1e10f), glm::vec2(1.f), glm::vec2(1e20f))
|
||||
, _size(SizeInfo, glm::vec2(1.f), glm::vec2(1.f), glm::vec2(1e11f))
|
||||
{
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -108,7 +108,7 @@ RenderableGrid::RenderableGrid(const ghoul::Dictionary& dictionary)
|
||||
_lineWidth = p.lineWidth.value_or(_lineWidth);
|
||||
addProperty(_lineWidth);
|
||||
|
||||
_size.setViewOption(properties::Property::ViewOptions::Logarithmic);
|
||||
_size.setExponent(10.f);
|
||||
_size = p.size.value_or(_size);
|
||||
_size.onChange([&]() { _gridIsDirty = true; });
|
||||
addProperty(_size);
|
||||
|
||||
@@ -65,17 +65,12 @@ namespace {
|
||||
"This value specifies the line width of the spherical grid."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo OuterRadiusInfo = {
|
||||
"OuterRadius",
|
||||
"Outer Radius",
|
||||
"The outer radius of the circular grid, i.e. its size."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo InnerRadiusInfo = {
|
||||
"InnerRadius",
|
||||
"Inner Radius",
|
||||
"The inner radius of the circular grid, that is the radius of the inmost ring. "
|
||||
"Must be smaller than the outer radius."
|
||||
constexpr openspace::properties::Property::PropertyInfo RadiiInfo = {
|
||||
"Radii",
|
||||
"Inner and Outer Radius",
|
||||
"The radii values that determine the size of the circular grid. The first value "
|
||||
"is the radius of the inmost ring and the second is the radius of the outmost "
|
||||
"ring."
|
||||
};
|
||||
|
||||
struct [[codegen::Dictionary(RenderableRadialGrid)]] Parameters {
|
||||
@@ -91,11 +86,8 @@ namespace {
|
||||
// [[codegen::verbatim(LineWidthInfo.description)]]
|
||||
std::optional<float> lineWidth;
|
||||
|
||||
// [[codegen::verbatim(OuterRadiusInfo.description)]]
|
||||
std::optional<float> outerRadius;
|
||||
|
||||
// [[codegen::verbatim(InnerRadiusInfo.description)]]
|
||||
std::optional<float> innerRadius;
|
||||
// [[codegen::verbatim(RadiiInfo.description)]]
|
||||
std::optional<glm::vec2> radii;
|
||||
};
|
||||
#include "renderableradialgrid_codegen.cpp"
|
||||
} // namespace
|
||||
@@ -112,8 +104,7 @@ RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary)
|
||||
, _gridSegments(GridSegmentsInfo, glm::ivec2(1), glm::ivec2(1), glm::ivec2(200))
|
||||
, _circleSegments(CircleSegmentsInfo, 36, 4, 200)
|
||||
, _lineWidth(LineWidthInfo, 0.5f, 1.f, 20.f)
|
||||
, _maxRadius(OuterRadiusInfo, 1.f, 0.f, 20.f)
|
||||
, _minRadius(InnerRadiusInfo, 0.f, 0.f, 20.f)
|
||||
, _radii(RadiiInfo, glm::vec2(0.f, 1.f), glm::vec2(0.f), glm::vec2(20.f))
|
||||
{
|
||||
const Parameters p = codegen::bake<Parameters>(dictionary);
|
||||
|
||||
@@ -140,24 +131,11 @@ RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary)
|
||||
_lineWidth = p.lineWidth.value_or(_lineWidth);
|
||||
addProperty(_lineWidth);
|
||||
|
||||
_minRadius = p.innerRadius.value_or(_minRadius);
|
||||
_maxRadius = p.outerRadius.value_or(_maxRadius);
|
||||
_radii = p.radii.value_or(_radii);
|
||||
_radii.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
_radii.onChange([&]() { _gridIsDirty = true; });
|
||||
|
||||
_maxRadius.setMinValue(_minRadius);
|
||||
_minRadius.setMaxValue(_maxRadius);
|
||||
|
||||
_maxRadius.onChange([&]() {
|
||||
_gridIsDirty = true;
|
||||
_minRadius.setMaxValue(_maxRadius);
|
||||
});
|
||||
|
||||
_minRadius.onChange([&]() {
|
||||
_gridIsDirty = true;
|
||||
_maxRadius.setMinValue(_minRadius);
|
||||
});
|
||||
|
||||
addProperty(_maxRadius);
|
||||
addProperty(_minRadius);
|
||||
addProperty(_radii);
|
||||
}
|
||||
|
||||
bool RenderableRadialGrid::isReady() const {
|
||||
@@ -236,12 +214,15 @@ void RenderableRadialGrid::update(const UpdateData&) {
|
||||
return;
|
||||
}
|
||||
|
||||
const float innerRadius = _radii.value().x;
|
||||
const float outerRadius = _radii.value().y;
|
||||
|
||||
// Circles
|
||||
const int nRadialSegments = _gridSegments.value()[0];
|
||||
const float fnCircles = static_cast<float>(nRadialSegments);
|
||||
const float deltaRadius = (_maxRadius - _minRadius) / fnCircles;
|
||||
const float deltaRadius = (outerRadius - innerRadius) / fnCircles;
|
||||
|
||||
const bool hasInnerRadius = _minRadius > 0;
|
||||
const bool hasInnerRadius = innerRadius > 0.f;
|
||||
const int nCircles = hasInnerRadius ? nRadialSegments : nRadialSegments + 1;
|
||||
|
||||
_circles.clear();
|
||||
@@ -258,11 +239,11 @@ void RenderableRadialGrid::update(const UpdateData&) {
|
||||
|
||||
// add an extra inmost circle
|
||||
if (hasInnerRadius) {
|
||||
addRing(_circleSegments, _minRadius);
|
||||
addRing(_circleSegments, innerRadius);
|
||||
}
|
||||
|
||||
for (int i = 0; i < nRadialSegments; ++i) {
|
||||
const float ri = static_cast<float>(i + 1) * deltaRadius + _minRadius;
|
||||
const float ri = static_cast<float>(i + 1) * deltaRadius + innerRadius;
|
||||
addRing(_circleSegments, ri);
|
||||
}
|
||||
|
||||
@@ -275,10 +256,10 @@ void RenderableRadialGrid::update(const UpdateData&) {
|
||||
|
||||
if (nLines > 1) {
|
||||
std::vector<rendering::helper::Vertex> outerVertices =
|
||||
rendering::helper::createRing(nLines, _maxRadius);
|
||||
rendering::helper::createRing(nLines, outerRadius);
|
||||
|
||||
std::vector<rendering::helper::Vertex> innerVertices =
|
||||
rendering::helper::createRing(nLines, _minRadius);
|
||||
rendering::helper::createRing(nLines, innerRadius);
|
||||
|
||||
for (int i = 0; i < nLines; ++i) {
|
||||
const rendering::helper::VertexXYZ vOut =
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
#include <openspace/properties/scalar/intproperty.h>
|
||||
#include <openspace/properties/vector/ivec2property.h>
|
||||
#include <openspace/properties/vector/vec2property.h>
|
||||
#include <openspace/properties/vector/vec3property.h>
|
||||
#include <openspace/rendering/helper.h>
|
||||
#include <ghoul/opengl/ghoul_gl.h>
|
||||
@@ -78,8 +79,7 @@ protected:
|
||||
properties::IVec2Property _gridSegments;
|
||||
properties::IntProperty _circleSegments;
|
||||
properties::FloatProperty _lineWidth;
|
||||
properties::FloatProperty _maxRadius;
|
||||
properties::FloatProperty _minRadius;
|
||||
properties::Vec2Property _radii;
|
||||
|
||||
bool _gridIsDirty = true;
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ RenderableDisc::RenderableDisc(const ghoul::Dictionary& dictionary)
|
||||
_texturePath.onChange([&]() { _texture->loadFromFile(_texturePath.value()); });
|
||||
addProperty(_texturePath);
|
||||
|
||||
_size.setViewOption(properties::Property::ViewOptions::Logarithmic);
|
||||
_size.setExponent(13.f);
|
||||
_size = p.size.value_or(_size);
|
||||
setBoundingSphere(_size);
|
||||
_size.onChange([&]() { _planeIsDirty = true; });
|
||||
|
||||
@@ -75,105 +75,78 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo BlendModeInfo = {
|
||||
"BlendMode",
|
||||
"Blending Mode",
|
||||
"This determines the blending mode that is applied to this plane."
|
||||
"This determines the blending mode that is applied to the renderable."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelColorInfo = {
|
||||
"LabelColor",
|
||||
"Label Color",
|
||||
"The label color for the astronomical object."
|
||||
constexpr openspace::properties::Property::PropertyInfo ColorInfo = {
|
||||
"Color",
|
||||
"Color",
|
||||
"The label text color."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = {
|
||||
"FontSize",
|
||||
"Font Size",
|
||||
"The font size for the astronomical object labels."
|
||||
"The font size (in points) for the label."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelSizeInfo = {
|
||||
"LabelSize",
|
||||
"Label Size",
|
||||
"The label size for the astronomical object labels."
|
||||
constexpr openspace::properties::Property::PropertyInfo SizeInfo = {
|
||||
"Size",
|
||||
"Size",
|
||||
"This value affects the size scale of the label."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelTextInfo = {
|
||||
"LabelText",
|
||||
"Label Text",
|
||||
constexpr openspace::properties::Property::PropertyInfo TextInfo = {
|
||||
"Text",
|
||||
"Text",
|
||||
"The text that will be displayed on screen."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelMinSizeInfo = {
|
||||
"LabelMinSize",
|
||||
"Label Min Size",
|
||||
"The minimal size (in pixels) of the labels for the astronomical "
|
||||
"objects being rendered."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
|
||||
"LabelMaxSize",
|
||||
"Label Max Size",
|
||||
"The maximum size (in pixels) of the labels for the astronomical "
|
||||
"objects being rendered."
|
||||
constexpr openspace::properties::Property::PropertyInfo MinMaxSizeInfo = {
|
||||
"MinMaxSize",
|
||||
"Min and Max Size",
|
||||
"The minimum and maximum size (in pixels) of the label."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo TransformationMatrixInfo = {
|
||||
"TransformationMatrix",
|
||||
"Transformation Matrix",
|
||||
"Transformation matrix to be applied to each astronomical object."
|
||||
"Transformation matrix to be applied to the label."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelOrientationOptionInfo = {
|
||||
"LabelOrientationOption",
|
||||
"Label Orientation Option",
|
||||
constexpr openspace::properties::Property::PropertyInfo OrientationOptionInfo = {
|
||||
"OrientationOption",
|
||||
"Orientation Option",
|
||||
"Label orientation rendering mode."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo EnableFadingEffectInfo = {
|
||||
"EnableFading",
|
||||
"Enable/Disable Fade-in effect",
|
||||
"Enable/Disable Fade-in Effect",
|
||||
"Enable/Disable the Fade-in effect."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = {
|
||||
"EnablePixelSizeControl",
|
||||
"Enable pixel size control.",
|
||||
"Enable pixel size control for rectangular projections."
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeWidthsInfo = {
|
||||
"FadeWidths",
|
||||
"Fade Widths",
|
||||
"The distances over which the fading takes place, given in the specified unit. "
|
||||
"The first value is the distance before the closest distance and the second "
|
||||
"the one after the furthest distance. For example, with the unit Parsec (pc), "
|
||||
"a value of {1, 2} will make the label being fully faded out 1 Parsec before "
|
||||
"the closest distance and 2 Parsec away from the furthest distance."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeStartUnitOptionInfo = {
|
||||
"FadeStartUnit",
|
||||
"Fade-In/-Out Start Unit.",
|
||||
"Unit for fade-in/-out starting position calculation."
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeDistancesInfo = {
|
||||
"FadeDistances",
|
||||
"Fade Distances",
|
||||
"The distance range in which the labels should be fully opaque, specified in "
|
||||
"the chosen unit. The distance from the position of the label to the camera."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeEndUnitOptionInfo = {
|
||||
"FadeEndUnit",
|
||||
"Fade-In/-Out End Unit.",
|
||||
"Unit for fade-in/-out ending position calculation."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeStartDistInfo = {
|
||||
"FadeStartDistance",
|
||||
"Fade-In/-Out starting distance.",
|
||||
"Fade-In/-Out starting distance."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeEndDistInfo = {
|
||||
"FadeEndDistance",
|
||||
"Fade-In/-Out ending distance.",
|
||||
"Fade-In/-Out ending distance."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeStartSpeedInfo = {
|
||||
"FadeStartSpeed",
|
||||
"Fade-In/-Out starting speed.",
|
||||
"Fade-In/-Out starting speed."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeEndSpeedInfo = {
|
||||
"FadeEndSpeed",
|
||||
"Fade-In/-Out ending speed.",
|
||||
"Fade-In/-Out ending speed."
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeUnitOptionInfo = {
|
||||
"FadeUnit",
|
||||
"Fade Distance Unit",
|
||||
"Distance unit for fade-in/-out distance calculations. Defaults to \"au\"."
|
||||
};
|
||||
|
||||
struct [[codegen::Dictionary(RenderableLabels)]] Parameters {
|
||||
@@ -190,33 +163,27 @@ namespace {
|
||||
PositionNormal [[codegen::key("Camera Position Normal")]]
|
||||
};
|
||||
|
||||
// [[codegen::verbatim(LabelOrientationOptionInfo.description)]]
|
||||
std::optional<Orientation> labelOrientationOption;
|
||||
// [[codegen::verbatim(OrientationOptionInfo.description)]]
|
||||
std::optional<Orientation> orientationOption;
|
||||
|
||||
// [[codegen::verbatim(LabelColorInfo.description)]]
|
||||
std::optional<glm::vec3> labelColor [[codegen::color()]];
|
||||
// [[codegen::verbatim(ColorInfo.description)]]
|
||||
std::optional<glm::vec3> color [[codegen::color()]];
|
||||
|
||||
// [[codegen::verbatim(LabelTextInfo.description)]]
|
||||
std::optional<std::string> labelText;
|
||||
// [[codegen::verbatim(TextInfo.description)]]
|
||||
std::optional<std::string> text;
|
||||
|
||||
// [[codegen::verbatim(FontSizeInfo.description)]]
|
||||
std::optional<float> fontSize;
|
||||
|
||||
// [[codegen::verbatim(LabelSizeInfo.description)]]
|
||||
std::optional<float> labelSize;
|
||||
// [[codegen::verbatim(SizeInfo.description)]]
|
||||
std::optional<float> size;
|
||||
|
||||
// [[codegen::verbatim(LabelMinSizeInfo.description)]]
|
||||
std::optional<float> labelMinSize;
|
||||
|
||||
// [[codegen::verbatim(LabelMaxSizeInfo.description)]]
|
||||
std::optional<float> labelMaxSize;
|
||||
// [[codegen::verbatim(MinMaxSizeInfo.description)]]
|
||||
std::optional<glm::ivec2> minMaxSize;
|
||||
|
||||
// [[codegen::verbatim(EnableFadingEffectInfo.description)]]
|
||||
std::optional<bool> enableFading;
|
||||
|
||||
// [[codegen::verbatim(PixelSizeControlInfo.description)]]
|
||||
std::optional<bool> enablePixelControl;
|
||||
|
||||
// [[codegen::verbatim(TransformationMatrixInfo.description)]]
|
||||
std::optional<glm::dmat4x4> transformationMatrix;
|
||||
|
||||
@@ -230,28 +197,19 @@ namespace {
|
||||
AstronomicalUnit [[codegen::key("au")]],
|
||||
Parsec [[codegen::key("pc")]],
|
||||
KiloParsec [[codegen::key("Kpc")]],
|
||||
MegaParsec [[codgen::key("Mpc")]],
|
||||
MegaParsec [[codegen::key("Mpc")]],
|
||||
GigaParsec [[codegen::key("Gpc")]],
|
||||
GigaLightyear [[codegen::key("Gly")]]
|
||||
};
|
||||
|
||||
// [[codegen::verbatim(FadeStartUnitOptionInfo.description)]]
|
||||
std::optional<Unit> fadeStartUnit;
|
||||
// [[codegen::verbatim(FadeUnitOptionInfo.description)]]
|
||||
std::optional<Unit> fadeUnit;
|
||||
|
||||
// [[codegen::verbatim(FadeEndUnitOptionInfo.description)]]
|
||||
std::optional<Unit> fadeEndUnit;
|
||||
// [[codegen::verbatim(FadeDistancesInfo.description)]]
|
||||
std::optional<glm::vec2> fadeDistances;
|
||||
|
||||
// [[codegen::verbatim(FadeStartDistInfo.description)]]
|
||||
std::optional<float> fadeStartDistance;
|
||||
|
||||
// [[codegen::verbatim(FadeEndDistInfo.description)]]
|
||||
std::optional<float> fadeEndDistance;
|
||||
|
||||
// [[codegen::verbatim(FadeStartSpeedInfo.description)]]
|
||||
std::optional<float> fadeStartSpeed;
|
||||
|
||||
// [[codegen::verbatim(FadeEndSpeedInfo.description)]]
|
||||
std::optional<float> fadeEndSpeed;
|
||||
// [[codegen::verbatim(FadeWidthsInfo.description)]]
|
||||
std::optional<glm::vec2> fadeWidths;
|
||||
};
|
||||
#include "renderablelabels_codegen.cpp"
|
||||
} // namespace
|
||||
@@ -265,33 +223,20 @@ documentation::Documentation RenderableLabels::Documentation() {
|
||||
RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
|
||||
: Renderable(dictionary)
|
||||
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _labelColor(
|
||||
LabelColorInfo,
|
||||
glm::vec3(1.f, 1.f, 1.f),
|
||||
glm::vec3(0.f),
|
||||
glm::vec3(1.f)
|
||||
)
|
||||
, _labelSize(LabelSizeInfo, 8.f, 0.5f, 30.f)
|
||||
, _color(ColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, _size(SizeInfo, 8.f, 0.5f, 30.f)
|
||||
, _fontSize(FontSizeInfo, 50.f, 1.f, 100.f)
|
||||
, _labelMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
|
||||
, _labelMaxSize(LabelMaxSizeInfo, 20.f, 0.5f, 100.f)
|
||||
, _pixelSizeControl(PixelSizeControlInfo, false)
|
||||
, _minMaxSize(MinMaxSizeInfo, glm::ivec2(8, 20), glm::ivec2(0), glm::ivec2(100))
|
||||
, _enableFadingEffect(EnableFadingEffectInfo, false)
|
||||
, _labelText(LabelTextInfo, "")
|
||||
, _fadeStartDistance(FadeStartDistInfo, 1.f, 0.f, 100.f)
|
||||
, _fadeEndDistance(FadeEndDistInfo, 1.f, 0.f, 100.f)
|
||||
, _fadeStartSpeed(FadeStartSpeedInfo, 1.f, 1.f, 100.f)
|
||||
, _fadeEndSpeed(FadeEndSpeedInfo, 1.f, 1.f, 100.f)
|
||||
, _labelOrientationOption(
|
||||
LabelOrientationOptionInfo,
|
||||
, _text(TextInfo, "")
|
||||
, _fadeDistances(FadeDistancesInfo, glm::vec2(1.f), glm::vec2(0.f), glm::vec2(100.f))
|
||||
, _fadeWidths(FadeWidthsInfo, glm::vec2(1.f), glm::vec2(0.f), glm::vec2(100.f))
|
||||
, _orientationOption(
|
||||
OrientationOptionInfo,
|
||||
properties::OptionProperty::DisplayType::Dropdown
|
||||
)
|
||||
, _fadeStartUnitOption(
|
||||
FadeStartUnitOptionInfo,
|
||||
properties::OptionProperty::DisplayType::Dropdown
|
||||
)
|
||||
, _fadeEndUnitOption(
|
||||
FadeEndUnitOptionInfo,
|
||||
, _fadeUnitOption(
|
||||
FadeUnitOptionInfo,
|
||||
properties::OptionProperty::DisplayType::Dropdown
|
||||
)
|
||||
{
|
||||
@@ -330,28 +275,28 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
|
||||
|
||||
addProperty(_blendMode);
|
||||
|
||||
_labelOrientationOption.addOption(ViewDirection, "Camera View Direction");
|
||||
_labelOrientationOption.addOption(NormalDirection, "Camera Position Normal");
|
||||
_orientationOption.addOption(ViewDirection, "Camera View Direction");
|
||||
_orientationOption.addOption(NormalDirection, "Camera Position Normal");
|
||||
|
||||
_labelOrientationOption = NormalDirection;
|
||||
if (p.labelOrientationOption.has_value()) {
|
||||
switch (*p.labelOrientationOption) {
|
||||
_orientationOption = NormalDirection;
|
||||
if (p.orientationOption.has_value()) {
|
||||
switch (*p.orientationOption) {
|
||||
case Parameters::Orientation::ViewDirection:
|
||||
_labelOrientationOption = ViewDirection;
|
||||
_orientationOption = ViewDirection;
|
||||
break;
|
||||
case Parameters::Orientation::PositionNormal:
|
||||
_labelOrientationOption = NormalDirection;
|
||||
_orientationOption = NormalDirection;
|
||||
break;
|
||||
}
|
||||
}
|
||||
addProperty(_labelOrientationOption);
|
||||
addProperty(_orientationOption);
|
||||
|
||||
_labelText = p.labelText.value_or(_labelText);
|
||||
addProperty(_labelText);
|
||||
_text = p.text.value_or(_text);
|
||||
addProperty(_text);
|
||||
|
||||
_labelColor = p.labelColor.value_or(_labelColor);
|
||||
_labelColor.setViewOption(properties::Property::ViewOptions::Color);
|
||||
addProperty(_labelColor);
|
||||
_color = p.color.value_or(_color);
|
||||
_color.setViewOption(properties::Property::ViewOptions::Color);
|
||||
addProperty(_color);
|
||||
|
||||
_fontSize = p.fontSize.value_or(_fontSize);
|
||||
_fontSize.onChange([&]() {
|
||||
@@ -364,156 +309,82 @@ RenderableLabels::RenderableLabels(const ghoul::Dictionary& dictionary)
|
||||
});
|
||||
addProperty(_fontSize);
|
||||
|
||||
_labelSize = p.labelSize.value_or(_labelSize);
|
||||
addProperty(_labelSize);
|
||||
_size = p.size.value_or(_size);
|
||||
addProperty(_size);
|
||||
|
||||
_labelMinSize = p.labelMinSize.value_or(_labelMinSize);
|
||||
addProperty(_labelMinSize);
|
||||
|
||||
_labelMaxSize = p.labelMaxSize.value_or(_labelMaxSize);
|
||||
addProperty(_labelMaxSize);
|
||||
_minMaxSize = p.minMaxSize.value_or(_minMaxSize);
|
||||
_minMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_minMaxSize);
|
||||
|
||||
_transformationMatrix = p.transformationMatrix.value_or(_transformationMatrix);
|
||||
|
||||
_pixelSizeControl = p.enablePixelControl.value_or(_pixelSizeControl);
|
||||
if (_pixelSizeControl) {
|
||||
// @TODO (abock, 2021-01-28) I don't know why we only add the property if the
|
||||
// pixel control is enabled, but I think this is an error
|
||||
addProperty(_pixelSizeControl);
|
||||
}
|
||||
|
||||
_enableFadingEffect = p.enableFading.value_or(_enableFadingEffect);
|
||||
addProperty(_enableFadingEffect);
|
||||
|
||||
_fadeStartDistance = p.fadeStartDistance.value_or(_fadeStartDistance);
|
||||
addProperty(_fadeStartDistance);
|
||||
_fadeUnitOption.addOption(Meter, MeterUnit);
|
||||
_fadeUnitOption.addOption(Kilometer, KilometerUnit);
|
||||
_fadeUnitOption.addOption(Megameter, MegameterUnit);
|
||||
_fadeUnitOption.addOption(Gigameter, GigameterUnit);
|
||||
_fadeUnitOption.addOption(AU, AstronomicalUnit);
|
||||
_fadeUnitOption.addOption(Terameter, TerameterUnit);
|
||||
_fadeUnitOption.addOption(Petameter, PetameterUnit);
|
||||
_fadeUnitOption.addOption(Parsec, ParsecUnit);
|
||||
_fadeUnitOption.addOption(Kiloparsec, KiloparsecUnit);
|
||||
_fadeUnitOption.addOption(Megaparsec, MegaparsecUnit);
|
||||
_fadeUnitOption.addOption(Gigaparsec, GigaparsecUnit);
|
||||
_fadeUnitOption.addOption(GigalightYears, GigalightyearUnit);
|
||||
|
||||
_fadeStartUnitOption.addOption(Meter, MeterUnit);
|
||||
_fadeStartUnitOption.addOption(Kilometer, KilometerUnit);
|
||||
_fadeStartUnitOption.addOption(Megameter, MegameterUnit);
|
||||
_fadeStartUnitOption.addOption(Gigameter, GigameterUnit);
|
||||
_fadeStartUnitOption.addOption(AU, AstronomicalUnit);
|
||||
_fadeStartUnitOption.addOption(Terameter, TerameterUnit);
|
||||
_fadeStartUnitOption.addOption(Petameter, PetameterUnit);
|
||||
_fadeStartUnitOption.addOption(Parsec, ParsecUnit);
|
||||
_fadeStartUnitOption.addOption(Kiloparsec, KiloparsecUnit);
|
||||
_fadeStartUnitOption.addOption(Megaparsec, MegaparsecUnit);
|
||||
_fadeStartUnitOption.addOption(Gigaparsec, GigaparsecUnit);
|
||||
_fadeStartUnitOption.addOption(GigalightYears, GigalightyearUnit);
|
||||
|
||||
|
||||
if (p.fadeStartUnit.has_value()) {
|
||||
switch (*p.fadeStartUnit) {
|
||||
if (p.fadeUnit.has_value()) {
|
||||
switch (*p.fadeUnit) {
|
||||
case Parameters::Unit::Meter:
|
||||
_fadeStartUnitOption = Meter;
|
||||
_fadeUnitOption = Meter;
|
||||
break;
|
||||
case Parameters::Unit::Kilometer:
|
||||
_fadeStartUnitOption = Kilometer;
|
||||
_fadeUnitOption = Kilometer;
|
||||
break;
|
||||
case Parameters::Unit::Megameter:
|
||||
_fadeStartUnitOption = Megameter;
|
||||
_fadeUnitOption = Megameter;
|
||||
break;
|
||||
case Parameters::Unit::Gigameter:
|
||||
_fadeStartUnitOption = Gigameter;
|
||||
_fadeUnitOption = Gigameter;
|
||||
break;
|
||||
case Parameters::Unit::Terameter:
|
||||
_fadeStartUnitOption = Terameter;
|
||||
_fadeUnitOption = Terameter;
|
||||
break;
|
||||
case Parameters::Unit::Petameter:
|
||||
_fadeStartUnitOption = Petameter;
|
||||
_fadeUnitOption = Petameter;
|
||||
break;
|
||||
case Parameters::Unit::AstronomicalUnit:
|
||||
_fadeStartUnitOption = AU;
|
||||
_fadeUnitOption = AU;
|
||||
break;
|
||||
case Parameters::Unit::Parsec:
|
||||
_fadeStartUnitOption = Parsec;
|
||||
_fadeUnitOption = Parsec;
|
||||
break;
|
||||
case Parameters::Unit::KiloParsec:
|
||||
_fadeStartUnitOption = Kiloparsec;
|
||||
_fadeUnitOption = Kiloparsec;
|
||||
break;
|
||||
case Parameters::Unit::MegaParsec:
|
||||
_fadeStartUnitOption = Megaparsec;
|
||||
_fadeUnitOption = Megaparsec;
|
||||
break;
|
||||
case Parameters::Unit::GigaParsec:
|
||||
_fadeStartUnitOption = Gigaparsec;
|
||||
_fadeUnitOption = Gigaparsec;
|
||||
break;
|
||||
case Parameters::Unit::GigaLightyear:
|
||||
_fadeStartUnitOption = GigalightYears;
|
||||
_fadeUnitOption = GigalightYears;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
_fadeStartUnitOption = AU;
|
||||
_fadeUnitOption = AU;
|
||||
}
|
||||
addProperty(_fadeStartUnitOption);
|
||||
addProperty(_fadeUnitOption);
|
||||
|
||||
_fadeStartSpeed = p.fadeStartSpeed.value_or(_fadeStartSpeed);
|
||||
addProperty(_fadeStartSpeed);
|
||||
_fadeDistances = p.fadeDistances.value_or(_fadeDistances);
|
||||
_fadeDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_fadeDistances);
|
||||
|
||||
_fadeEndDistance = p.fadeEndDistance.value_or(_fadeEndDistance);
|
||||
addProperty(_fadeEndDistance);
|
||||
|
||||
_fadeEndUnitOption.addOption(Meter, MeterUnit);
|
||||
_fadeEndUnitOption.addOption(Kilometer, KilometerUnit);
|
||||
_fadeEndUnitOption.addOption(Megameter, MegameterUnit);
|
||||
_fadeEndUnitOption.addOption(Gigameter, GigameterUnit);
|
||||
_fadeEndUnitOption.addOption(AU, AstronomicalUnit);
|
||||
_fadeEndUnitOption.addOption(Terameter, TerameterUnit);
|
||||
_fadeEndUnitOption.addOption(Petameter, PetameterUnit);
|
||||
_fadeEndUnitOption.addOption(Parsec, ParsecUnit);
|
||||
_fadeEndUnitOption.addOption(Kiloparsec, KiloparsecUnit);
|
||||
_fadeEndUnitOption.addOption(Megaparsec, MegaparsecUnit);
|
||||
_fadeEndUnitOption.addOption(Gigaparsec, GigaparsecUnit);
|
||||
_fadeEndUnitOption.addOption(GigalightYears, GigalightyearUnit);
|
||||
|
||||
|
||||
if (p.fadeEndUnit.has_value()) {
|
||||
switch (*p.fadeEndUnit) {
|
||||
case Parameters::Unit::Meter:
|
||||
_fadeStartUnitOption = Meter;
|
||||
break;
|
||||
case Parameters::Unit::Kilometer:
|
||||
_fadeStartUnitOption = Kilometer;
|
||||
break;
|
||||
case Parameters::Unit::Megameter:
|
||||
_fadeStartUnitOption = Megameter;
|
||||
break;
|
||||
case Parameters::Unit::Gigameter:
|
||||
_fadeStartUnitOption = Gigameter;
|
||||
break;
|
||||
case Parameters::Unit::Terameter:
|
||||
_fadeStartUnitOption = Terameter;
|
||||
break;
|
||||
case Parameters::Unit::Petameter:
|
||||
_fadeStartUnitOption = Petameter;
|
||||
break;
|
||||
case Parameters::Unit::AstronomicalUnit:
|
||||
_fadeStartUnitOption = AU;
|
||||
break;
|
||||
case Parameters::Unit::Parsec:
|
||||
_fadeStartUnitOption = Parsec;
|
||||
break;
|
||||
case Parameters::Unit::KiloParsec:
|
||||
_fadeEndUnitOption = Kiloparsec;
|
||||
break;
|
||||
case Parameters::Unit::MegaParsec:
|
||||
_fadeEndUnitOption = Megaparsec;
|
||||
break;
|
||||
case Parameters::Unit::GigaParsec:
|
||||
_fadeEndUnitOption = Gigaparsec;
|
||||
break;
|
||||
case Parameters::Unit::GigaLightyear:
|
||||
_fadeEndUnitOption = GigalightYears;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
_fadeEndUnitOption = AU;
|
||||
}
|
||||
addProperty(_fadeEndUnitOption);
|
||||
|
||||
_fadeEndSpeed = p.fadeEndSpeed.value_or(_fadeEndSpeed);
|
||||
addProperty(_fadeEndSpeed);
|
||||
_fadeWidths = p.fadeWidths.value_or(_fadeWidths);
|
||||
addProperty(_fadeWidths);
|
||||
}
|
||||
|
||||
bool RenderableLabels::isReady() const {
|
||||
@@ -528,7 +399,6 @@ void RenderableLabels::initialize() {
|
||||
|
||||
void RenderableLabels::initializeGL() {
|
||||
if (_font == nullptr) {
|
||||
//size_t _fontSize = 50;
|
||||
_font = global::fontManager->font(
|
||||
"Mono",
|
||||
_fontSize,
|
||||
@@ -554,17 +424,7 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) {
|
||||
float distanceNodeToCamera = static_cast<float>(
|
||||
glm::distance(data.camera.positionVec3(), data.modelTransform.translation)
|
||||
);
|
||||
float sUnit = unit(_fadeStartUnitOption);
|
||||
float eUnit = unit(_fadeEndUnitOption);
|
||||
float startX = _fadeStartDistance * sUnit;
|
||||
float endX = _fadeEndDistance * eUnit;
|
||||
fadeInVariable = linearSmoothStepFunc(
|
||||
distanceNodeToCamera,
|
||||
startX,
|
||||
endX,
|
||||
sUnit,
|
||||
eUnit
|
||||
);
|
||||
fadeInVariable = computeFadeFactor(distanceNodeToCamera);
|
||||
}
|
||||
|
||||
glm::dmat4 modelMatrix(1.0);
|
||||
@@ -598,7 +458,7 @@ void RenderableLabels::render(const RenderData& data, RendererTasks&) {
|
||||
|
||||
|
||||
void RenderableLabels::setLabelText(const std::string & newText) {
|
||||
_labelText = newText;
|
||||
_text = newText;
|
||||
}
|
||||
|
||||
void RenderableLabels::renderLabels(const RenderData& data,
|
||||
@@ -606,23 +466,23 @@ void RenderableLabels::renderLabels(const RenderData& data,
|
||||
const glm::dvec3& orthoRight,
|
||||
const glm::dvec3& orthoUp, float fadeInVariable)
|
||||
{
|
||||
glm::vec4 textColor = glm::vec4(glm::vec3(_labelColor), 1.f);
|
||||
glm::vec4 textColor = glm::vec4(glm::vec3(_color), 1.f);
|
||||
|
||||
textColor.a *= fadeInVariable;
|
||||
textColor.a *= _opacity;
|
||||
|
||||
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
|
||||
|
||||
labelInfo.orthoRight = orthoRight;
|
||||
labelInfo.orthoUp = orthoUp;
|
||||
labelInfo.minSize = static_cast<int>(_labelMinSize);
|
||||
labelInfo.maxSize = static_cast<int>(_labelMaxSize);
|
||||
labelInfo.cameraPos = data.camera.positionVec3();
|
||||
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
|
||||
labelInfo.renderType = _labelOrientationOption;
|
||||
labelInfo.mvpMatrix = modelViewProjectionMatrix;
|
||||
labelInfo.scale = powf(10.f, _labelSize);
|
||||
labelInfo.enableDepth = true;
|
||||
labelInfo.orthoRight = orthoRight;
|
||||
labelInfo.orthoUp = orthoUp;
|
||||
labelInfo.minSize = _minMaxSize.value().x;
|
||||
labelInfo.maxSize = _minMaxSize.value().y;
|
||||
labelInfo.cameraPos = data.camera.positionVec3();
|
||||
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
|
||||
labelInfo.renderType = _orientationOption;
|
||||
labelInfo.mvpMatrix = modelViewProjectionMatrix;
|
||||
labelInfo.scale = powf(10.f, _size);
|
||||
labelInfo.enableDepth = true;
|
||||
labelInfo.enableFalseDepth = false;
|
||||
|
||||
// We don't use spice rotation and scale
|
||||
@@ -633,52 +493,34 @@ void RenderableLabels::renderLabels(const RenderData& data,
|
||||
ghoul::fontrendering::FontRenderer::defaultProjectionRenderer().render(
|
||||
*_font,
|
||||
transformedPos,
|
||||
_labelText.value(),
|
||||
_text.value(),
|
||||
textColor,
|
||||
labelInfo
|
||||
);
|
||||
}
|
||||
|
||||
float RenderableLabels::changedPerlinSmoothStepFunc(float x, float startX,
|
||||
float endX) const
|
||||
{
|
||||
float f1 = 6.f * powf((x - startX), 5.f) - 15.f * powf((x - startX), 4.f) +
|
||||
10.f * powf((x - startX), 3.f);
|
||||
float f2 = -6.f * powf((x - endX), 5.f) + 15.f * powf((x - endX), 4.f) -
|
||||
10.f * powf((x - endX), 3.f) + 1.f;
|
||||
float f3 = 1.f;
|
||||
float RenderableLabels::computeFadeFactor(float distanceNodeToCamera) const {
|
||||
float distanceUnit = unit(_fadeUnitOption);
|
||||
|
||||
float x = distanceNodeToCamera;
|
||||
float startX = _fadeDistances.value().x * distanceUnit;
|
||||
float endX = _fadeDistances.value().y * distanceUnit;
|
||||
|
||||
// The distances over which the fading should happen
|
||||
float fadingStartDistance = _fadeWidths.value().x * distanceUnit;
|
||||
float fadingEndDistance = _fadeWidths.value().y * distanceUnit;
|
||||
|
||||
if (x <= startX) {
|
||||
float f1 = 1.f - (startX - x) / fadingStartDistance;
|
||||
return std::clamp(f1, 0.f, 1.f);
|
||||
}
|
||||
else if (x > startX && x < endX) {
|
||||
return f3;
|
||||
return 1.f; // not faded
|
||||
}
|
||||
else if (x >= endX) {
|
||||
else { // x >= endX
|
||||
float f2 = 1.f - (x - endX) / fadingEndDistance;
|
||||
return std::clamp(f2, 0.f, 1.f);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
float RenderableLabels::linearSmoothStepFunc(float x, float startX, float endX,
|
||||
float sUnit, float eUnit) const
|
||||
{
|
||||
float sdiv = 1.f / (sUnit * _fadeStartSpeed);
|
||||
float ediv = -1.f / (eUnit * _fadeEndSpeed);
|
||||
float f1 = sdiv * (x - startX) + 1.f;
|
||||
float f2 = ediv * (x - endX) + 1.f;
|
||||
float f3 = 1.f;
|
||||
|
||||
if (x <= startX) {
|
||||
return std::clamp(f1, 0.f, 1.f);
|
||||
}
|
||||
else if (x > startX && x < endX) {
|
||||
return f3;
|
||||
}
|
||||
else if (x >= endX) {
|
||||
return std::clamp(f2, 0.f, 1.f);
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
float RenderableLabels::unit(int unit) const {
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <openspace/properties/stringproperty.h>
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
#include <openspace/properties/vector/ivec2property.h>
|
||||
#include <openspace/properties/vector/vec2property.h>
|
||||
#include <openspace/properties/vector/vec3property.h>
|
||||
|
||||
@@ -77,7 +78,7 @@ protected:
|
||||
std::string toString(int unit) const;
|
||||
|
||||
// Data may require some type of transformation prior the spice transformation being
|
||||
// applied.
|
||||
// applied
|
||||
glm::dmat4 _transformationMatrix = glm::dmat4(1.0);
|
||||
|
||||
enum Unit {
|
||||
@@ -99,27 +100,21 @@ private:
|
||||
void renderLabels(const RenderData& data, const glm::dmat4& modelViewProjectionMatrix,
|
||||
const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable);
|
||||
|
||||
float changedPerlinSmoothStepFunc(float x, float startX, float endX) const;
|
||||
float computeFadeFactor(float distanceNodeToCamera) const;
|
||||
|
||||
float linearSmoothStepFunc(float x, float startX, float endX, float sUnit,
|
||||
float eUnit) const;
|
||||
|
||||
properties::Vec3Property _labelColor;
|
||||
properties::FloatProperty _labelSize;
|
||||
properties::Vec3Property _color;
|
||||
properties::FloatProperty _fontSize;
|
||||
properties::FloatProperty _labelMinSize;
|
||||
properties::FloatProperty _labelMaxSize;
|
||||
properties::BoolProperty _pixelSizeControl;
|
||||
properties::BoolProperty _enableFadingEffect;
|
||||
properties::StringProperty _labelText;
|
||||
properties::FloatProperty _fadeStartDistance;
|
||||
properties::FloatProperty _fadeEndDistance;
|
||||
properties::FloatProperty _fadeStartSpeed;
|
||||
properties::FloatProperty _fadeEndSpeed;
|
||||
properties::FloatProperty _size;
|
||||
properties::IVec2Property _minMaxSize;
|
||||
|
||||
properties::OptionProperty _labelOrientationOption;
|
||||
properties::OptionProperty _fadeStartUnitOption;
|
||||
properties::OptionProperty _fadeEndUnitOption;
|
||||
properties::StringProperty _text;
|
||||
|
||||
properties::BoolProperty _enableFadingEffect;
|
||||
properties::Vec2Property _fadeWidths;
|
||||
properties::Vec2Property _fadeDistances;
|
||||
properties::OptionProperty _fadeUnitOption;
|
||||
|
||||
properties::OptionProperty _orientationOption;
|
||||
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _font;
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary)
|
||||
|
||||
addProperty(_billboard);
|
||||
|
||||
_size.setViewOption(properties::Property::ViewOptions::Logarithmic);
|
||||
_size.setExponent(15.f);
|
||||
addProperty(_size);
|
||||
_size.onChange([this](){ _planeIsDirty = true; });
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
|
||||
: Renderable(dictionary)
|
||||
, _texturePath(TextureInfo)
|
||||
, _orientation(OrientationInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _size(SizeInfo, 1.f, 0.f, 1e35f)
|
||||
, _size(SizeInfo, 1.f, 0.f, 1e25f)
|
||||
, _segments(SegmentsInfo, 8, 4, 1000)
|
||||
, _mirrorTexture(MirrorTextureInfo, false)
|
||||
, _useAdditiveBlending(UseAdditiveBlendingInfo, false)
|
||||
@@ -213,7 +213,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
addProperty(_orientation);
|
||||
|
||||
_size.setViewOption(properties::Property::ViewOptions::Logarithmic);
|
||||
_size.setExponent(15.f);
|
||||
_size.onChange([this]() {
|
||||
setBoundingSphere(_size);
|
||||
_sphereIsDirty = true;
|
||||
|
||||
@@ -56,7 +56,7 @@ StaticTranslation::StaticTranslation()
|
||||
glm::dvec3(std::numeric_limits<double>::max())
|
||||
)
|
||||
{
|
||||
_position.setViewOption(properties::Property::ViewOptions::Logarithmic);
|
||||
_position.setExponent(20.f);
|
||||
addProperty(_position);
|
||||
|
||||
_position.onChange([this]() {
|
||||
|
||||
@@ -115,7 +115,7 @@ RenderableDebugPlane::RenderableDebugPlane(const ghoul::Dictionary& dictionary)
|
||||
_texture = p.texture.value_or(_texture);
|
||||
addProperty(_texture);
|
||||
|
||||
_size.setViewOption(properties::Property::ViewOptions::Logarithmic);
|
||||
_size.setExponent(15.f);
|
||||
_size.onChange([this](){ _planeIsDirty = true; });
|
||||
_size = p.size.value_or(_size);
|
||||
setBoundingSphere(_size);
|
||||
|
||||
@@ -33,23 +33,23 @@
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
#include <ghoul/filesystem/cachemanager.h>
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/misc/crc32.h>
|
||||
#include <ghoul/misc/templatefactory.h>
|
||||
#include <ghoul/font/fontmanager.h>
|
||||
#include <ghoul/font/fontrenderer.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/misc/crc32.h>
|
||||
#include <ghoul/misc/templatefactory.h>
|
||||
#include <ghoul/misc/profiling.h>
|
||||
#include <ghoul/opengl/openglstatecache.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
#include <ghoul/font/fontmanager.h>
|
||||
#include <ghoul/font/fontrenderer.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <glm/gtx/string_cast.hpp>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <cstdint>
|
||||
#include <locale>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
@@ -116,18 +116,11 @@ namespace {
|
||||
"The text size for the astronomical object labels."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelMinSizeInfo = {
|
||||
"TextMinSize",
|
||||
"Text Min Size",
|
||||
"The minimal size (in pixels) of the text for the labels for the astronomical "
|
||||
"objects being rendered."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
|
||||
"TextMaxSize",
|
||||
"Text Max Size",
|
||||
"The maximum size (in pixels) of the text for the labels for the astronomical "
|
||||
"objects being rendered."
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelMinMaxSizeInfo = {
|
||||
"TextMinMaxSize",
|
||||
"Text Min/Max Size",
|
||||
"The minimal and maximal size (in pixels) of the text for the labels for the "
|
||||
"astronomical objects being rendered."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = {
|
||||
@@ -178,48 +171,43 @@ namespace {
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo DisableFadeInInfo = {
|
||||
"DisableFadeIn",
|
||||
"Disable Fade-in effect",
|
||||
"Disable Fade-in Effect",
|
||||
"Enables/Disables the Fade-in effect."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo BillboardMaxSizeInfo = {
|
||||
"BillboardMaxSize",
|
||||
"Billboard Max Size in Pixels",
|
||||
"The max size (in pixels) for the billboard representing the astronomical "
|
||||
"object."
|
||||
constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = {
|
||||
"EnablePixelSizeControl",
|
||||
"Enable Pixel Size Control",
|
||||
"Enable pixel size control for rectangular projections. If set to true, the "
|
||||
"billboard size is restricted by the min/max size in pixels property."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo BillboardMinSizeInfo = {
|
||||
"BillboardMinSize",
|
||||
"Billboard Min Size in Pixels",
|
||||
"The min size (in pixels) for the billboard representing the astronomical "
|
||||
"object."
|
||||
constexpr openspace::properties::Property::PropertyInfo BillboardMinMaxSizeInfo = {
|
||||
"BillboardMinMaxSize",
|
||||
"Billboard Min/Max Size in Pixels",
|
||||
"The minimum and maximum size (in pixels) for the billboard representing the "
|
||||
"astronomical object."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo
|
||||
CorrectionSizeEndDistanceInfo = {
|
||||
CorrectionSizeEndDistanceInfo =
|
||||
{
|
||||
"CorrectionSizeEndDistance",
|
||||
"Distance in 10^X meters where correction size stops acting.",
|
||||
"Distance in 10^X meters where correction size stops acting",
|
||||
"Distance in 10^X meters where correction size stops acting."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo CorrectionSizeFactorInfo = {
|
||||
"CorrectionSizeFactor",
|
||||
"Control variable for distance size.",
|
||||
"Control variable for distance size",
|
||||
""
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = {
|
||||
"EnablePixelSizeControl",
|
||||
"Enable pixel size control.",
|
||||
"Enable pixel size control for rectangular projections."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo UseLinearFiltering = {
|
||||
"UseLinearFiltering",
|
||||
"Use Linear Filtering",
|
||||
"Determines whether the provided color map should be sampled nearest neighbor "
|
||||
"(=off) or linearly (=on"
|
||||
"(=off) or linearly (=on)"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo SetRangeFromData = {
|
||||
@@ -258,6 +246,8 @@ namespace {
|
||||
Gigaparsec [[codegen::key("Gpc")]],
|
||||
GigalightYears [[codegen::key("Gly")]]
|
||||
};
|
||||
// The unit used for all distances. Must match the unit of any
|
||||
// distances/positions in the data files
|
||||
std::optional<Unit> unit;
|
||||
|
||||
// [[codegen::verbatim(ScaleFactorInfo.description)]]
|
||||
@@ -289,11 +279,8 @@ namespace {
|
||||
// objects being rendered
|
||||
std::optional<std::string> labelFile;
|
||||
|
||||
// [[codegen::verbatim(LabelMinSizeInfo.description)]]
|
||||
std::optional<float> textMinSize;
|
||||
|
||||
// [[codegen::verbatim(LabelMaxSizeInfo.description)]]
|
||||
std::optional<float> textMaxSize;
|
||||
// [[codegen::verbatim(LabelMinMaxSizeInfo.description)]]
|
||||
std::optional<glm::ivec2> textMinMaxSize;
|
||||
|
||||
// [[codegen::verbatim(ColorOptionInfo.description)]]
|
||||
std::optional<std::vector<std::string>> colorOption;
|
||||
@@ -314,11 +301,8 @@ namespace {
|
||||
// [[codegen::verbatim(DisableFadeInInfo.description)]]
|
||||
std::optional<bool> disableFadeIn;
|
||||
|
||||
// [[codegen::verbatim(BillboardMaxSizeInfo.description)]]
|
||||
std::optional<float> billboardMaxSize;
|
||||
|
||||
// [[codegen::verbatim(BillboardMinSizeInfo.description)]]
|
||||
std::optional<float> billboardMinSize;
|
||||
// [[codegen::verbatim(BillboardMinMaxSizeInfo.description)]]
|
||||
std::optional<glm::vec2> billboardMinMaxSize;
|
||||
|
||||
// [[codegen::verbatim(CorrectionSizeEndDistanceInfo.description)]]
|
||||
std::optional<float> correctionSizeEndDistance;
|
||||
@@ -349,27 +333,34 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
|
||||
, _textColor(TextColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, _textOpacity(TextOpacityInfo, 1.f, 0.f, 1.f)
|
||||
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
|
||||
, _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
|
||||
, _textMaxSize(LabelMaxSizeInfo, 20.f, 0.5f, 100.f)
|
||||
, _textMinMaxSize(
|
||||
LabelMinMaxSizeInfo,
|
||||
glm::ivec2(8, 20),
|
||||
glm::ivec2(0),
|
||||
glm::ivec2(100)
|
||||
)
|
||||
, _drawElements(DrawElementsInfo, true)
|
||||
, _drawLabels(DrawLabelInfo, false)
|
||||
, _pixelSizeControl(PixelSizeControlInfo, false)
|
||||
, _colorOption(ColorOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _optionColorRangeData(OptionColorRangeInfo, glm::vec2(0.f))
|
||||
|
||||
, _datavarSizeOption(
|
||||
SizeOptionInfo,
|
||||
properties::OptionProperty::DisplayType::Dropdown
|
||||
)
|
||||
, _fadeInDistance(
|
||||
, _fadeInDistances(
|
||||
FadeInDistancesInfo,
|
||||
glm::vec2(0.f),
|
||||
glm::vec2(0.f),
|
||||
glm::vec2(100.f)
|
||||
)
|
||||
, _disableFadeInDistance(DisableFadeInInfo, true)
|
||||
, _billboardMaxSize(BillboardMaxSizeInfo, 400.f, 0.f, 1000.f)
|
||||
, _billboardMinSize(BillboardMinSizeInfo, 0.f, 0.f, 100.f)
|
||||
, _billboardMinMaxSize(
|
||||
BillboardMinMaxSizeInfo,
|
||||
glm::vec2(0.f, 400.f),
|
||||
glm::vec2(0.f),
|
||||
glm::vec2(1000.f)
|
||||
)
|
||||
, _correctionSizeEndDistance(CorrectionSizeEndDistanceInfo, 17.f, 12.f, 25.f)
|
||||
, _correctionSizeFactor(CorrectionSizeFactorInfo, 8.f, 0.f, 20.f)
|
||||
, _useLinearFiltering(UseLinearFiltering, false)
|
||||
@@ -441,6 +432,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
|
||||
|
||||
// @TODO (abock, 2021-01-31) I don't know why we only add this property if the
|
||||
// texture is given, but I think it's a bug
|
||||
// @TODO (emmbr, 2021-05-24) This goes for several properties in this renderable
|
||||
addProperty(_spriteTexturePath);
|
||||
}
|
||||
_hasSpriteTexture = p.texture.has_value();
|
||||
@@ -528,28 +520,28 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
|
||||
_textSize = p.textSize.value_or(_textSize);
|
||||
addProperty(_textSize);
|
||||
|
||||
_textMinSize = p.textMinSize.value_or(_textMinSize);
|
||||
addProperty(_textMinSize);
|
||||
|
||||
_textMaxSize = p.textMaxSize.value_or(_textMaxSize);
|
||||
addProperty(_textMaxSize);
|
||||
_textMinMaxSize = p.textMinMaxSize.value_or(_textMinMaxSize);
|
||||
_textMinMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_textMinMaxSize);
|
||||
}
|
||||
|
||||
_transformationMatrix = p.transformationMatrix.value_or(_transformationMatrix);
|
||||
|
||||
if (p.fadeInDistances.has_value()) {
|
||||
_fadeInDistance = *p.fadeInDistances;
|
||||
addProperty(_fadeInDistance);
|
||||
_fadeInDistances = *p.fadeInDistances;
|
||||
_fadeInDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_fadeInDistances);
|
||||
|
||||
_disableFadeInDistance = false;
|
||||
addProperty(_disableFadeInDistance);
|
||||
}
|
||||
|
||||
_billboardMaxSize = p.billboardMaxSize.value_or(_billboardMaxSize);
|
||||
addProperty(_billboardMaxSize);
|
||||
_pixelSizeControl = p.enablePixelSizeControl.value_or(_pixelSizeControl);
|
||||
addProperty(_pixelSizeControl);
|
||||
|
||||
_billboardMinSize = p.billboardMinSize.value_or(_billboardMinSize);
|
||||
addProperty(_billboardMinSize);
|
||||
_billboardMinMaxSize = p.billboardMinMaxSize.value_or(_billboardMinMaxSize);
|
||||
_billboardMinMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_billboardMinMaxSize);
|
||||
|
||||
_correctionSizeEndDistance =
|
||||
p.correctionSizeEndDistance.value_or(_correctionSizeEndDistance);
|
||||
@@ -560,11 +552,6 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di
|
||||
addProperty(_correctionSizeFactor);
|
||||
}
|
||||
|
||||
_pixelSizeControl = p.enablePixelSizeControl.value_or(_pixelSizeControl);
|
||||
if (p.enablePixelSizeControl.has_value()) {
|
||||
addProperty(_pixelSizeControl);
|
||||
}
|
||||
|
||||
_setRangeFromData.onChange([this]() {
|
||||
const int colorMapInUse =
|
||||
_hasColorMapFile ? _dataset.index(_colorOptionString) : 0;
|
||||
@@ -720,8 +707,11 @@ void RenderableBillboardsCloud::renderBillboards(const RenderData& data,
|
||||
glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix()
|
||||
)
|
||||
);
|
||||
_program->setUniform(_uniformCache.minBillboardSize, _billboardMinSize); // in pixels
|
||||
_program->setUniform(_uniformCache.maxBillboardSize, _billboardMaxSize); // in pixels
|
||||
|
||||
const float minBillboardSize = _billboardMinMaxSize.value().x; // in pixels
|
||||
const float maxBillboardSize = _billboardMinMaxSize.value().y; // in pixels
|
||||
_program->setUniform(_uniformCache.minBillboardSize, minBillboardSize);
|
||||
_program->setUniform(_uniformCache.maxBillboardSize, maxBillboardSize);
|
||||
_program->setUniform(_uniformCache.color, _pointColor);
|
||||
_program->setUniform(_uniformCache.alphaValue, _opacity);
|
||||
_program->setUniform(_uniformCache.scaleFactor, _scaleFactor);
|
||||
@@ -774,8 +764,8 @@ void RenderableBillboardsCloud::renderLabels(const RenderData& data,
|
||||
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
|
||||
labelInfo.orthoRight = orthoRight;
|
||||
labelInfo.orthoUp = orthoUp;
|
||||
labelInfo.minSize = static_cast<int>(_textMinSize);
|
||||
labelInfo.maxSize = static_cast<int>(_textMaxSize);
|
||||
labelInfo.minSize = _textMinMaxSize.value().x;
|
||||
labelInfo.maxSize = _textMinMaxSize.value().y;
|
||||
labelInfo.cameraPos = data.camera.positionVec3();
|
||||
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
|
||||
labelInfo.renderType = _renderOption;
|
||||
@@ -801,7 +791,7 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) {
|
||||
float fadeInVar = 1.f;
|
||||
if (!_disableFadeInDistance) {
|
||||
float distCamera = static_cast<float>(glm::length(data.camera.positionVec3()));
|
||||
const glm::vec2 fadeRange = _fadeInDistance;
|
||||
const glm::vec2 fadeRange = _fadeInDistances;
|
||||
const float a = static_cast<float>(
|
||||
1.f / ((fadeRange.y - fadeRange.x) * unitToMeter(_unit))
|
||||
);
|
||||
@@ -1136,7 +1126,7 @@ std::vector<float> RenderableBillboardsCloud::createDataSlice() {
|
||||
}
|
||||
}
|
||||
setBoundingSphere(maxRadius);
|
||||
_fadeInDistance.setMaxValue(glm::vec2(10.f * biggestCoord));
|
||||
_fadeInDistances.setMaxValue(glm::vec2(10.f * biggestCoord));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <openspace/properties/triggerproperty.h>
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
#include <openspace/properties/vector/ivec2property.h>
|
||||
#include <openspace/properties/vector/vec2property.h>
|
||||
#include <openspace/properties/vector/vec3property.h>
|
||||
#include <ghoul/opengl/ghoul_gl.h>
|
||||
@@ -111,18 +112,16 @@ private:
|
||||
properties::Vec3Property _textColor;
|
||||
properties::FloatProperty _textOpacity;
|
||||
properties::FloatProperty _textSize;
|
||||
properties::FloatProperty _textMinSize;
|
||||
properties::FloatProperty _textMaxSize;
|
||||
properties::IVec2Property _textMinMaxSize;
|
||||
properties::BoolProperty _drawElements;
|
||||
properties::BoolProperty _drawLabels;
|
||||
properties::BoolProperty _pixelSizeControl;
|
||||
properties::OptionProperty _colorOption;
|
||||
properties::Vec2Property _optionColorRangeData;
|
||||
properties::OptionProperty _datavarSizeOption;
|
||||
properties::Vec2Property _fadeInDistance;
|
||||
properties::Vec2Property _fadeInDistances;
|
||||
properties::BoolProperty _disableFadeInDistance;
|
||||
properties::FloatProperty _billboardMaxSize;
|
||||
properties::FloatProperty _billboardMinSize;
|
||||
properties::Vec2Property _billboardMinMaxSize;
|
||||
properties::FloatProperty _correctionSizeEndDistance;
|
||||
properties::FloatProperty _correctionSizeFactor;
|
||||
properties::BoolProperty _useLinearFiltering;
|
||||
@@ -135,7 +134,7 @@ private:
|
||||
ghoul::opengl::ProgramObject* _renderToPolygonProgram = nullptr;
|
||||
|
||||
UniformCache(
|
||||
cameraViewProjectionMatrix, modelMatrix, cameraPos, cameraLookup, renderOption,
|
||||
cameraViewProjectionMatrix, modelMatrix, cameraPos, cameraLookup, renderOption,
|
||||
minBillboardSize, maxBillboardSize, correctionSizeEndDistance,
|
||||
correctionSizeFactor, color, alphaValue, scaleFactor, up, right, fadeInValue,
|
||||
screenSize, spriteTexture, hasColormap, enabledRectSizeControl, hasDvarScaling
|
||||
|
||||
@@ -87,18 +87,11 @@ namespace {
|
||||
"objects being rendered."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelMinSizeInfo = {
|
||||
"TextMinSize",
|
||||
"Text Min Size",
|
||||
"The minimal size (in pixels) of the text for the labels for the astronomical "
|
||||
"objects being rendered."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelMaxSizeInfo = {
|
||||
"TextMaxSize",
|
||||
"Text Max Size",
|
||||
"The maximum size (in pixels) of the text for the labels for the astronomical "
|
||||
"objects being rendered."
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelMinMaxSizeInfo = {
|
||||
"TextMinMaxSize",
|
||||
"Text Min/Max Size",
|
||||
"The minimum and maximum size (in pixels) of the text for the labels for the "
|
||||
"astronomical objects being rendered."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = {
|
||||
@@ -162,11 +155,8 @@ namespace {
|
||||
// [[codegen::verbatim(LabelFileInfo.description)]]
|
||||
std::optional<std::string> labelFile;
|
||||
|
||||
// [[codegen::verbatim(LabelMinSizeInfo.description)]]
|
||||
std::optional<float> textMinSize;
|
||||
|
||||
// [[codegen::verbatim(LabelMaxSizeInfo.description)]]
|
||||
std::optional<float> textMaxSize;
|
||||
// [[codegen::verbatim(LabelMinMaxSizeInfo.description)]]
|
||||
std::optional<glm::ivec2> textMinMaxSize;
|
||||
|
||||
// [[codegen::verbatim(LineWidthInfo.description)]]
|
||||
std::optional<float> lineWidth;
|
||||
@@ -190,8 +180,12 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
||||
, _textSize(TextSizeInfo, 8.f, 0.5f, 24.f)
|
||||
, _drawElements(DrawElementsInfo, true)
|
||||
, _drawLabels(DrawLabelInfo, false)
|
||||
, _textMinSize(LabelMinSizeInfo, 8.f, 0.5f, 24.f)
|
||||
, _textMaxSize(LabelMaxSizeInfo, 500.f, 0.f, 1000.f)
|
||||
, _textMinMaxSize(
|
||||
LabelMinMaxSizeInfo,
|
||||
glm::ivec2(8, 500),
|
||||
glm::ivec2(0),
|
||||
glm::ivec2(1000)
|
||||
)
|
||||
, _lineWidth(LineWidthInfo, 2.f, 1.f, 16.f)
|
||||
, _renderOption(RenderOptionInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
{
|
||||
@@ -250,13 +244,13 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
||||
_lineWidth = p.lineWidth.value_or(_lineWidth);
|
||||
addProperty(_lineWidth);
|
||||
|
||||
_drawLabels = p.drawLabels.value_or(_drawLabels);
|
||||
addProperty(_drawLabels);
|
||||
|
||||
if (p.labelFile.has_value()) {
|
||||
_labelFile = absPath(*p.labelFile).string();
|
||||
_hasLabel = true;
|
||||
|
||||
_drawLabels = p.drawLabels.value_or(_drawLabels);
|
||||
addProperty(_drawLabels);
|
||||
|
||||
_textColor = p.textColor.value_or(_textColor);
|
||||
_hasLabel = p.textColor.has_value();
|
||||
_textColor.setViewOption(properties::Property::ViewOptions::Color);
|
||||
@@ -269,11 +263,9 @@ RenderableDUMeshes::RenderableDUMeshes(const ghoul::Dictionary& dictionary)
|
||||
_textSize = p.textSize.value_or(_textSize);
|
||||
addProperty(_textSize);
|
||||
|
||||
_textMinSize = p.textMinSize.value_or(_textMinSize);
|
||||
addProperty(_textMinSize);
|
||||
|
||||
_textMaxSize = p.textMaxSize.value_or(_textMaxSize);
|
||||
addProperty(_textMaxSize);
|
||||
_textMinMaxSize = p.textMinMaxSize.value_or(_textMinMaxSize);
|
||||
_textMinMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_textMinMaxSize);
|
||||
}
|
||||
|
||||
if (p.meshColor.has_value()) {
|
||||
@@ -417,8 +409,8 @@ void RenderableDUMeshes::renderLabels(const RenderData& data,
|
||||
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
|
||||
labelInfo.orthoRight = orthoRight;
|
||||
labelInfo.orthoUp = orthoUp;
|
||||
labelInfo.minSize = static_cast<int>(_textMinSize);
|
||||
labelInfo.maxSize = static_cast<int>(_textMaxSize);
|
||||
labelInfo.minSize = _textMinMaxSize.value().x;
|
||||
labelInfo.maxSize = _textMinMaxSize.value().y;
|
||||
labelInfo.cameraPos = data.camera.positionVec3();
|
||||
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
|
||||
labelInfo.renderType = _renderOption;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <openspace/properties/stringproperty.h>
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
#include <openspace/properties/vector/ivec2property.h>
|
||||
#include <openspace/properties/vector/vec3property.h>
|
||||
#include <ghoul/opengl/ghoul_gl.h>
|
||||
#include <ghoul/opengl/uniformcache.h>
|
||||
@@ -120,8 +121,7 @@ private:
|
||||
properties::FloatProperty _textSize;
|
||||
properties::BoolProperty _drawElements;
|
||||
properties::BoolProperty _drawLabels;
|
||||
properties::FloatProperty _textMinSize;
|
||||
properties::FloatProperty _textMaxSize;
|
||||
properties::IVec2Property _textMinMaxSize;
|
||||
properties::FloatProperty _lineWidth;
|
||||
|
||||
// DEBUG:
|
||||
|
||||
@@ -257,7 +257,7 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
|
||||
, _textSize(TextSizeInfo, 8.0, 0.5, 24.0)
|
||||
, _drawElements(DrawElementsInfo, true)
|
||||
, _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _fadeInDistance(
|
||||
, _fadeInDistances(
|
||||
FadeInDistancesInfo,
|
||||
glm::vec2(0.f),
|
||||
glm::vec2(0.f),
|
||||
@@ -374,9 +374,10 @@ RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary
|
||||
_sluminosity = p.scaleLuminosity.value_or(_sluminosity);
|
||||
|
||||
if (p.fadeInDistances.has_value()) {
|
||||
_fadeInDistance = *p.fadeInDistances;
|
||||
_fadeInDistances = *p.fadeInDistances;
|
||||
_disableFadeInDistance = false;
|
||||
addProperty(_fadeInDistance);
|
||||
_fadeInDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_fadeInDistances);
|
||||
addProperty(_disableFadeInDistance);
|
||||
}
|
||||
|
||||
@@ -556,7 +557,7 @@ void RenderablePlanesCloud::render(const RenderData& data, RendererTasks&) {
|
||||
if (!_disableFadeInDistance) {
|
||||
float distCamera = static_cast<float>(glm::length(data.camera.positionVec3()));
|
||||
distCamera = static_cast<float>(distCamera / scale);
|
||||
const glm::vec2 fadeRange = _fadeInDistance;
|
||||
const glm::vec2 fadeRange = _fadeInDistances;
|
||||
//const float a = 1.f / ((fadeRange.y - fadeRange.x) * scale);
|
||||
const float a = 1.f / ((fadeRange.y - fadeRange.x));
|
||||
const float b = -(fadeRange.x / (fadeRange.y - fadeRange.x));
|
||||
@@ -792,7 +793,7 @@ void RenderablePlanesCloud::createPlanes() {
|
||||
_dataIsDirty = false;
|
||||
|
||||
setBoundingSphere(maxRadius * _scaleFactor);
|
||||
_fadeInDistance.setMaxValue(glm::vec2(10.f * maxSize));
|
||||
_fadeInDistances.setMaxValue(glm::vec2(10.f * maxSize));
|
||||
}
|
||||
|
||||
if (_hasLabel && _labelDataIsDirty) {
|
||||
|
||||
@@ -115,7 +115,7 @@ private:
|
||||
properties::FloatProperty _textSize;
|
||||
properties::BoolProperty _drawElements;
|
||||
properties::OptionProperty _blendMode;
|
||||
properties::Vec2Property _fadeInDistance;
|
||||
properties::Vec2Property _fadeInDistances;
|
||||
properties::BoolProperty _disableFadeInDistance;
|
||||
properties::FloatProperty _planeMinSize;
|
||||
properties::OptionProperty _renderOption;
|
||||
|
||||
@@ -429,7 +429,7 @@ void createExoplanetSystem(const std::string& starName) {
|
||||
"Renderable = {"
|
||||
"Type = 'RenderableRadialGrid',"
|
||||
"Enabled = " + isCircleEnabledString + ","
|
||||
"OuterRadius = " + std::to_string(AU) + ","
|
||||
"Radii = { 0.0, 1.0 },"
|
||||
"CircleSegments = 64,"
|
||||
"LineWidth = 2.0,"
|
||||
"},"
|
||||
@@ -437,6 +437,10 @@ void createExoplanetSystem(const std::string& starName) {
|
||||
"Rotation = {"
|
||||
"Type = 'StaticRotation',"
|
||||
"Rotation = " + ghoul::to_string(meanOrbitPlaneRotationMatrix) + ""
|
||||
"},"
|
||||
"Scale = {"
|
||||
"Type = 'StaticScale',"
|
||||
"Scale = " + std::to_string(AU) + ""
|
||||
"}"
|
||||
"},"
|
||||
"GUI = {"
|
||||
|
||||
@@ -161,10 +161,10 @@ namespace {
|
||||
std::filesystem::path filename;
|
||||
glm::ivec3 dimensions;
|
||||
glm::vec3 size;
|
||||
|
||||
|
||||
// [[codegen::verbatim(NumberOfRayCastingStepsInfo.description)]]
|
||||
std::optional<float> steps;
|
||||
|
||||
|
||||
// [[codegen::verbatim(DownscaleVolumeRenderingInfo.description)]]
|
||||
std::optional<float> downscale;
|
||||
};
|
||||
@@ -227,7 +227,7 @@ RenderableGalaxy::RenderableGalaxy(const ghoul::Dictionary& dictionary)
|
||||
: Renderable(dictionary)
|
||||
, _volumeRenderingEnabled(VolumeRenderingEnabledInfo, true)
|
||||
, _starRenderingEnabled(StarRenderingEnabledInfo, true)
|
||||
, _stepSize(StepSizeInfo, 0.01f, 0.0005f, 0.05f, 0.001f)
|
||||
, _stepSize(StepSizeInfo, 0.01f, 0.001f, 0.05f, 0.001f)
|
||||
, _absorptionMultiply(AbsorptionMultiplyInfo, 40.f, 0.0f, 200.0f)
|
||||
, _emissionMultiply(EmissionMultiplyInfo, 200.f, 0.0f, 1000.0f)
|
||||
, _starRenderingMethod(
|
||||
|
||||
@@ -60,106 +60,86 @@ namespace {
|
||||
|
||||
constexpr int8_t CurrentCacheVersion = 1;
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsInfo = {
|
||||
"Labels",
|
||||
"Labels Enabled",
|
||||
"Enables and disables the rendering of labels on the globe surface from "
|
||||
"the csv label file"
|
||||
constexpr openspace::properties::Property::PropertyInfo EnabledInfo = {
|
||||
"Enabled",
|
||||
"Enabled",
|
||||
"Enables and disables labels' rendering."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsEnableInfo = {
|
||||
"Enable",
|
||||
"Enable",
|
||||
"Enables and disables labels' rendering from the asset file."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsFontSizeInfo = {
|
||||
"LabelsFontSize",
|
||||
"Labels Font Size",
|
||||
constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = {
|
||||
"FontSize",
|
||||
"Font Size",
|
||||
"Font size for the rendering labels. This is different fromt text size."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsMaxSizeInfo = {
|
||||
"LabelsMaxSize",
|
||||
"Labels Maximum Text Size",
|
||||
"Maximum label size"
|
||||
constexpr openspace::properties::Property::PropertyInfo MinMaxSizeInfo = {
|
||||
"MinMaxSize",
|
||||
"Min/Max Text Size",
|
||||
"Minimum and maximum label size, in pixels."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsMinSizeInfo = {
|
||||
"LabelsMinSize",
|
||||
"Labels Minimum Text Size",
|
||||
"Minimum label size"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsSizeInfo = {
|
||||
constexpr openspace::properties::Property::PropertyInfo SizeInfo = {
|
||||
"LabelsSize",
|
||||
"Labels Size",
|
||||
"Labels Size"
|
||||
"This value affects the size scale of the labels."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsMinHeightInfo = {
|
||||
"LabelsMinHeight",
|
||||
"Labels Minimum Height",
|
||||
"Labels Minimum Height"
|
||||
constexpr openspace::properties::Property::PropertyInfo HeightOffsetInfo = {
|
||||
"HeightOffset",
|
||||
"Height Offset",
|
||||
"This value moves the label away from the globe surface by the specified "
|
||||
"distance (in meters)."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsColorInfo = {
|
||||
"LabelsColor",
|
||||
"Labels Color",
|
||||
"Labels Color"
|
||||
constexpr openspace::properties::Property::PropertyInfo ColorInfo = {
|
||||
"Color",
|
||||
"Color",
|
||||
"The text color of the labels."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsOpacityInfo = {
|
||||
"LabelsOpacity",
|
||||
"Labels Opacity",
|
||||
"Labels Opacity"
|
||||
constexpr openspace::properties::Property::PropertyInfo OpacityInfo = {
|
||||
"Opacity",
|
||||
"Opacity",
|
||||
"The opacity of the labels."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo
|
||||
LabelsFadeInStartingDistanceInfo =
|
||||
{
|
||||
"FadeInStartingDistance",
|
||||
"Fade In Starting Distance for Labels",
|
||||
"Fade In Starting Distance for Labels"
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeDistancesInfo = {
|
||||
"FadeDistances",
|
||||
"Fade-In Distances",
|
||||
"The distances above the globe's surface at which the labels start fading in or "
|
||||
"out, given in meters. The final distances are also adjusted by the specified "
|
||||
"height offset."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo
|
||||
LabelsFadeOutStartingDistanceInfo =
|
||||
{
|
||||
"FadeOutStartingDistance",
|
||||
"Fade Out Starting Distance for Labels",
|
||||
"Fade Out Starting Distance for Labels"
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeInEnabledInfo = {
|
||||
"FadeInEnabled",
|
||||
"Fade In Enabled",
|
||||
"Sets whether the labels fade in when approaching the globe from a distance. If "
|
||||
"false, no fading happens and the labels immediately has full opacity."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsFadeInEnabledInfo = {
|
||||
"LabelsFadeInEnabled",
|
||||
"Labels fade In enabled",
|
||||
"Labels fade In enabled"
|
||||
constexpr openspace::properties::Property::PropertyInfo FadeOutEnabledInfo = {
|
||||
"FadeOutEnabled",
|
||||
"Fade Out Enabled",
|
||||
"Sets whether the labels fade out when approaching the surface of the globe. If "
|
||||
"false, no fading happens and the labels stays in full opacity."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsFadeOutEnabledInfo = {
|
||||
"LabelsFadeOutEnabled",
|
||||
"Labels fade Out enabled",
|
||||
"Labels fade Out enabled"
|
||||
constexpr openspace::properties::Property::PropertyInfo DisableCullingInfo = {
|
||||
"DisableCulling",
|
||||
"Culling Disabled",
|
||||
"Labels culling disabled."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo
|
||||
LabelsDisableCullingEnabledInfo =
|
||||
{
|
||||
"LabelsDisableCullingEnabled",
|
||||
"Labels culling disabled",
|
||||
"Labels culling disabled"
|
||||
constexpr openspace::properties::Property::PropertyInfo DistanceEPSInfo = {
|
||||
"DistanceEPS",
|
||||
"Culling Distance",
|
||||
"Labels culling distance from globe's center."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelsDistanceEPSInfo = {
|
||||
"LabelsDistanceEPS",
|
||||
"Labels culling distance from globe's center",
|
||||
"Labels culling distance from globe's center"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo LabelAlignmentOptionInfo = {
|
||||
"LabelAlignmentOption",
|
||||
"Label Alignment Option",
|
||||
constexpr openspace::properties::Property::PropertyInfo AlignmentOptionInfo = {
|
||||
"AlignmentOption",
|
||||
"Alignment Option",
|
||||
"Labels are aligned horizontally or circularly related to the planet."
|
||||
};
|
||||
|
||||
@@ -167,57 +147,48 @@ namespace {
|
||||
// The path to the labels file
|
||||
std::optional<std::filesystem::path> fileName;
|
||||
|
||||
// [[codegen::verbatim(LabelsInfo.description)]]
|
||||
std::optional<bool> labels;
|
||||
// [[codegen::verbatim(EnabledInfo.description)]]
|
||||
std::optional<bool> enabled;
|
||||
|
||||
// [[codegen::verbatim(LabelsEnableInfo.description)]]
|
||||
std::optional<bool> enable;
|
||||
// [[codegen::verbatim(FontSizeInfo.description)]]
|
||||
std::optional<float> fontSize;
|
||||
|
||||
// [[codegen::verbatim(LabelsFontSizeInfo.description)]]
|
||||
std::optional<float> labelsFontSize;
|
||||
// [[codegen::verbatim(MinMaxSizeInfo.description)]]
|
||||
std::optional<glm::ivec2> minMaxSize;
|
||||
|
||||
// [[codegen::verbatim(LabelsMinSizeInfo.description)]]
|
||||
std::optional<int> labelsMinSize;
|
||||
// [[codegen::verbatim(SizeInfo.description)]]
|
||||
std::optional<float> size;
|
||||
|
||||
// [[codegen::verbatim(LabelsMaxSizeInfo.description)]]
|
||||
std::optional<int> labelsMaxSize;
|
||||
// [[codegen::verbatim(HeightOffsetInfo.description)]]
|
||||
std::optional<float> heightOffset;
|
||||
|
||||
// [[codegen::verbatim(LabelsSizeInfo.description)]]
|
||||
std::optional<float> labelsSize;
|
||||
// [[codegen::verbatim(ColorInfo.description)]]
|
||||
std::optional<glm::vec3> color [[codegen::color()]];
|
||||
|
||||
// [[codegen::verbatim(LabelsMinHeightInfo.description)]]
|
||||
std::optional<float> labelsMinHeight;
|
||||
// [[codegen::verbatim(OpacityInfo.description)]]
|
||||
std::optional<float> opacity [[codegen::inrange(0.f, 1.f)]];
|
||||
|
||||
// [[codegen::verbatim(LabelsColorInfo.description)]]
|
||||
std::optional<glm::vec3> labelsColor [[codegen::color()]];
|
||||
// [[codegen::verbatim(FadeDistancesInfo.description)]]
|
||||
std::optional<glm::vec2> fadeDistances;
|
||||
|
||||
// [[codegen::verbatim(LabelsOpacityInfo.description)]]
|
||||
std::optional<float> labelsOpacity [[codegen::inrange(0.f, 1.f)]];
|
||||
// [[codegen::verbatim(FadeInEnabledInfo.description)]]
|
||||
std::optional<bool> fadeInEnabled;
|
||||
|
||||
// [[codegen::verbatim(LabelsFadeInStartingDistanceInfo.description)]]
|
||||
std::optional<float> fadeInStartingDistance;
|
||||
// [[codegen::verbatim(FadeOutEnabledInfo.description)]]
|
||||
std::optional<bool> fadeOutEnabled;
|
||||
|
||||
// [[codegen::verbatim(LabelsFadeOutStartingDistanceInfo.description)]]
|
||||
std::optional<float> fadeOutStartingDistance;
|
||||
// [[codegen::verbatim(DisableCullingInfo.description)]]
|
||||
std::optional<bool> disableCulling;
|
||||
|
||||
// [[codegen::verbatim(LabelsFadeInEnabledInfo.description)]]
|
||||
std::optional<bool> labelsFadeInEnabled;
|
||||
|
||||
// [[codegen::verbatim(LabelsFadeOutEnabledInfo.description)]]
|
||||
std::optional<bool> labelsFadeOutEnabled;
|
||||
|
||||
// [[codegen::verbatim(LabelsDisableCullingEnabledInfo.description)]]
|
||||
std::optional<bool> labelsDisableCullingEnabled;
|
||||
|
||||
// [[codegen::verbatim(LabelsDistanceEPSInfo.description)]]
|
||||
std::optional<float> labelsDistanceEPS;
|
||||
// [[codegen::verbatim(DistanceEPSInfo.description)]]
|
||||
std::optional<float> distanceEPS;
|
||||
|
||||
enum class Alignment {
|
||||
Horizontally,
|
||||
Circularly
|
||||
};
|
||||
// [[codegen::verbatim(LabelAlignmentOptionInfo.description)]]
|
||||
std::optional<Alignment> labelAlignmentOption;
|
||||
// [[codegen::verbatim(AlignmentOptionInfo.description)]]
|
||||
std::optional<Alignment> alignmentOption;
|
||||
};
|
||||
#include "globelabelscomponent_codegen.cpp"
|
||||
} // namespace
|
||||
@@ -230,49 +201,49 @@ documentation::Documentation GlobeLabelsComponent::Documentation() {
|
||||
|
||||
GlobeLabelsComponent::GlobeLabelsComponent()
|
||||
: properties::PropertyOwner({ "Labels" })
|
||||
, _labelsEnabled(LabelsInfo, false)
|
||||
, _labelsFontSize(LabelsFontSizeInfo, 30, 1, 300)
|
||||
, _labelsMaxSize(LabelsMaxSizeInfo, 300, 10, 1000)
|
||||
, _labelsMinSize(LabelsMinSizeInfo, 4, 1, 100)
|
||||
, _labelsSize(LabelsSizeInfo, 2.5, 0, 30)
|
||||
, _labelsMinHeight(LabelsMinHeightInfo, 100.0, 0.0, 10000.0)
|
||||
, _labelsColor(
|
||||
LabelsColorInfo,
|
||||
glm::vec3(1.f, 1.f, 0.f),
|
||||
glm::vec3(0.f),
|
||||
glm::vec3(1.f)
|
||||
, _enabled(EnabledInfo, false)
|
||||
, _fontSize(FontSizeInfo, 30, 1, 300)
|
||||
, _minMaxSize(MinMaxSizeInfo, glm::ivec2(1, 1000), glm::ivec2(1), glm::ivec2(1000))
|
||||
, _size(SizeInfo, 2.5, 0, 30)
|
||||
, _heightOffset(HeightOffsetInfo, 100.0, 0.0, 10000.0)
|
||||
, _color(ColorInfo, glm::vec3(1.f, 1.f, 0.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, _opacity(OpacityInfo, 1.f, 0.f, 1.f)
|
||||
, _fadeDistances(
|
||||
FadeDistancesInfo,
|
||||
glm::vec2(1e4, 1e6),
|
||||
glm::vec2(1.f),
|
||||
glm::vec2(1e8)
|
||||
)
|
||||
, _labelsOpacity(LabelsOpacityInfo, 1.f, 0.f, 1.f)
|
||||
, _labelsFadeInDist(LabelsFadeInStartingDistanceInfo, 1e6, 1e3, 1e8)
|
||||
, _labelsFadeOutDist(LabelsFadeOutStartingDistanceInfo, 1e4, 1, 1e7)
|
||||
, _labelsFadeInEnabled(LabelsFadeInEnabledInfo, false)
|
||||
, _labelsFadeOutEnabled(LabelsFadeOutEnabledInfo, false)
|
||||
, _labelsDisableCullingEnabled(LabelsDisableCullingEnabledInfo, false)
|
||||
, _labelsDistanceEPS(LabelsDistanceEPSInfo, 100000.f, 1000.f, 10000000.f)
|
||||
, _labelAlignmentOption(
|
||||
LabelAlignmentOptionInfo,
|
||||
, _fadeInEnabled(FadeInEnabledInfo, false)
|
||||
, _fadeOutEnabled(FadeOutEnabledInfo, false)
|
||||
, _disableCulling(DisableCullingInfo, false)
|
||||
, _distanceEPS(DistanceEPSInfo, 100000.f, 1000.f, 10000000.f)
|
||||
, _alignmentOption(
|
||||
AlignmentOptionInfo,
|
||||
properties::OptionProperty::DisplayType::Dropdown
|
||||
)
|
||||
{
|
||||
addProperty(_labelsEnabled);
|
||||
addProperty(_labelsFontSize);
|
||||
addProperty(_labelsSize);
|
||||
addProperty(_labelsMinHeight);
|
||||
_labelsColor.setViewOption(properties::Property::ViewOptions::Color);
|
||||
addProperty(_labelsColor);
|
||||
addProperty(_labelsOpacity);
|
||||
addProperty(_labelsFadeInDist);
|
||||
addProperty(_labelsFadeOutDist);
|
||||
addProperty(_labelsMinSize);
|
||||
addProperty(_labelsFadeInEnabled);
|
||||
addProperty(_labelsFadeOutEnabled);
|
||||
addProperty(_labelsDisableCullingEnabled);
|
||||
addProperty(_labelsDistanceEPS);
|
||||
addProperty(_enabled);
|
||||
addProperty(_fontSize);
|
||||
addProperty(_size);
|
||||
_minMaxSize.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_minMaxSize);
|
||||
addProperty(_color);
|
||||
addProperty(_opacity);
|
||||
_fadeDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
_fadeDistances.setExponent(3.f);
|
||||
addProperty(_fadeDistances);
|
||||
addProperty(_fadeInEnabled);
|
||||
addProperty(_fadeOutEnabled);
|
||||
addProperty(_heightOffset);
|
||||
_color.setViewOption(properties::Property::ViewOptions::Color);
|
||||
addProperty(_disableCulling);
|
||||
addProperty(_distanceEPS);
|
||||
|
||||
_labelAlignmentOption.addOption(Horizontally, "Horizontally");
|
||||
_labelAlignmentOption.addOption(Circularly, "Circularly");
|
||||
_labelAlignmentOption = Horizontally;
|
||||
addProperty(_labelAlignmentOption);
|
||||
_alignmentOption.addOption(Horizontally, "Horizontally");
|
||||
_alignmentOption.addOption(Circularly, "Circularly");
|
||||
_alignmentOption = Horizontally;
|
||||
addProperty(_alignmentOption);
|
||||
}
|
||||
|
||||
void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary,
|
||||
@@ -291,30 +262,28 @@ void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary,
|
||||
return;
|
||||
}
|
||||
|
||||
_labelsEnabled = p.enable.value_or(true);
|
||||
_labelsFontSize = p.labelsFontSize.value_or(_labelsFontSize);
|
||||
_labelsFontSize.onChange([this]() { initializeFonts(); });
|
||||
_labelsSize = p.labelsSize.value_or(_labelsSize);
|
||||
_labelsMinHeight = p.labelsMinHeight.value_or(_labelsMinHeight);
|
||||
_labelsColor = p.labelsColor.value_or(_labelsColor);
|
||||
_labelsOpacity = p.labelsOpacity.value_or(_labelsOpacity);
|
||||
_labelsFadeInEnabled = p.labelsFadeInEnabled.value_or(_labelsFadeInEnabled);
|
||||
_labelsFadeInDist = p.fadeInStartingDistance.value_or(_labelsFadeInDist);
|
||||
_labelsFadeOutEnabled = p.labelsFadeOutEnabled.value_or(_labelsFadeOutEnabled);
|
||||
_labelsFadeOutDist = p.fadeOutStartingDistance.value_or(_labelsFadeOutDist);
|
||||
_labelsMinSize = p.labelsMinSize.value_or(_labelsMinSize);
|
||||
_labelsMaxSize = p.labelsMaxSize.value_or(_labelsMaxSize);
|
||||
_labelsDisableCullingEnabled =
|
||||
p.labelsDisableCullingEnabled.value_or(_labelsDisableCullingEnabled);
|
||||
_labelsDistanceEPS = p.labelsDistanceEPS.value_or(_labelsDistanceEPS);
|
||||
_enabled = p.enabled.value_or(_enabled);
|
||||
_fontSize = p.fontSize.value_or(_fontSize);
|
||||
_fontSize.onChange([this]() { initializeFonts(); });
|
||||
_size = p.size.value_or(_size);
|
||||
_heightOffset = p.heightOffset.value_or(_heightOffset);
|
||||
_color = p.color.value_or(_color);
|
||||
_opacity = p.opacity.value_or(_opacity);
|
||||
_fadeInEnabled = p.fadeInEnabled.value_or(_fadeInEnabled);
|
||||
_fadeOutEnabled = p.fadeOutEnabled.value_or(_fadeOutEnabled);
|
||||
_fadeDistances = p.fadeDistances.value_or(_fadeDistances);
|
||||
_minMaxSize = p.minMaxSize.value_or(_minMaxSize);
|
||||
_disableCulling =
|
||||
p.disableCulling.value_or(_disableCulling);
|
||||
_distanceEPS = p.distanceEPS.value_or(_distanceEPS);
|
||||
|
||||
if (p.labelAlignmentOption.has_value()) {
|
||||
switch (*p.labelAlignmentOption) {
|
||||
if (p.alignmentOption.has_value()) {
|
||||
switch (*p.alignmentOption) {
|
||||
case Parameters::Alignment::Horizontally:
|
||||
_labelAlignmentOption = Horizontally;
|
||||
_alignmentOption = Horizontally;
|
||||
break;
|
||||
case Parameters::Alignment::Circularly:
|
||||
_labelAlignmentOption = Circularly;
|
||||
_alignmentOption = Circularly;
|
||||
break;
|
||||
default:
|
||||
throw ghoul::MissingCaseException();
|
||||
@@ -327,7 +296,7 @@ void GlobeLabelsComponent::initialize(const ghoul::Dictionary& dictionary,
|
||||
void GlobeLabelsComponent::initializeFonts() {
|
||||
_font = openspace::global::fontManager->font(
|
||||
"Mono",
|
||||
static_cast<float>(_labelsFontSize),
|
||||
static_cast<float>(_fontSize),
|
||||
ghoul::fontrendering::FontManager::Outline::Yes,
|
||||
ghoul::fontrendering::FontManager::LoadGlyphs::No
|
||||
);
|
||||
@@ -512,7 +481,7 @@ bool GlobeLabelsComponent::saveCachedFile(const std::string& file) const {
|
||||
}
|
||||
|
||||
void GlobeLabelsComponent::draw(const RenderData& data) {
|
||||
if (!_labelsEnabled) {
|
||||
if (!_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -524,18 +493,17 @@ void GlobeLabelsComponent::draw(const RenderData& data) {
|
||||
|
||||
glm::dvec3 globePosWorld =
|
||||
glm::dvec3(_globe->modelTransform() * glm::vec4(0.f, 0.f, 0.f, 1.f));
|
||||
glm::dvec3 camToGlobeDistanceWorld = globePosWorld - data.camera.positionVec3();
|
||||
double distanceCameraGlobeWorld = glm::length(camToGlobeDistanceWorld);
|
||||
glm::dvec3 cameraToGlobeWorld = globePosWorld - data.camera.positionVec3();
|
||||
double distanceCameraGlobeWorld = glm::length(cameraToGlobeWorld);
|
||||
|
||||
float varyingOpacity = 1.f;
|
||||
|
||||
double averageRadius = (
|
||||
_globe->ellipsoid().radii().x + _globe->ellipsoid().radii().y +
|
||||
_globe->ellipsoid().radii().z
|
||||
) / 3.0;
|
||||
if (_labelsFadeInEnabled) {
|
||||
glm::dvec2 fadeRange = glm::dvec2(averageRadius + _labelsMinHeight);
|
||||
fadeRange.x += _labelsFadeInDist;
|
||||
const glm::dvec3 globeRadii = _globe->ellipsoid().radii();
|
||||
double averageRadius = (globeRadii.x + globeRadii.y + globeRadii.z) / 3.0;
|
||||
|
||||
if (_fadeInEnabled) {
|
||||
glm::dvec2 fadeRange = glm::dvec2(averageRadius + _heightOffset);
|
||||
fadeRange.x += _fadeDistances.value().y;
|
||||
double a = 1.0 / (fadeRange.y - fadeRange.x);
|
||||
double b = -(fadeRange.x / (fadeRange.y - fadeRange.x));
|
||||
double funcValue = a * distanceCameraGlobeWorld + b;
|
||||
@@ -546,11 +514,11 @@ void GlobeLabelsComponent::draw(const RenderData& data) {
|
||||
}
|
||||
}
|
||||
|
||||
if (_labelsFadeOutEnabled) {
|
||||
if (_fadeOutEnabled) {
|
||||
glm::dvec2 fadeRange = glm::dvec2(
|
||||
averageRadius + _labelsMinHeight + LabelFadeOutLimitAltitudeMeters
|
||||
averageRadius + _heightOffset + LabelFadeOutLimitAltitudeMeters
|
||||
);
|
||||
fadeRange.x += _labelsFadeOutDist;
|
||||
fadeRange.x += _fadeDistances.value().x;
|
||||
double a = 1.0 / (fadeRange.x - fadeRange.y);
|
||||
double b = -(fadeRange.y / (fadeRange.x - fadeRange.y));
|
||||
double funcValue = a * distanceCameraGlobeWorld + b;
|
||||
@@ -569,8 +537,8 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data,
|
||||
float distToCamera, float fadeInVariable
|
||||
) {
|
||||
glm::vec4 textColor = glm::vec4(
|
||||
glm::vec3(_labelsColor),
|
||||
_labelsOpacity * fadeInVariable
|
||||
glm::vec3(_color),
|
||||
_opacity * fadeInVariable
|
||||
);
|
||||
|
||||
glm::dmat4 VP = glm::dmat4(data.camera.sgctInternal.projectionMatrix()) *
|
||||
@@ -604,11 +572,11 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data,
|
||||
double distanceCameraToLabelWorld =
|
||||
glm::length(locationPositionWorld - data.camera.positionVec3());
|
||||
|
||||
if (_labelsDisableCullingEnabled ||
|
||||
((distToCamera > (distanceCameraToLabelWorld + _labelsDistanceEPS)) &&
|
||||
if (_disableCulling ||
|
||||
((distToCamera > (distanceCameraToLabelWorld + _distanceEPS)) &&
|
||||
isLabelInFrustum(VP, locationPositionWorld)))
|
||||
{
|
||||
if (_labelAlignmentOption == Circularly) {
|
||||
if (_alignmentOption == Circularly) {
|
||||
glm::dvec3 labelNormalObj = glm::dvec3(
|
||||
invModelMatrix * glm::dvec4(data.camera.positionVec3(), 1.0)
|
||||
) - glm::dvec3(position);
|
||||
@@ -629,18 +597,19 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data,
|
||||
orthoUp = glm::normalize(glm::cross(labelNormalObj, orthoRight));
|
||||
}
|
||||
|
||||
position += _labelsMinHeight;
|
||||
// Move the position along the normal. Note that position is in model space
|
||||
position += _heightOffset.value() * glm::normalize(position);
|
||||
|
||||
ghoul::fontrendering::FontRenderer::ProjectedLabelsInformation labelInfo;
|
||||
labelInfo.orthoRight = orthoRight;
|
||||
labelInfo.orthoUp = orthoUp;
|
||||
labelInfo.minSize = _labelsMinSize;
|
||||
labelInfo.maxSize = _labelsMaxSize;
|
||||
labelInfo.minSize = _minMaxSize.value().x;
|
||||
labelInfo.maxSize = _minMaxSize.value().y;
|
||||
labelInfo.cameraPos = data.camera.positionVec3();
|
||||
labelInfo.cameraLookUp = data.camera.lookUpVectorWorldSpace();
|
||||
labelInfo.renderType = 0;
|
||||
labelInfo.mvpMatrix = modelViewProjectionMatrix;
|
||||
labelInfo.scale = powf(2.f, _labelsSize);
|
||||
labelInfo.scale = powf(2.f, _size);
|
||||
labelInfo.enableDepth = true;
|
||||
labelInfo.enableFalseDepth = true;
|
||||
labelInfo.disableTransmittance = true;
|
||||
@@ -667,7 +636,6 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data,
|
||||
bool GlobeLabelsComponent::isLabelInFrustum(const glm::dmat4& MVMatrix,
|
||||
const glm::dvec3& position) const
|
||||
{
|
||||
|
||||
// Frustum Planes
|
||||
glm::dvec3 col1(MVMatrix[0][0], MVMatrix[1][0], MVMatrix[2][0]);
|
||||
glm::dvec3 col2(MVMatrix[0][1], MVMatrix[1][1], MVMatrix[2][1]);
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
#include <openspace/properties/scalar/intproperty.h>
|
||||
#include <openspace/properties/vector/ivec2property.h>
|
||||
#include <openspace/properties/vector/vec2property.h>
|
||||
#include <openspace/properties/vector/vec3property.h>
|
||||
#include <ghoul/font/fontrenderer.h>
|
||||
#include <ghoul/glm.h>
|
||||
@@ -82,21 +84,21 @@ private:
|
||||
std::vector<LabelEntry> labelsArray;
|
||||
};
|
||||
|
||||
properties::BoolProperty _labelsEnabled;
|
||||
properties::FloatProperty _labelsFontSize;
|
||||
properties::IntProperty _labelsMaxSize;
|
||||
properties::IntProperty _labelsMinSize;
|
||||
properties::FloatProperty _labelsSize;
|
||||
properties::FloatProperty _labelsMinHeight;
|
||||
properties::Vec3Property _labelsColor;
|
||||
properties::FloatProperty _labelsOpacity;
|
||||
properties::FloatProperty _labelsFadeInDist;
|
||||
properties::FloatProperty _labelsFadeOutDist;
|
||||
properties::BoolProperty _labelsFadeInEnabled;
|
||||
properties::BoolProperty _labelsFadeOutEnabled;
|
||||
properties::BoolProperty _labelsDisableCullingEnabled;
|
||||
properties::FloatProperty _labelsDistanceEPS;
|
||||
properties::OptionProperty _labelAlignmentOption;
|
||||
properties::BoolProperty _enabled;
|
||||
properties::FloatProperty _fontSize;
|
||||
properties::FloatProperty _size;
|
||||
properties::IVec2Property _minMaxSize;
|
||||
properties::FloatProperty _heightOffset;
|
||||
|
||||
properties::Vec3Property _color;
|
||||
properties::FloatProperty _opacity;
|
||||
|
||||
properties::Vec2Property _fadeDistances;
|
||||
properties::BoolProperty _fadeInEnabled;
|
||||
properties::BoolProperty _fadeOutEnabled;
|
||||
properties::BoolProperty _disableCulling;
|
||||
properties::FloatProperty _distanceEPS;
|
||||
properties::OptionProperty _alignmentOption;
|
||||
|
||||
Labels _labels;
|
||||
|
||||
|
||||
@@ -122,10 +122,10 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo OffsetInfo = {
|
||||
"Offset",
|
||||
"Offset",
|
||||
"This value is used to limit the width of the rings.Each of the two values is a "
|
||||
"value between 0 and 1, where 0 is the center of the ring and 1 is the maximum "
|
||||
"extent at the radius. If this value is, for example {0.5, 1.0}, the ring is "
|
||||
"only shown between radius/2 and radius. It defaults to {0.0, 1.0}."
|
||||
"This value is used to limit the width of the rings. Each of the two values is "
|
||||
"a value between 0 and 1, where 0 is the center of the ring and 1 is the "
|
||||
"maximum extent at the radius. For example, if the value is {0.5, 1.0}, the "
|
||||
"ring is only shown between radius/2 and radius. It defaults to {0.0, 1.0}."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo NightFactorInfo = {
|
||||
@@ -249,7 +249,7 @@ void RingsComponent::initialize() {
|
||||
|
||||
addProperty(_enabled);
|
||||
|
||||
_size.setViewOption(properties::Property::ViewOptions::Logarithmic);
|
||||
_size.setExponent(15.f);
|
||||
_size = p.size.value_or(_size);
|
||||
_size.onChange([&]() { _planeIsDirty = true; });
|
||||
addProperty(_size);
|
||||
@@ -305,6 +305,7 @@ void RingsComponent::initialize() {
|
||||
}
|
||||
|
||||
_offset = p.offset.value_or(_offset);
|
||||
_offset.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_offset);
|
||||
|
||||
_nightFactor = p.nightFactor.value_or(_nightFactor);
|
||||
|
||||
@@ -136,6 +136,7 @@ RenderableHabitableZone::RenderableHabitableZone(const ghoul::Dictionary& dictio
|
||||
// The user should not be able to change this property. It's just used to communicate
|
||||
// the different rendering that happens outside of this interval
|
||||
addProperty(_kopparapuTeffInterval);
|
||||
_kopparapuTeffInterval.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
_kopparapuTeffInterval.setReadOnly(true);
|
||||
|
||||
// Make parent's size related properties read only. We want to set them based on the
|
||||
|
||||
@@ -60,10 +60,10 @@ namespace {
|
||||
constexpr openspace::properties::Property::PropertyInfo OffsetInfo = {
|
||||
"Offset",
|
||||
"Offset",
|
||||
"This value is used to limit the width of the rings.Each of the two values is a "
|
||||
"value between 0 and 1, where 0 is the center of the ring and 1 is the maximum "
|
||||
"extent at the radius. If this value is, for example {0.5, 1.0}, the ring is "
|
||||
"only shown between radius/2 and radius. It defaults to {0.0, 1.0}."
|
||||
"This value is used to limit the width of the rings. Each of the two values is "
|
||||
"a value between 0 and 1, where 0 is the center of the ring and 1 is the "
|
||||
"maximum extent at the radius. For example, if the value is {0.5, 1.0}, the "
|
||||
"ring is only shown between radius/2 and radius. It defaults to {0.0, 1.0}."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo NightFactorInfo = {
|
||||
@@ -127,6 +127,7 @@ RenderableRings::RenderableRings(const ghoul::Dictionary& dictionary)
|
||||
_textureFile = std::make_unique<File>(_texturePath.value());
|
||||
|
||||
_offset = p.offset.value_or(_offset);
|
||||
_offset.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_offset);
|
||||
|
||||
_texturePath.onChange([&]() { loadTexture(); });
|
||||
|
||||
@@ -511,7 +511,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
|
||||
, _userProvidedTextureOwner(UserProvidedTextureOptionInfo)
|
||||
, _parametersOwner(ParametersOwnerOptionInfo)
|
||||
, _moffatMethodOwner(MoffatMethodOptionInfo)
|
||||
, _fadeInDistance(
|
||||
, _fadeInDistances(
|
||||
FadeInDistancesInfo,
|
||||
glm::vec2(0.f),
|
||||
glm::vec2(0.f),
|
||||
@@ -617,6 +617,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
|
||||
_otherDataOption.onChange([&]() { _dataIsDirty = true; });
|
||||
addProperty(_otherDataOption);
|
||||
|
||||
_otherDataRange.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_otherDataRange);
|
||||
|
||||
addProperty(_otherDataColorMapPath);
|
||||
@@ -727,9 +728,10 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary)
|
||||
|
||||
if (p.fadeInDistances.has_value()) {
|
||||
glm::vec2 v = *p.fadeInDistances;
|
||||
_fadeInDistance = v;
|
||||
_fadeInDistances = v;
|
||||
_disableFadeInDistance = false;
|
||||
addProperty(_fadeInDistance);
|
||||
_fadeInDistances.setViewOption(properties::Property::ViewOptions::MinMaxRange);
|
||||
addProperty(_fadeInDistances);
|
||||
addProperty(_disableFadeInDistance);
|
||||
}
|
||||
}
|
||||
@@ -1034,7 +1036,7 @@ void RenderableStars::render(const RenderData& data, RendererTasks&) {
|
||||
float fadeInVariable = 1.f;
|
||||
if (!_disableFadeInDistance) {
|
||||
float distCamera = static_cast<float>(glm::length(data.camera.positionVec3()));
|
||||
const glm::vec2 fadeRange = _fadeInDistance;
|
||||
const glm::vec2 fadeRange = _fadeInDistances;
|
||||
const double a = 1.f / ((fadeRange.y - fadeRange.x) * PARSEC);
|
||||
const double b = -(fadeRange.x / (fadeRange.y - fadeRange.x));
|
||||
const double funcValue = a * distCamera + b;
|
||||
|
||||
@@ -125,7 +125,7 @@ private:
|
||||
properties::PropertyOwner _userProvidedTextureOwner;
|
||||
properties::PropertyOwner _parametersOwner;
|
||||
properties::PropertyOwner _moffatMethodOwner;
|
||||
properties::Vec2Property _fadeInDistance;
|
||||
properties::Vec2Property _fadeInDistances;
|
||||
properties::BoolProperty _disableFadeInDistance;
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _program;
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace {
|
||||
constexpr const char* MetaDataKeyReadOnly = "isReadOnly";
|
||||
constexpr const char* MetaDataKeyViewOptions = "ViewOptions";
|
||||
constexpr const char* MetaDataKeyVisibility = "Visibility";
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace openspace::properties {
|
||||
@@ -44,7 +43,7 @@ Property::OnChangeHandle Property::OnChangeHandleAll =
|
||||
std::numeric_limits<OnChangeHandle>::max();
|
||||
|
||||
const char* Property::ViewOptions::Color = "Color";
|
||||
const char* Property::ViewOptions::Logarithmic = "Logarithmic";
|
||||
const char* Property::ViewOptions::MinMaxRange = "MinMaxRange";
|
||||
|
||||
const char* Property::IdentifierKey = "Identifier";
|
||||
const char* Property::NameKey = "Name";
|
||||
@@ -55,7 +54,6 @@ const char* Property::MetaDataKey = "MetaData";
|
||||
const char* Property::AdditionalDataKey = "AdditionalData";
|
||||
|
||||
|
||||
|
||||
std::string sanitizeString(const std::string& s) {
|
||||
std::string result;
|
||||
|
||||
|
||||
@@ -447,6 +447,7 @@ SceneGraphNode::SceneGraphNode()
|
||||
_overrideBoundingSphere = std::nullopt;
|
||||
}
|
||||
});
|
||||
_boundingSphere.setExponent(10.f);
|
||||
addProperty(_boundingSphere);
|
||||
_interactionSphere.onChange([this]() {
|
||||
if (_interactionSphere >= 0.0) {
|
||||
@@ -456,6 +457,7 @@ SceneGraphNode::SceneGraphNode()
|
||||
_overrideInteractionSphere = std::nullopt;
|
||||
}
|
||||
});
|
||||
_interactionSphere.setExponent(10.f);
|
||||
addProperty(_interactionSphere);
|
||||
addProperty(_showDebugSphere);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user