mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 17:09:05 -05:00
adapt addFocusNodes for GlobeTranslation
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user