sky model update

This commit is contained in:
minjaesong
2023-07-25 15:15:12 +09:00
parent a73c536941
commit 4fb30821f1
5 changed files with 23 additions and 15 deletions

View File

@@ -1,8 +1,12 @@
package net.torvald.terrarum.modulebasegame.console
import net.torvald.reflection.extortField
import net.torvald.terrarum.INGAME
import net.torvald.terrarum.console.ConsoleCommand
import net.torvald.terrarum.console.Echo
import net.torvald.terrarum.gameactors.ActorWithBody
import net.torvald.terrarum.weather.WeatherMixer
import net.torvald.terrarum.worlddrawer.LightmapRenderer
/**
* Created by minjaesong on 2023-07-25.
@@ -17,6 +21,13 @@ internal object SetSol : ConsoleCommand {
try {
val solarAngle = args[1].toDouble().coerceIn(-75.0..75.0)
WeatherMixer.forceSolarElev = solarAngle
LightmapRenderer.recalculate(
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderBehind")!! +
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderMiddle")!! +
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderMidTop")!! +
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderFront")!! +
INGAME.extortField<ArrayList<ActorWithBody>>("visibleActorsRenderOverlay")!!
)
}
catch (e: NumberFormatException) {
Echo("Wrong number input.")