feat(render): implement Campaign AR and terrain fidelity
This commit is contained in:
parent
99cf26e00c
commit
7a5f96ede5
368 changed files with 50611 additions and 950 deletions
|
|
@ -35,6 +35,32 @@ public sealed class HostInputCameraCompositionTests
|
|||
Assert.Equal((1280, 720), fixture.Factory.Viewport.Size);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DiagnosticOrbitOverridesReachOnlyTheInitialOrbitCamera()
|
||||
{
|
||||
using var fixture = new Fixture();
|
||||
|
||||
HostInputCameraResult result = fixture
|
||||
.Phase(180f, -135f, 7.5f)
|
||||
.Compose(fixture.Platform);
|
||||
|
||||
Assert.Equal(180f, result.CameraController.Orbit.Distance);
|
||||
Assert.Equal(-135f * MathF.PI / 180f, result.CameraController.Orbit.Yaw);
|
||||
Assert.Equal(7.5f * MathF.PI / 180f, result.CameraController.Orbit.Pitch);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VulkanFactoryConvertsDiagnosticOrbitAnglesFromDegrees()
|
||||
{
|
||||
var factory = new VulkanHostInputCameraCompositionFactory();
|
||||
|
||||
CameraController camera = factory.CreateCameraController(200f, 180f, -12f);
|
||||
|
||||
Assert.Equal(200f, camera.Orbit.Distance);
|
||||
Assert.Equal(MathF.PI, camera.Orbit.Yaw, precision: 6);
|
||||
Assert.Equal(-12f * MathF.PI / 180f, camera.Orbit.Pitch, precision: 6);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[MemberData(nameof(FaultPointValues))]
|
||||
public void FailureAtEveryProductionBoundaryStopsTheExactSuffix(
|
||||
|
|
@ -138,7 +164,10 @@ public sealed class HostInputCameraCompositionTests
|
|||
public Factory Factory { get; }
|
||||
public Publication Publication { get; }
|
||||
|
||||
public HostInputCameraCompositionPhase Phase() => new(
|
||||
public HostInputCameraCompositionPhase Phase(
|
||||
float? initialOrbitDistanceMeters = null,
|
||||
float? initialOrbitYawDegrees = null,
|
||||
float? initialOrbitPitchDegrees = null) => new(
|
||||
new HostInputCameraDependencies(
|
||||
Framebuffer,
|
||||
new Vector2D<int>(1280, 720),
|
||||
|
|
@ -150,7 +179,10 @@ public sealed class HostInputCameraCompositionTests
|
|||
PlayerMode,
|
||||
Chase,
|
||||
Pointer,
|
||||
new DiagnosticLog()),
|
||||
new DiagnosticLog(),
|
||||
initialOrbitDistanceMeters,
|
||||
initialOrbitYawDegrees,
|
||||
initialOrbitPitchDegrees),
|
||||
Publication,
|
||||
Factory,
|
||||
point =>
|
||||
|
|
@ -318,8 +350,20 @@ public sealed class HostInputCameraCompositionTests
|
|||
KeyBindings bindings) =>
|
||||
InputDispatcher.CreateDetached(keyboard, mouse, bindings);
|
||||
|
||||
public CameraController CreateCameraController() =>
|
||||
new(new OrbitCamera(), new FlyCamera());
|
||||
public CameraController CreateCameraController(
|
||||
float? initialOrbitDistanceMeters,
|
||||
float? initialOrbitYawDegrees,
|
||||
float? initialOrbitPitchDegrees)
|
||||
{
|
||||
var orbit = new OrbitCamera();
|
||||
if (initialOrbitDistanceMeters is { } distance)
|
||||
orbit.Distance = distance;
|
||||
if (initialOrbitYawDegrees is { } yaw)
|
||||
orbit.Yaw = yaw * (MathF.PI / 180f);
|
||||
if (initialOrbitPitchDegrees is { } pitch)
|
||||
orbit.Pitch = pitch * (MathF.PI / 180f);
|
||||
return new CameraController(orbit, new FlyCamera());
|
||||
}
|
||||
|
||||
public IFramebufferCameraTarget CreateCameraTarget(CameraController camera) =>
|
||||
new CameraTarget(camera);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue