Add a test sphere to mas scene

This commit is contained in:
Jonathan Grangien
2018-05-16 13:30:05 -04:00
committed by Matthias Berg
parent f75590f8c6
commit abe5cf0fc5
2 changed files with 50 additions and 4 deletions

View File

@@ -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")

View File

@@ -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 })