using System.Runtime.InteropServices; namespace SabreTools.Data.Models.BSP { /// /// The worldlights lumps (Lump 15 for LDR and Lump 54 for HDR) /// contain information on each static light entity in the world, /// and are used to provide direct lighting for dynamically lit entities. /// The data is generated by VRAD from the entity lump. VRAD uses /// information from these lumps instead of referring to light /// entities from Entity lump. /// /// [StructLayout(LayoutKind.Sequential)] public sealed class WorldLight { public Vector3D Origin = new(); public Vector3D Intensity = new(); /// /// For surfaces and spotlights /// public Vector3D Normal = new(); public int Cluster; public EmitType EmitType; public int Style; /// /// Start of penumbra for emit_spotlight /// public float StopDot; /// /// End of penumbra for emit_spotlight /// public float StopDot2; public float Exponent; /// /// Cutoff distance /// public float Radius; // falloff for emit_spotlight + emit_point: // 1 / (constant_attn + linear_attn * dist + quadratic_attn * dist^2) public float ConstantAttn; public float LinearAttn; public float QuadraticAttn; /// /// Uses a combination of the DWL_FLAGS_ defines. /// public int Flags; public int Texinfo; /// /// Entity that this light it relative to /// public int Owner; } }