Files
OpenSpace/data/scene/globebrowsing.scene
Kalle Bladin 2e4f31ded8 Interaction Updates (#353)
* Interaction speed is not dependent on framerate

* Split up interaction code in files and perform smooth interpolation when changing focus

* Abstract interaction code in to functions.

* Interpolation time is dependent on angle to focus node.

* Use correct delta time when interpolating

* Fix bug regarding decomposition of camera rotation.

* Make orbital interaction mode behave as globe browsing and no longer use interactiondepth below ellipsoid.

* Do not always rotate with object. Depending on distance

* Remove interaction depth below ellipsoid. Now able to interact without renderable

* Remove specification of interactionDepthBelowEllipsoid and cameraMinHeight

* Remove GlobeBrowsingInteractionMode

* Rename OrbitalInteractionMode to OrbitalNavigator and no longer extend interactionmode.

* Move properties from interaction handler to orbital navigator

* Use smooth step for follow rotation interpolator

* Rename KeyframeInteractionMode to KeyframeNavigator

* Rename files

* Clean up.

* Separate mousestate from orbitalnavigator

* Clean up

* Split keybindingmanager from interactionhandler interactionhandler

* Rename interactionhandler to navigationhandler

* Rename files

* Clean up

* Take back usage of gotochunk and gotogeo

* Rename lua library navigation

* Move functionality from navigationhandler to keyframenavigator

* Update scripts for navigation

* Comment code

* Clean up

* Solve but that caused NaN values for camera position when being in center of globe and setting focus to the globe.

* Update jenkins file to remove build folder before building.

* Fix error in jenkins script

* Update jenkins file

* Update jenkins file

* Revert jenkins file

* I hope this makes Jenkins happy.

* Line endings God damnit

* Line endings

* Clean up

* Fix compilation issue

* Take back default scene.

* Fix indentation

* Move functions goToGeo and goToChunk to GlobeBrowsingModule.

* Include algorithm for std::find

* Remove auto and other clean up
2017-07-14 17:17:17 +02:00

105 lines
3.8 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"
)
--[[
-- Toggle trails
openspace.bindKey("o",
'openspace.setPropertyValue("*Trail.renderable.enabled", false)'
)
openspace.bindKey("p",
'openspace.setPropertyValue("*Trail.renderable.enabled", true)'
)
]]
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"
}
}