private bool ShouldUnrenderRegion(Region region) { if (!_renderedRegions.ContainsKey(region.RegionNumber)) { return(false); } var distance = SphereHelpers.DistanceBetweenPoints(region.Center.AsVector(), _player.transform.position, _planet.BaseRadius); return(distance > UnrenderDistance); }
private float CalculateRenderPriority(Region region) { if (_renderedRegions.ContainsKey(region.RegionNumber)) { return(0); } var distance = SphereHelpers.DistanceBetweenPoints(region.Center.AsVector(), _player.transform.position, _planet.BaseRadius); if (distance > RenderDistance) { return(0); } return(1 / distance); }