ThiefLightmapper/KeepersCompound.Lightmapper/Light.cs

35 lines
891 B
C#
Raw Normal View History

2024-10-27 15:10:28 +00:00
using System.Numerics;
using KeepersCompound.LGS.Database.Chunks;
namespace KeepersCompound.Lightmapper;
public class Light
{
2024-10-27 15:12:19 +00:00
public Vector3 Position;
public Vector3 Color;
public float InnerRadius;
public float Radius;
public float R2;
2024-10-27 15:10:28 +00:00
2024-10-27 15:12:19 +00:00
public bool Spotlight;
public Vector3 SpotlightDir;
public float SpotlightInnerAngle;
public float SpotlightOuterAngle;
2024-10-27 15:10:28 +00:00
2024-10-27 15:12:19 +00:00
public int ObjId;
public int LightTableIndex;
public bool Anim;
2024-10-27 15:10:28 +00:00
public WorldRep.LightTable.LightData ToLightData(float lightScale)
{
return new WorldRep.LightTable.LightData
{
2024-10-27 15:12:19 +00:00
Location = Position,
Direction = SpotlightDir,
Color = Color / lightScale,
InnerAngle = SpotlightInnerAngle,
OuterAngle = SpotlightOuterAngle,
Radius = Radius == float.MaxValue ? 0 : Radius,
2024-10-27 15:10:28 +00:00
};
}
}