Files
OpenSpace/data/assets/examples/debugcoordinateaxes.asset
Alexander Bock 705c898ccd Asset File cleanup (#2713)
* 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
2023-05-28 17:23:20 +02:00

117 lines
2.5 KiB
Lua

local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms")
local sunTransforms = asset.require("scene/solarsystem/sun/transforms")
local SunRadius = 6.957E8
local EarthRadius = 6.371E6
local EarthBarycenterAxes = {
Identifier = "EarthBarycenterAxes",
Parent = earthTransforms.EarthBarycenter.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = EarthRadius * 3.5
}
},
Renderable = {
Type = "RenderableCartesianAxes"
},
GUI = {
Path = "/Other/Coordinate Systems"
}
}
local EarthInertialAxes = {
Identifier = "EarthInertialAxes",
Parent = earthTransforms.EarthInertial.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = EarthRadius * 2.5
}
},
Renderable = {
Type = "RenderableCartesianAxes"
},
GUI = {
Path = "/Other/Coordinate Systems"
}
}
local EarthIAUAxes = {
Identifier = "EarthIAUAxes",
Parent = earthTransforms.EarthIAU.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = EarthRadius * 1.5
}
},
Renderable = {
Type = "RenderableCartesianAxes"
},
GUI = {
Path = "/Other/Coordinate Systems"
}
}
local SunIAUAxes = {
Identifier = "SunIAUAxes",
Parent = sunTransforms.SunIAU.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = SunRadius * 300
}
},
Renderable = {
Type = "RenderableCartesianAxes"
},
GUI = {
Path = "/Other/Coordinate Systems"
}
}
local SolarSystemBarycenterAxes = {
Identifier = "SolarSystemBarycenterAxes",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = SunRadius * 300
}
},
Renderable = {
Type = "RenderableCartesianAxes"
},
GUI = {
Path = "/Other/Coordinate Systems"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(EarthBarycenterAxes)
openspace.addSceneGraphNode(EarthInertialAxes)
openspace.addSceneGraphNode(EarthIAUAxes)
openspace.addSceneGraphNode(SunIAUAxes)
openspace.addSceneGraphNode(SolarSystemBarycenterAxes)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(SolarSystemBarycenterAxes)
openspace.removeSceneGraphNode(SunIAUAxes)
openspace.removeSceneGraphNode(EarthIAUAxes)
openspace.removeSceneGraphNode(EarthInertialAxes)
openspace.removeSceneGraphNode(EarthBarycenterAxes)
end)
asset.export(EarthBarycenterAxes)
asset.export(EarthInertialAxes)
asset.export(EarthIAUAxes)
asset.export(SunIAUAxes)
asset.export(SolarSystemBarycenterAxes)