mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-27 06:19:51 -05:00
23a446cb2c
Adapt to changes that absPath is not called automatically as often anymore Remove atmosphereearth.scene
238 lines
6.6 KiB
Plaintext
238 lines
6.6 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.
|
|
]]--
|
|
-- dofile(openspace.absPath('${SCRIPTS}/default_setup.lua'))
|
|
|
|
local TestFontSize1 = 20
|
|
local TestFontSize2 = 14
|
|
|
|
-- DashboardItemDate tests
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDate"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDate",
|
|
FontName = "Console"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDate",
|
|
FontName = "Light",
|
|
FontSize = TestFontSize1
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDate",
|
|
FontSize = TestFontSize2
|
|
})
|
|
|
|
-- DashboardItemDistance tests
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDistance"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDistance",
|
|
FontName = "Console",
|
|
SourceType = "Node",
|
|
SourceNodeName = "Moon"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDistance",
|
|
FontName = "Light",
|
|
FontSize = TestFontSize1,
|
|
SourceType = "Focus",
|
|
DestinationType = "Camera"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDistance",
|
|
FontSize = TestFontSize2,
|
|
SourceType = "Focus",
|
|
DestinationType = "Node",
|
|
DestinationNodeName = "Sun"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDistance",
|
|
SourceType = "Camera",
|
|
DestinationType = "Focus"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemDistance",
|
|
SourceType = "Camera",
|
|
SourceType = "Node",
|
|
SourceNodeName = "Saturn",
|
|
DestinationType = "Node",
|
|
DestinationNodeName = "Sun"
|
|
})
|
|
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemSpacing",
|
|
Spacing = 100
|
|
})
|
|
|
|
-- DashboardItemFramerate
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemFramerate"
|
|
})
|
|
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemFramerate",
|
|
FontName = "Light",
|
|
FontSize = TestFontSize1,
|
|
FrametimeType = "Average Deltatime"
|
|
})
|
|
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemFramerate",
|
|
FontName = "Console",
|
|
FrametimeType = "Frames per second"
|
|
})
|
|
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemFramerate",
|
|
FontSize = TestFontSize2,
|
|
FrametimeType = "Average frames per second"
|
|
})
|
|
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemFramerate",
|
|
FrametimeType = "None"
|
|
})
|
|
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemSpacing"
|
|
})
|
|
|
|
-- DashboardItemSimulationIncrement
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemSimulationIncrement"
|
|
})
|
|
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemSimulationIncrement",
|
|
FontName = "Light",
|
|
FontSize = TestFontSize1,
|
|
})
|
|
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemSimulationIncrement",
|
|
FontName = "Console"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemSimulationIncrement",
|
|
FontSize = TestFontSize2
|
|
})
|
|
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemSpacing"
|
|
})
|
|
|
|
-- DashboardItemAngle
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemAngle",
|
|
ReferenceType = "Node",
|
|
ReferenceNodeName = "Moon",
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemAngle",
|
|
FontName = "Console",
|
|
SourceType = "Node",
|
|
SourceNodeName = "Moon",
|
|
ReferenceType = "Node",
|
|
ReferenceNodeName = "Moon",
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemAngle",
|
|
FontName = "Light",
|
|
FontSize = TestFontSize1,
|
|
SourceType = "Focus",
|
|
ReferenceType = "Node",
|
|
ReferenceNodeName = "Moon",
|
|
DestinationType = "Camera"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemAngle",
|
|
FontSize = TestFontSize2,
|
|
SourceType = "Focus",
|
|
ReferenceType = "Node",
|
|
ReferenceNodeName = "Moon",
|
|
DestinationType = "Node",
|
|
DestinationNodeName = "Sun"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemAngle",
|
|
SourceType = "Camera",
|
|
ReferenceType = "Node",
|
|
ReferenceNodeName = "Moon",
|
|
DestinationType = "Focus"
|
|
})
|
|
openspace.dashboard.addDashboardItem({
|
|
Type = "DashboardItemAngle",
|
|
SourceType = "Camera",
|
|
SourceType = "Node",
|
|
SourceNodeName = "Saturn",
|
|
ReferenceType = "Node",
|
|
ReferenceNodeName = "Moon",
|
|
DestinationType = "Node",
|
|
DestinationNodeName = "Sun"
|
|
})
|
|
|
|
|
|
openspace.spice.loadKernel(openspace.absPath("${SPICE}/naif0012.tls"))
|
|
openspace.spice.loadKernel(openspace.absPath("${SPICE}/pck00010.tpc"))
|
|
|
|
openspace.time.setTime("2000 JAN 01")
|
|
dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua'))
|
|
end
|
|
|
|
function postInitialization()
|
|
openspace.printInfo("Setting default values")
|
|
|
|
openspace.setPropertyValueSingle("Global Properties.GlobeBrowsing.GdalWrapper.LogGdalErrors", false)
|
|
openspace.setPropertyValueSingle("Earth.RenderableGlobe.Debug.LevelByProjectedAreaElseDistance", false)
|
|
|
|
openspace.globebrowsing.goToGeo(58.5877, 16.1924, 20000000)
|
|
|
|
openspace.printInfo("Done setting default values")
|
|
|
|
-- Defined in scene_helper.lua
|
|
-- Used to create focus buttons for a subset of scenegraph nodes
|
|
mark_interesting_nodes({
|
|
"Earth"
|
|
})
|
|
end
|
|
|
|
|
|
return {
|
|
ScenePath = ".",
|
|
CommonFolder = "common",
|
|
Camera = {
|
|
Focus = "Earth",
|
|
Position = {0, 0, 0},
|
|
Rotation = {0.758797, 0.221490, -0.605693, -0.091135},
|
|
},
|
|
Modules = {
|
|
-- # Solar system objects
|
|
"sun",
|
|
"mercury",
|
|
"venus",
|
|
"earth",
|
|
"moon",
|
|
"mars",
|
|
"jupiter",
|
|
"saturn",
|
|
"uranus",
|
|
"neptune",
|
|
-- "satellites",
|
|
|
|
-- "grids",
|
|
-- "digitaluniverse",
|
|
"stars/digitaluniverse",
|
|
"milkyway/digitaluniverse",
|
|
|
|
-- "missions/voyager"
|
|
}
|
|
}
|
|
|