From 5008aa7cd76c2f2d6ae8c7ff11b3f923deec7e36 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 14 Mar 2025 11:25:26 +0100 Subject: [PATCH] Adding documentation and examples (#3541) - Make the SourceType and DestinationType parameters required in the DashboardItemAngle - Shift the "UTC" string in the DashboardDate from the FormatString to the TimeFormat - Make the SourceType and DestinationType parameters for the DashboardItemDistance required - Add new "Deltatime" option to the DashboardItemFramerate. Add examples for the DashboardItemFramerate - Fix issue where the inputstate would not update if no option was selected - Automatically disable simplification if a unit is requested in the asset for a DashboardItemSimulationIncrement or DashboardItemVelocity --- data/assets/dashboard/distance.asset | 4 +- .../angle_three-nodes.asset | 61 ++++++ .../angle_two-nodes-camera.asset | 45 ++++ .../angle_two-nodes-focus.asset | 45 ++++ .../dashboarditemdate/date.asset | 15 ++ .../dashboarditemdate/date_day-of-year.asset | 17 ++ .../date_no-decoration.asset | 17 ++ .../dashboarditemdate/date_timezone.asset | 17 ++ .../date_year-month-day.asset | 17 ++ .../distance_node-camera.asset | 28 +++ .../distance_node-focus.asset | 28 +++ .../distance_node-node.asset | 44 ++++ .../distance_nodesurface-camera.asset | 29 +++ .../dashboarditemelapsed/elapsed.asset | 17 ++ .../elapsed_fixed-time.asset | 18 ++ .../elapsed_no-decoration.asset | 19 ++ .../dashboarditemframerate/framerate.asset | 16 ++ .../framerate_deltatime.asset | 17 ++ .../globelocation.asset | 16 ++ .../globelocation_dms.asset | 18 ++ .../dashboarditeminputstate/inputstate.asset | 16 ++ .../inputstate_mouseonly.asset | 17 ++ .../inputstate_onlydisabled.asset | 17 ++ .../dashboarditemmission/mission.asset | 16 ++ .../parallelconnection.asset | 15 ++ .../propertyvalue_bool.asset | 17 ++ .../propertyvalue_float.asset | 18 ++ .../propertyvalue_int.asset | 18 ++ .../propertyvalue_vec3.asset | 17 ++ .../propertyvalue_vec4.asset | 17 ++ .../simulationincrement.asset | 15 ++ .../simulationincrement_nanoseconds.asset | 17 ++ .../simulationincrement_no-decoration.asset | 22 ++ .../dashboarditemspacing/spacing.asset | 16 ++ .../dashboarditemvelocity/velocity.asset | 15 ++ .../velocity_nauticalmiles.asset | 17 ++ data/assets/examples/dashboarditems.asset | 201 ------------------ .../cartesianaxes.asset | 4 +- .../cartesianaxes_parent.asset | 4 +- .../planeimagelocal.asset | 24 +++ .../planeimagelocal_billboard.asset | 26 +++ ...asset => planeimageonline_billboard.asset} | 8 +- .../rotation/fixedrotation/fixed.asset | 56 +++++ .../fixedrotation/fixed_axis-mapping.asset | 33 +++ .../fixedrotation/fixed_inverted.asset | 56 +++++ .../fixed_moving-two-objects.asset | 87 ++++++++ .../rotation/fixedrotation/fixed_moving.asset | 63 ++++++ .../{angle.asset => globe_angle.asset} | 0 ...{usecamera.asset => globe_usecamera.asset} | 0 .../examples/rotation/luarotation/lua.asset | 6 +- .../rotation/multirotation/multi.asset | 4 +- .../rotation/spicerotation/spice.asset | 8 +- ...{fixeddate.asset => spice_fixeddate.asset} | 10 +- ...{timeframe.asset => spice_timeframe.asset} | 12 +- .../rotation/spicerotation/timeoffset.asset | 8 +- .../{euler.asset => static_euler.asset} | 6 +- .../{matrix.asset => static_matrix.asset} | 6 +- ...aternion.asset => static_quaternion.asset} | 6 +- .../rotation/timelinerotation/timeline.asset | 10 +- ...te.asset => timeline_no-interpolate.asset} | 18 +- data/assets/examples/scale/luascale/lua.asset | 2 +- .../examples/scale/multiscale/multi.asset | 2 +- .../nonuniformstatic.asset | 12 +- .../nonuniformstatic_ellipsoid.asset | 2 +- .../examples/scale/staticscale/static.asset | 8 +- .../timedependentscale/timedependent.asset | 2 +- .../timedependent_speed.asset | 2 +- .../scale/timelinescale/no-interpolate.asset | 2 +- .../scale/timelinescale/timeline.asset | 2 +- .../timeline_no-interpolate.asset | 53 +++++ .../examples/screenspacedistancetoearth.asset | 2 +- data/assets/examples/timeframe/interval.asset | 28 +++ data/assets/examples/timeframe/union.asset | 4 +- .../translation/luatranslation/lua.asset | 9 +- .../translation/spicetranslation/spice.asset | 4 +- ...{fixeddate.asset => spice_fixeddate.asset} | 4 +- ...frame.asset => spice_referenceframe.asset} | 4 +- .../spicetranslation/timeoffset.asset | 4 +- .../timelinetranslation/timeline.asset | 48 +++++ .../timeline_no-interpolate.asset | 55 +++++ .../missions/juice/dashboard.asset | 8 +- .../missions/messenger/dashboard.asset | 4 +- .../missions/newhorizons/dashboard.asset | 4 +- .../missions/osirisrex/dashboard.asset | 4 +- .../missions/rosetta/dashboard.asset | 4 +- .../missions/voyager/dashboard.asset | 8 +- .../telescopes/gaia/dashboard.asset | 4 +- modules/base/dashboard/dashboarditemangle.cpp | 117 +++++----- modules/base/dashboard/dashboarditemangle.h | 2 +- modules/base/dashboard/dashboarditemdate.cpp | 11 +- .../base/dashboard/dashboarditemdistance.cpp | 90 ++++---- .../base/dashboard/dashboarditemdistance.h | 2 +- .../dashboard/dashboarditemelapsedtime.cpp | 5 +- .../base/dashboard/dashboarditemframerate.cpp | 38 +++- .../dashboard/dashboarditeminputstate.cpp | 11 +- .../base/dashboard/dashboarditemmission.cpp | 14 +- .../dashboarditemparallelconnection.cpp | 21 +- .../dashboard/dashboarditempropertyvalue.cpp | 9 +- .../dashboarditemsimulationincrement.cpp | 13 +- .../base/dashboard/dashboarditemspacing.cpp | 2 + .../base/dashboard/dashboarditemvelocity.cpp | 10 +- modules/base/rendering/renderablemodel.cpp | 14 +- modules/base/rendering/renderableplane.cpp | 4 + .../rendering/renderableplaneimagelocal.cpp | 2 + modules/base/rendering/renderablesphere.cpp | 4 + .../rendering/renderablesphereimagelocal.cpp | 3 + .../rendering/renderablesphereimageonline.cpp | 7 +- modules/base/rotation/constantrotation.cpp | 2 + modules/base/rotation/fixedrotation.cpp | 42 +++- modules/base/rotation/luarotation.cpp | 5 + modules/base/rotation/timelinerotation.cpp | 7 + modules/base/scale/luascale.cpp | 4 + modules/base/scale/timelinescale.cpp | 12 +- modules/base/timeframe/timeframeinterval.cpp | 5 + modules/base/translation/luatranslation.cpp | 5 + .../base/translation/statictranslation.cpp | 2 + .../base/translation/timelinetranslation.cpp | 10 +- .../src/dashboarditemglobelocation.cpp | 6 + modules/globebrowsing/src/globerotation.cpp | 5 + .../space/rendering/renderabletravelspeed.cpp | 4 +- modules/space/rotation/spicerotation.cpp | 23 +- .../space/translation/spicetranslation.cpp | 17 +- .../rendering/renderablemodelprojection.cpp | 14 +- modules/spout/renderablespherespout.cpp | 6 +- src/rendering/dashboarditem.cpp | 10 +- src/scene/rotation.cpp | 3 + src/scene/timeframe.cpp | 6 + 127 files changed, 1779 insertions(+), 487 deletions(-) create mode 100644 data/assets/examples/dashboarditem/dashboarditemangle/angle_three-nodes.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemangle/angle_two-nodes-camera.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemangle/angle_two-nodes-focus.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemdate/date.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemdate/date_day-of-year.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemdate/date_no-decoration.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemdate/date_timezone.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemdate/date_year-month-day.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-camera.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-focus.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-node.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemdistance/distance_nodesurface-camera.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed_fixed-time.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed_no-decoration.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemframerate/framerate.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemframerate/framerate_deltatime.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemglobelocation/globelocation.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemglobelocation/globelocation_dms.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate_mouseonly.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate_onlydisabled.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemmission/mission.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemparallelconnection/parallelconnection.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_bool.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_float.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_int.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_vec3.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_vec4.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement_nanoseconds.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement_no-decoration.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemspacing/spacing.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemvelocity/velocity.asset create mode 100644 data/assets/examples/dashboarditem/dashboarditemvelocity/velocity_nauticalmiles.asset delete mode 100644 data/assets/examples/dashboarditems.asset create mode 100644 data/assets/examples/renderable/renderableplaneimagelocal/planeimagelocal.asset create mode 100644 data/assets/examples/renderable/renderableplaneimagelocal/planeimagelocal_billboard.asset rename data/assets/examples/renderable/renderableplaneimageonline/{planeimageonline_billboarded.asset => planeimageonline_billboard.asset} (77%) create mode 100644 data/assets/examples/rotation/fixedrotation/fixed.asset create mode 100644 data/assets/examples/rotation/fixedrotation/fixed_axis-mapping.asset create mode 100644 data/assets/examples/rotation/fixedrotation/fixed_inverted.asset create mode 100644 data/assets/examples/rotation/fixedrotation/fixed_moving-two-objects.asset create mode 100644 data/assets/examples/rotation/fixedrotation/fixed_moving.asset rename data/assets/examples/rotation/globerotation/{angle.asset => globe_angle.asset} (100%) rename data/assets/examples/rotation/globerotation/{usecamera.asset => globe_usecamera.asset} (100%) rename data/assets/examples/rotation/spicerotation/{fixeddate.asset => spice_fixeddate.asset} (66%) rename data/assets/examples/rotation/spicerotation/{timeframe.asset => spice_timeframe.asset} (65%) rename data/assets/examples/rotation/staticrotation/{euler.asset => static_euler.asset} (76%) rename data/assets/examples/rotation/staticrotation/{matrix.asset => static_matrix.asset} (70%) rename data/assets/examples/rotation/staticrotation/{quaternion.asset => static_quaternion.asset} (69%) rename data/assets/examples/rotation/timelinerotation/{no-interpolate.asset => timeline_no-interpolate.asset} (56%) create mode 100644 data/assets/examples/scale/timelinescale/timeline_no-interpolate.asset create mode 100644 data/assets/examples/timeframe/interval.asset rename data/assets/examples/translation/spicetranslation/{fixeddate.asset => spice_fixeddate.asset} (85%) rename data/assets/examples/translation/spicetranslation/{referenceframe.asset => spice_referenceframe.asset} (84%) create mode 100644 data/assets/examples/translation/timelinetranslation/timeline.asset create mode 100644 data/assets/examples/translation/timelinetranslation/timeline_no-interpolate.asset diff --git a/data/assets/dashboard/distance.asset b/data/assets/dashboard/distance.asset index 6da0e66915..f87938d8e5 100644 --- a/data/assets/dashboard/distance.asset +++ b/data/assets/dashboard/distance.asset @@ -1,7 +1,9 @@ local Item = { Type = "DashboardItemDistance", Identifier = "Distance", - GuiName = "Distance" + GuiName = "Distance", + SourceType = "Camera", + DestinationType = "Focus" } diff --git a/data/assets/examples/dashboarditem/dashboarditemangle/angle_three-nodes.asset b/data/assets/examples/dashboarditem/dashboarditemangle/angle_three-nodes.asset new file mode 100644 index 0000000000..726dec459a --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemangle/angle_three-nodes.asset @@ -0,0 +1,61 @@ +-- Three nodes +-- This example adds three invisible scene graph nodes and then shows the angle between +-- those three nodes. + +local Node1 = { + Identifier = "DashboardItemAngle_Example_ThreeNodes_Node1", + GUI = { + Name = "DashboardItemAngle - Three Nodes (Node 1)" + } +} + +local Node2 = { + Identifier = "DashboardItemAngle_Example_ThreeNodes_Node2", + Transform = { + Translation = { + Type = "StaticTranslation", + Position = { 2.0, 1.0, 0.0 } + } + }, + GUI = { + Name = "DashboardItemAngle - Three Nodes (Node 2)" + } +} + +local Node3 = { + Identifier = "DashboardItemAngle_Example_ThreeNodes_Node3", + Transform = { + Translation = { + Type = "StaticTranslation", + Position = { -2.0, 1.0, 0.0 } + } + }, + GUI = { + Name = "DashboardItemAngle - Three Nodes (Node 3)" + } +} + +local Item = { + Identifier = "DashboardItemAngle_Example_ThreeNodes", + Type = "DashboardItemAngle", + SourceType = "Node", + SourceNodeIdentifier = Node1.Identifier, + ReferenceType = "Node", + ReferenceNodeIdentifier = Node2.Identifier, + DestinationType = "Node", + DestinationNodeIdentifier = Node3.Identifier +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node1) + openspace.addSceneGraphNode(Node2) + openspace.addSceneGraphNode(Node3) + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) + openspace.removeSceneGraphNode(Node3) + openspace.removeSceneGraphNode(Node2) + openspace.removeSceneGraphNode(Node1) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemangle/angle_two-nodes-camera.asset b/data/assets/examples/dashboarditem/dashboarditemangle/angle_two-nodes-camera.asset new file mode 100644 index 0000000000..267826b1e0 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemangle/angle_two-nodes-camera.asset @@ -0,0 +1,45 @@ +-- Two nodes and camera +-- This example adds two invisible scene graph nodes and then shows the angle between the +-- camera and those two nodes. + +local Node1 = { + Identifier = "DashboardItemAngle_Example_TwoNodesCamera_Node1", + GUI = { + Name = "DashboardItemAngle - Two Nodes & Camera (Node 1)" + } +} + +local Node2 = { + Identifier = "DashboardItemAngle_Example_TwoNodesCamera_Node2", + Transform = { + Translation = { + Type = "StaticTranslation", + Position = { 20.0, 1.0, 0.0 } + } + }, + GUI = { + Name = "DashboardItemAngle - Two Nodes & Camera (Node 2)" + } +} + +local Item = { + Identifier = "DashboardItemAngle_Example_TwoNodesCamera", + Type = "DashboardItemAngle", + SourceType = "Camera", + ReferenceType = "Node", + ReferenceNodeIdentifier = Node1.Identifier, + DestinationType = "Node", + DestinationNodeIdentifier = Node2.Identifier +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node1) + openspace.addSceneGraphNode(Node2) + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) + openspace.removeSceneGraphNode(Node2) + openspace.removeSceneGraphNode(Node1) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemangle/angle_two-nodes-focus.asset b/data/assets/examples/dashboarditem/dashboarditemangle/angle_two-nodes-focus.asset new file mode 100644 index 0000000000..1bc93c50eb --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemangle/angle_two-nodes-focus.asset @@ -0,0 +1,45 @@ +-- Two nodes and focus +-- This example adds two invisible scene graph nodes and then shows the angle between the +-- current focus node and those two nodes. + +local Node1 = { + Identifier = "DashboardItemAngle_Example_TwoNodesFocus_Node1", + GUI = { + Name = "DashboardItemAngle - Two Nodes & Focus (Node 1)" + } +} + +local Node2 = { + Identifier = "DashboardItemAngle_Example_TwoNodesFocus_Node2", + Transform = { + Translation = { + Type = "StaticTranslation", + Position = { 20.0, 1.0, 0.0 } + } + }, + GUI = { + Name = "DashboardItemAngle - Two Nodes & Focus (Node 2)" + } +} + +local Item = { + Identifier = "DashboardItemAngle_Example_TwoNodesFocus", + Type = "DashboardItemAngle", + SourceType = "Focus", + ReferenceType = "Node", + ReferenceNodeIdentifier = Node1.Identifier, + DestinationType = "Node", + DestinationNodeIdentifier = Node2.Identifier +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node1) + openspace.addSceneGraphNode(Node2) + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) + openspace.removeSceneGraphNode(Node2) + openspace.removeSceneGraphNode(Node1) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemdate/date.asset b/data/assets/examples/dashboarditem/dashboarditemdate/date.asset new file mode 100644 index 0000000000..20e8dfef51 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemdate/date.asset @@ -0,0 +1,15 @@ +-- Basic +-- This example adds a new DashboardItem that shows the current in-game simulation date. + +local Item = { + Identifier = "DashboardItemDate_Example", + Type = "DashboardItemDate" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemdate/date_day-of-year.asset b/data/assets/examples/dashboarditem/dashboarditemdate/date_day-of-year.asset new file mode 100644 index 0000000000..20640c7eaa --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemdate/date_day-of-year.asset @@ -0,0 +1,17 @@ +-- Day of Year +-- This example adds a new DashboardItem that shows the current in-game simulation date +-- showing the current year and the number of days that have passed in the year. + +local Item = { + Identifier = "DashboardItemDate_Example_DayOfYear", + Type = "DashboardItemDate", + TimeFormat = "YYYY DOY" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemdate/date_no-decoration.asset b/data/assets/examples/dashboarditem/dashboarditemdate/date_no-decoration.asset new file mode 100644 index 0000000000..9ef1348dff --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemdate/date_no-decoration.asset @@ -0,0 +1,17 @@ +-- No Decorations +-- This example adds a new DashboardItem that shows the current in-game simulation date +-- without any additional text surrounding the current date + +local Item = { + Identifier = "DashboardItemDate_Example_NoDecoration", + Type = "DashboardItemDate", + FormatString = "{}" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemdate/date_timezone.asset b/data/assets/examples/dashboarditem/dashboarditemdate/date_timezone.asset new file mode 100644 index 0000000000..e534124471 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemdate/date_timezone.asset @@ -0,0 +1,17 @@ +-- Timezone +-- This example adds a new DashboardItem that shows the current in-game simulation date +-- with a timezone of UTC-7 (=PDT) + +local Item = { + Identifier = "DashboardItemDate_Example_Timezone", + Type = "DashboardItemDate", + TimeFormat = "YYYY MON DD HR:MN:SC.### PDT ::UTC-7" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemdate/date_year-month-day.asset b/data/assets/examples/dashboarditem/dashboarditemdate/date_year-month-day.asset new file mode 100644 index 0000000000..90af7135b2 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemdate/date_year-month-day.asset @@ -0,0 +1,17 @@ +-- Year Month Day +-- This example adds a new DashboardItem that shows the current in-game simulation date +-- with a resolution of days. + +local Item = { + Identifier = "DashboardItemDate_Example_YearMonthDay", + Type = "DashboardItemDate", + TimeFormat = "YYYY MON DD" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-camera.asset b/data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-camera.asset new file mode 100644 index 0000000000..c6b2d5f8e9 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-camera.asset @@ -0,0 +1,28 @@ +-- Node-Camera +-- This example adds an invisible node and a dashboard item that shows the distance +-- between this node and the current focus node. + +local Node = { + Identifier = "DashboardItemDistance_Example_NodeCamera_Node", + GUI = { + Name = "DashboardItemDistance - Node-Camera" + } +} + +local Item = { + Identifier = "DashboardItemDistance_Example_NodeCamera", + Type = "DashboardItemDistance", + SourceType = "Node", + SourceNodeIdentifier = Node.Identifier, + DestinationType = "Camera" +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-focus.asset b/data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-focus.asset new file mode 100644 index 0000000000..c62552dc9a --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-focus.asset @@ -0,0 +1,28 @@ +-- Node-Focus +-- This example adds an invisible node and a dashboard item that shows the distance +-- between this node and the current focus node. + +local Node = { + Identifier = "DashboardItemDistance_Example_NodeFocus_Node", + GUI = { + Name = "DashboardItemDistance - Node-Focus" + } +} + +local Item = { + Identifier = "DashboardItemDistance_Example_NodeFocus", + Type = "DashboardItemDistance", + SourceType = "Node", + SourceNodeIdentifier = Node.Identifier, + DestinationType = "Focus" +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) + openspace.removeSceneGraphNode(Node1) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-node.asset b/data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-node.asset new file mode 100644 index 0000000000..bb686efe2a --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemdistance/distance_node-node.asset @@ -0,0 +1,44 @@ +-- Node-Node +-- This example adds two invisible nodes and a dashboard item that shows the distance +-- between those two nodes. + +local Node1 = { + Identifier = "DashboardItemDistance_Example_NodeNode_Node1", + GUI = { + Name = "DashboardItemDistance - Node-Node (Node 1)" + } +} + +local Node2 = { + Identifier = "DashboardItemDistance_Example_NodeNode_Node2", + Transform = { + Translation = { + Type = "StaticTranslation", + Position = { 2.0, 0.0, 0.0 } + } + }, + GUI = { + Name = "DashboardItemDistance - Node-Node (Node 2)" + } +} + +local Item = { + Identifier = "DashboardItemDistance_Example_NodeNode", + Type = "DashboardItemDistance", + SourceType = "Node", + SourceNodeIdentifier = Node1.Identifier, + DestinationType = "Node", + DestinationNodeIdentifier = Node2.Identifier +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node1) + openspace.addSceneGraphNode(Node2) + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) + openspace.removeSceneGraphNode(Node2) + openspace.removeSceneGraphNode(Node1) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemdistance/distance_nodesurface-camera.asset b/data/assets/examples/dashboarditem/dashboarditemdistance/distance_nodesurface-camera.asset new file mode 100644 index 0000000000..32cdf4894c --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemdistance/distance_nodesurface-camera.asset @@ -0,0 +1,29 @@ +-- NodeSurface-Camera +-- This example adds two invisible nodes and a dashboard item that shows the distance +-- between those two nodes + +local Node = { + Identifier = "DashboardItemDistance_Example_NodeSurfaceCamera_Node", + BoundingSphere = 200.0, + GUI = { + Name = "DashboardItemDistance - NodeSurface-Camera" + } +} + +local Item = { + Identifier = "DashboardItemDistance_Example_NodeSurfaceCamera", + Type = "DashboardItemDistance", + SourceType = "Node Surface", + SourceNodeIdentifier = Node.Identifier, + DestinationType = "Camera" +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed.asset b/data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed.asset new file mode 100644 index 0000000000..8c02355f0b --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed.asset @@ -0,0 +1,17 @@ +-- Basic +-- This example adds a dashboard item that shows the remaining time or the elapsed time +-- since midday 2000 JAN 01. + +local Item = { + Identifier = "DashboardItemElapsedTime_Example", + Type = "DashboardItemElapsedTime", + ReferenceTime = "2000 JAN 01 12:00:00" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed_fixed-time.asset b/data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed_fixed-time.asset new file mode 100644 index 0000000000..2e72405977 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed_fixed-time.asset @@ -0,0 +1,18 @@ +-- Fixed Time +-- This example adds a dashboard item that shows the remaining time or the elapsed time +-- since 2000 JAN 01 but ignoring any unit smaller than days. + +local Item = { + Identifier = "DashboardItemElapsedTime_Example_FixedTime", + Type = "DashboardItemElapsedTime", + ReferenceTime = "2000 JAN 01 12:00:00", + LowestTimeUnit = "Day" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed_no-decoration.asset b/data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed_no-decoration.asset new file mode 100644 index 0000000000..78b4730eea --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemelapsed/elapsed_no-decoration.asset @@ -0,0 +1,19 @@ +-- No Decorations +-- This example adds a dashboard item that shows the remaining time or the elapsed time +-- since midday 2000 JAN 01 without any additional text decoration and only printing the +-- remaining time. + +local Item = { + Identifier = "DashboardItemElapsedTime_Example_NoDecorations", + Type = "DashboardItemElapsedTime", + ReferenceTime = "2000 JAN 01 12:00:00", + FormatString = "{}" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemframerate/framerate.asset b/data/assets/examples/dashboarditem/dashboarditemframerate/framerate.asset new file mode 100644 index 0000000000..9cafcf215a --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemframerate/framerate.asset @@ -0,0 +1,16 @@ +-- Basic +-- This example adds a dashboard item that shows the average number of frames per second, +-- which is the default value for the frame time type setting. + +local Item = { + Identifier = "DashboardItemFramerate_Example", + Type = "DashboardItemFramerate" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemframerate/framerate_deltatime.asset b/data/assets/examples/dashboarditem/dashboarditemframerate/framerate_deltatime.asset new file mode 100644 index 0000000000..9b10d68970 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemframerate/framerate_deltatime.asset @@ -0,0 +1,17 @@ +-- Delta Time +-- This example adds a dashboard item that shows the frame rate of the last frame in +-- milliseconds. + +local Item = { + Identifier = "DashboardItemFramerate_Example_DeltaTime", + Type = "DashboardItemFramerate", + FrametimeType = "Deltatime" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemglobelocation/globelocation.asset b/data/assets/examples/dashboarditem/dashboarditemglobelocation/globelocation.asset new file mode 100644 index 0000000000..bae123c1d1 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemglobelocation/globelocation.asset @@ -0,0 +1,16 @@ +-- Basic +-- This example adds a dashboard item that shows the position of the camera relative to +-- the focus node, if that focus node is a globe. + +local Item = { + Identifier = "DashboardItemGlobeLocation_Example", + Type = "DashboardItemGlobeLocation" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemglobelocation/globelocation_dms.asset b/data/assets/examples/dashboarditem/dashboarditemglobelocation/globelocation_dms.asset new file mode 100644 index 0000000000..bd7d5cec2a --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemglobelocation/globelocation_dms.asset @@ -0,0 +1,18 @@ +-- Degree/Minute/Seconds +-- This example adds a dashboard item that shows the position of the camera relative to +-- the focus node, if that focus node is a globe. The longitude and latitude of the camera +-- is provided in the sexagesimal system (degrees, minutes, seconds). + +local Item = { + Identifier = "DashboardItemGlobeLocation_Example", + Type = "DashboardItemGlobeLocation", + DisplayFormat = "DegreeMinuteSeconds" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate.asset b/data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate.asset new file mode 100644 index 0000000000..27161f0757 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate.asset @@ -0,0 +1,16 @@ +-- Basic +-- This example adds a dashboard item that shows the input state of the mouse, keyboard, +-- and joystick input devices. + +local Item = { + Identifier = "DashboardItemInputState_Example", + Type = "DashboardItemInputState" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate_mouseonly.asset b/data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate_mouseonly.asset new file mode 100644 index 0000000000..c66b3d2e97 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate_mouseonly.asset @@ -0,0 +1,17 @@ +-- Mouse Only +-- This example adds a dashboard item that only shows the input state of the mouse inputs. + +local Item = { + Identifier = "DashboardItemInputState_Example_MouseOnly", + Type = "DashboardItemInputState", + ShowKeyboard = false, + ShowJoystick = false +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate_onlydisabled.asset b/data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate_onlydisabled.asset new file mode 100644 index 0000000000..a341084be0 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditeminputstate/inputstate_onlydisabled.asset @@ -0,0 +1,17 @@ +-- Only disabled +-- This example adds a dashboard item that shows the input state of the mouse, keyboard, +-- and joystick input devices but only when they are disabled. + +local Item = { + Identifier = "DashboardItemInputState_Example_OnlyDisabled", + Type = "DashboardItemInputState", + ShowWhenDisabled = true +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemmission/mission.asset b/data/assets/examples/dashboarditem/dashboarditemmission/mission.asset new file mode 100644 index 0000000000..7f8886420a --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemmission/mission.asset @@ -0,0 +1,16 @@ +-- Basic +-- This example adds a dashboard item that shows the status of the currently active +-- mission. + +local Item = { + Identifier = "DashboardItemMission_Example", + Type = "DashboardItemMission" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemparallelconnection/parallelconnection.asset b/data/assets/examples/dashboarditem/dashboarditemparallelconnection/parallelconnection.asset new file mode 100644 index 0000000000..4c153674b8 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemparallelconnection/parallelconnection.asset @@ -0,0 +1,15 @@ +-- Basic +-- This example adds a dashboard item that shows the status of the parallel connection. + +local Item = { + Identifier = "DashboardItemParallelConnection_Example", + Type = "DashboardItemParallelConnection" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_bool.asset b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_bool.asset new file mode 100644 index 0000000000..ba251345ba --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_bool.asset @@ -0,0 +1,17 @@ +-- Bool +-- This example adds a dashboard item that shows the state of a boolean property. + +local Item = { + Identifier = "DashboardItemPropertyValue_Example_Bool", + Type = "DashboardItemPropertyValue", + URI = "NavigationHandler.OrbitalNavigator.Friction.RotationalFriction", + DisplayString = "Rotational Friction is: {}" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_float.asset b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_float.asset new file mode 100644 index 0000000000..7390c7801f --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_float.asset @@ -0,0 +1,18 @@ +-- Float +-- This example adds a dashboard item that shows the state of a floating point value +-- property. + +local Item = { + Identifier = "DashboardItemPropertyValue_Example_Float", + Type = "DashboardItemPropertyValue", + URI = "RenderEngine.Gamma", + DisplayString = "Gamma Correction: {}" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_int.asset b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_int.asset new file mode 100644 index 0000000000..dd220cb847 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_int.asset @@ -0,0 +1,18 @@ +-- Int +-- This example adds a dashboard item that shows the state of a integer point value +-- property. + +local Item = { + Identifier = "DashboardItemPropertyValue_Example_Int", + Type = "DashboardItemPropertyValue", + URI = "LuaConsole.HistoryLength", + DisplayString = "Lua Console History Length: {}" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_vec3.asset b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_vec3.asset new file mode 100644 index 0000000000..680d30b5f3 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_vec3.asset @@ -0,0 +1,17 @@ +-- Vec3 +-- This example adds a dashboard item that shows the state of a 3-vector value property. + +local Item = { + Identifier = "DashboardItemPropertyValue_Example_Vec3", + Type = "DashboardItemPropertyValue", + URI = "RenderEngine.GlobalRotation", + DisplayString = "Global Rotation: ({}, {}, {})" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_vec4.asset b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_vec4.asset new file mode 100644 index 0000000000..4b4d8caf55 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditempropertyvalue/propertyvalue_vec4.asset @@ -0,0 +1,17 @@ +-- Vec4 +-- This example adds a dashboard item that shows the state of a 4-vector value property. + +local Item = { + Identifier = "DashboardItemPropertyValue_Example_Vec4", + Type = "DashboardItemPropertyValue", + URI = "RenderEngine.EnabledFontColor", + DisplayString = "Font Color (enabled): ({}, {}, {}, {})" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement.asset b/data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement.asset new file mode 100644 index 0000000000..5f88f68d7e --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement.asset @@ -0,0 +1,15 @@ +-- Basic +-- This example adds a dashboard item that shows the current simulation increment. + +local Item = { + Identifier = "DashboardItemSimulationIncrement_Example", + Type = "DashboardItemSimulationIncrement" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement_nanoseconds.asset b/data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement_nanoseconds.asset new file mode 100644 index 0000000000..2404a14541 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement_nanoseconds.asset @@ -0,0 +1,17 @@ +-- Nanoseconds +-- This example adds a dashboard item that shows the current simulation increment always +-- expressed in nanoseconds. + +local Item = { + Identifier = "DashboardItemSimulationIncrement_Example_NoDecoration", + Type = "DashboardItemSimulationIncrement", + RequestedUnit = "Nanosecond" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement_no-decoration.asset b/data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement_no-decoration.asset new file mode 100644 index 0000000000..196061b350 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemsimulationincrement/simulationincrement_no-decoration.asset @@ -0,0 +1,22 @@ +-- No Decoration +-- This example adds a dashboard item that shows the current simulation increment without +-- any textual decorations. This example also shows how to ignore the first two parameters +-- the `TransitionFormat` format string. Both the `TransitionFormat` and the +-- `RegularFormat` string replacement markers allow the setting of numbers to determine +-- which argument should be placed in here. The `TransitionFormat` in this example omits +-- the numbers 0 and 1, thus ignoring the first two arguments to the string. + +local Item = { + Identifier = "DashboardItemSimulationIncrement_Example_NoDecoration", + Type = "DashboardItemSimulationIncrement", + TransitionFormat = "{3:.1f} {4:s} / second{2:s}", + RegularFormat = "{:.1f} {:s} / second{:s}" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemspacing/spacing.asset b/data/assets/examples/dashboarditem/dashboarditemspacing/spacing.asset new file mode 100644 index 0000000000..a4c3360111 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemspacing/spacing.asset @@ -0,0 +1,16 @@ +-- Basic +-- This example adds a dashboard item that adds a spacing to the dashboard. This example +-- will not show anything by itself. + +local Item = { + Identifier = "DashboardItemSpacing_Example", + Type = "DashboardItemSpacing" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemvelocity/velocity.asset b/data/assets/examples/dashboarditem/dashboarditemvelocity/velocity.asset new file mode 100644 index 0000000000..51d5d56c7d --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemvelocity/velocity.asset @@ -0,0 +1,15 @@ +-- Basic +-- This example adds a dashboard item that shows the speed of the camera. + +local Item = { + Identifier = "DashboardItemVelocity_Example", + Type = "DashboardItemVelocity" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditem/dashboarditemvelocity/velocity_nauticalmiles.asset b/data/assets/examples/dashboarditem/dashboarditemvelocity/velocity_nauticalmiles.asset new file mode 100644 index 0000000000..c7f85bf1a9 --- /dev/null +++ b/data/assets/examples/dashboarditem/dashboarditemvelocity/velocity_nauticalmiles.asset @@ -0,0 +1,17 @@ +-- Nautical Miles +-- This example adds a dashboard item that shows the speed of the camera, but always +-- displayed in nautical miles per second (or knots). + +local Item = { + Identifier = "DashboardItemVelocity_Example_NauticalMiles", + Type = "DashboardItemVelocity", + RequestedUnit = "Nautical Mile" +} + +asset.onInitialize(function() + openspace.dashboard.addDashboardItem(Item) +end) + +asset.onDeinitialize(function() + openspace.dashboard.removeDashboardItem(Item) +end) diff --git a/data/assets/examples/dashboarditems.asset b/data/assets/examples/dashboarditems.asset deleted file mode 100644 index a072f0c44d..0000000000 --- a/data/assets/examples/dashboarditems.asset +++ /dev/null @@ -1,201 +0,0 @@ -asset.require("scene/solarsystem/planets/earth/earth") -asset.require("scene/solarsystem/planets/earth/moon/moon") - -local Angle = { - Type = "DashboardItemAngle", - Identifier = "Angle", - ReferenceType = "Node", - ReferenceNodeName = "Earth", - DestinationType = "Node", - DestinationNodeName = "Moon" -} - -local Date = { - Type = "DashboardItemDate", - Identifier = "Date" -} - -local SimulationIncrement = { - Type = "DashboardItemSimulationIncrement", - Identifier = "SimulationIncrement", - GuiName = "Simulation Increment" -} - -local Distance = { - Type = "DashboardItemDistance", - Identifier = "Distance" -} - -local Framerate = { - Type = "DashboardItemFramerate", - Identifier = "Framerate" -} - -local ParallelConnection = { - Type = "DashboardItemParallelConnection", - Identifier = "ParallelConnection", - GuiName = "Parallel Connection" -} - -local Mission = { - Type = "DashboardItemMission", - Identifier = "Mission" -} - -local PropertyValue = { - Type = "DashboardItemPropertyValue", - Identifier = "DashbaordItemPropertyValue", - URI = "Scene.Earth.Renderable.Enabled", - DisplayString = "Earth is enabled: {}" -} - -local PropertyValueFloat = { - Type = "DashboardItemPropertyValue", - Identifier = "DashbaordItemPropertyValue_Float", - URI = "Scene.Earth.Renderable.TargetLodScaleFactor", - DisplayString = "Earth LOD is {:.5f}" -} - -local PropertyValueDouble = { - Type = "DashboardItemPropertyValue", - Identifier = "DashbaordItemPropertyValue_Double", - URI = "NavigationHandler.PathNavigator.ArrivalDistanceFactor", - DisplayString = "Arrival Distance Factor is {:.8f}" -} - -local PropertyValueInt = { - Type = "DashboardItemPropertyValue", - Identifier = "DashbaordItemPropertyValue_Int", - URI = "LuaConsole.HistoryLength", - DisplayString = "History length is {}" -} - -local PropertyValueUInt = { - Type = "DashboardItemPropertyValue", - Identifier = "DashboardItemPropertyValue_UInt", - URI = "Modules.Globebrowsing.TileCacheSize", - DisplayString = "Tile Cache Size is {}" -} - -local PropertyValueDVec3 = { - Type = "DashboardItemPropertyValue", - Identifier = "DashboardItemPropertyValue_DVec3", - URI = "Scene.SolarSystemBarycenter.Transform.Transform", - DisplayString = "SSB Transform is: ({}, {}, {})" -} - -local PropertyValueIVec2 = { - Type = "DashboardItemPropertyValue", - Identifier = "DashboardItemPropertyValue_IVec2", - URI = "Scene.SolarSystemBarycenter.Renderable.ScreenSpacePosition", - DisplayString = "Random ScreenSpace Position: ({}, {})" -} - -local PropertyValueVec2 = { - Type = "DashboardItemPropertyValue", - Identifier = "DashboardItemPropertyValue_Vec2", - URI = "Scene.EarthAtmosphere.Renderable.AtmosphereDimmingSunsetAngle", - DisplayString = "Sunset Angle is ({}, {})" -} - -local PropertyValueVec3 = { - Type = "DashboardItemPropertyValue", - Identifier = "DashboardItemPropertyValue_Vec3", - URI = "RenderEngine.GlobalRotation", - DisplayString = "Global Rotation is ({}, {}, {})" -} - -local PropertyValueVec4 = { - Type = "DashboardItemPropertyValue", - Identifier = "DashboardItemPropertyValue_Vec4", - URI = "LuaConsole.BackgroundColor", - DisplayString = "Background Coolor is ({}, {}, {}, {})" -} - -local ElapsedTime = { - Type = "DashboardItemElapsedTime", - Identifier = "ElapsedTime", - ReferenceTime = "2022-10-12 12:00:00" -} - -local InputState = { - Type = "DashboardItemInputState", - Identifier = "InputState" -} - - -asset.onInitialize(function() - openspace.dashboard.addDashboardItem(Angle) - openspace.dashboard.addDashboardItem(Date) - openspace.dashboard.addDashboardItem(SimulationIncrement) - openspace.dashboard.addDashboardItem(Distance) - openspace.dashboard.addDashboardItem(Framerate) - openspace.dashboard.addDashboardItem(ParallelConnection) - openspace.dashboard.addDashboardItem(Mission) - openspace.dashboard.addDashboardItem(PropertyValue) - openspace.dashboard.addDashboardItem(PropertyValueFloat) - openspace.dashboard.addDashboardItem(PropertyValueDouble) - openspace.dashboard.addDashboardItem(PropertyValueInt) - openspace.dashboard.addDashboardItem(PropertyValueUInt) - openspace.dashboard.addDashboardItem(PropertyValueDVec3) - openspace.dashboard.addDashboardItem(PropertyValueIVec2) - openspace.dashboard.addDashboardItem(PropertyValueVec2) - openspace.dashboard.addDashboardItem(PropertyValueVec3) - openspace.dashboard.addDashboardItem(PropertyValueVec4) - openspace.dashboard.addDashboardItem(ElapsedTime) - openspace.dashboard.addDashboardItem(InputState) -end) - -asset.onDeinitialize(function() - openspace.dashboard.removeDashboardItem(InputState) - openspace.dashboard.removeDashboardItem(ElapsedTime) - openspace.dashboard.removeDashboardItem(PropertyValueVec4) - openspace.dashboard.removeDashboardItem(PropertyValueVec3) - openspace.dashboard.removeDashboardItem(PropertyValueVec2) - openspace.dashboard.removeDashboardItem(PropertyValueIVec2) - openspace.dashboard.removeDashboardItem(PropertyValueDVec3) - openspace.dashboard.removeDashboardItem(PropertyValueUInt) - openspace.dashboard.removeDashboardItem(PropertyValueInt) - openspace.dashboard.removeDashboardItem(PropertyValueDouble) - openspace.dashboard.removeDashboardItem(PropertyValueFloat) - openspace.dashboard.removeDashboardItem(PropertyValue) - openspace.dashboard.removeDashboardItem(Mission) - openspace.dashboard.removeDashboardItem(ParallelConnection) - openspace.dashboard.removeDashboardItem(Framerate) - openspace.dashboard.removeDashboardItem(Distance) - openspace.dashboard.removeDashboardItem(SimulationIncrement) - openspace.dashboard.removeDashboardItem(Date) - openspace.dashboard.removeDashboardItem(Angle) -end) - -asset.export(Angle) -asset.export(Date) -asset.export(SimulationIncrement) -asset.export(Distance) -asset.export(Framerate) -asset.export(ParallelConnection) -asset.export(Mission) -asset.export(PropertyValue) -asset.export(PropertyValueFloat) -asset.export(PropertyValueDouble) -asset.export(PropertyValueInt) -asset.export(PropertyValueUInt) -asset.export(PropertyValueDVec3) -asset.export(PropertyValueIVec2) -asset.export(PropertyValueVec2) -asset.export(PropertyValueVec3) -asset.export(PropertyValueVec4) -asset.export(ElapsedTime) -asset.export(InputState) - - - -asset.meta = { - Name = "Dashboard Items Example", - Description = [[Examples of different types of dashboard items. These are dynamic - information texts that will be shown over the rendering (per default in the top - left corner, on flat screens).]], - Author = "OpenSpace Team", - URL = "http://openspaceproject.com", - License = "MIT license" -} diff --git a/data/assets/examples/renderable/renderablecartesianaxes/cartesianaxes.asset b/data/assets/examples/renderable/renderablecartesianaxes/cartesianaxes.asset index 14f9f23159..74f5793a53 100644 --- a/data/assets/examples/renderable/renderablecartesianaxes/cartesianaxes.asset +++ b/data/assets/examples/renderable/renderablecartesianaxes/cartesianaxes.asset @@ -1,6 +1,6 @@ -- Basic --- This example creates a SceneGraphNode that only displays coordinate axes. The --- parent is not set which defaults to placing the axes at the center of the Sun. +-- This example creates a scene graph node that only displays coordinate axes. The parent +-- is not set which defaults to placing the axes at the center of the Sun. local Node = { Identifier = "RenderableCartesianAxes_Example", diff --git a/data/assets/examples/renderable/renderablecartesianaxes/cartesianaxes_parent.asset b/data/assets/examples/renderable/renderablecartesianaxes/cartesianaxes_parent.asset index 4dc7eb0dfd..67baebeffb 100644 --- a/data/assets/examples/renderable/renderablecartesianaxes/cartesianaxes_parent.asset +++ b/data/assets/examples/renderable/renderablecartesianaxes/cartesianaxes_parent.asset @@ -1,6 +1,6 @@ -- With Parent --- This example creates a SceneGraphNode that displays coordinate axes of the given parent --- node, in this case Earth. +-- This example creates a scene graph node that displays coordinate axes of the given +-- parent node, in this case Earth. local earth = asset.require("scene/solarsystem/planets/earth/earth") diff --git a/data/assets/examples/renderable/renderableplaneimagelocal/planeimagelocal.asset b/data/assets/examples/renderable/renderableplaneimagelocal/planeimagelocal.asset new file mode 100644 index 0000000000..13c4b57a2a --- /dev/null +++ b/data/assets/examples/renderable/renderableplaneimagelocal/planeimagelocal.asset @@ -0,0 +1,24 @@ +-- Basic +-- This example shows how to create a textured plane in 3D space, where the texture is +-- loaded from a local file on disk. + +local Node = { + Identifier = "RenderablePlaneImageLocal_Example", + Renderable = { + Type = "RenderablePlaneImageLocal", + Size = 3.0E11, + Texture = openspace.absPath("${DATA}/test2.jpg") + }, + GUI = { + Name = "RenderablePlaneImageLocal - Basic", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/renderable/renderableplaneimagelocal/planeimagelocal_billboard.asset b/data/assets/examples/renderable/renderableplaneimagelocal/planeimagelocal_billboard.asset new file mode 100644 index 0000000000..890289fd8b --- /dev/null +++ b/data/assets/examples/renderable/renderableplaneimagelocal/planeimagelocal_billboard.asset @@ -0,0 +1,26 @@ +-- Billboard Image +-- This example shows how to create a textured plane in 3D space, where the texture is +-- loaded from a local file on disk and the plane is billboarded to always face the +-- camera. + +local Node = { + Identifier = "RenderablePlaneImageLocal_Example_Billboard", + Renderable = { + Type = "RenderablePlaneImageLocal", + Size = 3.0E11, + Texture = openspace.absPath("${DATA}/test2.jpg"), + Billboard = true + }, + GUI = { + Name = "RenderablePlaneImageLocal - Billboard", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/renderable/renderableplaneimageonline/planeimageonline_billboarded.asset b/data/assets/examples/renderable/renderableplaneimageonline/planeimageonline_billboard.asset similarity index 77% rename from data/assets/examples/renderable/renderableplaneimageonline/planeimageonline_billboarded.asset rename to data/assets/examples/renderable/renderableplaneimageonline/planeimageonline_billboard.asset index e89d8eaad9..51b0016052 100644 --- a/data/assets/examples/renderable/renderableplaneimageonline/planeimageonline_billboarded.asset +++ b/data/assets/examples/renderable/renderableplaneimageonline/planeimageonline_billboard.asset @@ -1,18 +1,18 @@ --- Billboarded Image +-- Billboard Image -- This example shows how to create a textured plane in 3D space, where the texture is -- loaded from the internet though a web URL and the plane is billboarded to always -- face the camera. local Node = { - Identifier = "RenderablePlaneImageOnline_Example_Billboarded", + Identifier = "RenderablePlaneImageOnline_Example_Billboard", Renderable = { Type = "RenderablePlaneImageOnline", Size = 3.0E11, URL = "http://data.openspaceproject.com/examples/renderableplaneimageonline.jpg", - Billboarded = true + Billboard = true }, GUI = { - Name = "RenderablePlaneImageOnline - Billboarded", + Name = "RenderablePlaneImageOnline - Billboard", Path = "/Examples" } } diff --git a/data/assets/examples/rotation/fixedrotation/fixed.asset b/data/assets/examples/rotation/fixedrotation/fixed.asset new file mode 100644 index 0000000000..344ee24ed7 --- /dev/null +++ b/data/assets/examples/rotation/fixedrotation/fixed.asset @@ -0,0 +1,56 @@ +-- Basic +-- This asset creates a rotation that places coordinate axes close to a sphere with the +-- z axis pointing towards the sphere. The coordinate axes are translated away from the +-- sphere to make that orientation more obvious. +-- +-- Making the `YAxis` `{ 0.0, 1.0, 0.0 }` and actually using the orthogonal projection of +-- that direction means that the y axis of the new coordinate system will point in the +-- hemisphere in which the old y-axis was pointing, albeit being orthogonal to the other +-- specified axis. That axis is pointing towards the scene graph node holding the sphere. + +local Sphere = { + Identifier = "FixedRotation_Example_Sphere", + Transform = { + Translation = { + Type = "StaticTranslation", + Position = { 2.0, 1.5, 1.0 } + } + }, + Renderable = { + Type = "RenderableSphericalGrid" + }, + GUI = { + Name = "FixedRotation - Basic (Sphere)", + Path = "/Examples" + } +} + +local Node = { + Identifier = "FixedRotation_Example", + Transform = { + Rotation = { + Type = "FixedRotation", + Attached = "FixedRotation_Example", + YAxis = { 0.0, 1.0, 0.0 }, + YAxisOrthogonal = true, + ZAxis = "FixedRotation_Example_Sphere" + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "FixedRotation - Basic", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Sphere) + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) + openspace.removeSceneGraphNode(Sphere) +end) diff --git a/data/assets/examples/rotation/fixedrotation/fixed_axis-mapping.asset b/data/assets/examples/rotation/fixedrotation/fixed_axis-mapping.asset new file mode 100644 index 0000000000..fdc3882d06 --- /dev/null +++ b/data/assets/examples/rotation/fixedrotation/fixed_axis-mapping.asset @@ -0,0 +1,33 @@ +-- Axis Mapping +-- This asset creates a rotation that shows coordinate axes in which the x and the y axes +-- are flipped. While this could also be achieved with a +-- [ConstantRotation](#base_transform_rotation_constant) class, this serves as an example +-- for more elaborate coordinate system mappings, such as converting to a coordinate +-- system with a known coordinate axes. + +local Node = { + Identifier = "FixedRotation_Example_Mapping", + Transform = { + Rotation = { + Type = "FixedRotation", + XAxis = { 0.0, 1.0, 0.0 }, + YAxis = { 1.0, 0.0, 0.0 }, + ZAxis = { 0.0, 0.0, 1.0 } + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "FixedRotation - Mapping", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/rotation/fixedrotation/fixed_inverted.asset b/data/assets/examples/rotation/fixedrotation/fixed_inverted.asset new file mode 100644 index 0000000000..30f751d624 --- /dev/null +++ b/data/assets/examples/rotation/fixedrotation/fixed_inverted.asset @@ -0,0 +1,56 @@ +-- Inverted Axis +-- This asset creates a rotation that places coordinate axes close to a sphere with the z +-- axis pointing away from the sphere. The coordinate axes are translated away from the +-- sphere to make that orientation more obvious. +-- +-- Making the `YAxis` { 0.0, 1.0, 0.0 } and actually using the orthogonal projection of +-- that direction means that the y axis of the new coordinate system will point in the +-- hemisphere in which the old y-axis was pointing, albeit being orthogonal to the other +-- specified axis. That axis is pointing towards the scene graph node holding the sphere. +local Sphere = { + Identifier = "FixedRotation_Example_InvertedAxis_Sphere", + Transform = { + Translation = { + Type = "StaticTranslation", + Position = { 2.0, 1.5, 1.0 } + } + }, + Renderable = { + Type = "RenderableSphericalGrid" + }, + GUI = { + Name = "FixedRotation - Inverted Axis (Sphere)", + Path = "/Examples" + } +} + +local Node = { + Identifier = "FixedRotation_Example_InvertedAxis", + Transform = { + Rotation = { + Type = "FixedRotation", + Attached = "FixedRotation_Example_InvertedAxis", + YAxis = { 0.0, 1.0, 0.0 }, + YAxisOrthogonal = true, + ZAxis = Sphere.Identifier, + ZAxisInvert = true + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "FixedRotation - Inverted Axis", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Sphere) + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) + openspace.removeSceneGraphNode(Sphere) +end) diff --git a/data/assets/examples/rotation/fixedrotation/fixed_moving-two-objects.asset b/data/assets/examples/rotation/fixedrotation/fixed_moving-two-objects.asset new file mode 100644 index 0000000000..2cccd5336b --- /dev/null +++ b/data/assets/examples/rotation/fixedrotation/fixed_moving-two-objects.asset @@ -0,0 +1,87 @@ +-- Rotation Following Two Moving Objects +-- This asset creates a rotation that places coordinate axes orbiting close to two spheres +-- with the y axis always pointing towards the first sphere and the z axis always pointing +-- towards the second sphere as the coordinate system moves around. The set of coordinate +-- axes are orbiting using a [KeplerTranslation](#space_transform_kepler) that provides a +-- configurable orbital motion. The use of the +-- [KeplerTranslation](#space_transform_kepler) in this example is arbitrary and the +-- FixedRotation does not depend on the use of that class. We use it in this example as we +-- want a moving object to show that the `FixedRotation` will always point at the object, +-- even as it is moving. +-- +-- Note that in this example the coordinate system will be skewed as, in general, it is +-- not guaranteed that the direction from the node to the two spheres will be an +-- orthogonal vector. + +local Sphere1 = { + Identifier = "FixedRotation_Example_Moving_TwoObjects_Sphere1", + Transform = { + Translation = { + Type = "StaticTranslation", + Position = { 3.0, -2.0, 0.0 } + } + }, + Renderable = { + Type = "RenderableSphericalGrid" + }, + GUI = { + Name = "FixedRotation - Moving Two Objects (Sphere 1)", + Path = "/Examples" + } +} + +local Sphere2 = { + Identifier = "FixedRotation_Example_Moving_TwoObjects_Sphere2", + Transform = { + Translation = { + Type = "KeplerTranslation", + Eccentricity = 0.5, + SemiMajorAxis = 0.0025, + Inclination = 0.0, + AscendingNode = 0.0, + ArgumentOfPeriapsis = 0.0, + MeanAnomaly = 0.0, + Epoch = "2000 JAN 01 12:00:00", + Period = 10.0 + } + }, + Renderable = { + Type = "RenderableSphericalGrid" + }, + GUI = { + Name = "FixedRotation - Moving Two Objects (Sphere 2)", + Path = "/Examples" + } +} + +local Node = { + Identifier = "FixedRotation_Example_Moving_TwoObjects", + Transform = { + Rotation = { + Type = "FixedRotation", + Attached = "FixedRotation_Example_Moving_TwoObjects", + YAxis = Sphere1.Identifier, + YAxisOrthogonal = true, + ZAxis = Sphere2.Identifier + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "FixedRotation - Moving Two Objects", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Sphere1) + openspace.addSceneGraphNode(Sphere2) + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) + openspace.removeSceneGraphNode(Sphere2) + openspace.removeSceneGraphNode(Sphere1) +end) diff --git a/data/assets/examples/rotation/fixedrotation/fixed_moving.asset b/data/assets/examples/rotation/fixedrotation/fixed_moving.asset new file mode 100644 index 0000000000..414dc3da6b --- /dev/null +++ b/data/assets/examples/rotation/fixedrotation/fixed_moving.asset @@ -0,0 +1,63 @@ +-- Rotation Following One Moving Object +-- This asset creates a rotation that places coordinate axes orbiting close to a sphere +-- with the z axis always pointing towards the sphere as it orbits around the sphere. The +-- coordinate axes are translated away from the sphere to make that orientation more +-- obvious. +-- +-- Making the `YAxis` { 0.0, 1.0, 0.0 } and actually using the orthogonal projection of +-- that direction means that the y axis of the new coordinate system will point in the +-- hemisphere in which the old y-axis was pointing, albeit being orthogonal to the other +-- specified axis. That axis is pointing towards the scene graph node holding the sphere. +local Sphere = { + Identifier = "FixedRotation_Example_Moving_Sphere", + Transform = { + Translation = { + Type = "KeplerTranslation", + Eccentricity = 0.5, + SemiMajorAxis = 0.0025, + Inclination = 0.0, + AscendingNode = 0.0, + ArgumentOfPeriapsis = 0.0, + MeanAnomaly = 0.0, + Epoch = "2000 JAN 01 12:00:00", + Period = 10.0 + } + }, + Renderable = { + Type = "RenderableSphericalGrid" + }, + GUI = { + Name = "FixedRotation - Moving (Sphere)", + Path = "/Examples" + } +} + +local Node = { + Identifier = "FixedRotation_Example_Moving", + Transform = { + Rotation = { + Type = "FixedRotation", + Attached = "FixedRotation_Example_Moving", + YAxis = { 0.0, 1.0, 0.0 }, + YAxisOrthogonal = true, + ZAxis = Sphere.Identifier + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "FixedRotation - Moving", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Sphere) + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) + openspace.removeSceneGraphNode(Sphere) +end) diff --git a/data/assets/examples/rotation/globerotation/angle.asset b/data/assets/examples/rotation/globerotation/globe_angle.asset similarity index 100% rename from data/assets/examples/rotation/globerotation/angle.asset rename to data/assets/examples/rotation/globerotation/globe_angle.asset diff --git a/data/assets/examples/rotation/globerotation/usecamera.asset b/data/assets/examples/rotation/globerotation/globe_usecamera.asset similarity index 100% rename from data/assets/examples/rotation/globerotation/usecamera.asset rename to data/assets/examples/rotation/globerotation/globe_usecamera.asset diff --git a/data/assets/examples/rotation/luarotation/lua.asset b/data/assets/examples/rotation/luarotation/lua.asset index e20d46fbfb..ae37b0cdb7 100644 --- a/data/assets/examples/rotation/luarotation/lua.asset +++ b/data/assets/examples/rotation/luarotation/lua.asset @@ -1,7 +1,7 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes. The rotation of --- coordinate axes are determined by executing a Lua file that returns the rotation matrix --- to be used. +-- This asset creates a scene graph node that only displays coordinate axes. The rotation +-- of coordinate axes are determined by executing a Lua file that returns the rotation +-- matrix to be used. -- -- ```{literalinclude} example.lua -- :language: lua diff --git a/data/assets/examples/rotation/multirotation/multi.asset b/data/assets/examples/rotation/multirotation/multi.asset index c36899c2fe..a593330643 100644 --- a/data/assets/examples/rotation/multirotation/multi.asset +++ b/data/assets/examples/rotation/multirotation/multi.asset @@ -1,6 +1,6 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes. The rotation of --- the coordinate axes are determined by a combination of individual rotations. The +-- This asset creates a scene graph node that only displays coordinate axes. The rotation +-- of the coordinate axes are determined by a combination of individual rotations. The -- rotations are applied in the order in which they are specified local Node = { diff --git a/data/assets/examples/rotation/spicerotation/spice.asset b/data/assets/examples/rotation/spicerotation/spice.asset index be46c5f4ba..0aeaed82d0 100644 --- a/data/assets/examples/rotation/spicerotation/spice.asset +++ b/data/assets/examples/rotation/spicerotation/spice.asset @@ -1,8 +1,8 @@ -- Basic --- This asset creates a rotation provided by a SPICE kernel and applies it to a --- SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes --- are determined by SPICE, in this case pretending that the coordinate axes are rotating --- at the same rate as Earth. +-- This asset creates a rotation provided by a SPICE kernel and applies it to a scene +-- graph node that only displays coordinate axes. The rotation of the coordinate axes are +-- determined by SPICE, in this case pretending that the coordinate axes are rotating at +-- the same rate as Earth. -- For more information about SPICE see: https://naif.jpl.nasa.gov/naif/ -- Load the default SPICE kernels, which are the planetary constants and the DE430 kernel diff --git a/data/assets/examples/rotation/spicerotation/fixeddate.asset b/data/assets/examples/rotation/spicerotation/spice_fixeddate.asset similarity index 66% rename from data/assets/examples/rotation/spicerotation/fixeddate.asset rename to data/assets/examples/rotation/spicerotation/spice_fixeddate.asset index d3c580a656..97654344a9 100644 --- a/data/assets/examples/rotation/spicerotation/fixeddate.asset +++ b/data/assets/examples/rotation/spicerotation/spice_fixeddate.asset @@ -1,9 +1,9 @@ -- Fixed Date --- This asset creates a rotation provided by a SPICE kernel and applies it to a --- SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes --- are determined by SPICE, in this case pretending that the coordinate axes are rotating --- at the same rate as Earth. In this specific example, the orientation is independent of --- the actual in-game time in OpenSpace and only uses a fixed date of 2000 JAN 01 instead. +-- This asset creates a rotation provided by a SPICE kernel and applies it to a scene +-- graph node that only displays coordinate axes. The rotation of the coordinate axes are +-- determined by SPICE, in this case pretending that the coordinate axes are rotating at +-- the same rate as Earth. In this specific example, the orientation is independent of the +-- actual in-game time in OpenSpace and only uses a fixed date of 2000 JAN 01 instead. -- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel asset.require("spice/core") diff --git a/data/assets/examples/rotation/spicerotation/timeframe.asset b/data/assets/examples/rotation/spicerotation/spice_timeframe.asset similarity index 65% rename from data/assets/examples/rotation/spicerotation/timeframe.asset rename to data/assets/examples/rotation/spicerotation/spice_timeframe.asset index 6eb7eb3f90..326a741c90 100644 --- a/data/assets/examples/rotation/spicerotation/timeframe.asset +++ b/data/assets/examples/rotation/spicerotation/spice_timeframe.asset @@ -1,10 +1,10 @@ -- TimeFrame --- This asset creates a rotation provided by a SPICE kernel and applies it to a --- SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes --- are determined by SPICE, in this case pretending that the coordinate axes are rotating --- at the same rate as Earth. In this example, the rotation is only calculated between --- 2000 JAN 01 and 2002 JAN 01 to exemplify a use-case in which the data from the SPICE --- kernel is not available for the whole duration. +-- This asset creates a rotation provided by a SPICE kernel and applies it to a scene +-- graph node that only displays coordinate axes. The rotation of the coordinate axes are +-- determined by SPICE, in this case pretending that the coordinate axes are rotating at +-- the same rate as Earth. In this example, the rotation is only calculated between 2000 +-- JAN 01 and 2002 JAN 01 to exemplify a use-case in which the data from the SPICE kernel +-- is not available for the whole duration. -- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel asset.require("spice/core") diff --git a/data/assets/examples/rotation/spicerotation/timeoffset.asset b/data/assets/examples/rotation/spicerotation/timeoffset.asset index 73a84dab41..b508f8ddb5 100644 --- a/data/assets/examples/rotation/spicerotation/timeoffset.asset +++ b/data/assets/examples/rotation/spicerotation/timeoffset.asset @@ -1,8 +1,8 @@ -- Time offset --- This asset creates a rotation provided by a SPICE kernel and applies it to a --- SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes --- are determined by SPICE, in this case pretending that the coordinate axes are rotating --- at the same rate as Earth. In this specific example, the orientation is offset 8h back +-- This asset creates a rotation provided by a SPICE kernel and applies it to a scene +-- graph node that only displays coordinate axes. The rotation of the coordinate axes are +-- determined by SPICE, in this case pretending that the coordinate axes are rotating at +-- the same rate as Earth. In this specific example, the orientation is offset 8h back -- compared to the actual in-game time in OpenSpace. -- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel diff --git a/data/assets/examples/rotation/staticrotation/euler.asset b/data/assets/examples/rotation/staticrotation/static_euler.asset similarity index 76% rename from data/assets/examples/rotation/staticrotation/euler.asset rename to data/assets/examples/rotation/staticrotation/static_euler.asset index 3a8aa929a9..c024e7c0f6 100644 --- a/data/assets/examples/rotation/staticrotation/euler.asset +++ b/data/assets/examples/rotation/staticrotation/static_euler.asset @@ -1,7 +1,7 @@ -- Euler Angles --- This asset creates a rotation provided by Euler angles and applies it to a --- SceneGraphNode that only displays coordinate axes. The rotation of the coordinate axes --- are determined by a constant and unchanging static rotation. +-- This asset creates a rotation provided by Euler angles and applies it to a scene graph +-- node that only displays coordinate axes. The rotation of the coordinate axes are +-- determined by a constant and unchanging static rotation. local Node = { Identifier = "StaticRotation_Example_Euler", diff --git a/data/assets/examples/rotation/staticrotation/matrix.asset b/data/assets/examples/rotation/staticrotation/static_matrix.asset similarity index 70% rename from data/assets/examples/rotation/staticrotation/matrix.asset rename to data/assets/examples/rotation/staticrotation/static_matrix.asset index 60b530da7c..3f996e0815 100644 --- a/data/assets/examples/rotation/staticrotation/matrix.asset +++ b/data/assets/examples/rotation/staticrotation/static_matrix.asset @@ -1,7 +1,7 @@ -- Matrix --- This asset creates a SceneGraphNode that only displays coordinate axes. The rotation of --- the coordinate axes are determined by a constant and unchanging static rotation that is --- provided by a 3-by-3 rotation matrix in column-major order. +-- This asset creates a scene graph node that only displays coordinate axes. The rotation +-- of the coordinate axes are determined by a constant and unchanging static rotation that +-- is provided by a 3-by-3 rotation matrix in column-major order. local Node = { Identifier = "StaticRotation_Example_Matrix", diff --git a/data/assets/examples/rotation/staticrotation/quaternion.asset b/data/assets/examples/rotation/staticrotation/static_quaternion.asset similarity index 69% rename from data/assets/examples/rotation/staticrotation/quaternion.asset rename to data/assets/examples/rotation/staticrotation/static_quaternion.asset index ad1ea3929e..7aac867819 100644 --- a/data/assets/examples/rotation/staticrotation/quaternion.asset +++ b/data/assets/examples/rotation/staticrotation/static_quaternion.asset @@ -1,7 +1,7 @@ -- Quaternion --- This asset creates a SceneGraphNode that only displays coordinate axes. The rotation of --- the coordinate axes are determined by a constant and unchanging static rotation that is --- provided by a four-dimensional quaternion. +-- This asset creates a scene graph node that only displays coordinate axes. The rotation +-- of the coordinate axes are determined by a constant and unchanging static rotation that +-- is provided by a four-dimensional quaternion. local Node = { Identifier = "StaticRotation_Example_Quaternion", diff --git a/data/assets/examples/rotation/timelinerotation/timeline.asset b/data/assets/examples/rotation/timelinerotation/timeline.asset index 51db1d1361..04757d1ef4 100644 --- a/data/assets/examples/rotation/timelinerotation/timeline.asset +++ b/data/assets/examples/rotation/timelinerotation/timeline.asset @@ -1,9 +1,9 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes. The rotation of --- the coordinate axes are determined by a timeline of individual rotations. These rotations --- are keyframes that are used to seamlessly change between different orientations. This --- example transitions between three rotations over a long time span. This example will --- only work if the in-game time is set to January 1st, 2000. +-- This asset creates a scene graph node that only displays coordinate axes. The rotation +-- of the coordinate axes are determined by a timeline of individual rotations. These +-- rotations are keyframes that are used to seamlessly change between different +-- orientations. This example transitions between three rotations over a long time span. +-- This example will only work if the in-game time is set to January 1st, 2000. local Node = { Identifier = "TimelineRotation_Example", diff --git a/data/assets/examples/rotation/timelinerotation/no-interpolate.asset b/data/assets/examples/rotation/timelinerotation/timeline_no-interpolate.asset similarity index 56% rename from data/assets/examples/rotation/timelinerotation/no-interpolate.asset rename to data/assets/examples/rotation/timelinerotation/timeline_no-interpolate.asset index 5980216e71..376fa9fa35 100644 --- a/data/assets/examples/rotation/timelinerotation/no-interpolate.asset +++ b/data/assets/examples/rotation/timelinerotation/timeline_no-interpolate.asset @@ -1,13 +1,13 @@ -- No Interpolation --- This asset creates a SceneGraphNode that only displays coordinate axes. The rotation of --- the coordinate axes are determined by a timeline of individual rotations that are used --- without interpolating between the timeline entries. These rotations are keyframes that --- are used to change between different orientations. This example transitions between --- three rotations. In this example, the interpolation between entries is disabled, which --- will cause the coordinate axes to change their orientation abruptly when the rotation --- changes. If the interpolation were enabled, the orientation of the coordinate axes --- would transition seamlessly instead at the provided times. This example will only work --- if the in-game time is set to January 1st, 2000. +-- This asset creates a scene graph node that only displays coordinate axes. The rotation +-- of the coordinate axes are determined by a timeline of individual rotations that are +-- used without interpolating between the timeline entries. These rotations are keyframes +-- that are used to change between different orientations. This example transitions +-- between three rotations. In this example, the interpolation between entries is +-- disabled, which will cause the coordinate axes to change their orientation abruptly +-- when the rotation changes. If the interpolation were enabled, the orientation of the +-- coordinate axes would transition seamlessly instead at the provided times. This example +-- will only work if the in-game time is set to January 1st, 2000. local Node = { Identifier = "TimelineRotation_Example_NoInterpolation", diff --git a/data/assets/examples/scale/luascale/lua.asset b/data/assets/examples/scale/luascale/lua.asset index b36911727b..17a2271946 100644 --- a/data/assets/examples/scale/luascale/lua.asset +++ b/data/assets/examples/scale/luascale/lua.asset @@ -1,5 +1,5 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes. The sizes of +-- This asset creates a scene graph node that only displays coordinate axes. The sizes of -- coordinate axes are determined by executing a Lua file that returns the scaling -- parameters to be used as a table. -- diff --git a/data/assets/examples/scale/multiscale/multi.asset b/data/assets/examples/scale/multiscale/multi.asset index fd3b6c6992..56237700be 100644 --- a/data/assets/examples/scale/multiscale/multi.asset +++ b/data/assets/examples/scale/multiscale/multi.asset @@ -1,5 +1,5 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes, with a set of +-- This asset creates a scene graph node that only displays coordinate axes, with a set of -- multiple scales that are applied one after the other. local Node = { diff --git a/data/assets/examples/scale/nonuniformstaticscale/nonuniformstatic.asset b/data/assets/examples/scale/nonuniformstaticscale/nonuniformstatic.asset index a0bfdef597..7f44c6edd1 100644 --- a/data/assets/examples/scale/nonuniformstaticscale/nonuniformstatic.asset +++ b/data/assets/examples/scale/nonuniformstaticscale/nonuniformstatic.asset @@ -1,10 +1,10 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes. The coordinate --- axis normally have a length of 1 meter and are scaled in this example by different --- values for each axis. The x axis is scaled by a factor of 149597870700, which means --- they will be 149597870700 m (1 AU) long and thus reaching the same distance as Earth's --- orbit around the Sun. The y-axis stays at its original size, and the z-axis will be --- hidden entirely by setting the scale value close to 0. +-- This asset creates a scene graph node that only displays coordinate axes. The +-- coordinate axis normally have a length of 1 meter and are scaled in this example by +-- different values for each axis. The x axis is scaled by a factor of 149597870700, which +-- means they will be 149597870700 m (1 AU) long and thus reaching the same distance as +-- Earth's orbit around the Sun. The y-axis stays at its original size, and the z-axis +-- will be hidden entirely by setting the scale value close to 0. local Node = { Identifier = "NonUniformStaticScale_Example", diff --git a/data/assets/examples/scale/nonuniformstaticscale/nonuniformstatic_ellipsoid.asset b/data/assets/examples/scale/nonuniformstaticscale/nonuniformstatic_ellipsoid.asset index 4f6a1c8169..2fdbb125c9 100644 --- a/data/assets/examples/scale/nonuniformstaticscale/nonuniformstatic_ellipsoid.asset +++ b/data/assets/examples/scale/nonuniformstaticscale/nonuniformstatic_ellipsoid.asset @@ -1,5 +1,5 @@ -- Ellipsoid --- This asset creates a SceneGraphNode that is rendering a sphere which is adjust to an +-- This asset creates a scene graph node that is rendering a sphere which is adjust to an -- ellipsoidal shape by using a non-uniform scaling. In particular, the second axis is -- half as long as the first, and the third axis is a third as long. diff --git a/data/assets/examples/scale/staticscale/static.asset b/data/assets/examples/scale/staticscale/static.asset index bde46f25d0..8d1c280d75 100644 --- a/data/assets/examples/scale/staticscale/static.asset +++ b/data/assets/examples/scale/staticscale/static.asset @@ -1,8 +1,8 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes. The coordinate --- axis normally have a length of 1 meter and are scaled in this example by a factor of --- 149597870700, which means they will be 149597870700 m (1 AU) long, thus reaching the --- same distance as Earth's orbit around the Sun. +-- This asset creates a scene graph node that only displays coordinate axes. The +-- coordinate axis normally have a length of 1 meter and are scaled in this example by a +-- factor of 149597870700, which means they will be 149597870700 m (1 AU) long, thus +-- reaching the same distance as Earth's orbit around the Sun. local Node = { Identifier = "StaticScale_Example", diff --git a/data/assets/examples/scale/timedependentscale/timedependent.asset b/data/assets/examples/scale/timedependentscale/timedependent.asset index 80db2ffbc7..91d598c197 100644 --- a/data/assets/examples/scale/timedependentscale/timedependent.asset +++ b/data/assets/examples/scale/timedependentscale/timedependent.asset @@ -1,5 +1,5 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes, which grow at +-- This asset creates a scene graph node that only displays coordinate axes, which grow at -- a speed of 1 m/s starting on January 1st, 2000 00:00:00. This means that on -- that date, the coordinate axes will disappear and, for example, on January 1st, 2000 -- 12:00:00, the coordinate axes will be 43200 meters long. diff --git a/data/assets/examples/scale/timedependentscale/timedependent_speed.asset b/data/assets/examples/scale/timedependentscale/timedependent_speed.asset index 77e353d259..6dfaac3816 100644 --- a/data/assets/examples/scale/timedependentscale/timedependent_speed.asset +++ b/data/assets/examples/scale/timedependentscale/timedependent_speed.asset @@ -1,5 +1,5 @@ -- with Speed --- This asset creates a SceneGraphNode that only displays coordinate axes, which grow at +-- This asset creates a scene graph node that only displays coordinate axes, which grow at -- a speed of 12 km/s starting on August 8th, 1969 12:00:00. This means that on -- that date, the coordinate axes will disappear and, for example, on August 8th, 1969 -- 23:00:00, the coordinate axes will be 475200 km long. diff --git a/data/assets/examples/scale/timelinescale/no-interpolate.asset b/data/assets/examples/scale/timelinescale/no-interpolate.asset index 76d5f54ec3..5b9ba449bd 100644 --- a/data/assets/examples/scale/timelinescale/no-interpolate.asset +++ b/data/assets/examples/scale/timelinescale/no-interpolate.asset @@ -1,5 +1,5 @@ -- No Interpolation --- This asset creates a SceneGraphNode that only displays coordinate axes. The scale of +-- This asset creates a scene graph node that only displays coordinate axes. The scale of -- the coordinate axes are determined by a timeline of individual scales that are used -- without interpolating between the timeline entries. These scales are keyframes that are -- used to change between different sizes. This example transitions between three sizes. diff --git a/data/assets/examples/scale/timelinescale/timeline.asset b/data/assets/examples/scale/timelinescale/timeline.asset index 3029f4d148..6ed4f59522 100644 --- a/data/assets/examples/scale/timelinescale/timeline.asset +++ b/data/assets/examples/scale/timelinescale/timeline.asset @@ -1,5 +1,5 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes. The scale of +-- This asset creates a scene graph node that only displays coordinate axes. The scale of -- the coordinate axes are determined by a timeline of individual scales. These scales -- are keyframes that are used to seamlessly change between different sizes. This example -- transitions between three scales over a long time span. This example will only work if diff --git a/data/assets/examples/scale/timelinescale/timeline_no-interpolate.asset b/data/assets/examples/scale/timelinescale/timeline_no-interpolate.asset new file mode 100644 index 0000000000..abcdbffd9b --- /dev/null +++ b/data/assets/examples/scale/timelinescale/timeline_no-interpolate.asset @@ -0,0 +1,53 @@ +-- No Interpolation +-- This asset creates a scene graph node that only displays coordinate axes whose scale is +-- determined by a timeline of individual scales that are used without interpolating +-- between the timeline entries. These scales are keyframes that are used to change +-- between different sizes. +-- +-- This example transitions between three sizes, but as the interpolation between entries +-- is disabled, it will cause the coordinate axes to change their size abruptly when the +-- scale changes. If the interpolation were enabled, the orientation of the coordinate +-- axes would transition seamlessly instead at the provided times. This example will only +-- work if the in-game time is set to January 1st, 2000. + +local Node = { + Identifier = "TimelineScale_Example_NoInterpolation", + Transform = { + Scale = { + Type = "TimelineScale", + Keyframes = { + -- The first timeline entry + ["2000 JAN 01 00:00:00"] = { + Type = "StaticScale", + Scale = 10.0 + }, + -- The second timeline entry + ["2000 JAN 01 12:00:00"] = { + Type = "StaticScale", + Scale = 0.0 + }, + -- The third timeline entry + ["2000 JAN 01 23:59:59"] = { + Type = "StaticScale", + Scale = -10.0 + } + }, + ShouldInterpolate = false + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "TimelineScale - No Interpolation", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/screenspacedistancetoearth.asset b/data/assets/examples/screenspacedistancetoearth.asset index 8200f392a1..3ef61d806f 100644 --- a/data/assets/examples/screenspacedistancetoearth.asset +++ b/data/assets/examples/screenspacedistancetoearth.asset @@ -16,7 +16,7 @@ local Dashboard = { FontSize = 40, SourceType = "Camera", DestinationType = "Node", - DestinationNodeName = earth.Earth.Identifier, + DestinationNodeIdentifier = earth.Earth.Identifier, -- Specify to use a specific unit, by disabling the automatic simplification of -- unit and instead use light-years Simplification = false, diff --git a/data/assets/examples/timeframe/interval.asset b/data/assets/examples/timeframe/interval.asset new file mode 100644 index 0000000000..acfb800eb5 --- /dev/null +++ b/data/assets/examples/timeframe/interval.asset @@ -0,0 +1,28 @@ +-- Basic +-- This example creates time frame interval and uses it for a scene graph node displaying +-- a set of coordinate axes. The time frame interval causes the scene graph node to only +-- be valid between January 1st, 2000 and March 1st, 2002. + +local Node = { + Identifier = "TimeFrameInterval_Example", + TimeFrame = { + Type = "TimeFrameInterval", + Start = "2000 JAN 01 00:00:00.000", + End = "2002 MAR 02 00:00:00.00" + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "TimeFrameInterval - Basic", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/timeframe/union.asset b/data/assets/examples/timeframe/union.asset index f1fa1bd62b..2b4014a90e 100644 --- a/data/assets/examples/timeframe/union.asset +++ b/data/assets/examples/timeframe/union.asset @@ -13,13 +13,13 @@ local Node = { { Type = "TimeFrameInterval", Start = "2000 JAN 01 00:00:00.000", - End = "2000 JAN 01 23:59:59.999" + End = "2000 JAN 02 00:00:00.000" }, -- The second TimeFrameInterval for the second day { Type = "TimeFrameInterval", Start = "2002 MAR 01 00:00:00.000", - End = "2002 MAR 01 23:59:59.999" + End = "2002 MAR 02 00:00:00.000" } } }, diff --git a/data/assets/examples/translation/luatranslation/lua.asset b/data/assets/examples/translation/luatranslation/lua.asset index 722b8f1830..bf14caa61d 100644 --- a/data/assets/examples/translation/luatranslation/lua.asset +++ b/data/assets/examples/translation/luatranslation/lua.asset @@ -1,8 +1,9 @@ -- Basic --- This asset creates a SceneGraphNode that only displays coordinate axes. The coordinate --- axes are translated by a value determined by executing a Lua file that returns the --- translation parameters to be used as a table. In order to see the translation, we need --- to also have a node that does not move so that we can see the relative movement. +-- This asset creates a scene graph node that only displays coordinate axes. The +-- coordinate axes are translated by a value determined by executing a Lua file that +-- returns the translation parameters to be used as a table. In order to see the +-- translation, we need to also have a node that does not move so that we can see the +-- relative movement. -- -- ```{literalinclude} example.lua -- :language: lua diff --git a/data/assets/examples/translation/spicetranslation/spice.asset b/data/assets/examples/translation/spicetranslation/spice.asset index 49b33775e5..3a2cd972b1 100644 --- a/data/assets/examples/translation/spicetranslation/spice.asset +++ b/data/assets/examples/translation/spicetranslation/spice.asset @@ -1,7 +1,7 @@ -- Basic -- This asset creates a time-varying translation with information from a SPICE kernel and --- applies it to a SceneGraphNode that only displays coordinate axes. The position of the --- coordinate axes are determined by SPICE, in this case pretending that the axes are +-- applies it to a scene graph node that only displays coordinate axes. The position of +-- the coordinate axes are determined by SPICE, in this case pretending that the axes are -- orbiting the same way the Moon does around Earth. -- For more information about SPICE see: https://naif.jpl.nasa.gov/naif/ diff --git a/data/assets/examples/translation/spicetranslation/fixeddate.asset b/data/assets/examples/translation/spicetranslation/spice_fixeddate.asset similarity index 85% rename from data/assets/examples/translation/spicetranslation/fixeddate.asset rename to data/assets/examples/translation/spicetranslation/spice_fixeddate.asset index 93285faa76..f7a5b93efa 100644 --- a/data/assets/examples/translation/spicetranslation/fixeddate.asset +++ b/data/assets/examples/translation/spicetranslation/spice_fixeddate.asset @@ -1,7 +1,7 @@ -- Fixed Date -- This asset creates a time-varying translation with information from a SPICE kernel and --- applies it to a SceneGraphNode that only displays coordinate axes. The position of the --- coordinate axes are determined by SPICE, in this case pretending that the axes are +-- applies it to a scene graph node that only displays coordinate axes. The position of +-- the coordinate axes are determined by SPICE, in this case pretending that the axes are -- orbiting the same way the Moon does around Earth. In this specific example, the -- position is independent of the actual in-game time in OpenSpace and only uses a fixed -- date of 2000 JAN 01 instead. diff --git a/data/assets/examples/translation/spicetranslation/referenceframe.asset b/data/assets/examples/translation/spicetranslation/spice_referenceframe.asset similarity index 84% rename from data/assets/examples/translation/spicetranslation/referenceframe.asset rename to data/assets/examples/translation/spicetranslation/spice_referenceframe.asset index cb16f29b19..e74df0da07 100644 --- a/data/assets/examples/translation/spicetranslation/referenceframe.asset +++ b/data/assets/examples/translation/spicetranslation/spice_referenceframe.asset @@ -1,7 +1,7 @@ -- Reference Frame -- This asset creates a time-varying translation with information from a SPICE kernel and --- applies it to a SceneGraphNode that only displays coordinate axes. The position of the --- coordinate axes are determined by SPICE, in this case pretending that the axes are +-- applies it to a scene graph node that only displays coordinate axes. The position of +-- the coordinate axes are determined by SPICE, in this case pretending that the axes are -- orbiting the same way the Moon does around Earth. The calculated position will be -- provided in the rotating coordinate system of Earth itself. -- For more information about SPICE see: https://naif.jpl.nasa.gov/naif/ diff --git a/data/assets/examples/translation/spicetranslation/timeoffset.asset b/data/assets/examples/translation/spicetranslation/timeoffset.asset index 1e557447f9..e5170fc2d7 100644 --- a/data/assets/examples/translation/spicetranslation/timeoffset.asset +++ b/data/assets/examples/translation/spicetranslation/timeoffset.asset @@ -1,7 +1,7 @@ -- Fixed Date -- This asset creates a time-varying translation with information from a SPICE kernel and --- applies it to a SceneGraphNode that only displays coordinate axes. The position of the --- coordinate axes are determined by SPICE, in this case pretending that the axes are +-- applies it to a scene graph node that only displays coordinate axes. The position of +-- the coordinate axes are determined by SPICE, in this case pretending that the axes are -- orbiting the same way the Moon does around Earth. In this specific example, the position -- is offset 8h back compared to the actual in-game time in OpenSpace. -- For more information about SPICE see: https://naif.jpl.nasa.gov/naif/ diff --git a/data/assets/examples/translation/timelinetranslation/timeline.asset b/data/assets/examples/translation/timelinetranslation/timeline.asset new file mode 100644 index 0000000000..d7151a9c92 --- /dev/null +++ b/data/assets/examples/translation/timelinetranslation/timeline.asset @@ -0,0 +1,48 @@ +-- Basic +-- This asset creates a scene graph node that only displays coordinate axes whose +-- translation of the coordinate axes is determined by a timeline of individual +-- translations. These translations are provided as keyframes that interpolate seamlessly +-- between different positions. +-- +-- This example will only work if the in-game time is set to January 1st, 2000. + +local Node = { + Identifier = "TimelineTranslation_Example", + Transform = { + Translation = { + Type = "TimelineTranslation", + Keyframes = { + -- The first timeline entry + ["2000 JAN 01 00:00:00"] = { + Type = "StaticTranslation", + Position = { -10.0, 0.0, 0.0 } + }, + -- The second timeline entry + ["2000 JAN 01 12:00:00"] = { + Type = "StaticTranslation", + Position = { 0.0, 0.0, 0.0 } + }, + -- The third timeline entry + ["2000 JAN 01 23:59:59"] = { + Type = "StaticTranslation", + Position = { 10.0, 0.0, 0.0 } + } + } + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "TimelineTranslation - Basic", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/translation/timelinetranslation/timeline_no-interpolate.asset b/data/assets/examples/translation/timelinetranslation/timeline_no-interpolate.asset new file mode 100644 index 0000000000..0a8b05609f --- /dev/null +++ b/data/assets/examples/translation/timelinetranslation/timeline_no-interpolate.asset @@ -0,0 +1,55 @@ +-- No Interpolation +-- This asset creates a scene graph node that only displays coordinate axes whose +-- translation of the coordinate axes is determined by a timeline of individual +-- translations that are used without interpolating between the timeline entries. These +-- translations are keyframes that are used to change between different positions. +-- +-- This example transitions between three positions. In this example, the interpolation +-- between entries is disabled, which will cause the coordinate axes to change their +-- position abruptly when the translation changes. If the interpolation were enabled, the +-- orientation of the coordinate axes would transition seamlessly instead at the provided +-- times. +-- +-- This example will only work if the in-game time is set to January 1st, 2000. + +local Node = { + Identifier = "TimelineTranslation_Example_NoInterpolation", + Transform = { + Translation = { + Type = "TimelineTranslation", + Keyframes = { + -- The first timeline entry + ["2000 JAN 01 00:00:00"] = { + Type = "StaticTranslation", + Position = { -10.0, 0.0, 0.0 } + }, + -- The second timeline entry + ["2000 JAN 01 12:00:00"] = { + Type = "StaticTranslation", + Position = { 0.0, 0.0, 0.0 } + }, + -- The third timeline entry + ["2000 JAN 01 23:59:59"] = { + Type = "StaticTranslation", + Position = { 10.0, 0.0, 0.0 } + } + }, + ShouldInterpolate = false + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "TimelineTranslation - No Interpolation", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/scene/solarsystem/missions/juice/dashboard.asset b/data/assets/scene/solarsystem/missions/juice/dashboard.asset index fdd20f5580..0f9693a22a 100644 --- a/data/assets/scene/solarsystem/missions/juice/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/juice/dashboard.asset @@ -9,9 +9,9 @@ local DistanceJuiceJupiter = { Identifier = "JuiceJupiterDistance", Enabled = asset.enabled, SourceType = "Node", - SourceNodeName = juice.Juice.Identifier, + SourceNodeIdentifier = juice.Juice.Identifier, DestinationType = "Node", - DestinationNodeName = jupiter.Jupiter.Identifier, + DestinationNodeIdentifier = jupiter.Jupiter.Identifier, GuiName = "Juice - Jupiter Distance" } @@ -20,9 +20,9 @@ local DistanceJuiceGanymede = { Identifier = "JuiceGanymedeDistance", Enabled = asset.enabled, SourceType = "Node", - SourceNodeName = juice.Juice.Identifier, + SourceNodeIdentifier = juice.Juice.Identifier, DestinationType = "Node", - DestinationNodeName = ganymede.Ganymede.Identifier, + DestinationNodeIdentifier = ganymede.Ganymede.Identifier, GuiName = "Juice - Ganymede Distance" } diff --git a/data/assets/scene/solarsystem/missions/messenger/dashboard.asset b/data/assets/scene/solarsystem/missions/messenger/dashboard.asset index a43bebb168..f8cb849e1e 100644 --- a/data/assets/scene/solarsystem/missions/messenger/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/messenger/dashboard.asset @@ -8,9 +8,9 @@ local Distance = { Identifier = "MessengerDistance", GuiName = "Messenger - Mercury Distance", SourceType = "Node", - SourceNodeName = messenger.Messenger.Identifier, + SourceNodeIdentifier = messenger.Messenger.Identifier, DestinationType = "Node", - DestinationNodeName = mercury.Mercury.Identifier + DestinationNodeIdentifier = mercury.Mercury.Identifier } diff --git a/data/assets/scene/solarsystem/missions/newhorizons/dashboard.asset b/data/assets/scene/solarsystem/missions/newhorizons/dashboard.asset index 919c069a25..4c4d763297 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/dashboard.asset @@ -15,9 +15,9 @@ local Distance = { Identifier = "NewHorizonsPlutoDistance", GuiName = "New Horizons Pluto Distance", SourceType = "Node", - SourceNodeName = "NewHorizons", + SourceNodeIdentifier = "NewHorizons", DestinationType = "Node Surface", - DestinationNodeName = "PlutoProjection" + DestinationNodeIdentifier = "PlutoProjection" } local Instruments = { diff --git a/data/assets/scene/solarsystem/missions/osirisrex/dashboard.asset b/data/assets/scene/solarsystem/missions/osirisrex/dashboard.asset index 5427a98485..bbc027c8a5 100644 --- a/data/assets/scene/solarsystem/missions/osirisrex/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/osirisrex/dashboard.asset @@ -15,9 +15,9 @@ local Distance = { Identifier = "OsirisRexBennuDistance", GuiName = "OSIRIS-REx Bennu Distance", SourceType = "Node", - SourceNodeName = model.OsirisRex.Identifier, + SourceNodeIdentifier = model.OsirisRex.Identifier, DestinationType = "Node", - DestinationNodeName = transforms.BennuBarycenter.Identifier + DestinationNodeIdentifier = transforms.BennuBarycenter.Identifier } local Instruments = { diff --git a/data/assets/scene/solarsystem/missions/rosetta/dashboard.asset b/data/assets/scene/solarsystem/missions/rosetta/dashboard.asset index 6091b75d85..41aecc2271 100644 --- a/data/assets/scene/solarsystem/missions/rosetta/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/rosetta/dashboard.asset @@ -15,9 +15,9 @@ local Distance = { Identifier = "Rosetta67PDistance", GuiName = "Rosetta 67P Distance", SourceType = "Node", - SourceNodeName = rosetta.Rosetta.Identifier, + SourceNodeIdentifier = rosetta.Rosetta.Identifier, DestinationType = "Node", - DestinationNodeName = cg.Comet67P.Identifier + DestinationNodeIdentifier = cg.Comet67P.Identifier } local Instruments = { diff --git a/data/assets/scene/solarsystem/missions/voyager/dashboard.asset b/data/assets/scene/solarsystem/missions/voyager/dashboard.asset index 64ab43fa87..3a3c21e029 100644 --- a/data/assets/scene/solarsystem/missions/voyager/dashboard.asset +++ b/data/assets/scene/solarsystem/missions/voyager/dashboard.asset @@ -8,9 +8,9 @@ local DistanceVoyager1 = { Identifier = "Voyager1Distance", GuiName = "Voyager 1 - Earth Distance", SourceType = "Node", - SourceNodeName = voyager1.Voyager_1.Identifier, + SourceNodeIdentifier = voyager1.Voyager_1.Identifier, DestinationType = "Node", - DestinationNodeName = earth.Earth.Identifier, + DestinationNodeIdentifier = earth.Earth.Identifier, Enabled = asset.enabled } @@ -19,9 +19,9 @@ local DistanceVoyager2 = { Identifier = "Voyager2Distance", GuiName = "Voyager 2 - Earth Distance", SourceType = "Node", - SourceNodeName = voyager2.Voyager_2.Identifier, + SourceNodeIdentifier = voyager2.Voyager_2.Identifier, DestinationType = "Node", - DestinationNodeName = earth.Earth.Identifier, + DestinationNodeIdentifier = earth.Earth.Identifier, Enabled = asset.enabled } diff --git a/data/assets/scene/solarsystem/telescopes/gaia/dashboard.asset b/data/assets/scene/solarsystem/telescopes/gaia/dashboard.asset index 1c5bc07537..bc7598dc81 100644 --- a/data/assets/scene/solarsystem/telescopes/gaia/dashboard.asset +++ b/data/assets/scene/solarsystem/telescopes/gaia/dashboard.asset @@ -8,9 +8,9 @@ local distance = { Identifier = "GaiaEarthDistance", GuiName = "Gaia Earth Distance", SourceType = "Node", - SourceNodeName = gaia.Gaia.Identifier, + SourceNodeIdentifier = gaia.Gaia.Identifier, DestinationType = "Node Surface", - DestinationNodeName = earth.Earth.Identifier + DestinationNodeIdentifier = earth.Earth.Identifier } diff --git a/modules/base/dashboard/dashboarditemangle.cpp b/modules/base/dashboard/dashboarditemangle.cpp index e030993dc2..03e8f1e986 100644 --- a/modules/base/dashboard/dashboarditemangle.cpp +++ b/modules/base/dashboard/dashboarditemangle.cpp @@ -50,16 +50,16 @@ namespace { "SourceType", "Source Type", "The type of position that is used as the triangle apex used to calculate the " - "angle. The default value is 'Camera'.", + "angle.", openspace::properties::Property::Visibility::User }; - constexpr openspace::properties::Property::PropertyInfo SourceNodeNameInfo = { - "SourceNodeName", - "Source Node Name", - "If a scene graph node is selected as type, this value specifies the name of the " - "node that is to be used as the apex of the triangle used to calculate the " - "angle. The computed angle is the incident angle to Source in the triangle (" + constexpr openspace::properties::Property::PropertyInfo SourceNodeIdentifierInfo = { + "SourceNodeIdentifier", + "Source Node Identifier", + "If a scene graph node is selected as type, this value specifies the identifier " + "of the node that is to be used as the apex of the triangle used to calculate " + "the angle. The computed angle is the incident angle to Source in the triangle (" "Source, Reference, Destination).", openspace::properties::Property::Visibility::User }; @@ -73,11 +73,12 @@ namespace { openspace::properties::Property::Visibility::User }; - constexpr openspace::properties::Property::PropertyInfo ReferenceNodeNameInfo = { - "ReferenceNodeName", - "Reference Node Name", - "If a scene graph node is selected as type, this value specifies the name of the " - "node that is to be used as the reference direction to compute the angle.", + constexpr openspace::properties::Property::PropertyInfo ReferenceNodeIdentifierInfo = + { + "ReferenceNodeIdentifier", + "Reference Node Identifier", + "If a scene graph node is selected as type, this value specifies the identifier " + "of the node that is to be used as the reference direction to compute the angle.", openspace::properties::Property::Visibility::User }; @@ -86,21 +87,27 @@ namespace { "Destination Type", "The type of position that is used as the destination to calculate the angle. " "The computed angle is the incident angle to Source in the triangle (" - "Source, Reference, Destination). The default value for this is 'Focus'.", + "Source, Reference, Destination).", openspace::properties::Property::Visibility::User }; - constexpr openspace::properties::Property::PropertyInfo DestinationNodeNameInfo = { - "DestinationNodeName", - "Destination Node Name", - "If a scene graph node is selected as type, this value specifies the name of the " - "node that is to be used as the destination for computing the angle.", + constexpr openspace::properties::Property::PropertyInfo + DestinationNodeIdentifierInfo = + { + "DestinationNodeIdentifier", + "Destination Node Identifier", + "If a scene graph node is selected as type, this value specifies the identifier " + "of the node that is to be used as the destination for computing the angle.", openspace::properties::Property::Visibility::User }; - // This DashboardItem shows the angle between two scenegraph nodes relative to a - // reference node. The angle is calculated in the plane that is defined by the - // 'SourceNodeName', 'DestinationNodeName', and the 'ReferenceNodeName'. + // This `DashboardItem` shows the angle between the lines `Source`->`Reference` and + // `Source`->`Destination`. Each of `Source`, `Reference`, and `Destination` can be + // either the identifier of a node, the current focus node, or the position of the + // camera. The angle cannot be calculated if two of these three items are located in + // the same position, in which case an error message is printed. The `SourceNodeName`, + // `ReferenceNodeName`, and `DestinationNodeName` parameters are only used if the + // `SourceType`, `ReferenceType`, or `DestinationType` respectively is set to `Node`. struct [[codegen::Dictionary(DashboardItemAngle)]] Parameters { enum class [[codegen::map(Type)]] Type { Node, @@ -109,17 +116,17 @@ namespace { }; // [[codegen::verbatim(SourceTypeInfo.description)]] - std::optional sourceType; - // [[codegen::verbatim(SourceNodeNameInfo.description)]] - std::optional sourceNodeName; + Type sourceType; + // [[codegen::verbatim(SourceNodeIdentifierInfo.description)]] + std::optional sourceNodeIdentifier; // [[codegen::verbatim(ReferenceTypeInfo.description)]] Type referenceType; - // [[codegen::verbatim(ReferenceNodeNameInfo.description)]] - std::optional referenceNodeName; + // [[codegen::verbatim(ReferenceNodeIdentifierInfo.description)]] + std::optional referenceNodeIdentifier; // [[codegen::verbatim(DestinationTypeInfo.description)]] - std::optional destinationType; - // [[codegen::verbatim(DestinationNodeNameInfo.description)]] - std::optional destinationNodeName; + Type destinationType; + // [[codegen::verbatim(DestinationNodeIdentifierInfo.description)]] + std::optional destinationNodeIdentifier; }; #include "dashboarditemangle_codegen.cpp" } // namespace @@ -140,7 +147,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) SourceTypeInfo, properties::OptionProperty::DisplayType::Dropdown ), - properties::StringProperty(SourceNodeNameInfo), + properties::StringProperty(SourceNodeIdentifierInfo), nullptr } , _reference{ @@ -148,7 +155,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) ReferenceTypeInfo, properties::OptionProperty::DisplayType::Dropdown ), - properties::StringProperty(ReferenceNodeNameInfo), + properties::StringProperty(ReferenceNodeIdentifierInfo), nullptr } , _destination{ @@ -156,7 +163,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) DestinationTypeInfo, properties::OptionProperty::DisplayType::Dropdown ), - properties::StringProperty(DestinationNodeNameInfo), + properties::StringProperty(DestinationNodeIdentifierInfo), nullptr } { @@ -167,18 +174,13 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) { Type::Focus, "Focus" }, { Type::Camera, "Camera" } }); - if (p.sourceType.has_value()) { - _source.type = codegen::map(*p.sourceType); - } - else { - _source.type = Type::Camera; - } + _source.type = codegen::map(p.sourceType); addProperty(_source.type); - _source.nodeName.onChange([this]() { _source.node = nullptr; }); + _source.nodeIdentifier.onChange([this]() { _source.node = nullptr; }); if (_source.type == Type::Node) { - if (p.sourceNodeName.has_value()) { - _source.nodeName = *p.sourceNodeName; + if (p.sourceNodeIdentifier.has_value()) { + _source.nodeIdentifier = *p.sourceNodeIdentifier; } else { LERRORC( @@ -187,7 +189,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) ); } } - addProperty(_source.nodeName); + addProperty(_source.nodeIdentifier); _reference.type.addOptions({ @@ -198,10 +200,10 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) _reference.type = codegen::map(p.referenceType); addProperty(_reference.type); - _reference.nodeName.onChange([this]() { _reference.node = nullptr; }); + _reference.nodeIdentifier.onChange([this]() { _reference.node = nullptr; }); if (_reference.type == Type::Node) { - if (p.referenceNodeName.has_value()) { - _reference.nodeName = *p.referenceNodeName; + if (p.referenceNodeIdentifier.has_value()) { + _reference.nodeIdentifier = *p.referenceNodeIdentifier; } else { LERRORC( @@ -210,24 +212,19 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) ); } } - addProperty(_reference.nodeName); + addProperty(_reference.nodeIdentifier); _destination.type.addOptions({ { Type::Node, "Node" }, { Type::Focus, "Focus" }, { Type::Camera, "Camera" } }); - if (p.destinationType.has_value()) { - _destination.type = codegen::map(*p.destinationType); - } - else { - _destination.type = Type::Focus; - } + _destination.type = codegen::map(p.destinationType); addProperty(_destination.type); - _destination.nodeName.onChange([this]() { _destination.node = nullptr; }); + _destination.nodeIdentifier.onChange([this]() { _destination.node = nullptr; }); if (_destination.type == Type::Node) { - if (p.destinationNodeName.has_value()) { - _destination.nodeName = *p.destinationNodeName; + if (p.destinationNodeIdentifier.has_value()) { + _destination.nodeIdentifier = *p.destinationNodeIdentifier; } else { LERRORC( @@ -236,7 +233,7 @@ DashboardItemAngle::DashboardItemAngle(const ghoul::Dictionary& dictionary) ); } } - addProperty(_destination.nodeName); + addProperty(_destination.nodeIdentifier); _localBuffer.resize(128); } @@ -255,7 +252,8 @@ void DashboardItemAngle::update() { if (glm::length(a) == 0.0 || glm::length(b) == 0) { char* end = std::format_to( _localBuffer.data(), - "Could not compute angle at {} between {} and {}", + "Could not compute angle at {} between {} and {}. At least two of the three " + "items are placed in the same location", sourceInfo.second, destinationInfo.second, referenceInfo.second ); _buffer = std::string(_localBuffer.data(), end - _localBuffer.data()); @@ -284,12 +282,13 @@ glm::vec2 DashboardItemAngle::size() const { std::pair DashboardItemAngle::positionAndLabel(Component& comp) { if (comp.type == Type::Node) { if (!comp.node) { - comp.node = global::renderEngine->scene()->sceneGraphNode(comp.nodeName); + comp.node = + global::renderEngine->scene()->sceneGraphNode(comp.nodeIdentifier); if (!comp.node) { LERRORC( "DashboardItemAngle", - "Could not find node '" + comp.nodeName.value() + "'" + "Could not find node '" + comp.nodeIdentifier.value() + "'" ); return { glm::dvec3(0.0), "Node" }; } diff --git a/modules/base/dashboard/dashboarditemangle.h b/modules/base/dashboard/dashboarditemangle.h index 9acc87dce3..b178bc1f41 100644 --- a/modules/base/dashboard/dashboarditemangle.h +++ b/modules/base/dashboard/dashboarditemangle.h @@ -51,7 +51,7 @@ public: private: struct Component { properties::OptionProperty type; - properties::StringProperty nodeName; + properties::StringProperty nodeIdentifier; SceneGraphNode* node; }; diff --git a/modules/base/dashboard/dashboarditemdate.cpp b/modules/base/dashboard/dashboarditemdate.cpp index e73c82293c..fb08128277 100644 --- a/modules/base/dashboard/dashboarditemdate.cpp +++ b/modules/base/dashboard/dashboarditemdate.cpp @@ -40,7 +40,8 @@ namespace { "FormatString", "Format String", "The format text describing how this dashboard item renders its text. This text " - "must contain exactly one {} which is a placeholder that will contain the date.", + "must contain exactly one {} which is a placeholder that will contain the date " + "in the format as specified by `TimeFormat`.", openspace::properties::Property::Visibility::AdvancedUser }; @@ -54,6 +55,10 @@ namespace { openspace::properties::Property::Visibility::User }; + // This `DashboardItem` shows the current in-game simulation time. The `FormatString` + // and the `TimeFormat` options provide the ability to customize the output that is + // printed. See these two parameters for more information on how to structure the + // inputs. struct [[codegen::Dictionary(DashboardItemDate)]] Parameters { // [[codegen::verbatim(FormatStringInfo.description)]] std::optional formatString; @@ -75,8 +80,8 @@ documentation::Documentation DashboardItemDate::Documentation() { DashboardItemDate::DashboardItemDate(const ghoul::Dictionary& dictionary) : DashboardTextItem(dictionary, 15.f) - , _formatString(FormatStringInfo, "Date: {} UTC") - , _timeFormat(TimeFormatInfo, "YYYY MON DDTHR:MN:SC.### ::RND") + , _formatString(FormatStringInfo, "Date: {}") + , _timeFormat(TimeFormatInfo, "YYYY MON DD HR:MN:SC.### UTC ::RND") { const Parameters p = codegen::bake(dictionary); diff --git a/modules/base/dashboard/dashboarditemdistance.cpp b/modules/base/dashboard/dashboarditemdistance.cpp index e687ec7353..60961ed2a7 100644 --- a/modules/base/dashboard/dashboarditemdistance.cpp +++ b/modules/base/dashboard/dashboarditemdistance.cpp @@ -51,32 +51,32 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SourceTypeInfo = { "SourceType", "Source Type", - "The type of position that is used as the source to calculate the distance. The " - "default value is 'Camera'.", + "The type of position that is used as the source to calculate the distance.", openspace::properties::Property::Visibility::User }; - constexpr openspace::properties::Property::PropertyInfo SourceNodeNameInfo = { - "SourceNodeName", - "Source Node Name", - "If a scene graph node is selected as type, this value specifies the name of the " - "node that is to be used as the source for computing the distance.", + constexpr openspace::properties::Property::PropertyInfo SourceNodeIdentifierInfo = { + "SourceNodeIdentifier", + "Source Node Identifier", + "If a scene graph node is selected as type, this value specifies the identifier " + "of the node that is to be used as the source for computing the distance.", openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DestinationTypeInfo = { "DestinationType", "Destination Type", - "The type of position that is used as the destination to calculate the distance. " - "The default value for this is 'Focus'.", + "The type of position that is used as the destination to calculate the distance.", openspace::properties::Property::Visibility::User }; - constexpr openspace::properties::Property::PropertyInfo DestinationNodeNameInfo = { - "DestinationNodeName", - "Destination Node Name", - "If a scene graph node is selected as type, this value specifies the name of the " - "node that is to be used as the destination for computing the distance.", + constexpr openspace::properties::Property::PropertyInfo + DestinationNodeIdentifierInfo = + { + "DestinationNodeIdentifier", + "Destination Node Identifier", + "If a scene graph node is selected as type, this value specifies the identifier " + "of the node that is to be used as the destination for computing the distance.", openspace::properties::Property::Visibility::User }; @@ -106,6 +106,14 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `DashboardItem` displays the distance between two points. The points can be + // defined either by the location of a scene graph node, the surface of a scene graph + // node's bounding sphere, the location of the current focus node, or the position of + // the camera. These definitions can be mixed and matched to calculate any combination + // of positions. + // + // The resulting text can be formatted in the `FormatString` and the measurement unit + // is chosed by changing the `Simplification` and `RequestedUnit` parameters. struct [[codegen::Dictionary(DashboardItemDistance)]] Parameters { enum class [[codegen::map(Type)]] TypeInfo { Node, @@ -115,16 +123,16 @@ namespace { }; // [[codegen::verbatim(SourceTypeInfo.description)]] - std::optional sourceType; + TypeInfo sourceType; - // [[codegen::verbatim(SourceNodeNameInfo.description)]] - std::optional sourceNodeName; + // [[codegen::verbatim(SourceNodeIdentifierInfo.description)]] + std::optional sourceNodeIdentifier; // [[codegen::verbatim(DestinationTypeInfo.description)]] - std::optional destinationType; + TypeInfo destinationType; - // [[codegen::verbatim(DestinationNodeNameInfo.description)]] - std::optional destinationNodeName; + // [[codegen::verbatim(DestinationNodeIdentifierInfo.description)]] + std::optional destinationNodeIdentifier; // [[codegen::verbatim(SimplificationInfo.description)]] std::optional simplification; @@ -158,7 +166,7 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary SourceTypeInfo, properties::OptionProperty::DisplayType::Dropdown ), - properties::StringProperty(SourceNodeNameInfo), + properties::StringProperty(SourceNodeIdentifierInfo), nullptr } , _destination{ @@ -166,7 +174,7 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary DestinationTypeInfo, properties::OptionProperty::DisplayType::Dropdown ), - properties::StringProperty(DestinationNodeNameInfo), + properties::StringProperty(DestinationNodeIdentifierInfo), nullptr } { @@ -179,24 +187,19 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary { Type::Camera, "Camera" } }); _source.type.onChange([this]() { - _source.nodeName.setVisibility( + _source.nodeIdentifier.setVisibility( properties::Property::Visibility( _source.type == Type::Node || _source.type == Type::NodeSurface ) ); }); - if (p.sourceType.has_value()) { - _source.type = codegen::map(*p.sourceType); - } - else { - _source.type = Type::Camera; - } + _source.type = codegen::map(p.sourceType); addProperty(_source.type); - _source.nodeName.onChange([this]() { _source.node = nullptr; }); + _source.nodeIdentifier.onChange([this]() { _source.node = nullptr; }); if (_source.type == Type::Node || _source.type == Type::NodeSurface) { - if (p.sourceNodeName.has_value()) { - _source.nodeName = *p.sourceNodeName; + if (p.sourceNodeIdentifier.has_value()) { + _source.nodeIdentifier = *p.sourceNodeIdentifier; } else { LERRORC( @@ -205,7 +208,7 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary ); } } - addProperty(_source.nodeName); + addProperty(_source.nodeIdentifier); _destination.type.addOptions({ { Type::Node, "Node" }, @@ -214,23 +217,18 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary { Type::Camera, "Camera" } }); _destination.type.onChange([this]() { - _destination.nodeName.setVisibility( + _destination.nodeIdentifier.setVisibility( properties::Property::Visibility( _source.type == Type::Node || _source.type == Type::NodeSurface ) ); }); - if (p.destinationType.has_value()) { - _destination.type = codegen::map(*p.destinationType); - } - else { - _destination.type = Type::Focus; - } + _destination.type = codegen::map(p.destinationType); addProperty(_destination.type); - _destination.nodeName.onChange([this]() { _destination.node = nullptr; }); + _destination.nodeIdentifier.onChange([this]() { _destination.node = nullptr; }); if (_destination.type == Type::Node || _destination.type == Type::NodeSurface) { - if (p.destinationNodeName.has_value()) { - _destination.nodeName = *p.destinationNodeName; + if (p.destinationNodeIdentifier.has_value()) { + _destination.nodeIdentifier = *p.destinationNodeIdentifier; } else { LERRORC( @@ -239,7 +237,7 @@ DashboardItemDistance::DashboardItemDistance(const ghoul::Dictionary& dictionary ); } } - addProperty(_destination.nodeName); + addProperty(_destination.nodeIdentifier); _doSimplification = p.simplification.value_or(_doSimplification); addProperty(_doSimplification); @@ -270,13 +268,13 @@ std::pair DashboardItemDistance::positionAndLabel( if ((mainComp.type == Type::Node) || (mainComp.type == Type::NodeSurface)) { if (!mainComp.node) [[unlikely]] { mainComp.node = global::renderEngine->scene()->sceneGraphNode( - mainComp.nodeName + mainComp.nodeIdentifier ); if (!mainComp.node) { LERRORC( "DashboardItemDistance", - "Could not find node '" + mainComp.nodeName.value() + "'" + "Could not find node '" + mainComp.nodeIdentifier.value() + "'" ); return { glm::dvec3(0.0), "Node" }; } diff --git a/modules/base/dashboard/dashboarditemdistance.h b/modules/base/dashboard/dashboarditemdistance.h index cd82958ffa..a258d93f52 100644 --- a/modules/base/dashboard/dashboarditemdistance.h +++ b/modules/base/dashboard/dashboarditemdistance.h @@ -52,7 +52,7 @@ public: private: struct Component { properties::OptionProperty type; - properties::StringProperty nodeName; + properties::StringProperty nodeIdentifier; SceneGraphNode* node; }; diff --git a/modules/base/dashboard/dashboarditemelapsedtime.cpp b/modules/base/dashboard/dashboarditemelapsedtime.cpp index 4a6a6f93a6..aa482e46ef 100644 --- a/modules/base/dashboard/dashboarditemelapsedtime.cpp +++ b/modules/base/dashboard/dashboarditemelapsedtime.cpp @@ -70,12 +70,15 @@ namespace { openspace::properties::Property::Visibility::User }; + // This `DashboardItem` displays the remaining time until a provided `ReferenceTime` + // or the elapsed time since the `ReferenceTime`. The output can be configured through + // the `FormatString` and the unit that is used to display the configurable as well. struct [[codegen::Dictionary(DashboardItemElapsedTime)]] Parameters { // [[codegen::verbatim(FormatStringInfo.description)]] std::optional formatString; // [[codegen::verbatim(ReferenceTimeInfo.description)]] - std::string referenceTime; + std::string referenceTime [[codegen::datetime()]]; // [[codegen::verbatim(SimplifyTimeInfo.description)]] std::optional simplifyTime; diff --git a/modules/base/dashboard/dashboarditemframerate.cpp b/modules/base/dashboard/dashboarditemframerate.cpp index f272e1b110..e2274f14cb 100644 --- a/modules/base/dashboard/dashboarditemframerate.cpp +++ b/modules/base/dashboard/dashboarditemframerate.cpp @@ -36,7 +36,8 @@ namespace { enum FrametimeType { - DtTimeAvg = 0, + DtTime = 0, + DtTimeAvg, DtTimeExtremes, DtStandardDeviation, DtCoefficientOfVariation, @@ -60,6 +61,14 @@ namespace { }; [[nodiscard]] char* formatDt(std::vector& buffer) { + return std::format_to( + buffer.data(), + "Frametime: {:.2f} ms\0", + openspace::global::windowDelegate->deltaTime() + ); + } + + [[nodiscard]] char* formatDtAvg(std::vector& buffer) { return std::format_to( buffer.data(), "Avg. Frametime: {:.2f} ms\0", @@ -120,8 +129,10 @@ namespace { { using namespace openspace; switch (frametimeType) { - case FrametimeType::DtTimeAvg: + case FrametimeType::DtTime: return formatDt(buffer); + case FrametimeType::DtTimeAvg: + return formatDtAvg(buffer); case FrametimeType::DtTimeExtremes: return formatDtExtremes(buffer, minFrametimeCache, maxFrametimeCache); case FrametimeType::DtStandardDeviation: @@ -137,8 +148,29 @@ namespace { } } + // This `DashboardItem` provides information about the current framerate at which the + // rendering updates. The `FrametimeType` can have different values that will show + // different statistical aspects of the framerate. + // + // - `Deltatime`: Shows the time in milliseconds it took to render the previous + // frame + // - `Average Deltatime`: Shows the time that it took to render in milliseconds + // averaged over the last 100 or so frames + // - `Deltatime extremes`: Shows the minimum and maximum values of the render time + // in milliseconds over the last 100 or so frames + // - `Deltatime standard deviation`: Shows the standard deviation of the render time + // in milliseconds over the last 100 or so frames + // - `Deltatime coefficient of variation`: Shows the normalized root-mean-square + // deviation of the render time in + // milliseconds over the last 100 or so + // frames + // - `Frames per second`: Shows the inverse of the delta time it took the render the + // last frame. + // - `Average frames per second`: Shows average number of frames that have been + // presented over the last 100 or so frames struct [[codegen::Dictionary(DashboardItemFramerate)]] Parameters { enum class [[codegen::map(FrametimeType)]] Type { + DtTime [[codegen::key("Deltatime")]], DtTimeAvg [[codegen::key("Average Deltatime")]], DtTimeExtremes [[codegen::key("Deltatime extremes")]], DtStandardDeviation [[codegen::key("Deltatime standard deviation")]], @@ -152,7 +184,6 @@ namespace { std::optional frametimeType; }; #include "dashboarditemframerate_codegen.cpp" - } // namespace namespace openspace { @@ -172,6 +203,7 @@ DashboardItemFramerate::DashboardItemFramerate(const ghoul::Dictionary& dictiona const Parameters p = codegen::bake(dictionary); _frametimeType.addOptions({ + { static_cast(FrametimeType::DtTime), "Deltatime" }, { static_cast(FrametimeType::DtTimeAvg), "Average Deltatime" }, { static_cast(FrametimeType::DtTimeExtremes), "Deltatime extremes" }, { diff --git a/modules/base/dashboard/dashboarditeminputstate.cpp b/modules/base/dashboard/dashboarditeminputstate.cpp index f723c51e4e..d5bd787e49 100644 --- a/modules/base/dashboard/dashboarditeminputstate.cpp +++ b/modules/base/dashboard/dashboarditeminputstate.cpp @@ -69,7 +69,12 @@ namespace { openspace::properties::Property::Visibility::User }; - struct [[codegen::Dictionary(DashboardItemPropertyValue)]] Parameters { + // This `DashboardItem` shows the current state of the different methods to provide + // user input: keyboard, mouse, and/or joystick. + // + // Each input method has the ability to be selectively disabled, meaning that all + // inputs from that input method are ignored by the system entirely. + struct [[codegen::Dictionary(DashboardItemInputState)]] Parameters { // [[codegen::verbatim(ShowWhenEnabledInfo.description)]] std::optional showWhenEnabled; @@ -166,9 +171,7 @@ void DashboardItemInputState::update() { } } - if (!text.empty()) { - _buffer = ghoul::join(std::move(text), "\n"); - } + _buffer = ghoul::join(std::move(text), "\n"); } glm::vec2 DashboardItemInputState::size() const { diff --git a/modules/base/dashboard/dashboarditemmission.cpp b/modules/base/dashboard/dashboarditemmission.cpp index 7e3e951d00..66fcba10fb 100644 --- a/modules/base/dashboard/dashboarditemmission.cpp +++ b/modules/base/dashboard/dashboarditemmission.cpp @@ -51,15 +51,21 @@ namespace { progress.append("|"); return progress; } + + // This `DashboardItem` shows information about the currently active mission. This + // includes information about the currently active mission phase, the next phase, and + // all subphases of the currently active phase. + struct [[codegen::Dictionary(DashboardItemMission)]] Parameters {}; +#include "dashboarditemmission_codegen.cpp" } // namespace namespace openspace { documentation::Documentation DashboardItemMission::Documentation() { - documentation::Documentation doc = DashboardTextItem::Documentation(); - doc.name = "DashboardItemMission"; - doc.id = "base_dashboarditem_mission"; - return doc; + return codegen::doc( + "base_dashboarditem_mission", + DashboardTextItem::Documentation() + ); } DashboardItemMission::DashboardItemMission(const ghoul::Dictionary& dictionary) diff --git a/modules/base/dashboard/dashboarditemparallelconnection.cpp b/modules/base/dashboard/dashboarditemparallelconnection.cpp index e2d78bb685..234c6b908f 100644 --- a/modules/base/dashboard/dashboarditemparallelconnection.cpp +++ b/modules/base/dashboard/dashboarditemparallelconnection.cpp @@ -34,13 +34,26 @@ #include #include +namespace { + // This `DashboardItem` displays information about the status of the parallel + // connection, which is whether OpenSpace is directly connected to other OpenSpace + // instances and can either control those instances or be controlled by the master of + // the session. If OpenSpace is not connected, this `DashboardItem` will not display + // anything. + // + // The information presented contains how many clients are connected to the same + // session and whether this machine is currently the host of the session. + struct [[codegen::Dictionary(DashboardItemParallelConnection)]] Parameters {}; +#include "dashboarditemparallelconnection_codegen.cpp" +} // namespace + namespace openspace { documentation::Documentation DashboardItemParallelConnection::Documentation() { - documentation::Documentation doc = DashboardTextItem::Documentation(); - doc.name = "DashboardItemParallelConnection"; - doc.id = "base_dashboarditem_parallelconnection"; - return doc; + return codegen::doc( + "base_dashboarditem_parallelconnection", + DashboardTextItem::Documentation() + ); } DashboardItemParallelConnection::DashboardItemParallelConnection( diff --git a/modules/base/dashboard/dashboarditempropertyvalue.cpp b/modules/base/dashboard/dashboarditempropertyvalue.cpp index c3b5b17ee4..6711f1b46d 100644 --- a/modules/base/dashboard/dashboarditempropertyvalue.cpp +++ b/modules/base/dashboard/dashboarditempropertyvalue.cpp @@ -67,11 +67,16 @@ namespace { "the value itself will be displayed), or it must contain extact one or more " "instances of {}, which will be replaced with the value(s) of the property " "during rendering. For scalar types, there has to be exactly one instance of {}, " - "for vector types, there need to be as many {} as there are compoents in the " - "vector, for example two {} for vec2 types, three for vec3 types, etc.", + "for vector types, there need to be as many {} as there are components in the " + "vector, for example two {} for vec2 types, three for vec3 types, etc. For more " + "information on how to structure the formatting string, see the documentation at " + "https://en.cppreference.com/w/cpp/utility/format/spec.", openspace::properties::Property::Visibility::User }; + // This `DashboardItem` will show the value of the provided property. Depending on the + // type of the property, the `DisplayString` will have to be adapted. See the + // documentation for the `DisplayString` for more information. struct [[codegen::Dictionary(DashboardItemPropertyValue)]] Parameters { // [[codegen::verbatim(PropertyUriInfo.description)]] std::optional uri [[codegen::key("URI")]]; diff --git a/modules/base/dashboard/dashboarditemsimulationincrement.cpp b/modules/base/dashboard/dashboarditemsimulationincrement.cpp index c2879e07c7..0daea282c3 100644 --- a/modules/base/dashboard/dashboarditemsimulationincrement.cpp +++ b/modules/base/dashboard/dashboarditemsimulationincrement.cpp @@ -61,7 +61,9 @@ namespace { "delta time. This format gets five parameters in this order: The target delta " "time value, the target delta time unit, the string 'Paused' if the delta time " "is paused or the empty string otherwise, the current delta time value, and the " - "current delta time unit.", + "current delta time unit. More information about how to make use of the format " + "string, see the documentation at " + "https://en.cppreference.com/w/cpp/utility/format/spec.", openspace::properties::Property::Visibility::AdvancedUser }; @@ -71,7 +73,9 @@ namespace { "The format string used to format the text if the target delta time is the same " "as the current delta time. This format gets three parameters in this order: " "The target delta value, the target delta unit, and the string 'Paused' if the " - "delta time is paused or the empty string otherwise.", + "delta time is paused or the empty string otherwise. More information about how " + "to make use of the format string, see the documentation at " + "https://en.cppreference.com/w/cpp/utility/format/spec.", openspace::properties::Property::Visibility::AdvancedUser }; @@ -88,6 +92,10 @@ namespace { return res; } + // This `DashboardItem` shows how fast the in-game time progresses. The display string + // for the `RegularFormat` is used when the current simulation increment is not + // changing, the `TransitionFormat` is used if the simulation increment is currently + // interpolating to a new value. struct [[codegen::Dictionary(DashboardItemSimulationIncrement)]] Parameters { // [[codegen::verbatim(SimplificationInfo.description)]] std::optional simplification; @@ -143,6 +151,7 @@ DashboardItemSimulationIncrement::DashboardItemSimulationIncrement( if (p.requestedUnit.has_value()) { const TimeUnit unit = timeUnitFromString(*p.requestedUnit); _requestedUnit = static_cast(unit); + _doSimplification = false; } _requestedUnit.setVisibility(properties::Property::Visibility::Hidden); addProperty(_requestedUnit); diff --git a/modules/base/dashboard/dashboarditemspacing.cpp b/modules/base/dashboard/dashboarditemspacing.cpp index 96778dcc06..2e7fb397f2 100644 --- a/modules/base/dashboard/dashboarditemspacing.cpp +++ b/modules/base/dashboard/dashboarditemspacing.cpp @@ -37,6 +37,8 @@ namespace { openspace::properties::Property::Visibility::User }; + // This `DashboardItem` adds a variable amount of spacing between two other + // `DashboardItem`s. struct [[codegen::Dictionary(DashboardItemSpacing)]] Parameters { // [[codegen::verbatim(SpacingInfo.description)]] std::optional spacing; diff --git a/modules/base/dashboard/dashboarditemvelocity.cpp b/modules/base/dashboard/dashboarditemvelocity.cpp index 162a710757..c82b836448 100644 --- a/modules/base/dashboard/dashboarditemvelocity.cpp +++ b/modules/base/dashboard/dashboarditemvelocity.cpp @@ -55,6 +55,12 @@ namespace { openspace::properties::Property::Visibility::User }; + // This `DashboardItem` shows the velocity of the camera, that is how fast the camera + // has moved since the last frame in the amount of time it took to render that frame. + // The `Simplification` and `RequestedUnit` can be used to control which unit is used + // to display the speed. By default, `Simplification` is enabled, which means that the + // most natural unit, that is, the one that gives the least number of printed digits, + // is used. struct [[codegen::Dictionary(DashboardItemVelocity)]] Parameters { // [[codegen::verbatim(SimplificationInfo.description)]] std::optional simplification; @@ -81,7 +87,6 @@ DashboardItemVelocity::DashboardItemVelocity(const ghoul::Dictionary& dictionary , _requestedUnit(RequestedUnitInfo, properties::OptionProperty::DisplayType::Dropdown) { const Parameters p = codegen::bake(dictionary); - _doSimplification = p.simplification.value_or(_doSimplification); _doSimplification.onChange([this]() { _requestedUnit.setVisibility( _doSimplification ? @@ -89,6 +94,7 @@ DashboardItemVelocity::DashboardItemVelocity(const ghoul::Dictionary& dictionary properties::Property::Visibility::User ); }); + _doSimplification = p.simplification.value_or(_doSimplification); addProperty(_doSimplification); for (const DistanceUnit u : DistanceUnits) { @@ -101,8 +107,8 @@ DashboardItemVelocity::DashboardItemVelocity(const ghoul::Dictionary& dictionary if (p.requestedUnit.has_value()) { const DistanceUnit unit = distanceUnitFromString(*p.requestedUnit); _requestedUnit = static_cast(unit); + _doSimplification = false; } - _requestedUnit.setVisibility(properties::Property::Visibility::Hidden); addProperty(_requestedUnit); } diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 23043b097f..d3b43fd3a7 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -168,10 +168,18 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `Renderable` shows a three-dimensional model. The provided model may contain + // textures and animations and is affected by the optionally-provided light sources. + // Each model's scale can be adapted by the `ModelScale` and `InvertModelScale` + // parameters to account for discrepancies in the units that a model was created in. + // See the Documentation page "Scaling of models" for more detailed information. + // + // Limitation: At the time, only animations of the "Keyframe" type are supported. See + // each specific model format to see if it supports that type of animation. struct [[codegen::Dictionary(RenderableModel)]] Parameters { - // The file or files that should be loaded in this RenderableModel. The file can - // contain filesystem tokens. This specifies the model that is rendered by - // the Renderable. + // The file or files that should be loaded in this RenderableModel. Most common + // model formats, such as .obj, .fbx, or .gltf. For a full list of supported file + // formats, see https://github.com/assimp/assimp/blob/master/doc/Fileformats.md std::filesystem::path geometryFile; // The scale of the model. For example, if the model is in centimeters then diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index 8c0cceed64..23fdb2c641 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -93,6 +93,10 @@ namespace { openspace::properties::Property::Visibility::User }; + // A `RenderablePlane` is a renderable that will shows some form of contents projected + // on a two-dimensional plane, which in turn is placed in three-dimensional space as + // any other `Renderable`. It is possible to specify the `Size` of the plane, whether + // it should always face the camera (`Billboard`), and other parameters shown below. struct [[codegen::Dictionary(RenderablePlane)]] Parameters { // [[codegen::verbatim(BillboardInfo.description)]] std::optional billboard; diff --git a/modules/base/rendering/renderableplaneimagelocal.cpp b/modules/base/rendering/renderableplaneimagelocal.cpp index 749bf023eb..ea19d5c5d7 100644 --- a/modules/base/rendering/renderableplaneimagelocal.cpp +++ b/modules/base/rendering/renderableplaneimagelocal.cpp @@ -45,6 +45,8 @@ namespace { openspace::properties::Property::Visibility::User }; + // A RenderablePlaneImageLocal creates a textured 3D plane, where the texture is + // provided by a local file on disk. struct [[codegen::Dictionary(RenderablePlaneImageLocal)]] Parameters { // [[codegen::verbatim(TextureInfo.description)]] std::string texture; diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index 8ef676b16a..c078e5948f 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -129,6 +129,10 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `Renderable` represents a simple sphere with an image. The image that is shown + // should be in an equirectangular projection/spherical panoramic image or else + // distortions will be introduced. The `Orientation` parameter determines whether the + // provided image is shown on the inside, outside, or both sides of the sphere. struct [[codegen::Dictionary(RenderableSphere)]] Parameters { // [[codegen::verbatim(SizeInfo.description)]] std::optional size [[codegen::greater(0.f)]]; diff --git a/modules/base/rendering/renderablesphereimagelocal.cpp b/modules/base/rendering/renderablesphereimagelocal.cpp index 126e5f6912..322b6e92d2 100644 --- a/modules/base/rendering/renderablesphereimagelocal.cpp +++ b/modules/base/rendering/renderablesphereimagelocal.cpp @@ -41,6 +41,9 @@ namespace { openspace::properties::Property::Visibility::User }; + // This `Renderable` shows a sphere with an image provided by a local file on disk. To + // show a sphere with an image from an online source, see + // [RenderableSphereImageOnline](#base_screenspace_image_online). struct [[codegen::Dictionary(RenderableSphereImageLocal)]] Parameters { // [[codegen::verbatim(TextureInfo.description)]] std::filesystem::path texture; diff --git a/modules/base/rendering/renderablesphereimageonline.cpp b/modules/base/rendering/renderablesphereimageonline.cpp index 74cf362d06..ffb567cbf8 100644 --- a/modules/base/rendering/renderablesphereimageonline.cpp +++ b/modules/base/rendering/renderablesphereimageonline.cpp @@ -64,9 +64,10 @@ namespace { ); } - // A RenderableSphereImageOnline can be used to show an image from an online source - // (as a URL) on a sphere in the OpenSpace scene. The image should be provided in an - // equirectangular projection, if it is a map that is draped over the sphere. + // This `Renderable` shows a sphere with an image provided by an online URL. The image + // will be downloaded when the `Renderable` is added to a scene graph node. To show a + // sphere with an image from a local file, see + // [RenderableSphereImageLocal](#base_screenspace_image_local). struct [[codegen::Dictionary(RenderableSphereImageOnline)]] Parameters { // [[codegen::verbatim(TextureInfo.description)]] std::string url [[codegen::key("URL")]]; diff --git a/modules/base/rotation/constantrotation.cpp b/modules/base/rotation/constantrotation.cpp index 140d0db3ca..f8050989c7 100644 --- a/modules/base/rotation/constantrotation.cpp +++ b/modules/base/rotation/constantrotation.cpp @@ -45,6 +45,8 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This rotation type will cause a scene graph node to rotate about the provided axis + // at a fixed and constant rotation speed. struct [[codegen::Dictionary(ConstantRotation)]] Parameters { // [[codegen::verbatim(RotationInfo.description)]] std::optional rotationAxis diff --git a/modules/base/rotation/fixedrotation.cpp b/modules/base/rotation/fixedrotation.cpp index a673d84a83..aab2a77ec1 100644 --- a/modules/base/rotation/fixedrotation.cpp +++ b/modules/base/rotation/fixedrotation.cpp @@ -192,7 +192,46 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `Rotation` calculates the rotation in such a way that the attached scene graph + // node will always be relative to some other direction or pointing at another scene + // graph node. + // + // The first use-case of the `FixedRotation` needs exactly two of its three axes + // (`XAxis`, `YAxis`, `ZAxis`) specified with the last axis being unspecified. The + // axis that is missing will be calculated using a right-handed coordinate completion + // using the two provided axes. Each axis can be specified either by providing the + // `Identifier` of another scene graph node, or by providing a direction vector. For + // the general use-case of this `Rotation`, one of the provided axes usually is an + // `Identifier` and the other is a direction vector (see the examples below). + // If any of the axes is using the `Identifier` of another scene graph node, the + // `Attached` value must be specified and should almost always be the identifier of + // the scene graph node to which this `Rotation` belongs. + // + // A second use-case for this `Rotation` is to directly specify mappings for the + // coordinate axes. In this use-case, two or all three axes are specified using + // direction vectors. The orientation of the rotated coordinate system will then be + // determined by the specified axes, such that the new x-axis points in the direction + // provided to the `XAxis`, for example. Note that all direction vectors are assumed + // to be normalized. If only two direction vectors are specified, the third direction + // is computed using a right-handed coordinate system completion. + // + // Each axis has an `invert` option that will cause the provided axes to be considered + // inverted. For the direction-type of axis, this just inverts the provided values, + // but it is more useful for the `Identifier` version to construct a direction that + // either points towards or away from the provided scene graph node. + // + // Lastly, each axis has an `orthogonal` option. If that value is specified, the + // provided axis is instead cross-producted with the other axis first with the + // resulting orthogonal vector used as the mapped axis. This is primarily useful when + // specifying a direction vector and wanting to ensure that the total rotation remains + // a valid non-skewed rotation (meaning that all three coordinate axes are orthogonal + // to each other) when the second axis can assume arbitrary values. Unless there is a + // very good reason not to, whenever an axis is specified as a direction vector, that + // axis' `orthogonal` setting should also probably be enabled. struct [[codegen::Dictionary(FixedRotation)]] Parameters { + // [[codegen::verbatim(AttachedInfo.description)]] + std::optional attached; + // This value specifies the direction of the new X axis. If this value is not // specified, it will be computed by completing a right handed coordinate system // from the Y and Z axis, which must be specified instead. If this value is a @@ -231,9 +270,6 @@ namespace { // [[codegen::verbatim(ZAxisInvertObjectInfo.description)]] std::optional zAxisInvert; - - // [[codegen::verbatim(AttachedInfo.description)]] - std::optional attached; }; #include "fixedrotation_codegen.cpp" } // namespace diff --git a/modules/base/rotation/luarotation.cpp b/modules/base/rotation/luarotation.cpp index 4a6fb72825..11ea70a306 100644 --- a/modules/base/rotation/luarotation.cpp +++ b/modules/base/rotation/luarotation.cpp @@ -51,6 +51,11 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `Rotation` type generates the rotation for the attached scene graph node by + // calling the provided Lua script to create the full matrix used to orient the scene + // graph node. The returned matrix must be a valid rotation matrix. The script + // parameter describes in greater detail how the Lua script file should be + // constructed. struct [[codegen::Dictionary(LuaRotation)]] Parameters { // [[codegen::verbatim(ScriptInfo.description)]] std::filesystem::path script; diff --git a/modules/base/rotation/timelinerotation.cpp b/modules/base/rotation/timelinerotation.cpp index ac241327eb..6421d40796 100644 --- a/modules/base/rotation/timelinerotation.cpp +++ b/modules/base/rotation/timelinerotation.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -39,6 +40,10 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `Rotation` uses a timeline of other `Rotation` classes to calculate the + // final rotation for the attached scene graph node. The current in-game time is + // used to determine which specific keyframe to currently use. It is also possible to + // interpolate between two adjacent keyframes. struct [[codegen::Dictionary(TimelineRotation)]] Parameters { // A table of keyframes, with keys formatted as YYYY-MM-DDTHH:MM:SS and values // that are valid Rotation objects @@ -69,6 +74,8 @@ TimelineRotation::TimelineRotation(const ghoul::Dictionary& dictionary) ghoul::mm_unique_ptr rotation = Rotation::createFromDictionary( kf.second ); + rotation->setIdentifier(makeIdentifier(kf.first)); + addPropertySubOwner(rotation.get()); _timeline.addKeyframe(t, std::move(rotation)); } diff --git a/modules/base/scale/luascale.cpp b/modules/base/scale/luascale.cpp index 4c3e1acbc8..af64764303 100644 --- a/modules/base/scale/luascale.cpp +++ b/modules/base/scale/luascale.cpp @@ -50,6 +50,10 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `Scale` type generates the scale values for the attached scene graph node by + // calling the provided Lua script. The script must return three scaling factors, one + // for each principal axis. The script parameter describes in greater detail how the + // Lua script file should be constructed. struct [[codegen::Dictionary(LuaScale)]] Parameters { // [[codegen::verbatim(ScriptInfo.description)]] std::filesystem::path script; diff --git a/modules/base/scale/timelinescale.cpp b/modules/base/scale/timelinescale.cpp index f7b1f3a320..272805971d 100644 --- a/modules/base/scale/timelinescale.cpp +++ b/modules/base/scale/timelinescale.cpp @@ -46,7 +46,7 @@ namespace { // interpolate between two adjacent keyframes. struct [[codegen::Dictionary(TimelineScale)]] Parameters { // A table of keyframes, with keys formatted as YYYY-MM-DDTHH:MM:SS and values - // that are valid Scale objects + // that are valid Scale objects. std::map keyframes [[codegen::reference("core_transform_scale")]]; @@ -108,10 +108,14 @@ glm::dvec3 TimelineScale::scaleValue(const UpdateData& data) const { return glm::mix(prev->data->scaleValue(data), next->data->scaleValue(data), t); } else { - return now < nextTime ? - prev->data->scaleValue(data) : - next->data->scaleValue(data); + if (prevTime <= now && now < nextTime) { + return prev->data->scaleValue(data); + } + else if (nextTime <= now) { + return next->data->scaleValue(data); + } } + return glm::dvec3(0.0); } } // namespace openspace diff --git a/modules/base/timeframe/timeframeinterval.cpp b/modules/base/timeframe/timeframeinterval.cpp index b2ab9a9e7e..62faf9ca14 100644 --- a/modules/base/timeframe/timeframeinterval.cpp +++ b/modules/base/timeframe/timeframeinterval.cpp @@ -59,6 +59,11 @@ namespace { openspace::properties::Property::Visibility::User }; + // This `TimeFrame`'s validity is determined by a single start and end time in between + // which the scene graph node is valid. The start time is inclusive, while the end + // time is exclusive. If the start time or end time is not specified, the value + // corresponds to $-\infty$ and $\infty$ respectively. If both the start and end time + // are not specified, the `TimeFrameInterval` will always be valid. struct [[codegen::Dictionary(TimeFrameInterval)]] Parameters { // [[codegen::verbatim(StartInfo.description)]] std::optional> start; diff --git a/modules/base/translation/luatranslation.cpp b/modules/base/translation/luatranslation.cpp index 64fe6d2fc8..9af55740ca 100644 --- a/modules/base/translation/luatranslation.cpp +++ b/modules/base/translation/luatranslation.cpp @@ -51,6 +51,11 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `Translation` type generates the translation values used to offset the + // attached scene graph node's position by calling the provided Lua script. The script + // must return three translation factors, one for each principal axis, each providing + // in meters. The script parameter describes in greater detail how the Lua script file + // should be constructed. struct [[codegen::Dictionary(LuaTranslation)]] Parameters { // [[codegen::verbatim(ScriptInfo.description)]] std::filesystem::path script; diff --git a/modules/base/translation/statictranslation.cpp b/modules/base/translation/statictranslation.cpp index 559d6a65fd..a74fccb2e0 100644 --- a/modules/base/translation/statictranslation.cpp +++ b/modules/base/translation/statictranslation.cpp @@ -36,6 +36,8 @@ namespace { openspace::properties::Property::Visibility::User }; + // This `Translation` provides a fixed translation to the attached scene graph node + // that does not change unless the `Position` property is changed. struct [[codegen::Dictionary(StaticTranslation)]] Parameters { // [[codegen::verbatim(PositionInfo.description)]] glm::dvec3 position; diff --git a/modules/base/translation/timelinetranslation.cpp b/modules/base/translation/timelinetranslation.cpp index 74b491f613..8559934058 100644 --- a/modules/base/translation/timelinetranslation.cpp +++ b/modules/base/translation/timelinetranslation.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -39,6 +40,11 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `Translation` uses a timeline of other `Translation` classes to calculate the + // final translation for the attached scene graph node. The current in-game time is + // used to determine which specific keyframe to currently use. It is also possible to + // disable the interpolation between two adjacent keyframes by setting the + // `ShouldInterpolate` parameter to `false`. struct [[codegen::Dictionary(TimelineTranslation)]] Parameters { // A table of keyframes, with keys formatted as YYYY-MM-DDTHH:MM:SS and values // that are valid Translation objects @@ -68,6 +74,8 @@ TimelineTranslation::TimelineTranslation(const ghoul::Dictionary& dictionary) ghoul::mm_unique_ptr translation = Translation::createFromDictionary(kf.second); + translation->setIdentifier(makeIdentifier(kf.first)); + addPropertySubOwner(translation.get()); _timeline.addKeyframe(t, std::move(translation)); } @@ -99,7 +107,7 @@ glm::dvec3 TimelineTranslation::position(const UpdateData& data) const { if (nextTime - prevTime > 0.0) { t = (now - prevTime) / (nextTime - prevTime); } - return t * next->data->position(data) + (1.0 - t) * prev->data->position(data); + return glm::mix(prev->data->position(data), next->data->position(data), t); } else { if (prevTime <= now && now < nextTime) { diff --git a/modules/globebrowsing/src/dashboarditemglobelocation.cpp b/modules/globebrowsing/src/dashboarditemglobelocation.cpp index 77dc002e6c..6ed10c365c 100644 --- a/modules/globebrowsing/src/dashboarditemglobelocation.cpp +++ b/modules/globebrowsing/src/dashboarditemglobelocation.cpp @@ -57,6 +57,12 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `DashboardItem` shows the longitude/latitude location of the camera and its + // distance to the current focus node. If the current focus node is Earth, these are + // provided in the WGS84 reference frame; if the focus is on another planetary body, + // it is in the native coordinate frame for that planetary body. If the current focus + // node is not a planetary body, a position of (0,0) with a distance of 0 will be + // displayed. struct [[codegen::Dictionary(DashboardItemGlobeLocation)]] Parameters { enum class DisplayFormat { DecimalDegrees, diff --git a/modules/globebrowsing/src/globerotation.cpp b/modules/globebrowsing/src/globerotation.cpp index 7bde01ca2f..c8e19f7953 100644 --- a/modules/globebrowsing/src/globerotation.cpp +++ b/modules/globebrowsing/src/globerotation.cpp @@ -87,6 +87,11 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + // This `Rotation` orients the scene graph node in such a way that the y-axis points + // away from the provided globe, the x-axis points towards the globe's southern pole + // and the z-axis points in a western direction. Using this rotation generally means + // using the [GlobeTranslation](#globebrowsing_translation_globetranslation) to place + // the scene graph node at the same position for which the rotation is calculated. struct [[codegen::Dictionary(GlobeRotation)]] Parameters { // [[codegen::verbatim(GlobeInfo.description)]] std::string globe diff --git a/modules/space/rendering/renderabletravelspeed.cpp b/modules/space/rendering/renderabletravelspeed.cpp index de66b9ef02..eef73a859c 100644 --- a/modules/space/rendering/renderabletravelspeed.cpp +++ b/modules/space/rendering/renderabletravelspeed.cpp @@ -87,13 +87,13 @@ namespace { openspace::properties::Property::Visibility::User }; - // This renderable can be used to visualize a certain travel speed using a line that + // This `Renderable` can be used to visualize a certain travel speed using a line that // moves at the provided speed from a start object to a target. The start position // will be set from the `Parent` of this scene graph node, and the end position is // set from the provided `Target` scene graph node. Per default, the speed is set to // the speed of light. // - // The length of the traveling line is set based on the travel speed and can be used + // The length of the travelling line is set based on the travel speed and can be used // to show more information related to the distance traveled. For example, a length // of 1 shows how far an object would move over a duration of one second based on the // selected speed. diff --git a/modules/space/rotation/spicerotation.cpp b/modules/space/rotation/spicerotation.cpp index 388b139877..768e46518e 100644 --- a/modules/space/rotation/spicerotation.cpp +++ b/modules/space/rotation/spicerotation.cpp @@ -56,14 +56,15 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; - constexpr openspace::properties::Property::PropertyInfo TimeOffsetInfo = { - "TimeOffset", - "Time Offset", - "A time offset, in seconds, added to the simulation time (or Fixed Date if any), " - "at which to compute the rotation.", - openspace::properties::Property::Visibility::User - }; - + // This `Rotation` type uses [SPICE](https://naif.jpl.nasa.gov/naif/) kernels to + // provide rotation information for the attached scene graph node. SPICE is a library + // used by scientists and engineers to, among other tasks, plan space missions. If you + // are unfamiliar with SPICE, their webpage has both extensive + // [Tutorials](https://naif.jpl.nasa.gov/naif/tutorials.html) as well as + // [Lessions](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Lessons/) that explain + // the system deeper. This class provides access to the + // [pxform_c](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/pxform_c.html) + // function of the Spice library. struct [[codegen::Dictionary(SpiceRotation)]] Parameters { // [[codegen::verbatim(SourceInfo.description)]] std::string sourceFrame @@ -75,11 +76,7 @@ namespace { std::optional destinationFrame; // [[codegen::verbatim(FixedDateInfo.description)]] - std::optional fixedDate - [[codegen::annotation("A time to lock the rotation to")]]; - - // [[codegen::verbatim(TimeOffsetInfo.description)]] - std::optional timeOffset; + std::optional fixedDate [[codegen::datetime()]]; }; #include "spicerotation_codegen.cpp" } // namespace diff --git a/modules/space/translation/spicetranslation.cpp b/modules/space/translation/spicetranslation.cpp index a13c5c0700..3f8ea42df9 100644 --- a/modules/space/translation/spicetranslation.cpp +++ b/modules/space/translation/spicetranslation.cpp @@ -77,14 +77,15 @@ namespace { openspace::properties::Property::Visibility::User }; - constexpr openspace::properties::Property::PropertyInfo TimeOffsetInfo = { - "TimeOffset", - "Time Offset", - "A time offset, in seconds, added to the simulation time (or Fixed Date if any), " - "at which to compute the translation.", - openspace::properties::Property::Visibility::User - }; - + // This `Translation` type uses [SPICE](https://naif.jpl.nasa.gov/naif/) kernels to + // provide translational information for the attached scene graph node. SPICE is a + // library used by scientists and engineers to, among other tasks, plan space + // missions. If you are unfamiliar with SPICE, their webpage has both extensive + // [Tutorials](https://naif.jpl.nasa.gov/naif/tutorials.html) as well as + // [Lessions](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Lessons/) that explain + // the system deeper. This class provides access to the + // [spkpos_c](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkpos_c.html) + // function of the Spice library. struct [[codegen::Dictionary(SpiceTranslation)]] Parameters { // [[codegen::verbatim(TargetInfo.description)]] std::variant target; diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp index 5f927122e5..ebe2f29ca2 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp @@ -47,12 +47,14 @@ namespace { openspace::properties::Property::Visibility::NoviceUser }; - // Similarly to the [RenderablePlaneProjection](spacecraftinstruments_renderableplaneprojection) and - // [RenderablePlanetProjection](spacecraftinstruments_renderableplanetprojection), this Renderable type - // servers as a potential target for image projections from a spacecraft's instrument. - // This renderable will determine whenever an image in a currently loaded image - // sequence is projected whether that instrument's field of view intersects this model - // and will correctly project the captured image onto the model. + // Similarly to the + // [RenderablePlaneProjection](spacecraftinstruments_renderableplaneprojection) and + // [RenderablePlanetProjection](spacecraftinstruments_renderableplanetprojection), + // this Renderable type servers as a potential target for image projections from a + // spacecraft's instrument. This renderable will determine whenever an image in a + // currently loaded image sequence is projected whether that instrument's field of + // view intersects this model and will correctly project the captured image onto the + // model. struct [[codegen::Dictionary(RenderableModelProjection)]] Parameters { // The file or files that should be loaded, that specifies the model to load. The // file can contain filesystem tokens or can be specified relative to the diff --git a/modules/spout/renderablespherespout.cpp b/modules/spout/renderablespherespout.cpp index d60e6be45d..aedc5f3698 100644 --- a/modules/spout/renderablespherespout.cpp +++ b/modules/spout/renderablespherespout.cpp @@ -31,10 +31,10 @@ #include #include -// The RenderableSphereSpout can be used to render a sphere with a texture that is -// provided by another application on the same computer using the SPOUT library. Note that -// this library is only available on Windows. namespace { + // The RenderableSphereSpout can be used to render a sphere with a texture that is + // provided by another application on the same computer using the SPOUT library. + // Note: The Spout library is only available on Windows struct [[codegen::Dictionary(RenderableSphereSpout)]] Parameters { // Specifies the GUI name of the RenderableSphereSpout std::optional name; diff --git a/src/rendering/dashboarditem.cpp b/src/rendering/dashboarditem.cpp index 855a654965..f3505d67e4 100644 --- a/src/rendering/dashboarditem.cpp +++ b/src/rendering/dashboarditem.cpp @@ -37,10 +37,16 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Enabled", - "If this value is set to 'true' this dashboard item is shown in the dashboard.", - openspace::properties::Property::Visibility::AdvancedUser + "If this value is set to 'true' this dashboard item is shown in the dashboard. " + "Otherwise it will be hidden." }; + // A `DashboardItem` is an item that is rendered in a dashboard. There are multiple + // dashboards that can exist in the system. One dashboard is created by default, which + // is rendered to the top left of the screen. Others can be added through the + // [ScreenSpaceDashboard](#base_screenspace_dashboard). Each `DashboardItem` shows its + // respective text in the dashboard if it is enabled and it depends on the concrete + // type of `DashboardItem` to determine what that information is. struct [[codegen::Dictionary(DashboardItem)]] Parameters { // Determines the type of the DashbordItem that should be created. std::string type; diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index 028508da62..1268c28d6c 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -36,6 +36,9 @@ #include namespace { + // A `Rotation` object describes a specific rotation for a scene graph node, which may + // or may not be time-dependent. The exact method of determining the rotation depends + // on the concrete type. struct [[codegen::Dictionary(Rotation)]] Parameters { // The type of the rotation that is described in this element. The available types // of rotations depend on the configuration of the application and can be written diff --git a/src/scene/timeframe.cpp b/src/scene/timeframe.cpp index 2cb0cc0992..03b1eea50d 100644 --- a/src/scene/timeframe.cpp +++ b/src/scene/timeframe.cpp @@ -45,6 +45,12 @@ namespace { openspace::properties::Property::Visibility::Developer }; + // A `TimeFrame` object determines the time frame during which a scene graph node is + // valid. If the simulation time is outside the time frame range, the scene graph node + // and all of its children are automatically disabled and any attached + // [Renderable](#renderable) will not be displayed either. Usually, the time frame + // corresponds to the time during which datasets are available or to disable a scene + // graph node during uninteresting periods of time. struct [[codegen::Dictionary(TimeFrame)]] Parameters { // The type of the time frame that is described in this element. The available // types of scaling depend on the configuration of the application and can be