Files
OpenSpace/data/assets/examples/renderable/renderablenodeline/nodeline.asset
Emma Broman 3d3580fa65 Polish and docs for RenderableDistanceLabel and docs for RenderableNodeLine (#3485)
* Update add add documentation for `RenderableDistanceLabel`

* Move distancelabel to `base` module and remove now empty `vislab` module

* Add examples for `RenderableNodeLine` and `RenderableDistanceLabel`

* Fix faultily formatted documentation ID for `RenderableNodeLine`

* Make `RenderableDistanceLabel` unit use units from distanceconversion file

And simplify how the different names for a unit are specified

* Use new distanceUnitList() function for other classes that uses the units

* Change default unit to correct option according to documentation

* Make the text property readonly for `RenderableDistanceLabel`

* Add property to specify the precision of the number

distance label precision to docs

* Add examples with different units and descriptors

* Add docs description to `RenderableNodeLine`

* Update name in one of the examples

* Remove redundant switch cases

* Apply suggestions from code review

Co-authored-by: Ylva Selling <ylva.selling@gmail.com>

---------

Co-authored-by: Ylva Selling <ylva.selling@gmail.com>
2025-01-29 16:11:47 +01:00

36 lines
1.0 KiB
Lua

-- Basic
-- This example draws a line between two nodes in the scene, in this case the planets
-- Earth and Mars.
--
-- Note that this example asset is used in another example, for
-- [RenderableDistanceLabel](#base_renderable_distancelabel). Due to this, we export the
-- `Node` table so we can access and refer to its identifier in the other example, the
-- same way as we do for Earth and Mars in this asset.
local earth = asset.require("scene/solarsystem/planets/earth/earth")
local mars = asset.require("scene/solarsystem/planets/mars/mars")
local Node = {
Identifier = "RenderableNodeLine_Example",
Renderable = {
Type = "RenderableNodeLine",
StartNode = earth.Earth.Identifier,
EndNode = mars.Mars.Identifier
},
GUI = {
Name = "RenderableNodeLine - Basic",
Path = "/Examples"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
-- Export the Node table so it can be used in another example
asset.export("NodeLine", Node)