mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 12:59:07 -06:00
94 lines
3.5 KiB
Plaintext
94 lines
3.5 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",
|
|
"openspace.setInteractionMode('GlobeBrowsing')" ..
|
|
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.printInfo("Setting default values")
|
|
|
|
openspace.setPropertyValue("MilkyWay.renderable.Transparency", 0.55)
|
|
openspace.setPropertyValue("MilkyWay.renderable.Segments", 50)
|
|
|
|
openspace.setPropertyValue("Sun.renderable.Enabled", true)
|
|
openspace.setPropertyValue("SunGlare.renderable.Enabled", false)
|
|
openspace.setPropertyValue("SunMarker.renderable.Enabled", false)
|
|
|
|
openspace.setPropertyValue("Earth.RenderableGlobe.Atmosphere", true)
|
|
openspace.setPropertyValue("Earth.RenderableGlobe.Debug.LevelByProjectedAreaElseDistance", false)
|
|
openspace.setPropertyValue("Earth.RenderableGlobe.Layers.ColorLayers.BlendTileLevels", true)
|
|
|
|
openspace.globebrowsing.goToGeo(0, 0, 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 = {
|
|
"lodglobes",
|
|
"sun",
|
|
"stars",
|
|
"milkyway",
|
|
-- "satellites"
|
|
}
|
|
}
|
|
|