using NUnit.Framework; using ProjectM.Simulation; using Unity.Mathematics; namespace ProjectM.Tests { /// /// Unit tests for the LANTERN light-as-territory relevancy DECISION (LightRelevancyMath). The full per-connection /// GhostRelevancy set population is netcode-world (the L3 gamma test); this pins the pure planar-distance rule. /// public class LightRelevancyMathTests { [Test] public void InsideLamp_IsVisible() { float r = LightRelevancyMath.LampRadiusDefault; Assert.IsFalse(LightRelevancyMath.IsHidden(float3.zero, new float3(r - 1f, 0f, 0f), r * r), "just inside the radius = visible"); Assert.IsFalse(LightRelevancyMath.IsHidden(float3.zero, float3.zero, r * r), "at the player = visible"); } [Test] public void OutsideLamp_IsHidden() { float r = LightRelevancyMath.LampRadiusDefault; Assert.IsTrue(LightRelevancyMath.IsHidden(float3.zero, new float3(r + 1f, 0f, 0f), r * r), "just beyond the radius = hidden (nothing to see)"); } [Test] public void Planar_IgnoresY() { float r = 5f; // Within the planar (XZ) radius but far in Y is still VISIBLE — top-down relevancy ignores height. Assert.IsFalse(LightRelevancyMath.IsHidden(float3.zero, new float3(2f, 1000f, 2f), r * r), "Y is ignored (planar XZ test)"); } } }