mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 20:21:24 -06:00
126 lines
4.5 KiB
Plaintext
126 lines
4.5 KiB
Plaintext
-- Add folders to this list that contain .info files describing HiRISE patches
|
|
local mars_folders = {
|
|
-- Add a folder here whose contents will be automatically added to the Mars globe
|
|
-- If multiple folders are added, the results will be added sequentially, meaning that
|
|
-- if areas overlap (for example CTX and HiRISE) and CTX is specified *after* HiRISE,
|
|
-- CTX will stomp over the HiRISE
|
|
--
|
|
-- tl;dr: Specify CTX folders first, then HiRISE
|
|
}
|
|
|
|
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")
|
|
|
|
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")
|
|
|
|
-- Add the CTX and HiRISE patches described at the top of this file
|
|
for _, file in pairs(mars_folders) do
|
|
openspace.globebrowsing.addBlendingLayersFromDirectory(file, "Mars")
|
|
end
|
|
end
|
|
|
|
|
|
return {
|
|
ScenePath = ".",
|
|
CommonFolder = "common",
|
|
Camera = {
|
|
Focus = "Earth",
|
|
Position = {0, 0, 0},
|
|
Rotation = {0.758797, 0.221490, -0.605693, -0.091135},
|
|
},
|
|
Assets = {
|
|
"sun",
|
|
--"mercury",
|
|
--"venus",
|
|
"earth",
|
|
"moon",
|
|
"mars",
|
|
"jupiter",
|
|
"saturn",
|
|
"uranus",
|
|
"neptune",
|
|
"stars/digitaluniverse",
|
|
-- "stars/denver",
|
|
"milkyway/digitaluniverse",
|
|
--"milkyway/eso",
|
|
-- "satellites"
|
|
"constellationbounds",
|
|
"grids"
|
|
}
|
|
}
|
|
|