Move Light to own file

This commit is contained in:
Jarrod Doyle 2024-10-27 15:10:28 +00:00
parent b263bdd77e
commit 50f3c1e9e1
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 35 additions and 32 deletions

View File

@ -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,
};
}
}

View File

@ -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();