mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
moved light source to sun.asset, removed light_source.asset
This commit is contained in:
@@ -4,7 +4,7 @@ local sun_transforms = asset.require("scene/solarsystem/sun/transforms")
|
||||
local mars = asset.require("scene/solarsystem/planets/mars/mars")
|
||||
local earth = asset.require("scene/solarsystem/planets/earth/earth")
|
||||
local moon = asset.require("scene/solarsystem/planets/earth/moon/moon")
|
||||
local lightsource = asset.require("scene/solarsystem/sun/light_source")
|
||||
local sun = asset.require("scene/solarsystem/sun/sun")
|
||||
|
||||
local celestial_globe_folder = asset.resource({
|
||||
Name = "Celestial Globe",
|
||||
@@ -49,7 +49,7 @@ function createModel(longitude, latitude, scale, name, parent, group)
|
||||
sun_transforms.LightSource
|
||||
},
|
||||
CastShadow = true,
|
||||
LightSource = lightsource.LightSource.Identifier,
|
||||
LightSource = sun.LightSource.Identifier,
|
||||
ShadowGroup = group
|
||||
},
|
||||
GUI = {
|
||||
@@ -71,7 +71,8 @@ asset.onInitialize(function()
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
for i = 1, #globeModels do
|
||||
-- Reverse order to deinitialize to avoid dependency issues between nodes
|
||||
for i = #globeModels, 1, -1 do
|
||||
openspace.removeSceneGraphNode(globeModels[i].Identifier)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
local transforms = asset.require("./transforms")
|
||||
|
||||
local LightSource = {
|
||||
Identifier = "sun-directional-lightsource",
|
||||
Parent = transforms.SunIAU.Identifier,
|
||||
Renderable = {
|
||||
Type = "DirectionalLightSource",
|
||||
},
|
||||
GUI = {
|
||||
Name = "Directional Light Source",
|
||||
Path = "/Solar System/Sun",
|
||||
Description = "Shadow-casting directional light source for our Sun"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(LightSource)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(LightSource)
|
||||
end)
|
||||
|
||||
asset.export("LightSource", LightSource)
|
||||
@@ -50,21 +50,34 @@ local SunLabel = {
|
||||
}
|
||||
}
|
||||
|
||||
local LightSource = {
|
||||
Identifier = "sun-directional-lightsource",
|
||||
Parent = transforms.SunIAU.Identifier,
|
||||
Renderable = {
|
||||
Type = "DirectionalLightSource",
|
||||
},
|
||||
GUI = {
|
||||
Name = "Directional Light Source",
|
||||
Path = "/Solar System/Sun",
|
||||
Description = "Shadow-casting directional light source for our Sun"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Sun)
|
||||
openspace.addSceneGraphNode(SunLabel)
|
||||
openspace.addSceneGraphNode(LightSource)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(LightSource)
|
||||
openspace.removeSceneGraphNode(SunLabel)
|
||||
openspace.removeSceneGraphNode(Sun)
|
||||
end)
|
||||
|
||||
asset.export(Sun)
|
||||
asset.export(SunLabel)
|
||||
|
||||
|
||||
asset.export("LightSource", LightSource)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Sun",
|
||||
|
||||
Reference in New Issue
Block a user