fix(world): match retail portal passage and exit warp
This commit is contained in:
parent
eab23cbdd1
commit
842bd89c16
11 changed files with 355 additions and 28 deletions
|
|
@ -8,6 +8,46 @@ namespace AcDream.App.Tests.Rendering;
|
|||
|
||||
public class RetailChaseCameraTests
|
||||
{
|
||||
[Fact]
|
||||
public void ResetViewerToPlayer_TeleportReseedsViewerAndReextendsFromPlayer()
|
||||
{
|
||||
bool savedColl = CameraDiagnostics.CollideCamera;
|
||||
float savedT = CameraDiagnostics.TranslationStiffness;
|
||||
float savedR = CameraDiagnostics.RotationStiffness;
|
||||
try
|
||||
{
|
||||
CameraDiagnostics.CollideCamera = false;
|
||||
CameraDiagnostics.TranslationStiffness = 0.45f;
|
||||
CameraDiagnostics.RotationStiffness = 0.45f;
|
||||
|
||||
var camera = new RetailChaseCamera();
|
||||
camera.Update(
|
||||
Vector3.Zero, 0f, Vector3.Zero, true, Vector3.UnitZ, 1f / 60f,
|
||||
cellId: 0x100u);
|
||||
|
||||
var destination = new Vector3(200f, -300f, 12f);
|
||||
float yaw = MathF.PI / 2f;
|
||||
camera.ResetViewerToPlayer(destination, yaw);
|
||||
|
||||
Assert.Equal(destination, camera.Position);
|
||||
Assert.Equal(0u, camera.ViewerCellId);
|
||||
|
||||
camera.Update(
|
||||
destination, yaw, Vector3.Zero, true, Vector3.UnitZ, 1f / 60f,
|
||||
cellId: 0x12340100u);
|
||||
|
||||
float firstStep = Vector3.Distance(camera.Position, destination);
|
||||
Assert.InRange(firstStep, 0.001f, 0.3f);
|
||||
Assert.Equal(0x12340100u, camera.ViewerCellId);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CameraDiagnostics.CollideCamera = savedColl;
|
||||
CameraDiagnostics.TranslationStiffness = savedT;
|
||||
CameraDiagnostics.RotationStiffness = savedR;
|
||||
}
|
||||
}
|
||||
|
||||
// ── Heading source ────────────────────────────────────────────────
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue