diff --git a/data/assets/mas.scene b/data/assets/mas.scene index 39aefefb95..a584c5ba21 100644 --- a/data/assets/mas.scene +++ b/data/assets/mas.scene @@ -18,6 +18,7 @@ asset.require('util/default_keybindings') local sunAsset = asset.require('scene/solarsystem/sun/sun') -- local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') local masMhdAsset = asset.require('scene/solarsystem/model/mas/mas') +local testSphere = asset.require('scene/solarsystem/model/mas/testsphere') -- This causes crash because the renderable is not removed properly before the next frame local toggleMas = function () @@ -42,8 +43,8 @@ local Keybindings = { }, { Key = "F9", - Command = "openspace.setPropertyValueSingle('Scene.SunGlare.renderable.Enabled', false);", - Documentation = "Turn off sun glare", + Command = propertyHelper.invert('Scene.SunGlare.renderable.Enabled'), + Documentation = "Toggle sun glare", Local = false }, { @@ -59,6 +60,8 @@ asset.onInitialize(function () openspace.time.setTime(openspace.time.currentWallTime()) sceneHelper.bindKeys(Keybindings) + openspace.setPropertyValueSingle('Scene.SunGlare.renderable.Enabled', false); + openspace.setDefaultGuiSorting() -- openspace.globebrowsing.loadWMSServersFromFile( @@ -66,7 +69,7 @@ asset.onInitialize(function () -- ) openspace.markInterestingNodes({ - "Mas_MHD" + "Mas_MHD", "TestSphere" }) openspace.addVirtualProperty( @@ -91,7 +94,7 @@ asset.onDeinitialize(function () sceneHelper.unbindKeys(Keybindings) openspace.removeInterestingNodes({ - "Mas_MHD" + "Mas_MHD", "TestSphere" }) openspace.removeVirtualProperty("*Trail.renderable.Enabled") diff --git a/data/assets/scene/solarsystem/model/mas/testsphere.asset b/data/assets/scene/solarsystem/model/mas/testsphere.asset new file mode 100644 index 0000000000..a2a31af65c --- /dev/null +++ b/data/assets/scene/solarsystem/model/mas/testsphere.asset @@ -0,0 +1,43 @@ +local assetHelper = asset.require("util/asset_helper") +local sunTransforms = asset.require('scene/solarsystem/sun/transforms') +asset.require("spice/base") + +local textures = asset.syncedResource({ + Name = "Background Radiation Textures", + Type = "HttpSynchronization", + Identifier = "digitaluniverse_backgroundradiation_textures", + Version = 1 +}) + +local TestSphere = { + Identifier = "TestSphere", + Parent = sunTransforms.SolarSystemBarycenter.Identifier, + Renderable = { + Type = "RenderableSphere", + Enabled = true, + Size = 1.2E9, + Segments = 80, + Opacity = 1.0, + Texture = textures .. "/wmap_ilc_7yr_v4_200uK_RGB_sos.png", + Orientation = "Outside", + FadeInThreshould = 0.1 + }, + Transform = { + Translation = { + Type = "SpiceTranslation", + Target = "SUN", + Observer = "SUN" + } + -- Scale = { + -- Type = "StaticScale", + -- Scale = 0.04 * sunRadius + -- } + }, + GUI = { + Path = "/Solar System/Mas/TestSphere", + Hidden = false + } +} + +assetHelper.registerSceneGraphNodesAndExport(asset, { TestSphere }) +