mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-25 06:19:02 -06:00
Merge branch 'master' into thesis/2019/camera-paths
# Conflicts: # src/navigation/navigationhandler.cpp
This commit is contained in:
@@ -265,7 +265,7 @@ QWidget* LauncherWindow::createCentralWidget() {
|
||||
[this]() {
|
||||
const std::string selection = _profileBox->currentText().toStdString();
|
||||
int selectedIndex = _profileBox->currentIndex();
|
||||
bool isUserProfile = selectedIndex <= _userAssetCount;
|
||||
bool isUserProfile = selectedIndex < _userAssetCount;
|
||||
openProfileEditor(selection, isUserProfile);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -10,7 +10,6 @@ asset.require('spice/base')
|
||||
-- Load default key bindings applicable to most scenes
|
||||
asset.require('dashboard/default_dashboard')
|
||||
asset.require('util/default_keybindings')
|
||||
asset.require('util/default_joystick')
|
||||
|
||||
-- Load web gui
|
||||
local webGui = asset.require('util/webgui')
|
||||
|
||||
227
data/assets/examples/animation.asset
Normal file
227
data/assets/examples/animation.asset
Normal file
@@ -0,0 +1,227 @@
|
||||
local assetHelper = asset.require('util/asset_helper')
|
||||
local sunTransforms = asset.require('scene/solarsystem/sun/transforms')
|
||||
local transforms = asset.require('scene/solarsystem/planets/earth/transforms')
|
||||
|
||||
local model = asset.syncedResource({
|
||||
Name = "Animated Box",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "animated_box",
|
||||
Version = 1
|
||||
})
|
||||
|
||||
local StartTime = "2021 06 01 00:00:00";
|
||||
|
||||
local animationLoop = {
|
||||
Identifier = "animationLoop",
|
||||
Parent = transforms.EarthCenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "StaticTranslation",
|
||||
Position = { 0.0, -11E7, 0.0 }
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableModel",
|
||||
GeometryFile = model .. "/BoxAnimated.glb",
|
||||
EnableAnimation = true,
|
||||
AnimationMode = "LoopFromStart",
|
||||
AnimationStartTime = StartTime,
|
||||
ModelScale = 3E7,
|
||||
LightSources = {
|
||||
{
|
||||
Type = "SceneGraphLightSource",
|
||||
Identifier = "Sun",
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
}
|
||||
},
|
||||
PerformShading = true,
|
||||
DisableFaceCulling = true
|
||||
},
|
||||
GUI = {
|
||||
Name = "Animated Model example (LoopFromStart)",
|
||||
Path = "/Example",
|
||||
Description = "Simple animated box model with the animation mode 'LoopFromStart'",
|
||||
}
|
||||
}
|
||||
|
||||
local animationLoopInf = {
|
||||
Identifier = "animationLoopInf",
|
||||
Parent = transforms.EarthCenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "StaticTranslation",
|
||||
Position = { 0.0, 11E7, 0.0 }
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableModel",
|
||||
GeometryFile = model .. "/BoxAnimated.glb",
|
||||
EnableAnimation = true,
|
||||
AnimationMode = "LoopInfinitely",
|
||||
AnimationStartTime = StartTime,
|
||||
ModelScale = 3E7,
|
||||
LightSources = {
|
||||
{
|
||||
Type = "SceneGraphLightSource",
|
||||
Identifier = "Sun",
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
}
|
||||
},
|
||||
PerformShading = true,
|
||||
DisableFaceCulling = true
|
||||
},
|
||||
GUI = {
|
||||
Name = "Animated Model example (LoopInfinitely)",
|
||||
Path = "/Example",
|
||||
Description = "Simple animated box model with the animation mode 'LoopInfinitely'",
|
||||
}
|
||||
}
|
||||
|
||||
local animationOnce = {
|
||||
Identifier = "animationOnce",
|
||||
Parent = transforms.EarthCenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "StaticTranslation",
|
||||
Position = { 11E7, 0.0, 0.0 }
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableModel",
|
||||
GeometryFile = model .. "/BoxAnimated.glb",
|
||||
EnableAnimation = true,
|
||||
AnimationMode = "Once",
|
||||
AnimationStartTime = StartTime,
|
||||
ModelScale = 3E7,
|
||||
LightSources = {
|
||||
{
|
||||
Type = "SceneGraphLightSource",
|
||||
Identifier = "Sun",
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
}
|
||||
},
|
||||
PerformShading = true,
|
||||
DisableFaceCulling = true
|
||||
},
|
||||
GUI = {
|
||||
Name = "Animated Model example (Once)",
|
||||
Path = "/Example",
|
||||
Description = "Simple animated box model with the animation mode 'Once'",
|
||||
}
|
||||
}
|
||||
|
||||
local animationBounceInf = {
|
||||
Identifier = "animationBounceInf",
|
||||
Parent = transforms.EarthCenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "StaticTranslation",
|
||||
Position = { 0.0, 0.0, 11E7 }
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableModel",
|
||||
GeometryFile = model .. "/BoxAnimated.glb",
|
||||
EnableAnimation = true,
|
||||
AnimationMode = "BounceInfinitely",
|
||||
AnimationStartTime = StartTime,
|
||||
ModelScale = 3E7,
|
||||
LightSources = {
|
||||
{
|
||||
Type = "SceneGraphLightSource",
|
||||
Identifier = "Sun",
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
}
|
||||
},
|
||||
PerformShading = true,
|
||||
DisableFaceCulling = true
|
||||
},
|
||||
GUI = {
|
||||
Name = "Animated Model example (BounceInfinitely)",
|
||||
Path = "/Example",
|
||||
Description = "Simple animated box model with the animation mode 'BounceInfinitely'",
|
||||
}
|
||||
}
|
||||
|
||||
local animationBounce = {
|
||||
Identifier = "animationBounce",
|
||||
Parent = transforms.EarthCenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "StaticTranslation",
|
||||
Position = { 0.0, 0.0, -11E7 }
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableModel",
|
||||
GeometryFile = model .. "/BoxAnimated.glb",
|
||||
EnableAnimation = true,
|
||||
AnimationMode = "BounceFromStart",
|
||||
AnimationStartTime = StartTime,
|
||||
ModelScale = 3E7,
|
||||
LightSources = {
|
||||
{
|
||||
Type = "SceneGraphLightSource",
|
||||
Identifier = "Sun",
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
}
|
||||
},
|
||||
PerformShading = true,
|
||||
DisableFaceCulling = true
|
||||
},
|
||||
GUI = {
|
||||
Name = "Animated Model example (BounceFromStart)",
|
||||
Path = "/Example",
|
||||
Description = "Simple animated box model with the animation mode 'BounceFromStart'",
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, {
|
||||
animationLoop,
|
||||
animationLoopInf,
|
||||
animationOnce,
|
||||
animationBounceInf,
|
||||
animationBounce
|
||||
})
|
||||
|
||||
-- Asset
|
||||
asset.meta = {
|
||||
Name = "Animation Example asset",
|
||||
Version = "1.0",
|
||||
Description = "Simple animation example asset with an animated box model",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {
|
||||
"animationLoop",
|
||||
"animationLoopInf",
|
||||
"animationOnce",
|
||||
"animationBounceInf",
|
||||
"animationBounce"
|
||||
}
|
||||
}
|
||||
|
||||
-- Model
|
||||
asset.meta = {
|
||||
Name = "Animated Box Model",
|
||||
Version = "1.0",
|
||||
Description = "Simple animated box model",
|
||||
Author = "Cesium, https://cesium.com/",
|
||||
URL = "https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/BoxAnimated",
|
||||
License = [[
|
||||
Creative Commons Attribution 4.0 International License,
|
||||
https://creativecommons.org/licenses/by/4.0/
|
||||
]],
|
||||
Identifiers = {
|
||||
"animationLoop",
|
||||
"animationLoopInf",
|
||||
"animationOnce",
|
||||
"animationBounceInf",
|
||||
"animationBounce"
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,6 @@ asset.require('spice/base')
|
||||
|
||||
asset.require('util/default_keybindings')
|
||||
asset.require('util/default_dashboard')
|
||||
asset.require('util/default_joystick')
|
||||
|
||||
asset.require('util/webgui')
|
||||
local spheres = asset.require('examples/spheres')
|
||||
|
||||
@@ -28,7 +28,7 @@ local object = {
|
||||
ColorOption = { "redshift", "proximity" },
|
||||
ColorRange = { { 0.0, 0.075 }, { 1.0, 25.0 } },
|
||||
Unit = "Mpc",
|
||||
ScaleFactor = 520.0,
|
||||
ScaleFactor = 505.0,
|
||||
BillboardMaxSize = 4.7,
|
||||
EnablePixelSizeControl = true
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@ asset.export("layer", layer)
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Charon Black & White & White [USGS]",
|
||||
Name = "Charon Black & White [USGS]",
|
||||
Version = "1.0",
|
||||
Description = [[ Charon New Horizons LORRI MVIC Global Mosaic 300m v1. This detailed,
|
||||
high-quality global mosaic of Pluto’s largest moon, Charon, was assembled from nearly
|
||||
|
||||
@@ -14,7 +14,7 @@ asset.export("layer", layer)
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Pluto Black & White & White [USGS]",
|
||||
Name = "Pluto Black & White [USGS]",
|
||||
Version = "1.0",
|
||||
Description = [[ This detailed, high-quality global mosaic of Pluto was assembled from
|
||||
nearly all of the highest-resolution images obtained by the Long-Range
|
||||
|
||||
@@ -13,7 +13,7 @@ local PlutoBarycenterTrail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "PLUTO BARYCENTER",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernels
|
||||
},
|
||||
Color = { 0.3, 0.7, 0.3 },
|
||||
@@ -35,7 +35,7 @@ assetHelper.registerSceneGraphNodesAndExport(asset, { PlutoBarycenterTrail })
|
||||
asset.meta = {
|
||||
Name = "Pluto Barycenter Trail",
|
||||
Version = "1.0",
|
||||
Description = [[ Trail of Pluto as observed by the Sun. Data from
|
||||
Description = [[ Trail of Pluto Barycenter as observed by the Sun. Data from
|
||||
NASA Spice (see base spice asset)]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
|
||||
@@ -12,7 +12,7 @@ local PlutoBarycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "PLUTO BARYCENTER",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernels
|
||||
}
|
||||
},
|
||||
|
||||
@@ -28,7 +28,7 @@ local Ceres = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "CERES",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = {
|
||||
kernels .. "/dawn_ceres_v01.tpc",
|
||||
kernels .. "/sb_ceres_140724.bsp",
|
||||
@@ -65,7 +65,7 @@ local CeresTrail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "CERES",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.7, 0.8, 0.7 },
|
||||
StartTime = "2010 JAN 01 00:00:00.000",
|
||||
|
||||
@@ -637,7 +637,7 @@ local Dawn = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "DAWN",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = KernelFiles
|
||||
},
|
||||
Rotation = {
|
||||
@@ -722,7 +722,7 @@ local DawnTrail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "DAWN",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 1.0, 0.8, 0.4 },
|
||||
ShowFullTrail = false,
|
||||
|
||||
@@ -31,7 +31,7 @@ local Vesta = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VESTA",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = {
|
||||
--kernels .. "/dawn_vesta_v06.tpc",
|
||||
kernels .. "/sb_vesta_071107.bsp"
|
||||
@@ -118,7 +118,7 @@ local VestaTrail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VESTA",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.7, 0.8, 0.7 },
|
||||
StartTime = "2007 JUL 20 12:00:00",
|
||||
|
||||
@@ -115,8 +115,7 @@ local JWSTModel = {
|
||||
ModelScale = "Foot",
|
||||
InvertModelScale = true,
|
||||
EnableAnimation = true,
|
||||
--TODO: Update theese when the new animation is finished
|
||||
AnimationStartTime = "2018 10 01 15:00:00",
|
||||
AnimationStartTime = "2018 10 01 14:05:52",
|
||||
AnimationMode = "Once",
|
||||
LightSources = {
|
||||
{
|
||||
@@ -130,7 +129,7 @@ local JWSTModel = {
|
||||
DisableFaceCulling = true
|
||||
},
|
||||
GUI = {
|
||||
Name = "James Webb Space Telescope",
|
||||
Name = "James Webb Space Telescope Model",
|
||||
Path = "/Solar System/Missions/JWST",
|
||||
}
|
||||
}
|
||||
@@ -165,7 +164,7 @@ local JWSTSunTrail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "JWST",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = JWSTKernel .. "/jwst_horizons_20200101_20240101_v01.bsp"
|
||||
},
|
||||
Color = { 0.0, 0.9, 0.9 },
|
||||
@@ -226,7 +225,7 @@ local JWSTLaunchModel = {
|
||||
Parent = JWSTLaunchPosition.Identifier,
|
||||
TimeFrame = {
|
||||
Type = "TimeFrameInterval",
|
||||
Start = "2018 OCT 01 13:18:00",
|
||||
Start = "2018 OCT 01 14:05:52",
|
||||
End = "2019 OCT 01"
|
||||
},
|
||||
Transform = {
|
||||
@@ -245,8 +244,7 @@ local JWSTLaunchModel = {
|
||||
ModelScale = "Foot",
|
||||
InvertModelScale = true,
|
||||
EnableAnimation = true,
|
||||
--TODO: Update theese when the new animation is finished
|
||||
AnimationStartTime = "2018 10 01 15:00:00",
|
||||
AnimationStartTime = "2018 10 01 14:05:52",
|
||||
AnimationMode = "Once",
|
||||
LightSources = {
|
||||
{
|
||||
|
||||
@@ -67,7 +67,7 @@ local Messenger = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MESSENGER",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = LocalKernels
|
||||
},
|
||||
Rotation = {
|
||||
|
||||
@@ -16,7 +16,7 @@ local NewHorizons = {
|
||||
Type = "RenderableModel",
|
||||
Body = "NEW HORIZONS",
|
||||
GeometryFile = models .. "/NewHorizonsCleanModel.obj",
|
||||
AmbientIntensity = 0.0,
|
||||
AmbientIntensity = 0.2,
|
||||
DiffuseIntensity = 1.0,
|
||||
SpecularIntensity = 1.0,
|
||||
LightSources = {
|
||||
@@ -25,11 +25,6 @@ local NewHorizons = {
|
||||
Identifier = "Sun",
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
},
|
||||
{
|
||||
Identifier = "Camera",
|
||||
Type = "CameraLightSource",
|
||||
Intensity = 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@ local PlutoBarycenterAccurate = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "PLUTO BARYCENTER",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernels.PlutoKernels
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5,6 +5,15 @@ local models = asset.require('./models').models
|
||||
|
||||
local BENNU_BODY = "2101955"
|
||||
|
||||
local LightSources = {
|
||||
{
|
||||
Type = "SceneGraphLightSource",
|
||||
Identifier = "Sun",
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
},
|
||||
}
|
||||
|
||||
local Bennu = {
|
||||
Identifier = "Bennu",
|
||||
Parent = transforms.BennuBarycenter.Identifier,
|
||||
@@ -14,41 +23,18 @@ local Bennu = {
|
||||
SourceFrame = "IAU_BENNU",
|
||||
DestinationFrame = "GALACTIC"
|
||||
},
|
||||
Scale = {
|
||||
Type = "StaticScale",
|
||||
Scale = 1000.0
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Enabled = false,
|
||||
Type = "RenderableModel",
|
||||
Body = BENNU_BODY,
|
||||
GeometryFile = models .. "/Bennu_v20_200k.stl",
|
||||
GeometryFile = models .. "/Bennu_v20_200k_an.obj",
|
||||
LightSources = LightSources,
|
||||
SpecularIntensity = 0.0
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Asteroid"
|
||||
}
|
||||
}
|
||||
|
||||
local BennuTrail = {
|
||||
Identifier = "BennuTrail",
|
||||
Parent = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableTrailTrajectory",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = BENNU_BODY,
|
||||
Observer = "SUN"
|
||||
},
|
||||
Color = { 0.4, 0.0, 0.7 },
|
||||
StartTime = "2015 JAN 01 00:00:00.000",
|
||||
EndTime = "2023 MAY 31 00:00:00.000",
|
||||
SampleInterval = 3600
|
||||
},
|
||||
GUI = {
|
||||
Name = "Bennu Trail",
|
||||
Path = "/Solar System/Asteroid"
|
||||
}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { Bennu, BennuTrail })
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, {Bennu})
|
||||
|
||||
@@ -88,7 +88,7 @@ local BennuTrail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = BENNU_BODY,
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.4, 0.0, 0.7 },
|
||||
StartTime = "2015 JAN 01 00:00:00.000",
|
||||
|
||||
@@ -36,7 +36,7 @@ local OsirisRex = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "OSIRIS-REX",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = OsirisRexKernels
|
||||
},
|
||||
Rotation = {
|
||||
@@ -130,34 +130,36 @@ local PolyCamFov = {
|
||||
}
|
||||
}
|
||||
|
||||
local RexisFov = {
|
||||
Identifier = "REXIS FOV",
|
||||
Parent = Rexis.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderableFov",
|
||||
Body = "OSIRIS-REX",
|
||||
Frame = "ORX_REXIS",
|
||||
RGB = { 0.8, 0.7, 0.7 },
|
||||
Instrument = {
|
||||
Name = "ORX_REXIS",
|
||||
Method = "ELLIPSOID",
|
||||
Aberration = "NONE"
|
||||
},
|
||||
PotentialTargets = { BENNU_BODY },
|
||||
FrameConversions = {
|
||||
[BENNU_BODY] = "IAU_BENNU"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Name = "REXIS FOV",
|
||||
Path = "/Solar System/Missions/OSIRIS REx/Instruments"
|
||||
}
|
||||
}
|
||||
-- Commenting this out as REXIS' shape is circle, which is currently not supported in
|
||||
-- the RenderableFOV class
|
||||
-- local RexisFov = {
|
||||
-- Identifier = "REXIS FOV",
|
||||
-- Parent = Rexis.Identifier,
|
||||
-- Renderable = {
|
||||
-- Type = "RenderableFov",
|
||||
-- Body = "OSIRIS-REX",
|
||||
-- Frame = "ORX_REXIS",
|
||||
-- RGB = { 0.8, 0.7, 0.7 },
|
||||
-- Instrument = {
|
||||
-- Name = "ORX_REXIS",
|
||||
-- Method = "ELLIPSOID",
|
||||
-- Aberration = "NONE"
|
||||
-- },
|
||||
-- PotentialTargets = { BENNU_BODY },
|
||||
-- FrameConversions = {
|
||||
-- [BENNU_BODY] = "IAU_BENNU"
|
||||
-- }
|
||||
-- },
|
||||
-- GUI = {
|
||||
-- Name = "REXIS FOV",
|
||||
-- Path = "/Solar System/Missions/OSIRIS REx/Instruments"
|
||||
-- }
|
||||
-- }
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, {
|
||||
OsirisRex,
|
||||
PolyCam,
|
||||
Rexis,
|
||||
PolyCamFov,
|
||||
RexisFov
|
||||
-- RexisFov
|
||||
})
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
asset.require('./bennu')
|
||||
asset.require('./bennu_projection')
|
||||
asset.require('./model')
|
||||
asset.require('./trail')
|
||||
|
||||
@@ -37,7 +37,7 @@ local OsirisRexTrailSolarSystem = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "OSIRIS-REX",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.2, 0.9, 0.2 },
|
||||
StartTime = "2016 SEP 8 23:05:00.50",
|
||||
|
||||
@@ -12,7 +12,7 @@ local BennuBarycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = BENNU_BODY,
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -35,7 +35,7 @@ local PerseveranceNode = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = perseverance_id,
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = m2020_kernels
|
||||
}
|
||||
},
|
||||
@@ -54,7 +54,7 @@ local PerseveranceTrailSun = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = perseverance_id,
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = m2020_kernels
|
||||
},
|
||||
Color = { 0.2, 0.7, 0.1 },
|
||||
|
||||
@@ -21,7 +21,7 @@ local Pioneer10 = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = Pioneer10NAIF,
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernelsList
|
||||
}
|
||||
},
|
||||
@@ -41,7 +41,7 @@ local Pioneer10Trail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = Pioneer10NAIF,
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernelsList
|
||||
},
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
|
||||
@@ -24,7 +24,7 @@ local Pioneer11 = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = Pioneer11NAIF,
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernelsList
|
||||
}
|
||||
},
|
||||
@@ -44,7 +44,7 @@ local Pioneer11Trail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = Pioneer11NAIF,
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernelsList
|
||||
},
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
|
||||
@@ -33,7 +33,7 @@ local Barycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "CHURYUMOV-GERASIMENKO",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
@@ -118,7 +118,7 @@ local Trail67P = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "CHURYUMOV-GERASIMENKO",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.1, 0.9, 0.2 },
|
||||
StartTime = "2014 JAN 01 00:00:00.000",
|
||||
|
||||
@@ -94,7 +94,7 @@ local Rosetta = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "ROSETTA",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = RosettaKernels
|
||||
},
|
||||
Rotation = {
|
||||
|
||||
@@ -47,7 +47,7 @@ local Voyager1 = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 1",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
Rotation = {
|
||||
@@ -108,7 +108,7 @@ local VoyagerTrailCruiseEarthJupiter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 1",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
@@ -130,7 +130,7 @@ local VoyagerTrailEncounterJupiter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 1",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
@@ -153,7 +153,7 @@ local VoyagerTrailCruiseJupiterSaturn = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 1",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
@@ -176,7 +176,7 @@ local VoyagerTrailEncounterSaturn = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 1",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
@@ -199,7 +199,7 @@ local VoyagerTrailCruiseSaturnInf = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 1",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
|
||||
@@ -37,7 +37,7 @@ local LightSources = {
|
||||
Node = sunTransforms.SolarSystemBarycenter.Identifier,
|
||||
Intensity = 1.0
|
||||
},
|
||||
{
|
||||
{
|
||||
Identifier = "Camera",
|
||||
Type = "CameraLightSource",
|
||||
Intensity = 0.5
|
||||
@@ -51,7 +51,7 @@ local Voyager2 = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
Rotation = {
|
||||
@@ -112,7 +112,7 @@ local VoyagerTrailCruiseEarthJupiter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
@@ -134,7 +134,7 @@ local VoyagerTrailEncounterJupiter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
@@ -157,7 +157,7 @@ local VoyagerTrailCruiseJupiterSaturn = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
@@ -180,7 +180,7 @@ local VoyagerTrailEncounterSaturn = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
@@ -203,7 +203,7 @@ local VoyagerTrailCruiseSaturnUranus = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
@@ -226,7 +226,7 @@ local VoyagerTrailEncounterUranus = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
@@ -249,7 +249,7 @@ local VoyagerTrailCruiseUranusNeptune = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
@@ -272,7 +272,7 @@ local VoyagerTrailEncounterNeptune = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
@@ -295,7 +295,7 @@ local VoyagerTrailCruiseNeptuneInf = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VOYAGER 2",
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = Kernels
|
||||
},
|
||||
EnableFade = false,
|
||||
|
||||
@@ -20,7 +20,7 @@ local L1 = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "391", -- L1
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernels .. "/L1_de431.bsp"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@ local L2Small = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "392", -- L2
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernels .. "/L2_de431.bsp"
|
||||
}
|
||||
},
|
||||
@@ -46,7 +46,7 @@ local L2 = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "392", -- L2
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernels .. "/L2_de431.bsp"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -20,7 +20,7 @@ local L4 = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "394", -- L4
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernels .. "/L4_de431.bsp"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -20,7 +20,7 @@ local L5 = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "395", -- L5
|
||||
Observer = "SUN",
|
||||
Observer = "SSB",
|
||||
Kernels = kernels .. "/L5_de431.bsp"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -12,7 +12,7 @@ local EarthTrail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "EARTH",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.5, 0.8, 1.0 },
|
||||
Period = 365.242,
|
||||
|
||||
@@ -11,7 +11,7 @@ local EarthBarycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "EARTH BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -7,6 +7,11 @@ local Jupiter = {
|
||||
Identifier = "Jupiter",
|
||||
Parent = transforms.JupiterBarycenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "JUPITER",
|
||||
Observer = "JUPITER BARYCENTER"
|
||||
},
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "IAU_JUPITER",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local LabelsPath = asset.syncedResource({
|
||||
Name = "Callisto Labels",
|
||||
Name = "Jupiter Labels",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "jupiter_labels",
|
||||
Version = 1
|
||||
|
||||
@@ -11,8 +11,8 @@ local JupiterTrail = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "JUPITER BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Target = "JUPITER",
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.8, 0.7, 0.7 },
|
||||
Period = 4330.595,
|
||||
|
||||
@@ -12,7 +12,7 @@ local JupiterTrailEarth = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "JUPITER BARYCENTER",
|
||||
Target = "JUPITER",
|
||||
Observer = "EARTH"
|
||||
},
|
||||
Color = { 1.0, 0.5, 0.2 },
|
||||
@@ -36,7 +36,7 @@ asset.meta = {
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"VenusTrailEarth"}
|
||||
Identifiers = {"JupiterTrailEarth"}
|
||||
}
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { JupiterTrailEarth })
|
||||
|
||||
@@ -11,7 +11,7 @@ local JupiterBarycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "JUPITER BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
@@ -27,7 +27,7 @@ assetHelper.registerSceneGraphNodesAndExport(asset, { JupiterBarycenter })
|
||||
asset.meta = {
|
||||
Name = "Jupiter Transforms",
|
||||
Version = "1.0",
|
||||
Description = [[ Jupiter Barycenter transform]],
|
||||
Description = [[ Jupiter Barycenter transform ]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
|
||||
@@ -11,6 +11,11 @@ local Mars = {
|
||||
Identifier = "Mars",
|
||||
Parent = transforms.MarsBarycenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MARS",
|
||||
Observer = "MARS BARYCENTER"
|
||||
},
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "IAU_MARS",
|
||||
|
||||
@@ -11,8 +11,8 @@ local MarsTrail = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MARS BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Target = "MARS",
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.814, 0.305, 0.220 },
|
||||
Period = 686.973,
|
||||
|
||||
@@ -12,7 +12,7 @@ local MarsTrailEarth = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MARS BARYCENTER",
|
||||
Target = "MARS",
|
||||
Observer = "EARTH"
|
||||
},
|
||||
Color = { 1.0, 0.5, 0.2 },
|
||||
|
||||
@@ -9,7 +9,7 @@ local MarsBarycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MARS BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -9,6 +9,11 @@ local Mercury = {
|
||||
Identifier = "Mercury",
|
||||
Parent = transforms.MercuryBarycenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MERCURY",
|
||||
Observer = "MERCURY BARYCENTER"
|
||||
},
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "IAU_MERCURY",
|
||||
|
||||
@@ -12,7 +12,7 @@ local MercuryTrail = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MERCURY",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.6, 0.5, 0.5 },
|
||||
Period = 87.968,
|
||||
|
||||
@@ -12,7 +12,7 @@ local MercuryTrailEarth = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MERCURY BARYCENTER",
|
||||
Target = "MERCURY",
|
||||
Observer = "EARTH"
|
||||
},
|
||||
Color = { 1.0, 0.5, 0.2 },
|
||||
|
||||
@@ -8,8 +8,8 @@ local MercuryBarycenter = {
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "MERCURY",
|
||||
Observer = "SUN"
|
||||
Target = "MERCURY BARYCENTER",
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -2,7 +2,7 @@ asset.require('./triton')
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Neptune Minor Moons",
|
||||
Name = "Neptune Major Moons",
|
||||
Version = "1.0",
|
||||
Description = [[ Meta asset containing Neptune's major moon: Triton]],
|
||||
Author = "OpenSpace Team",
|
||||
|
||||
@@ -7,6 +7,11 @@ local Neptune = {
|
||||
Identifier = "Neptune",
|
||||
Parent = transforms.NeptuneBarycenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "NEPTUNE",
|
||||
Observer = "NEPTUNE BARYCENTER"
|
||||
},
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "IAU_NEPTUNE",
|
||||
|
||||
@@ -11,8 +11,8 @@ local NeptuneTrail = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "NEPTUNE BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Target = "NEPTUNE",
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.2, 0.5, 1.0 },
|
||||
-- Period = 60200,
|
||||
|
||||
@@ -12,7 +12,7 @@ local NeptuneTrailEarth = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "NEPTUNE BARYCENTER",
|
||||
Target = "NEPTUNE",
|
||||
Observer = "EARTH"
|
||||
},
|
||||
Color = { 1.0, 0.5, 0.2 },
|
||||
@@ -40,5 +40,5 @@ asset.meta = {
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"VenusTrailEarth"}
|
||||
Identifiers = {"NeptuneTrailEarth"}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ local NeptuneBarycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "NEPTUNE BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
@@ -26,7 +26,7 @@ assetHelper.registerSceneGraphNodesAndExport(asset, { NeptuneBarycenter })
|
||||
asset.meta = {
|
||||
Name = "Neptune Transforms",
|
||||
Version = "1.0",
|
||||
Description = [[ Neptune Barycenter transform]],
|
||||
Description = [[ Neptune Barycenter transform ]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
|
||||
@@ -9,6 +9,11 @@ local Saturn = {
|
||||
Identifier = "Saturn",
|
||||
Parent = transforms.SaturnBarycenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "SATURN",
|
||||
Observer = "SATURN BARYCENTER"
|
||||
},
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "IAU_SATURN",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
local LabelsPath = asset.syncedResource({
|
||||
Name = "Dione Labels",
|
||||
Name = "Saturn Labels",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "saturn_labels",
|
||||
Version = 1
|
||||
|
||||
@@ -10,8 +10,8 @@ local SaturnTrail = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "SATURN BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Target = "SATURN",
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.85, 0.75, 0.51 },
|
||||
Period = 10746.94,
|
||||
|
||||
@@ -12,7 +12,7 @@ local SaturnTrailEarth = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "SATURN BARYCENTER",
|
||||
Target = "SATURN",
|
||||
Observer = "EARTH"
|
||||
},
|
||||
Color = { 1.0, 0.5, 0.2 },
|
||||
@@ -37,8 +37,8 @@ asset.meta = {
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"VenusTrailEarth"}
|
||||
Identifiers = {"SaturnTrailEarth"}
|
||||
}
|
||||
|
||||
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { UranusTrailEarth })
|
||||
assetHelper.registerSceneGraphNodesAndExport(asset, { SaturnTrailEarth })
|
||||
|
||||
@@ -9,7 +9,7 @@ local SaturnBarycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "SATURN BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
|
||||
@@ -10,8 +10,8 @@ local UranusTrail = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "URANUS BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Target = "URANUS",
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 0.60, 0.95, 1.00 },
|
||||
Period = 30588.740,
|
||||
|
||||
@@ -12,7 +12,7 @@ local UranusTrailEarth = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "URANUS BARYCENTER",
|
||||
Target = "URANUS",
|
||||
Observer = "EARTH"
|
||||
},
|
||||
Color = { 1.0, 0.5, 0.2 },
|
||||
@@ -40,5 +40,5 @@ asset.meta = {
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
Identifiers = {"VenusTrailEarth"}
|
||||
Identifiers = {"UranusTrailEarth"}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ local UranusBarycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "URANUS BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
@@ -31,5 +31,6 @@ asset.meta = {
|
||||
Description = [[ Uranus Barycenter transform]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
License = "MIT license",
|
||||
Identifiers = {"UranusBarycenter"}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,11 @@ local Uranus = {
|
||||
Identifier = "Uranus",
|
||||
Parent = transforms.UranusBarycenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "URANUS",
|
||||
Observer = "URANUS BARYCENTER"
|
||||
},
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "IAU_URANUS",
|
||||
|
||||
@@ -11,8 +11,8 @@ local VenusTrail = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VENUS BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Target = "VENUS",
|
||||
Observer = "SSB"
|
||||
},
|
||||
Color = { 1.0, 0.5, 0.2 },
|
||||
Period = 224.695,
|
||||
|
||||
@@ -11,7 +11,7 @@ local VenusTrailEarth = {
|
||||
Type = "RenderableTrailOrbit",
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VENUS BARYCENTER",
|
||||
Target = "VENUS",
|
||||
Observer = "EARTH"
|
||||
},
|
||||
Color = { 1.0, 0.5, 0.2 },
|
||||
|
||||
@@ -9,7 +9,7 @@ local VenusBarycenter = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VENUS BARYCENTER",
|
||||
Observer = "SUN"
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
@@ -26,7 +26,7 @@ assetHelper.registerSceneGraphNodesAndExport(asset, { VenusBarycenter })
|
||||
asset.meta = {
|
||||
Name = "Venus Transforms",
|
||||
Version = "1.0",
|
||||
Description = [[ Spice translation for Venus Barycenter]],
|
||||
Description = [[ Spice translation for Venus Barycenter ]],
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license",
|
||||
|
||||
@@ -8,6 +8,11 @@ local Venus = {
|
||||
Identifier = "Venus",
|
||||
Parent = transforms.VenusBarycenter.Identifier,
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "VENUS",
|
||||
Observer = "VENUS BARYCENTER"
|
||||
},
|
||||
Rotation = {
|
||||
Type = "SpiceRotation",
|
||||
SourceFrame = "IAU_VENUS",
|
||||
|
||||
@@ -7,7 +7,7 @@ asset.require("spice/base")
|
||||
|
||||
local SunGlare = {
|
||||
Identifier = "SunGlare",
|
||||
Parent = transforms.SolarSystemBarycenter.Identifier,
|
||||
Parent = transforms.SunIAU.Identifier,
|
||||
Renderable = {
|
||||
Type = "RenderablePlaneImageLocal",
|
||||
Size = 1.3*10^10.5,
|
||||
@@ -18,13 +18,6 @@ local SunGlare = {
|
||||
Opacity = 0.65,
|
||||
RenderableType = "PreDeferredTransparency"
|
||||
},
|
||||
Transform = {
|
||||
Translation = {
|
||||
Type = "SpiceTranslation",
|
||||
Target = "SUN",
|
||||
Observer = "SSB"
|
||||
}
|
||||
},
|
||||
GUI = {
|
||||
Name = "Sun Glare",
|
||||
Path = "/Solar System/Sun",
|
||||
|
||||
@@ -1,228 +0,0 @@
|
||||
local propertyHelper = asset.require('./property_helper')
|
||||
|
||||
-- Allowed values for the second parameter of bindJoystickAxis:
|
||||
-- "None"
|
||||
-- "Orbit X"
|
||||
-- "Orbit Y"
|
||||
-- "Zoom" -- both in and out
|
||||
-- "Zoom In"
|
||||
-- "Zoom Out"
|
||||
-- "LocalRoll X"
|
||||
-- "LocalRoll Y"
|
||||
-- "GlobalRoll X"
|
||||
-- "GlobalRoll Y"
|
||||
-- "Pan X"
|
||||
-- "Pan Y"
|
||||
-- Third parameter determines whether the axis should be inverted
|
||||
-- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1]
|
||||
|
||||
|
||||
local XBoxController = {
|
||||
LeftThumbStick = { 0 , 1 },
|
||||
RightThumbStick = { 2, 3 },
|
||||
LeftTrigger = 4,
|
||||
RightTrigger = 5,
|
||||
A = 0,
|
||||
B = 1,
|
||||
X = 2,
|
||||
Y = 3,
|
||||
LB = 4,
|
||||
RB = 5,
|
||||
Select = 6,
|
||||
Start = 7,
|
||||
LeftStick = 8,
|
||||
RightStick = 9,
|
||||
DPad = {
|
||||
Up = 10,
|
||||
Right = 11,
|
||||
Down = 12,
|
||||
Left = 13
|
||||
}
|
||||
}
|
||||
|
||||
local PS4Controller = {
|
||||
LeftThumbStick = { 0 , 1 },
|
||||
RightThumbStick = { 2, 5 },
|
||||
LeftTrigger = 3,
|
||||
RightTrigger = 4,
|
||||
A = 1, -- Cross
|
||||
B = 2, -- Circle
|
||||
X = 0, -- Square
|
||||
Y = 3, -- Triangle
|
||||
LB = 4,
|
||||
RB = 5,
|
||||
Select = 9, -- options
|
||||
Start = 12, -- PS button
|
||||
LeftStick = 10,
|
||||
RightStick = 11,
|
||||
DPad = {
|
||||
Up = 14,
|
||||
Right = 15,
|
||||
Down = 16,
|
||||
Left = 17
|
||||
}
|
||||
}
|
||||
|
||||
local SpaceMouse = {
|
||||
Push = {0, 1, 2}, -- left/right, back/forth, up/down
|
||||
Twist = {5}, -- left/right
|
||||
Tilt = {4, 3}, -- left/right, back/forth
|
||||
LeftButton = 0,
|
||||
RightButton = 1
|
||||
}
|
||||
|
||||
-- Variables to store the state of the joystick between frames
|
||||
Joystick = {}
|
||||
Joystick.State = {}
|
||||
Joystick.State.IsInRollMode = false
|
||||
Joystick.State.Axis = {}
|
||||
|
||||
local bindLocalRoll = function(axis)
|
||||
return [[
|
||||
-- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup
|
||||
if not Joystick.State.IsInRollMode then
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
end
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
Joystick.State.IsInRollMode = true
|
||||
]]
|
||||
end
|
||||
|
||||
local bindGlobalRoll = function(axis)
|
||||
return [[
|
||||
-- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup
|
||||
if not Joystick.State.IsInRollMode then
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
end
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
Joystick.State.IsInRollMode = true
|
||||
]]
|
||||
end
|
||||
|
||||
local permaBindLocalRoll = function(axis)
|
||||
return [[
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
]]
|
||||
end
|
||||
|
||||
local permaBindGlobalRoll = function(axis)
|
||||
return [[
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
]]
|
||||
end
|
||||
|
||||
local unbindRoll = function(axis)
|
||||
return [[
|
||||
-- Reset previous state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
]]
|
||||
end
|
||||
|
||||
asset.onInitialize(function()
|
||||
-- Set the controller to the connected controller
|
||||
-- Currently: XBoxController, PS4Controller or SpaceMouse
|
||||
local controller = XBoxController;
|
||||
|
||||
-- Case of XBoxController or PS4Controller
|
||||
if(controller.A ~= nil) then
|
||||
openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[2], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(controller.RightThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(controller.RightThumbStick[2], 0.15)
|
||||
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[2], "Orbit Y", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[1], "Pan X", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[2], "Pan Y", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftTrigger, "Zoom Out", false, true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightTrigger, "Zoom In", false, true);
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.LB,
|
||||
bindLocalRoll(controller.RightThumbStick[1]),
|
||||
"Switch to local roll mode"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.LB,
|
||||
unbindRoll(controller.RightThumbStick[1]),
|
||||
"Switch back to normal mode",
|
||||
"Release"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.RB,
|
||||
bindGlobalRoll(controller.RightThumbStick[1]),
|
||||
"Switch to global roll mode"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.RB,
|
||||
unbindRoll(controller.RightThumbStick[1]),
|
||||
"Switch back to normal mode",
|
||||
"Release"
|
||||
)
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.A,
|
||||
propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'),
|
||||
"Toggle zoom friction"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.B,
|
||||
propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'),
|
||||
"Toggle rotational friction"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.DPad.Left,
|
||||
propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'),
|
||||
"Toggle roll friction"
|
||||
)
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.X,
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);",
|
||||
"Switch target to Earth"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.Y,
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Mars');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);",
|
||||
"Switch target to Mars"
|
||||
)
|
||||
-- Case of SpaceMouse
|
||||
elseif (controller.LeftButton ~= nil) then
|
||||
openspace.navigation.bindJoystickAxis(controller.Push[1], "Orbit X", false, false, true, 40.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Push[2], "Orbit Y", false, false, true, 40.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Twist[1], "Pan X", true, false, true, 40.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Tilt[2], "Pan Y", false, false, true, 35.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Push[3], "Zoom", false, false, true, 40.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Tilt[1], "LocalRoll X", false, false, true, 35.0);
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.LeftButton,
|
||||
permaBindLocalRoll(controller.Tilt[1]),
|
||||
"Switch to local roll mode"
|
||||
)
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.RightButton,
|
||||
permaBindGlobalRoll(controller.Tilt[1]),
|
||||
"Switch to global roll mode"
|
||||
)
|
||||
end
|
||||
end)
|
||||
66
data/assets/util/joysticks/joystick_helper.asset
Normal file
66
data/assets/util/joysticks/joystick_helper.asset
Normal file
@@ -0,0 +1,66 @@
|
||||
-- Variables to store the state of the joystick between frames
|
||||
Joystick = {}
|
||||
Joystick.State = {}
|
||||
Joystick.State.IsInRollMode = false
|
||||
Joystick.State.Axis = {}
|
||||
|
||||
local bindLocalRoll = function(axis)
|
||||
return [[
|
||||
-- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup
|
||||
if not Joystick.State.IsInRollMode then
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
end
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
Joystick.State.IsInRollMode = true
|
||||
]]
|
||||
end
|
||||
|
||||
local bindGlobalRoll = function(axis)
|
||||
return [[
|
||||
-- We only want to store the current state in the first mode that is enabled, otherwise we will overwrite the backup
|
||||
if not Joystick.State.IsInRollMode then
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
end
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
Joystick.State.IsInRollMode = true
|
||||
]]
|
||||
end
|
||||
|
||||
local permaBindLocalRoll = function(axis)
|
||||
return [[
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "LocalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
]]
|
||||
end
|
||||
|
||||
local permaBindGlobalRoll = function(axis)
|
||||
return [[
|
||||
-- Save current axis state
|
||||
Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity = openspace.navigation.joystickAxis(]] .. axis .. [[)
|
||||
|
||||
-- Set new axis state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, "GlobalRoll X", Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
]]
|
||||
end
|
||||
|
||||
local unbindRoll = function(axis)
|
||||
return [[
|
||||
-- Reset previous state
|
||||
openspace.navigation.bindJoystickAxis(]] .. axis .. [[, Joystick.State.Axis.Type, Joystick.State.Axis.Inverted, Joystick.State.Axis.Normalized, Joystick.State.Axis.Sticky, Joystick.State.Axis.Sensitivity);
|
||||
]]
|
||||
end
|
||||
|
||||
asset.export("bindLocalRoll", bindLocalRoll)
|
||||
asset.export("bindGlobalRoll", bindGlobalRoll)
|
||||
asset.export("permaBindLocalRoll", permaBindLocalRoll)
|
||||
asset.export("permaBindGlobalRoll", permaBindGlobalRoll)
|
||||
asset.export("unbindRoll", unbindRoll)
|
||||
118
data/assets/util/joysticks/ps4.asset
Normal file
118
data/assets/util/joysticks/ps4.asset
Normal file
@@ -0,0 +1,118 @@
|
||||
local propertyHelper = asset.require('../property_helper')
|
||||
local joystickHelper = asset.require('./joystick_helper')
|
||||
|
||||
-- Allowed values for the second parameter of bindJoystickAxis:
|
||||
-- "None"
|
||||
-- "Orbit X"
|
||||
-- "Orbit Y"
|
||||
-- "Zoom" -- both in and out
|
||||
-- "Zoom In"
|
||||
-- "Zoom Out"
|
||||
-- "LocalRoll X"
|
||||
-- "LocalRoll Y"
|
||||
-- "GlobalRoll X"
|
||||
-- "GlobalRoll Y"
|
||||
-- "Pan X"
|
||||
-- "Pan Y"
|
||||
-- Third parameter determines whether the axis should be inverted
|
||||
-- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1]
|
||||
-- Fifth parameters determins if the axis should be "Sticky" or not.
|
||||
-- The axis values can either go back to 0 when the joystick is released or it can
|
||||
-- stay at the value it was before the joystick was released.
|
||||
-- The latter is called a sticky axis, when the values don't go back to 0.
|
||||
-- Sixth parameter is the sensitivity for the axis
|
||||
|
||||
local PS4Controller = {
|
||||
LeftThumbStick = { 0 , 1 },
|
||||
RightThumbStick = { 2, 5 },
|
||||
L2 = 3,
|
||||
R2 = 4,
|
||||
Cross = 1,
|
||||
Circle = 2,
|
||||
Square = 0,
|
||||
Triangle = 3,
|
||||
L1 = 4,
|
||||
R1 = 5,
|
||||
Share = 8,
|
||||
Options = 9,
|
||||
PS = 12,
|
||||
LeftStickButton = 10,
|
||||
RightStickButton = 11,
|
||||
TouchPad = 13,
|
||||
DPad = {
|
||||
Up = 14,
|
||||
Right = 15,
|
||||
Down = 16,
|
||||
Left = 17
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
local controller = PS4Controller;
|
||||
|
||||
openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[2], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(controller.RightThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(controller.RightThumbStick[2], 0.15)
|
||||
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[2], "Orbit Y", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[1], "Pan X", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[2], "Pan Y", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.L2, "Zoom Out", false, true);
|
||||
openspace.navigation.bindJoystickAxis(controller.R2, "Zoom In", false, true);
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.L1,
|
||||
joystickHelper.bindLocalRoll(controller.RightThumbStick[1]),
|
||||
"Switch to local roll mode"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.L1,
|
||||
joystickHelper.unbindRoll(controller.RightThumbStick[1]),
|
||||
"Switch back to normal mode",
|
||||
"Release"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.R1,
|
||||
joystickHelper.bindGlobalRoll(controller.RightThumbStick[1]),
|
||||
"Switch to global roll mode"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.R1,
|
||||
joystickHelper.unbindRoll(controller.RightThumbStick[1]),
|
||||
"Switch back to normal mode",
|
||||
"Release"
|
||||
)
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.Cross,
|
||||
propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'),
|
||||
"Toggle zoom friction"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.Circle,
|
||||
propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'),
|
||||
"Toggle rotational friction"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.DPad.Left,
|
||||
propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'),
|
||||
"Toggle roll friction"
|
||||
)
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.Square,
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);",
|
||||
"Switch target to Earth"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.Triangle,
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Mars');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);",
|
||||
"Switch target to Mars"
|
||||
)
|
||||
end)
|
||||
55
data/assets/util/joysticks/space-mouse-not-sticky.asset
Normal file
55
data/assets/util/joysticks/space-mouse-not-sticky.asset
Normal file
@@ -0,0 +1,55 @@
|
||||
local propertyHelper = asset.require('../property_helper')
|
||||
local joystickHelper = asset.require('./joystick_helper')
|
||||
|
||||
-- Allowed values for the second parameter of bindJoystickAxis:
|
||||
-- "None"
|
||||
-- "Orbit X"
|
||||
-- "Orbit Y"
|
||||
-- "Zoom" -- both in and out
|
||||
-- "Zoom In"
|
||||
-- "Zoom Out"
|
||||
-- "LocalRoll X"
|
||||
-- "LocalRoll Y"
|
||||
-- "GlobalRoll X"
|
||||
-- "GlobalRoll Y"
|
||||
-- "Pan X"
|
||||
-- "Pan Y"
|
||||
-- Third parameter determines whether the axis should be inverted
|
||||
-- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1]
|
||||
-- Fifth parameters determins if the axis should be "Sticky" or not.
|
||||
-- The axis values can either go back to 0 when the joystick is released or it can
|
||||
-- stay at the value it was before the joystick was released.
|
||||
-- The latter is called a sticky axis, when the values don't go back to 0.
|
||||
-- This version of the SpaceMouse is NOT Sticky.
|
||||
-- Sixth parameter is the sensitivity for the axis
|
||||
|
||||
local SpaceMouse = {
|
||||
Push = {0, 1, 2}, -- left/right, back/forth, up/down
|
||||
Twist = {5}, -- left/right
|
||||
Tilt = {4, 3}, -- left/right, back/forth
|
||||
LeftButton = 0,
|
||||
RightButton = 1
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
local controller = SpaceMouse;
|
||||
|
||||
openspace.navigation.bindJoystickAxis(controller.Push[1], "Orbit X", false);
|
||||
openspace.navigation.bindJoystickAxis(controller.Push[2], "Orbit Y", false);
|
||||
openspace.navigation.bindJoystickAxis(controller.Twist[1], "Pan X", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.Tilt[2], "Pan Y", false);
|
||||
openspace.navigation.bindJoystickAxis(controller.Push[3], "Zoom", false);
|
||||
openspace.navigation.bindJoystickAxis(controller.Tilt[1], "LocalRoll X", false);
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.LeftButton,
|
||||
joystickHelper.permaBindLocalRoll(controller.Tilt[1]),
|
||||
"Switch to local roll mode"
|
||||
)
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.RightButton,
|
||||
joystickHelper.permaBindGlobalRoll(controller.Tilt[1]),
|
||||
"Switch to global roll mode"
|
||||
)
|
||||
end)
|
||||
55
data/assets/util/joysticks/space-mouse.asset
Normal file
55
data/assets/util/joysticks/space-mouse.asset
Normal file
@@ -0,0 +1,55 @@
|
||||
local propertyHelper = asset.require('../property_helper')
|
||||
local joystickHelper = asset.require('./joystick_helper')
|
||||
|
||||
-- Allowed values for the second parameter of bindJoystickAxis:
|
||||
-- "None"
|
||||
-- "Orbit X"
|
||||
-- "Orbit Y"
|
||||
-- "Zoom" -- both in and out
|
||||
-- "Zoom In"
|
||||
-- "Zoom Out"
|
||||
-- "LocalRoll X"
|
||||
-- "LocalRoll Y"
|
||||
-- "GlobalRoll X"
|
||||
-- "GlobalRoll Y"
|
||||
-- "Pan X"
|
||||
-- "Pan Y"
|
||||
-- Third parameter determines whether the axis should be inverted
|
||||
-- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1]
|
||||
-- Fifth parameters determins if the axis should be "Sticky" or not.
|
||||
-- The axis values can either go back to 0 when the joystick is released or it can
|
||||
-- stay at the value it was before the joystick was released.
|
||||
-- The latter is called a sticky axis, when the values don't go back to 0.
|
||||
-- This version of the SpaceMouse IS Sticky.
|
||||
-- Sixth parameter is the sensitivity for the axis
|
||||
|
||||
local SpaceMouse = {
|
||||
Push = {0, 1, 2}, -- left/right, back/forth, up/down
|
||||
Twist = {5}, -- left/right
|
||||
Tilt = {4, 3}, -- left/right, back/forth
|
||||
LeftButton = 0,
|
||||
RightButton = 1
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
local controller = SpaceMouse;
|
||||
|
||||
openspace.navigation.bindJoystickAxis(controller.Push[1], "Orbit X", false, false, true, 40.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Push[2], "Orbit Y", false, false, true, 40.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Twist[1], "Pan X", true, false, true, 40.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Tilt[2], "Pan Y", false, false, true, 35.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Push[3], "Zoom", false, false, true, 40.0);
|
||||
openspace.navigation.bindJoystickAxis(controller.Tilt[1], "LocalRoll X", false, false, true, 35.0);
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.LeftButton,
|
||||
joystickHelper.permaBindLocalRoll(controller.Tilt[1]),
|
||||
"Switch to local roll mode"
|
||||
)
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.RightButton,
|
||||
joystickHelper.permaBindGlobalRoll(controller.Tilt[1]),
|
||||
"Switch to global roll mode"
|
||||
)
|
||||
end)
|
||||
116
data/assets/util/joysticks/xbox.asset
Normal file
116
data/assets/util/joysticks/xbox.asset
Normal file
@@ -0,0 +1,116 @@
|
||||
local propertyHelper = asset.require('../property_helper')
|
||||
local joystickHelper = asset.require('./joystick_helper')
|
||||
|
||||
-- Allowed values for the second parameter of bindJoystickAxis:
|
||||
-- "None"
|
||||
-- "Orbit X"
|
||||
-- "Orbit Y"
|
||||
-- "Zoom" -- both in and out
|
||||
-- "Zoom In"
|
||||
-- "Zoom Out"
|
||||
-- "LocalRoll X"
|
||||
-- "LocalRoll Y"
|
||||
-- "GlobalRoll X"
|
||||
-- "GlobalRoll Y"
|
||||
-- "Pan X"
|
||||
-- "Pan Y"
|
||||
-- Third parameter determines whether the axis should be inverted
|
||||
-- Fourth parameter determines whether the axis should be normalized from [-1,1] to [0,1]
|
||||
-- Fifth parameters determins if the axis should be "Sticky" or not.
|
||||
-- The axis values can either go back to 0 when the joystick is released or it can
|
||||
-- stay at the value it was before the joystick was released.
|
||||
-- The latter is called a sticky axis, when the values don't go back to 0.
|
||||
-- Sixth parameter is the sensitivity for the axis
|
||||
|
||||
local XBoxController = {
|
||||
LeftThumbStick = { 0 , 1 },
|
||||
RightThumbStick = { 2, 3 },
|
||||
LeftTrigger = 4,
|
||||
RightTrigger = 5,
|
||||
A = 0,
|
||||
B = 1,
|
||||
X = 2,
|
||||
Y = 3,
|
||||
LB = 4,
|
||||
RB = 5,
|
||||
Select = 6,
|
||||
Start = 7,
|
||||
LeftStickButton = 8,
|
||||
RightStickButton = 9,
|
||||
DPad = {
|
||||
Up = 10,
|
||||
Right = 11,
|
||||
Down = 12,
|
||||
Left = 13
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
local controller = XBoxController;
|
||||
|
||||
openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(controller.LeftThumbStick[2], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(controller.RightThumbStick[1], 0.15)
|
||||
openspace.navigation.setAxisDeadZone(controller.RightThumbStick[2], 0.15)
|
||||
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[1], "Orbit X");
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftThumbStick[2], "Orbit Y", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[1], "Pan X", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightThumbStick[2], "Pan Y", true);
|
||||
openspace.navigation.bindJoystickAxis(controller.LeftTrigger, "Zoom Out", false, true);
|
||||
openspace.navigation.bindJoystickAxis(controller.RightTrigger, "Zoom In", false, true);
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.LB,
|
||||
joystickHelper.bindLocalRoll(controller.RightThumbStick[1]),
|
||||
"Switch to local roll mode"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.LB,
|
||||
joystickHelper.unbindRoll(controller.RightThumbStick[1]),
|
||||
"Switch back to normal mode",
|
||||
"Release"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.RB,
|
||||
joystickHelper.bindGlobalRoll(controller.RightThumbStick[1]),
|
||||
"Switch to global roll mode"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.RB,
|
||||
joystickHelper.unbindRoll(controller.RightThumbStick[1]),
|
||||
"Switch back to normal mode",
|
||||
"Release"
|
||||
)
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.A,
|
||||
propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.ZoomFriction'),
|
||||
"Toggle zoom friction"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.B,
|
||||
propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RotationalFriction'),
|
||||
"Toggle rotational friction"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.DPad.Left,
|
||||
propertyHelper.invert('NavigationHandler.OrbitalNavigator.Friction.RollFriction'),
|
||||
"Toggle roll friction"
|
||||
)
|
||||
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.X,
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Earth');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);",
|
||||
"Switch target to Earth"
|
||||
)
|
||||
openspace.navigation.bindJoystickButton(
|
||||
controller.Y,
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Aim', '');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.Anchor', 'Mars');" ..
|
||||
"openspace.setPropertyValueSingle('NavigationHandler.OrbitalNavigator.RetargetAnchor', nil);",
|
||||
"Switch target to Mars"
|
||||
)
|
||||
end)
|
||||
@@ -3,7 +3,7 @@ asset.require('./static_server')
|
||||
local guiCustomization = asset.require('customization/gui')
|
||||
|
||||
-- Select which commit hashes to use for the frontend and backend
|
||||
local frontendHash = "7fed95043e967c632b446ae1c98c6390f3fb7edc"
|
||||
local frontendHash = "96b88e6c760e59d143bd29da6f06011eaafce4b1"
|
||||
local dataProvider = "data.openspaceproject.com/files/webgui"
|
||||
|
||||
local frontend = asset.syncedResource({
|
||||
|
||||
Submodule ext/ghoul updated: fcb8e8b964...c3c9b88e52
@@ -53,6 +53,15 @@ struct Configuration {
|
||||
};
|
||||
std::map<std::string, std::string> fonts;
|
||||
|
||||
struct FontSizes {
|
||||
float frameInfo;
|
||||
float shutdown;
|
||||
float log;
|
||||
float cameraInfo;
|
||||
float versionInfo;
|
||||
};
|
||||
FontSizes fontSize;
|
||||
|
||||
struct Logging {
|
||||
std::string level = "Info";
|
||||
bool forceImmediateFlush = false;
|
||||
|
||||
@@ -125,7 +125,7 @@ private:
|
||||
bool _hasScheduledAssetLoading = false;
|
||||
std::string _scheduledAssetPathToLoad;
|
||||
|
||||
glm::vec2 _mousePosition;
|
||||
glm::vec2 _mousePosition = glm::vec2(0.f);
|
||||
|
||||
//grabs json from each module to pass to the documentation engine.
|
||||
std::string _documentationJson;
|
||||
|
||||
@@ -130,6 +130,7 @@ inline std::string to_string(
|
||||
case T::OrbitY: return "Orbit Y";
|
||||
case T::ZoomIn: return "Zoom In";
|
||||
case T::ZoomOut: return "Zoom Out";
|
||||
case T::Zoom: return "Zoom In and Out";
|
||||
case T::LocalRollX: return "LocalRoll X";
|
||||
case T::LocalRollY: return "LocalRoll Y";
|
||||
case T::GlobalRollX: return "GlobalRoll X";
|
||||
@@ -149,9 +150,9 @@ from_string(std::string_view string)
|
||||
if (string == "None") { return T::None; }
|
||||
if (string == "Orbit X") { return T::OrbitX; }
|
||||
if (string == "Orbit Y") { return T::OrbitY; }
|
||||
if (string == "Zoom") { return T::Zoom; }
|
||||
if (string == "Zoom In") { return T::ZoomIn; }
|
||||
if (string == "Zoom Out") { return T::ZoomOut; }
|
||||
if (string == "Zoom") { return T::Zoom; }
|
||||
if (string == "LocalRoll X") { return T::LocalRollX; }
|
||||
if (string == "LocalRoll Y") { return T::LocalRollY; }
|
||||
if (string == "GlobalRoll X") { return T::GlobalRollX; }
|
||||
|
||||
@@ -233,8 +233,9 @@ private:
|
||||
std::vector<ghoul::opengl::ProgramObject*> _programs;
|
||||
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontFrameInfo;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontInfo;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontDate;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontCameraInfo;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontVersionInfo;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontShutdown;
|
||||
std::shared_ptr<ghoul::fontrendering::Font> _fontLog;
|
||||
|
||||
struct {
|
||||
|
||||
@@ -125,7 +125,6 @@ private:
|
||||
// Logging variables
|
||||
bool _logFileExists = false;
|
||||
bool _logScripts = true;
|
||||
std::string _logType;
|
||||
std::string _logFilename;
|
||||
};
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
|
||||
double lt;
|
||||
glm::dvec3 sunPosWorld = SpiceManager::ref().targetPosition(
|
||||
"SUN",
|
||||
"SUN",
|
||||
"SSB",
|
||||
"GALACTIC",
|
||||
{},
|
||||
_time,
|
||||
@@ -386,7 +386,7 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
|
||||
// Getting source and caster:
|
||||
glm::dvec3 sourcePos = SpiceManager::ref().targetPosition(
|
||||
shadowConf.source.first,
|
||||
"SUN",
|
||||
"SSB",
|
||||
"GALACTIC",
|
||||
{},
|
||||
_time,
|
||||
@@ -395,7 +395,7 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
|
||||
sourcePos *= KM_TO_M; // converting to meters
|
||||
glm::dvec3 casterPos = SpiceManager::ref().targetPosition(
|
||||
shadowConf.caster.first,
|
||||
"SUN",
|
||||
"SSB",
|
||||
"GALACTIC",
|
||||
{},
|
||||
_time,
|
||||
@@ -682,7 +682,7 @@ void AtmosphereDeferredcaster::loadComputationPrograms() {
|
||||
);
|
||||
}
|
||||
_irradianceSupTermsProgramObject->setIgnoreUniformLocationError(IgnoreError::Yes);
|
||||
|
||||
|
||||
//
|
||||
// InScattering S
|
||||
if (!_inScatteringProgramObject) {
|
||||
|
||||
@@ -161,7 +161,7 @@ private:
|
||||
glm::vec3 _ozoneExtinctionCoeff = glm::vec3(0.f);
|
||||
glm::vec3 _mieScatteringCoeff = glm::vec3(0.f);
|
||||
glm::vec3 _mieExtinctionCoeff = glm::vec3(0.f);
|
||||
glm::dvec3 _ellipsoidRadii = glm::vec3(0.f);
|
||||
glm::dvec3 _ellipsoidRadii = glm::dvec3(0.0);
|
||||
|
||||
// Atmosphere Textures Dimmensions
|
||||
glm::ivec2 _transmittanceTableSize = glm::ivec2(256, 64);
|
||||
|
||||
@@ -230,11 +230,11 @@ void RenderableSphericalGrid::update(const UpdateData&) {
|
||||
normal = glm::normalize(normal);
|
||||
}
|
||||
|
||||
glm::vec4 tmp(x, y, z, 1);
|
||||
glm::vec4 tmp(x, y, z, 1.f);
|
||||
glm::mat4 rot = glm::rotate(
|
||||
glm::mat4(1),
|
||||
glm::mat4(1.f),
|
||||
glm::half_pi<float>(),
|
||||
glm::vec3(1, 0, 0)
|
||||
glm::vec3(1.f, 0.f, 0.f)
|
||||
);
|
||||
tmp = glm::vec4(glm::dmat4(rot) * glm::dvec4(tmp));
|
||||
|
||||
|
||||
@@ -575,7 +575,6 @@ void RenderableModel::initializeGL() {
|
||||
|
||||
_geometry->initialize();
|
||||
_geometry->calculateBoundingRadius();
|
||||
setBoundingSphere(_geometry->boundingRadius() * _modelScale);
|
||||
}
|
||||
|
||||
void RenderableModel::deinitializeGL() {
|
||||
@@ -717,6 +716,10 @@ void RenderableModel::update(const UpdateData& data) {
|
||||
ghoul::opengl::updateUniformLocations(*_program, _uniformCache, UniformNames);
|
||||
}
|
||||
|
||||
setBoundingSphere(_geometry->boundingRadius() * _modelScale *
|
||||
glm::compMax(data.modelTransform.scale)
|
||||
);
|
||||
|
||||
if (_geometry->hasAnimation() && !_animationStart.empty()) {
|
||||
double relativeTime;
|
||||
double now = data.time.j2000Seconds();
|
||||
|
||||
@@ -256,7 +256,10 @@ void RenderablePrism::updateVertexData() {
|
||||
}
|
||||
|
||||
// Indices for Base shape
|
||||
ghoul_assert(_nShapeSegments.value <= std::numeric_limit<uint8_t>::max(), "Too many shape segments")
|
||||
ghoul_assert(
|
||||
_nShapeSegments.value() <= std::numeric_limits<uint8_t>::max(),
|
||||
"Too many shape segments"
|
||||
);
|
||||
for (uint8_t i = 0; i < _nShapeSegments; ++i) {
|
||||
_indexArray.push_back(i);
|
||||
}
|
||||
@@ -329,7 +332,7 @@ void RenderablePrism::render(const RenderData& data, RendererTasks&) {
|
||||
_shader->deactivate();
|
||||
}
|
||||
|
||||
void RenderablePrism::update(const UpdateData&) {
|
||||
void RenderablePrism::update(const UpdateData& data) {
|
||||
if (_shader->isDirty()) {
|
||||
_shader->rebuildFromFile();
|
||||
ghoul::opengl::updateUniformLocations(*_shader, _uniformCache, UniformNames);
|
||||
@@ -337,6 +340,7 @@ void RenderablePrism::update(const UpdateData&) {
|
||||
if (_prismIsDirty) {
|
||||
updateVertexData();
|
||||
updateBufferData();
|
||||
setBoundingSphere(_length * glm::compMax(data.modelTransform.scale));
|
||||
_prismIsDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ ScreenSpaceFramebuffer::ScreenSpaceFramebuffer(const ghoul::Dictionary& dictiona
|
||||
|
||||
glm::vec2 resolution = global::windowDelegate->currentDrawBufferResolution();
|
||||
addProperty(_size);
|
||||
_size.set(glm::vec4(0, 0, resolution.x,resolution.y));
|
||||
_size.set(glm::vec4(0.f, 0.f, resolution.x, resolution.y));
|
||||
}
|
||||
|
||||
ScreenSpaceFramebuffer::~ScreenSpaceFramebuffer() {} // NOLINT
|
||||
|
||||
@@ -1024,9 +1024,14 @@ std::vector<float> RenderableBillboardsCloud::createDataSlice() {
|
||||
float minColorIdx = std::numeric_limits<float>::max();
|
||||
float maxColorIdx = -std::numeric_limits<float>::max();
|
||||
for (const speck::Dataset::Entry& e : _dataset.entries) {
|
||||
float color = e.data[colorMapInUse];
|
||||
minColorIdx = std::min(color, minColorIdx);
|
||||
maxColorIdx = std::max(color, maxColorIdx);
|
||||
if (e.data.size() > 0) {
|
||||
float color = e.data[colorMapInUse];
|
||||
minColorIdx = std::min(color, minColorIdx);
|
||||
maxColorIdx = std::max(color, maxColorIdx);
|
||||
} else {
|
||||
minColorIdx = 0;
|
||||
maxColorIdx = 0;
|
||||
}
|
||||
}
|
||||
|
||||
double maxRadius = 0.0;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace {
|
||||
namespace openspace {
|
||||
|
||||
GalaxyRaycaster::GalaxyRaycaster(ghoul::opengl::Texture& texture)
|
||||
: _boundingBox(glm::vec3(1.0))
|
||||
: _boundingBox(glm::vec3(1.f))
|
||||
, _texture(texture)
|
||||
, _textureUnit(nullptr)
|
||||
{}
|
||||
@@ -133,7 +133,7 @@ bool GalaxyRaycaster::isCameraInside(const RenderData& data, glm::vec3& localPos
|
||||
glm::vec4 modelPos = glm::inverse(modelViewTransform(data)) *
|
||||
glm::vec4(0.f, 0.f, 0.f, 1.f);
|
||||
|
||||
localPosition = (glm::vec3(modelPos) + glm::vec3(0.5));
|
||||
localPosition = (glm::vec3(modelPos) + glm::vec3(0.5f));
|
||||
|
||||
return (localPosition.x > 0 && localPosition.x < 1 &&
|
||||
localPosition.y > 0 && localPosition.y < 1 &&
|
||||
|
||||
@@ -98,7 +98,7 @@ void main() {
|
||||
levelWeights = getLevelWeights(distToVertexOnEllipsoid);
|
||||
|
||||
// Get the height value and apply skirts
|
||||
float height = getTileHeightScaled(in_uv, levelWeights) - getTileVertexSkirtLength();
|
||||
float height = getTileHeightScaled(in_uv, levelWeights) - getTileVertexSkirtLength() * 100.0;
|
||||
|
||||
// Translate the point along normal
|
||||
p += patchNormalCameraSpace * height;
|
||||
|
||||
@@ -202,17 +202,17 @@ documentation::Documentation GlobeLabelsComponent::Documentation() {
|
||||
GlobeLabelsComponent::GlobeLabelsComponent()
|
||||
: properties::PropertyOwner({ "Labels" })
|
||||
, _enabled(EnabledInfo, false)
|
||||
, _fontSize(FontSizeInfo, 30, 1, 300)
|
||||
, _fontSize(FontSizeInfo, 30.f, 1.f, 300.f)
|
||||
, _minMaxSize(MinMaxSizeInfo, glm::ivec2(1, 1000), glm::ivec2(1), glm::ivec2(1000))
|
||||
, _size(SizeInfo, 2.5, 0, 30)
|
||||
, _heightOffset(HeightOffsetInfo, 100.0, 0.0, 10000.0)
|
||||
, _heightOffset(HeightOffsetInfo, 100.f, 0.f, 10000.f)
|
||||
, _color(ColorInfo, glm::vec3(1.f, 1.f, 0.f), glm::vec3(0.f), glm::vec3(1.f))
|
||||
, _opacity(OpacityInfo, 1.f, 0.f, 1.f)
|
||||
, _fadeDistances(
|
||||
FadeDistancesInfo,
|
||||
glm::vec2(1e4, 1e6),
|
||||
glm::vec2(1e4f, 1e6f),
|
||||
glm::vec2(1.f),
|
||||
glm::vec2(1e8)
|
||||
glm::vec2(1e8f)
|
||||
)
|
||||
, _fadeInEnabled(FadeInEnabledInfo, false)
|
||||
, _fadeOutEnabled(FadeOutEnabledInfo, false)
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace {
|
||||
|
||||
const openspace::globebrowsing::AABB3 CullingFrustum{
|
||||
glm::vec3(-1.f, -1.f, 0.f),
|
||||
glm::vec3( 1.f, 1.f, 1e35)
|
||||
glm::vec3( 1.f, 1.f, 1e35f)
|
||||
};
|
||||
constexpr const float DefaultHeight = 0.f;
|
||||
|
||||
@@ -464,7 +464,7 @@ std::array<glm::dvec4, 8> boundingCornersForChunk(const Chunk& chunk,
|
||||
cornerGeodetic.geodetic2.lat += latDiff;
|
||||
}
|
||||
|
||||
corners[i] = glm::dvec4(ellipsoid.cartesianPosition(cornerGeodetic), 1);
|
||||
corners[i] = glm::dvec4(ellipsoid.cartesianPosition(cornerGeodetic), 1.0);
|
||||
}
|
||||
|
||||
return corners;
|
||||
@@ -567,7 +567,7 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary)
|
||||
for (const Parameters::ShadowGroup::Caster& caster : p.shadowGroup->casters) {
|
||||
Ellipsoid::ShadowConfiguration sc;
|
||||
sc.source = std::pair<std::string, double>(source.name, source.radius);
|
||||
sc.caster = std::pair<std::string, double>(source.name, source.radius);
|
||||
sc.caster = std::pair<std::string, double>(caster.name, caster.radius);
|
||||
shadowConfArray.push_back(sc);
|
||||
}
|
||||
}
|
||||
@@ -1357,7 +1357,7 @@ void RenderableGlobe::renderChunkLocally(const Chunk& chunk, const RenderData& d
|
||||
const glm::dvec3 cornerModelSpace = _ellipsoid.cartesianSurfacePosition(corner);
|
||||
cornersModelSpace[i] = cornerModelSpace;
|
||||
const glm::dvec3 cornerCameraSpace = glm::dvec3(
|
||||
modelViewTransform * glm::dvec4(cornerModelSpace, 1)
|
||||
modelViewTransform * glm::dvec4(cornerModelSpace, 1.0)
|
||||
);
|
||||
cornersCameraSpace[i] = cornerCameraSpace;
|
||||
}
|
||||
@@ -1995,7 +1995,7 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog
|
||||
// Getting source and caster:
|
||||
glm::dvec3 sourcePos = SpiceManager::ref().targetPosition(
|
||||
shadowConf.source.first,
|
||||
"SUN",
|
||||
"SSB",
|
||||
"GALACTIC",
|
||||
{},
|
||||
data.time.j2000Seconds(),
|
||||
@@ -2004,7 +2004,7 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog
|
||||
sourcePos *= KM_TO_M; // converting to meters
|
||||
glm::dvec3 casterPos = SpiceManager::ref().targetPosition(
|
||||
shadowConf.caster.first,
|
||||
"SUN",
|
||||
"SSB",
|
||||
"GALACTIC",
|
||||
{},
|
||||
data.time.j2000Seconds(),
|
||||
@@ -2056,7 +2056,7 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog
|
||||
|
||||
const glm::dvec3 sunPos = SpiceManager::ref().targetPosition(
|
||||
"SUN",
|
||||
"SUN",
|
||||
"SSB",
|
||||
"GALACTIC",
|
||||
{},
|
||||
data.time.j2000Seconds(),
|
||||
@@ -2311,11 +2311,11 @@ bool RenderableGlobe::isCullableByHorizon(const Chunk& chunk,
|
||||
// position needs to be transformed with the inverse model matrix
|
||||
const GeodeticPatch& patch = chunk.surfacePatch;
|
||||
const float maxHeight = heights.max;
|
||||
const glm::dvec3 globePos = glm::dvec3(0, 0, 0); // In model space it is 0
|
||||
const glm::dvec3 globePos = glm::dvec3(0.0, 0.0, 0.0); // In model space it is 0
|
||||
const double minimumGlobeRadius = _ellipsoid.minimumRadius();
|
||||
|
||||
const glm::dvec3 cameraPos = glm::dvec3(
|
||||
_cachedInverseModelTransform * glm::dvec4(renderData.camera.positionVec3(), 1)
|
||||
_cachedInverseModelTransform * glm::dvec4(renderData.camera.positionVec3(), 1.0)
|
||||
);
|
||||
|
||||
const glm::dvec3 globeToCamera = cameraPos;
|
||||
|
||||
@@ -420,7 +420,7 @@ void RingsComponent::draw(const RenderData& data, RenderPass renderPass,
|
||||
const glm::dmat4 inverseModelTransform = glm::inverse(modelTransform);
|
||||
|
||||
glm::vec3 sunPositionObjectSpace = glm::normalize(
|
||||
glm::vec3(inverseModelTransform * glm::vec4(_sunPosition, 0.0))
|
||||
glm::vec3(inverseModelTransform * glm::vec4(_sunPosition, 0.f))
|
||||
);
|
||||
|
||||
_shader->setUniform(
|
||||
|
||||
@@ -54,8 +54,8 @@ namespace documentation { struct Documentation; }
|
||||
class ShadowComponent : public properties::PropertyOwner {
|
||||
public:
|
||||
struct ShadowMapData {
|
||||
glm::dmat4 shadowMatrix;
|
||||
GLuint shadowDepthTexture;
|
||||
glm::dmat4 shadowMatrix = glm::dmat4(1.0);
|
||||
GLuint shadowDepthTexture = 0;
|
||||
};
|
||||
|
||||
ShadowComponent(const ghoul::Dictionary& dictionary);
|
||||
|
||||
@@ -71,17 +71,17 @@ IswaCygnet::IswaCygnet(const ghoul::Dictionary& dictionary)
|
||||
_data.id = static_cast<int>(dictionary.value<double>("Id"));
|
||||
_data.updateTime = static_cast<int>(dictionary.value<double>("UpdateTime"));
|
||||
|
||||
_data.spatialScale = glm::dvec4(0.f);
|
||||
_data.spatialScale = glm::dvec4(0.0);
|
||||
if (dictionary.hasValue<glm::dvec4>("SpatialScale")) {
|
||||
_data.spatialScale = dictionary.value<glm::dvec4>("SpatialScale");
|
||||
}
|
||||
|
||||
_data.gridMin = glm::dvec3(0.f);
|
||||
_data.gridMin = glm::dvec3(0.0);
|
||||
if (dictionary.hasValue<glm::dvec3>("GridMin")) {
|
||||
_data.gridMin = dictionary.value<glm::dvec3>("GridMin");
|
||||
}
|
||||
|
||||
_data.gridMax = glm::dvec3(0.f);
|
||||
_data.gridMax = glm::dvec3(0.0);
|
||||
if (dictionary.hasValue<glm::dvec3>("GridMax")) {
|
||||
_data.gridMax = dictionary.value<glm::dvec3>("GridMax");
|
||||
}
|
||||
@@ -94,7 +94,7 @@ IswaCygnet::IswaCygnet(const ghoul::Dictionary& dictionary)
|
||||
}
|
||||
|
||||
|
||||
double xOffset = 0.f;
|
||||
double xOffset = 0.0;
|
||||
if (dictionary.hasValue<double>("XOffset")) {
|
||||
xOffset = dictionary.value<double>("XOffset");
|
||||
}
|
||||
|
||||
@@ -231,8 +231,8 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict
|
||||
return;
|
||||
}
|
||||
|
||||
//_pscOffset = psc(glm::vec4(0.0));
|
||||
//_boxScaling = glm::vec3(1.0);
|
||||
//_pscOffset = psc(glm::vec4(0.f));
|
||||
//_boxScaling = glm::vec3(1.f);
|
||||
|
||||
|
||||
/*if (dictionary.hasKey(KeyBoxScaling)) {
|
||||
|
||||
@@ -53,7 +53,7 @@ struct Dataset {
|
||||
int orientationDataIndex = -1;
|
||||
|
||||
struct Entry {
|
||||
glm::vec3 position;
|
||||
glm::vec3 position = glm::vec3(0.f);
|
||||
std::vector<float> data;
|
||||
std::optional<std::string> comment;
|
||||
};
|
||||
@@ -67,7 +67,7 @@ struct Labelset {
|
||||
int textColorIndex = -1;
|
||||
|
||||
struct Entry {
|
||||
glm::vec3 position;
|
||||
glm::vec3 position = glm::vec3(0.f);
|
||||
std::string text;
|
||||
};
|
||||
std::vector<Entry> entries;
|
||||
|
||||
@@ -171,9 +171,9 @@ void HorizonsTranslation::readHorizonsTextFile() {
|
||||
std::stringstream str(line);
|
||||
std::string date;
|
||||
std::string time;
|
||||
float range = 0;
|
||||
float gLon = 0;
|
||||
float gLat = 0;
|
||||
double range = 0;
|
||||
double gLon = 0;
|
||||
double gLat = 0;
|
||||
|
||||
// File is structured by:
|
||||
// YYYY-MM-DD
|
||||
|
||||
@@ -66,6 +66,13 @@ namespace {
|
||||
"making it more visible."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo AlwaysDrawFovInfo = {
|
||||
"AlwaysDrawFov",
|
||||
"Always Draw FOV",
|
||||
"If this value is enabled, the field of view will always be drawn, regardless of "
|
||||
"whether image information has been loaded or not"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo DefaultStartColorInfo = {
|
||||
"Colors.DefaultStart",
|
||||
"Start of default color",
|
||||
@@ -160,6 +167,10 @@ namespace {
|
||||
// A table describing the instrument whose field of view should be rendered
|
||||
Instrument instrument;
|
||||
|
||||
// If this value is set to 'true', the field of view specified here will always be
|
||||
// rendered, regardless of whether image information is currently available or not
|
||||
std::optional<bool> alwaysDrawFov;
|
||||
|
||||
// A list of potential targets (specified as SPICE names) that the field of view
|
||||
// should be tested against
|
||||
std::vector<std::string> potentialTargets;
|
||||
@@ -192,6 +203,7 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary)
|
||||
: Renderable(dictionary)
|
||||
, _lineWidth(LineWidthInfo, 1.f, 1.f, 20.f)
|
||||
, _standOffDistance(StandoffDistanceInfo, 0.9999, 0.99, 1.0, 0.000001)
|
||||
, _alwaysDrawFov(AlwaysDrawFovInfo, false)
|
||||
, _colors({
|
||||
{ DefaultStartColorInfo, glm::vec3(0.4f), glm::vec3(0.f), glm::vec3(1.f) },
|
||||
{ DefaultEndColorInfo, glm::vec3(0.85f), glm::vec3(0.f), glm::vec3(1.f) },
|
||||
@@ -239,6 +251,9 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary)
|
||||
|
||||
_standOffDistance = p.standOffDistance.value_or(_standOffDistance);
|
||||
addProperty(_standOffDistance);
|
||||
|
||||
_alwaysDrawFov = p.alwaysDrawFov.value_or(_alwaysDrawFov);
|
||||
addProperty(_alwaysDrawFov);
|
||||
|
||||
_simplifyBounds = p.simplifyBounds.value_or(_simplifyBounds);
|
||||
|
||||
@@ -769,7 +784,7 @@ void RenderableFov::render(const RenderData& data, RendererTasks&) {
|
||||
}
|
||||
|
||||
void RenderableFov::update(const UpdateData& data) {
|
||||
_drawFOV = false;
|
||||
_drawFOV = _alwaysDrawFov;
|
||||
if (ImageSequencer::ref().isReady()) {
|
||||
_drawFOV = ImageSequencer::ref().isInstrumentActive(
|
||||
data.time.j2000Seconds(),
|
||||
|
||||
@@ -77,6 +77,7 @@ private:
|
||||
// properties
|
||||
properties::FloatProperty _lineWidth;
|
||||
properties::DoubleProperty _standOffDistance;
|
||||
properties::BoolProperty _alwaysDrawFov;
|
||||
ghoul::opengl::ProgramObject* _program = nullptr;
|
||||
UniformCache(modelViewProjection, defaultColorStart, defaultColorEnd, activeColor,
|
||||
targetInFieldOfViewColor, intersectionStartColor, intersectionEndColor,
|
||||
|
||||
@@ -1202,7 +1202,7 @@ void TouchInteraction::resetToDefault() {
|
||||
_centroidStillThreshold.set(0.0018f);
|
||||
_interpretPan.set(0.015f);
|
||||
_slerpTime.set(3.0f);
|
||||
_friction.set(glm::vec4(0.025, 0.025, 0.02, 0.02));
|
||||
_friction.set(glm::vec4(0.025f, 0.025f, 0.02f, 0.02f));
|
||||
}
|
||||
|
||||
void TouchInteraction::tap() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user