Move Light to own file
This commit is contained in:
parent
b263bdd77e
commit
50f3c1e9e1
|
@ -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,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,38 +8,6 @@ namespace KeepersCompound.Lightmapper;
|
||||||
|
|
||||||
class Program
|
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)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
Timing.Reset();
|
Timing.Reset();
|
||||||
|
|
Loading…
Reference in New Issue