Files
OpenSpace/data/assets/examples/debugcoordinateaxes.asset
Emma Broman 4d5ce33903 Add UI descriptions and asset metas to a bunch of assets (#2845)
* Add asset meta and GUI description to AltAz grid and move to Night sky in menu

To avoid confusion with other grids, that have a global position rather than a local one

* Add asset metas and GUI descriptions to Night Sky assets

* Add metas and update name of some example assets

* Night sky asset meta

* Add descriptions and asset metas to scale objects

---------

Co-authored-by: Ylva Selling <ylva.selling@gmail.com>
2023-08-18 16:33:59 +02:00

134 lines
3.0 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 = {
Name = "Earth Barycenter Axes",
Path = "/Other/Coordinate Systems"
}
}
local EarthInertialAxes = {
Identifier = "EarthInertialAxes",
Parent = earthTransforms.EarthInertial.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = EarthRadius * 2.5
}
},
Renderable = {
Type = "RenderableCartesianAxes"
},
GUI = {
Name = "Earth Inertial Axes",
Path = "/Other/Coordinate Systems"
}
}
local EarthIAUAxes = {
Identifier = "EarthIAUAxes",
Parent = earthTransforms.EarthIAU.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = EarthRadius * 1.5
}
},
Renderable = {
Type = "RenderableCartesianAxes"
},
GUI = {
Name = "Earth IAU Axes",
Path = "/Other/Coordinate Systems"
}
}
local SunIAUAxes = {
Identifier = "SunIAUAxes",
Parent = sunTransforms.SunIAU.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = SunRadius * 300
}
},
Renderable = {
Type = "RenderableCartesianAxes"
},
GUI = {
Name = "Sun IAU Axes",
Path = "/Other/Coordinate Systems"
}
}
local SolarSystemBarycenterAxes = {
Identifier = "SolarSystemBarycenterAxes",
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
Transform = {
Scale = {
Type = "StaticScale",
Scale = SunRadius * 300
}
},
Renderable = {
Type = "RenderableCartesianAxes"
},
GUI = {
Name = "Solar System Barycenter Axes",
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)
asset.meta = {
Name = "Debug Coordinates",
Version = "1.0",
Description = [[A set of coordinate axes demonstrating different XYZ coordinate
reference frames that are useful for debugging, such as the Earth or Solar
System Barycenter.]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}