mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-18 01:41:29 -06:00
115 lines
4.0 KiB
Plaintext
115 lines
4.0 KiB
Plaintext
function preInitialization()
|
|
--[[
|
|
The scripts in this function are executed after the scene is loaded but before the
|
|
scene elements have been initialized, thus they should be used to set the time at
|
|
which the scene should start and other settings that might determine initialization
|
|
critical objects.
|
|
]]--
|
|
|
|
openspace.spice.loadKernel("${SPICE}/naif0012.tls")
|
|
openspace.spice.loadKernel("${SPICE}/pck00010.tpc")
|
|
|
|
-- For unit test
|
|
--openspace.time.setTime("2016 SEP 8 23:00:00.500")
|
|
--openspace.time.togglePause()
|
|
|
|
openspace.time.setTime(openspace.time.currentWallTime())
|
|
dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua'))
|
|
|
|
|
|
-- Toggle night texture, shading, atmosphere and water
|
|
openspace.bindKey("s",
|
|
helper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
|
|
helper.property.invert('Earth.RenderableGlobe.PerformShading') ..
|
|
helper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
|
|
helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled'),
|
|
"Toggle night texture, shading, atmosphere, and water for Earth."
|
|
)
|
|
|
|
-- Toggle background
|
|
openspace.bindKey("b",
|
|
helper.property.invert('MilkyWay.renderable.Enabled') ..
|
|
helper.property.invert('Stars.renderable.Enabled'),
|
|
"Toggle background (Stars and Milkyway)."
|
|
)
|
|
|
|
openspace.bindKey("g",
|
|
helper.property.invert('MilkyWay.renderable.Enabled') ..
|
|
helper.property.invert('Stars.renderable.Enabled') ..
|
|
helper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
|
|
helper.property.invert('Earth.RenderableGlobe.PerformShading') ..
|
|
helper.property.invert('Mars.RenderableGlobe.PerformShading') ..
|
|
helper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
|
|
helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
|
|
helper.property.invert('Moon.RenderableGlobe.Enabled') ..
|
|
helper.property.invert('Sun.renderable.Enabled'),
|
|
"Toogles background and shading mode on the Earth and Mars alongside visibility of the Moon and the Sun"
|
|
)
|
|
|
|
openspace.bindKey("h",
|
|
"openspace.setPropertyValue('*Trail.renderable.Enabled', false)",
|
|
"Disables visibility of the trails"
|
|
)
|
|
end
|
|
|
|
function postInitialization()
|
|
openspace.addVirtualProperty(
|
|
"BoolProperty",
|
|
"Show Trails",
|
|
"*Trail.renderable.Enabled",
|
|
"Disable or enable all trails of the scene at the same time",
|
|
true,
|
|
nil,
|
|
nil
|
|
)
|
|
|
|
openspace.printInfo("Setting default values")
|
|
|
|
openspace.setPropertyValue("SunGlare.renderable.Enabled", false)
|
|
openspace.setPropertyValue("SunMarker.renderable.Enabled", false)
|
|
|
|
openspace.setPropertyValue("Constellation Bounds.renderable.Enabled", false)
|
|
|
|
openspace.setPropertyValue("Earth.RenderableGlobe.Atmosphere", true)
|
|
openspace.setPropertyValue("Earth.RenderableGlobe.Debug.LevelByProjectedAreaElseDistance", false)
|
|
|
|
openspace.setPropertyValue("Ecliptic Grid.renderable.Enabled", false)
|
|
openspace.setPropertyValue("Equatorial Grid.renderable.Enabled", false)
|
|
openspace.setPropertyValue("Galactic Grid.renderable.Enabled", false)
|
|
|
|
openspace.globebrowsing.goToGeo(58.5877, 16.1924, 20000000)
|
|
|
|
openspace.printInfo("Done setting default values")
|
|
end
|
|
|
|
|
|
return {
|
|
ScenePath = ".",
|
|
CommonFolder = "common",
|
|
Camera = {
|
|
Focus = "Earth",
|
|
Position = {0, 0, 0},
|
|
Rotation = {0.758797, 0.221490, -0.605693, -0.091135},
|
|
},
|
|
Modules = {
|
|
"sun",
|
|
"mercury",
|
|
"venus",
|
|
"earth",
|
|
"moon",
|
|
"mars",
|
|
"jupiter",
|
|
"saturn",
|
|
"uranus",
|
|
"neptune",
|
|
"stars/digitaluniverse",
|
|
-- "stars/denver",
|
|
"milkyway/digitaluniverse",
|
|
--"milkyway/eso",
|
|
-- "satellites"
|
|
"constellationbounds",
|
|
"grids"
|
|
}
|
|
}
|
|
|