From 50f3c1e9e145555b2e9fcb17d6e3f310fa5ef041 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sun, 27 Oct 2024 15:10:28 +0000 Subject: [PATCH] Move Light to own file --- KeepersCompound.Lightmapper/Light.cs | 35 ++++++++++++++++++++++++++ KeepersCompound.Lightmapper/Program.cs | 32 ----------------------- 2 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 KeepersCompound.Lightmapper/Light.cs diff --git a/KeepersCompound.Lightmapper/Light.cs b/KeepersCompound.Lightmapper/Light.cs new file mode 100644 index 0000000..3e87248 --- /dev/null +++ b/KeepersCompound.Lightmapper/Light.cs @@ -0,0 +1,35 @@ +using System.Numerics; +using KeepersCompound.LGS.Database.Chunks; + +namespace KeepersCompound.Lightmapper; + +public class Light +{ + public Vector3 position; + public Vector3 color; + public float innerRadius; + public float radius; + public float r2; + + public bool spotlight; + public Vector3 spotlightDir; + public float spotlightInnerAngle; + public float spotlightOuterAngle; + + public int objId; + public int lightTableIndex; + public bool anim; + + public WorldRep.LightTable.LightData ToLightData(float lightScale) + { + return new WorldRep.LightTable.LightData + { + Location = position, + Direction = spotlightDir, + Color = color / lightScale, + InnerAngle = spotlightInnerAngle, + OuterAngle = spotlightOuterAngle, + Radius = radius == float.MaxValue ? 0 : radius, + }; + } +} \ No newline at end of file diff --git a/KeepersCompound.Lightmapper/Program.cs b/KeepersCompound.Lightmapper/Program.cs index 530000c..43bc611 100644 --- a/KeepersCompound.Lightmapper/Program.cs +++ b/KeepersCompound.Lightmapper/Program.cs @@ -8,38 +8,6 @@ namespace KeepersCompound.Lightmapper; class Program { - // Super simple for now - private record Light - { - public Vector3 position; - public Vector3 color; - public float innerRadius; - public float radius; - public float r2; - - public bool spotlight; - public Vector3 spotlightDir; - public float spotlightInnerAngle; - public float spotlightOuterAngle; - - public int objId; - public int lightTableIndex; - public bool anim; - - public WorldRep.LightTable.LightData ToLightData(float lightScale) - { - return new WorldRep.LightTable.LightData - { - Location = position, - Direction = spotlightDir, - Color = color / lightScale, - InnerAngle = spotlightInnerAngle, - OuterAngle = spotlightOuterAngle, - Radius = radius == float.MaxValue ? 0 : radius, - }; - } - } - static void Main(string[] args) { Timing.Reset();