feat(render): Phase A8.F — add CameraDiagnostics.CollideCamera flag (default on)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-29 19:00:11 +02:00
parent 77a6331ecd
commit 69c7f8db86
2 changed files with 23 additions and 0 deletions

View file

@ -37,6 +37,17 @@ public static class CameraDiagnostics
public static bool AlignToSlope { get; set; } =
Environment.GetEnvironmentVariable("ACDREAM_CAMERA_ALIGN_SLOPE") != "0";
/// <summary>
/// When true (default), the chase camera sweeps a 0.3 m collision
/// sphere from the head-pivot to the desired eye and stops it at the
/// first wall (retail <c>SmartBox::update_viewer</c> spring arm), so
/// the eye never sits behind/inside geometry. Initial state from
/// <c>ACDREAM_CAMERA_COLLIDE</c>; default-on if unset, off only when
/// explicitly set to <c>"0"</c>.
/// </summary>
public static bool CollideCamera { get; set; } =
Environment.GetEnvironmentVariable("ACDREAM_CAMERA_COLLIDE") != "0";
/// <summary>
/// Per-frame translation damping rate. Retail default 0.45. Higher
/// (→ 1.0) snaps faster; lower (→ 0.0) lags more. Formula per frame:

View file

@ -46,4 +46,16 @@ public class CameraDiagnosticsTests
CameraDiagnostics.TranslationStiffness = 0.45f;
CameraDiagnostics.UseRetailChaseCamera = true;
}
[Fact]
public void CollideCamera_DefaultOn_AndPersistsRuntimeChanges()
{
CameraDiagnostics.CollideCamera = true;
Assert.True(CameraDiagnostics.CollideCamera);
CameraDiagnostics.CollideCamera = false;
Assert.False(CameraDiagnostics.CollideCamera);
CameraDiagnostics.CollideCamera = true; // reset so other tests aren't poisoned
}
}