mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 20:50:59 -05:00
8b74493d96
- Remove the asset_helper file and call the onInitialize and onDeinitialize functions directly - Small compile fix on Windows - Removes the need for the registerIdentifierWithMeta function by automatically doing that for all asset.export statements - Allow the passing of either identifiers (as before) or entire tables to the removeSceneGraphNode, removeScreenSpaceRenderable, deleteLayer, removeAction, and export methods. In that case, the Identifier key from the table is extracted and used instead
29 lines
652 B
Lua
29 lines
652 B
Lua
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_TOYVOLUME enabled
|
|
|
|
local transforms = asset.require("scene/solarsystem/sun/transforms")
|
|
|
|
local ToyVolume = {
|
|
Identifier = "RenderableToyVolume",
|
|
Parent = transforms.SolarSystemBarycenter.Identifier,
|
|
Renderable = {
|
|
Type = "RenderableToyVolume",
|
|
Size = { 5, 5, 5 },
|
|
ScalingExponent = 11,
|
|
StepSize = 0.01,
|
|
Color = { 1, 0, 0 }
|
|
},
|
|
GUI = {
|
|
Path = "/Examples"
|
|
}
|
|
}
|
|
|
|
asset.onInitialize(function()
|
|
openspace.addSceneGraphNode(ToyVolume)
|
|
end)
|
|
|
|
asset.onDeinitialize(function()
|
|
openspace.removeSceneGraphNode(ToyVolume)
|
|
end)
|
|
|
|
asset.export(ToyVolume)
|