[WL-816q] 가시 범위 — 첫 배치 때 카메라가 없었으면 생긴 뒤 다시 고르게 (#816)

ViewMovedEnough 가 _viewOn=false 에서 곧장 false 를 돌려줘, 카메라가 씬보다 늦게 생기는 경우
가시 범위가 영영 안 켜지고 섬 전체에 인스턴스가 남았다(그림은 정상 · 최적화만 무효).
카메라가 생겼는데 아직 범위를 못 잡았으면 true 를 돌려 한 번 다시 고르게 한다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
깃 관리자 2026-09-15 08:38:58 +09:00
parent c1eb8742d1
commit dd5a47bab2
1 changed files with 2 additions and 1 deletions

View File

@ -98,9 +98,10 @@ namespace WL.Look.Farm
/// <summary>카메라가 「다시 골라야 할 만큼」 움직였는지(위치 보폭 또는 회전 각).</summary>
public bool ViewMovedEnough()
{
if (cfg == null || cfg.viewCullEnabled == 0 || !_cacheValid || !_viewOn) return false;
if (cfg == null || cfg.viewCullEnabled == 0 || !_cacheValid) return false;
var cam = PickCamera();
if (cam == null) return false;
if (!_viewOn) return true; // 처음 깔 때 카메라가 아직 없었다 → 이제 생겼으니 다시 고른다
if ((cam.transform.position - _viewBuiltPos).sqrMagnitude
> Mathf.Max(0.05f, cfg.viewRebuildStep) * Mathf.Max(0.05f, cfg.viewRebuildStep)) return true;
return Vector3.Angle(cam.transform.forward, _viewBuiltFwd) > Mathf.Max(0.1f, cfg.viewRebuildAngle);