mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 18:11:01 -05:00
705c898ccd
* Updating all assets to new coding style * Cleaning up asset files * Moving default_actions and default_keybindings files * Changing procedural globes to explicitly specified globes * Move Spice loading explicitly to the initialize part and also deinitialize * Removing unused asset files * Removing asset_helper * Removing scale_model_helper asset * Removing script_scheduler_helper * Removing testing_keybindings * Remove procedural_globe
75 lines
1.6 KiB
Lua
75 lines
1.6 KiB
Lua
local sun = asset.require("scene/solarsystem/sun/sun")
|
|
local earth = asset.require("scene/solarsystem/planets/earth/earth")
|
|
|
|
|
|
|
|
local models = asset.syncedResource({
|
|
Name = "New Horizons Model",
|
|
Type = "HttpSynchronization",
|
|
Identifier = "newhorizons_model",
|
|
Version = 2
|
|
})
|
|
|
|
|
|
local ExampleFixedHeight = {
|
|
Identifier = "ExampleFixedHeight",
|
|
Parent = earth.Earth.Identifier,
|
|
Transform = {
|
|
Translation = {
|
|
Type = "GlobeTranslation",
|
|
Globe = earth.Earth.Identifier,
|
|
Latitude = 40.7128,
|
|
Longitude = -74.006,
|
|
Altitude = 100000.0
|
|
}
|
|
},
|
|
Renderable = {
|
|
Type = "RenderableModel",
|
|
GeometryFile = models .. "NewHorizonsCleanModel.obj",
|
|
LightSources = {
|
|
sun.LightSource
|
|
}
|
|
},
|
|
GUI = {
|
|
Path = "/Example"
|
|
}
|
|
}
|
|
|
|
local ExampleAdaptiveHeight = {
|
|
Identifier = "ExampleAdaptiveHeight",
|
|
Parent = earth.Earth.Identifier,
|
|
Transform = {
|
|
Translation = {
|
|
Type = "GlobeTranslation",
|
|
Globe = earth.Earth.Identifier,
|
|
Latitude = 40.7128,
|
|
Longitude = -74.006,
|
|
UseHeightmap = true
|
|
}
|
|
},
|
|
Renderable = {
|
|
Type = "RenderableModel",
|
|
GeometryFile = models .. "NewHorizonsCleanModel.obj",
|
|
LightSources = {
|
|
sun.LightSource
|
|
}
|
|
},
|
|
GUI = {
|
|
Path = "/Example"
|
|
}
|
|
}
|
|
|
|
|
|
asset.onInitialize(function()
|
|
openspace.addSceneGraphNode(ExampleFixedHeight)
|
|
openspace.addSceneGraphNode(ExampleAdaptiveHeight)
|
|
end)
|
|
|
|
asset.onDeinitialize(function()
|
|
openspace.removeSceneGraphNode(ExampleAdaptiveHeight)
|
|
openspace.removeSceneGraphNode(ExampleFixedHeight)
|
|
end)
|
|
|
|
asset.export(ExampleFixedHeight)
|
|
asset.export(ExampleAdaptiveHeight)
|