Merge branch 'master' into feature/radec-conversion

This commit is contained in:
Malin Ejdbo
2021-06-15 15:44:24 +02:00
75 changed files with 561 additions and 342 deletions

View File

@@ -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')

View File

@@ -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')

View File

@@ -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 Plutos largest moon, Charon, was assembled from nearly

View File

@@ -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

View File

@@ -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",

View File

@@ -12,7 +12,7 @@ local PlutoBarycenter = {
Translation = {
Type = "SpiceTranslation",
Target = "PLUTO BARYCENTER",
Observer = "SUN",
Observer = "SSB",
Kernels = kernels
}
},

View File

@@ -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",

View File

@@ -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,

View File

@@ -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",

View File

@@ -165,7 +165,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 },

View File

@@ -67,7 +67,7 @@ local Messenger = {
Translation = {
Type = "SpiceTranslation",
Target = "MESSENGER",
Observer = "SUN",
Observer = "SSB",
Kernels = LocalKernels
},
Rotation = {

View File

@@ -14,7 +14,7 @@ local PlutoBarycenterAccurate = {
Translation = {
Type = "SpiceTranslation",
Target = "PLUTO BARYCENTER",
Observer = "SUN",
Observer = "SSB",
Kernels = kernels.PlutoKernels
}
},

View File

@@ -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",

View File

@@ -36,7 +36,7 @@ local OsirisRex = {
Translation = {
Type = "SpiceTranslation",
Target = "OSIRIS-REX",
Observer = "SUN",
Observer = "SSB",
Kernels = OsirisRexKernels
},
Rotation = {

View File

@@ -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",

View File

@@ -12,7 +12,7 @@ local BennuBarycenter = {
Translation = {
Type = "SpiceTranslation",
Target = BENNU_BODY,
Observer = "SUN"
Observer = "SSB"
}
},
GUI = {

View File

@@ -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 },

View File

@@ -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 },

View File

@@ -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 },

View File

@@ -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",

View File

@@ -94,7 +94,7 @@ local Rosetta = {
Translation = {
Type = "SpiceTranslation",
Target = "ROSETTA",
Observer = "SUN",
Observer = "SSB",
Kernels = RosettaKernels
},
Rotation = {

View File

@@ -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,

View File

@@ -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,

View File

@@ -20,7 +20,7 @@ local L1 = {
Translation = {
Type = "SpiceTranslation",
Target = "391", -- L1
Observer = "SUN",
Observer = "SSB",
Kernels = kernels .. "/L1_de431.bsp"
}
},

View File

@@ -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"
}
},

View File

@@ -20,7 +20,7 @@ local L4 = {
Translation = {
Type = "SpiceTranslation",
Target = "394", -- L4
Observer = "SUN",
Observer = "SSB",
Kernels = kernels .. "/L4_de431.bsp"
}
},

View File

@@ -20,7 +20,7 @@ local L5 = {
Translation = {
Type = "SpiceTranslation",
Target = "395", -- L5
Observer = "SUN",
Observer = "SSB",
Kernels = kernels .. "/L5_de431.bsp"
}
},

View File

@@ -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,

View File

@@ -11,7 +11,7 @@ local EarthBarycenter = {
Translation = {
Type = "SpiceTranslation",
Target = "EARTH BARYCENTER",
Observer = "SUN"
Observer = "SSB"
}
},
GUI = {

View File

@@ -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",

View File

@@ -1,5 +1,5 @@
local LabelsPath = asset.syncedResource({
Name = "Callisto Labels",
Name = "Jupiter Labels",
Type = "HttpSynchronization",
Identifier = "jupiter_labels",
Version = 1

View File

@@ -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,

View File

@@ -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 })

View File

@@ -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",

View File

@@ -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",

View File

@@ -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,

View File

@@ -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 },

View File

@@ -9,7 +9,7 @@ local MarsBarycenter = {
Translation = {
Type = "SpiceTranslation",
Target = "MARS BARYCENTER",
Observer = "SUN"
Observer = "SSB"
}
},
GUI = {

View File

@@ -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",

View File

@@ -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,

View File

@@ -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 },

View File

@@ -8,8 +8,8 @@ local MercuryBarycenter = {
Transform = {
Translation = {
Type = "SpiceTranslation",
Target = "MERCURY",
Observer = "SUN"
Target = "MERCURY BARYCENTER",
Observer = "SSB"
}
},
GUI = {

View File

@@ -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",

View File

@@ -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",

View File

@@ -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,

View File

@@ -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"}
}

View File

@@ -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",

View File

@@ -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",

View File

@@ -1,5 +1,5 @@
local LabelsPath = asset.syncedResource({
Name = "Dione Labels",
Name = "Saturn Labels",
Type = "HttpSynchronization",
Identifier = "saturn_labels",
Version = 1

View File

@@ -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,

View File

@@ -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 })

View File

@@ -9,7 +9,7 @@ local SaturnBarycenter = {
Translation = {
Type = "SpiceTranslation",
Target = "SATURN BARYCENTER",
Observer = "SUN"
Observer = "SSB"
}
},
GUI = {

View File

@@ -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,

View File

@@ -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"}
}

View File

@@ -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"}
}

View File

@@ -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",

View File

@@ -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,

View File

@@ -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 },

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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)

View 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)

View 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)

View 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)

View 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)

View 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)

View File

@@ -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; }

View File

@@ -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) {

View File

@@ -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;
}
}

View File

@@ -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(),

View File

@@ -165,7 +165,7 @@ NavigationHandler::NavigationState::NavigationState(std::string anchor_, std::st
NavigationHandler::NavigationHandler()
: properties::PropertyOwner({ "NavigationHandler" })
, _disableMouseInputs(KeyDisableMouseInputInfo, false)
, _disableJoystickInputs(KeyDisableJoystickInputInfo, true)
, _disableJoystickInputs(KeyDisableJoystickInputInfo, false)
, _useKeyFrameInteraction(KeyFrameInfo, false)
{
addPropertySubOwner(_orbitalNavigator);

View File

@@ -2103,7 +2103,7 @@ std::vector<std::string> SessionRecording::playbackList() const {
DWORD attributes = GetFileAttributes(e.path().string().c_str());
bool isHidden = attributes & FILE_ATTRIBUTE_HIDDEN;
#else
bool isHidden = filename.rfind(".", 0) != 0;
bool isHidden = filename.find(".") == 0;
#endif // WIN32
if (!isHidden) {
// Don't add hidden files

View File

@@ -325,6 +325,11 @@ bool SpiceManager::hasSpkCoverage(const std::string& target, double et) const {
ghoul_assert(!target.empty(), "Empty target");
const int id = naifId(target);
// SOLAR SYSTEM BARYCENTER special case, implicitly included by Spice
if (id == 0) {
return true;
}
const auto it = _spkIntervals.find(id);
if (it != _spkIntervals.end()) {
const std::vector<std::pair<double, double>>& intervalVector = it->second;