mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-17 09:21:00 -06:00
139 lines
4.8 KiB
Plaintext
139 lines
4.8 KiB
Plaintext
KernelCase = 2 -- Right now we only have the image times for case 2
|
|
|
|
dofile(openspace.absPath('${SCRIPTS}/scene_helper.lua'))
|
|
|
|
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")
|
|
|
|
--local startTime = "2019 APR 16 12:03:00.00"
|
|
openspace.time.setTime("2016 SEP 8 23:00:00.500")
|
|
|
|
-- Load the common helper functions
|
|
dofile(openspace.absPath('${SCRIPTS}/common.lua'))
|
|
dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua'))
|
|
|
|
-- Set focuses
|
|
openspace.bindKey(
|
|
"a",
|
|
"openspace.setPropertyValue('Interaction.origin', 'OsirisRex')",
|
|
"Sets the focus of the camera on 'Osiris Rex'."
|
|
)
|
|
openspace.bindKey(
|
|
"s",
|
|
"openspace.setPropertyValue('Interaction.origin', 'BennuBarycenter')",
|
|
"Sets the focus of the camera on 'Bennu'."
|
|
)
|
|
|
|
openspace.bindKey(
|
|
"F6" ,
|
|
"openspace.printInfo('Set time: Launch');openspace.time.setTime('2016 SEP 08 23:05:00');",
|
|
"Sets the time to the launch."
|
|
)
|
|
openspace.bindKey(
|
|
"F7",
|
|
"openspace.printInfo('Set time: Gravity Assist');openspace.time.setTime('2017 SEP 22 15:00:00');",
|
|
"Sets the time to the Earth gravity assist."
|
|
)
|
|
openspace.bindKey(
|
|
"F8",
|
|
"openspace.printInfo('Set time: Approach');openspace.time.setTime('2018-SEP-11 21:31:01.183');",
|
|
"Sets the time to the approach at Bennu."
|
|
)
|
|
openspace.bindKey(
|
|
"F9",
|
|
"openspace.printInfo('Set time: Preliminary Survey');openspace.time.setTime('2018-NOV-20 01:13:12.183');",
|
|
"Sets the time to the preliminary survey of Bennu."
|
|
)
|
|
openspace.bindKey(
|
|
"F10",
|
|
"openspace.printInfo('Set time: Orbital B');openspace.time.setTime('2019-APR-08 10:35:27.186');",
|
|
"Sets the time to the orbital B event."
|
|
)
|
|
openspace.bindKey(
|
|
"F11",
|
|
"openspace.printInfo('Set time: Recon');openspace.time.setTime('2019-MAY-25 03:50:31.195');",
|
|
"Sets the time to the recon event."
|
|
)
|
|
|
|
openspace.bindKey(
|
|
"q",
|
|
helper.property.invert('SunMarker.renderable.enabled'),
|
|
"Toggles the visibility of the text marking the location of the Sun."
|
|
)
|
|
openspace.bindKey(
|
|
"e",
|
|
helper.property.invert('EarthMarker.renderable.enabled'),
|
|
"Toggles the visibility of the text marking the location of the Earth."
|
|
)
|
|
|
|
openspace.scriptScheduler.loadFile("${OPENSPACE_DATA}/scene/missions/osirisrex/scheduled_scripts.lua")
|
|
end
|
|
|
|
function postInitialization()
|
|
--[[
|
|
The scripts in this function are executed after all objects in the scene have been
|
|
created and initialized, but before the first render call. This is the place to set
|
|
graphical settings for the renderables.
|
|
]]--
|
|
openspace.printInfo("Setting default values")
|
|
openspace.setPropertyValue("Sun.renderable.Enabled", false)
|
|
openspace.setPropertyValue("SunMarker.renderable.Enabled", false)
|
|
openspace.setPropertyValue("EarthMarker.renderable.Enabled", false)
|
|
--openspace.setPropertyValue("Constellation Bounds.renderable.enabled", false)
|
|
openspace.setPropertyValue("PlutoTrail.renderable.Enabled", true)
|
|
openspace.setPropertyValue("PlutoTexture.renderable.Enabled", false)
|
|
|
|
openspace.setPropertyValue("MilkyWay.renderable.Transparency", 0.55)
|
|
openspace.setPropertyValue("MilkyWay.renderable.Segments", 50)
|
|
|
|
-- Activate night textures and water masks
|
|
openspace.setPropertyValue("Earth.RenderableGlobe.WaterMasks", {0, 1});
|
|
openspace.setPropertyValue("Earth.RenderableGlobe.NightLayers", {0, 1});
|
|
openspace.setPropertyValue("Earth.RenderableGlobe.Atmosphere", true);
|
|
|
|
openspace.printInfo("Done setting default values")
|
|
openspace.loadMission("${OPENSPACE_DATA}/scene/missions/osirisrex/osirisrex/osirisrex.mission")
|
|
|
|
openspace.navigation.resetCameraDirection()
|
|
|
|
mark_interesting_nodes({
|
|
"OsirisRex", "BennuBarycenter", "Earth"
|
|
})
|
|
end
|
|
|
|
return {
|
|
ScenePath = ".",
|
|
CommonFolder = "common",
|
|
Camera = {
|
|
Focus = "OsirisRex",
|
|
Position = {26974590199.661884, 76314608558.908020, -127086452897.101791},
|
|
Rotation = {0.729548, -0.126024, 0.416827, 0.527382},
|
|
},
|
|
Modules = {
|
|
"sun",
|
|
"mercury",
|
|
"venus",
|
|
"earth",
|
|
"moon",
|
|
"mars",
|
|
"jupiter",
|
|
"saturn",
|
|
"uranus",
|
|
"neptune",
|
|
"stars/digitaluniverse",
|
|
-- "stars/denver",
|
|
"milkyway/digitaluniverse",
|
|
--"milkyway/eso",
|
|
"missions/osirisrex",
|
|
}
|
|
}
|
|
|