adapt addFocusNodes for GlobeTranslation

This commit is contained in:
Micah Acinapura
2021-07-06 23:38:36 -04:00
parent d4c06951da
commit c35ff0e8f2

View File

@@ -315,24 +315,25 @@ openspace.globebrowsing.addFocusNodesFromDirectory = function (dir, node_name)
if file and file:find('.info') then
local t = openspace.globebrowsing.parseInfoFile(file)
if t.Node and t.Location then
openspace.printInfo("Creating focus node for '" .. n .. "'")
if node_name and t.Location then
openspace.printInfo("Creating focus node for '" .. node_name .. "'")
local lat = t.Location.Center[2]
local long = t.Location.Center[1]
local a, b, c = openspace.globebrowsing.getGeoPosition(node_name, lat, long, 0.0)
local p = { a, b, c }
local lat = t.Location.Center[1]
local long = t.Location.Center[2]
local identifier = node_name .. " - " .. t.Identifier
local name = node_name .. " - " .. t.Node
local name = node_name .. " - " .. t.Name
openspace.addSceneGraphNode({
Identifier = identifier,
Parent = node_name,
Transform = {
Translation = {
Type = "StaticTranslation",
Position = { p[1], p[2], p[3] }
Type = "GlobeTranslation",
Globe = node_name,
Latitude = lat,
Longitude = long,
UseHeightmap = true
}
},
GUI = {
@@ -348,8 +349,6 @@ end
openspace.globebrowsing.addFocusNodeFromLatLong = function (name, globe_identifier, lat, long, altitude)
altitude = altitude or 0;
local a, b, c = openspace.globebrowsing.getGeoPosition(globe_identifier, lat, long, altitude)
local p = { a, b, c }
local identifier = globe_identifier .. "-" .. name
openspace.addSceneGraphNode({