Revert "fix(camera): rest-snap render position — kills the indoor doorway standing-still flicker"

This reverts commit cd974b29bc.
This commit is contained in:
Erik 2026-06-08 15:08:25 +02:00
parent cd974b29bc
commit 9b1857ac52
2 changed files with 1 additions and 91 deletions

View file

@ -810,30 +810,7 @@ public sealed class PlayerMovementController
private Vector3 ComputeRenderPosition()
{
float alpha = Math.Clamp(_physicsAccum / PhysicsBody.MinQuantum, 0f, 1f);
return ComputeRenderPosition(_prevPhysicsPos, _currPhysicsPos, _body.Position, _body.Velocity, alpha);
}
// Render-position rest-snap (2026-06-08, indoor doorway flap). At rest the authoritative
// body position is byte-stable, but the two physics-tick snapshots (prev/curr) can lag it by
// microns — the per-frame resolve edge-settles the resting sphere against doorframe geometry
// after the last tick wrote curr — so Lerp(prev, curr, alpha) with a per-frame-VARYING
// leftover-accumulator alpha dithers the render position by microns. The grazing-doorframe
// camera-collision sweep (PhysicsCameraCollisionProbe.SweepEye) amplifies that ~1000x into a
// ~1.3 mm eye jitter that trips the portal-flood clip → the standing-still indoor flicker
// (pinned live, flap-churn.log: rawPlayer 1 distinct, RenderPosition 15 distinct, eye 17).
// When the body is at rest (velocity below epsilon) render AT the authoritative position so
// the camera's pivot input is byte-stable. Mirrors retail (a resting object renders
// bit-stable) + the boom convergence snap (RetailChaseCamera.ApplyConvergenceSnap, d2212cf),
// one layer earlier. Interpolation between tick snapshots is preserved during motion
// (velocity above epsilon), so sub-tick movement stays smooth.
internal const float RestVelocityEpsilonSq = 1e-4f; // (0.01 m/s)^2 — below this the body is at rest
internal static Vector3 ComputeRenderPosition(
Vector3 prevPhysicsPos, Vector3 currPhysicsPos, Vector3 bodyPosition, Vector3 bodyVelocity, float alpha)
{
if (bodyVelocity.LengthSquared() < RestVelocityEpsilonSq)
return bodyPosition; // at rest: render at the authoritative byte-stable position
return Vector3.Lerp(prevPhysicsPos, currPhysicsPos, alpha);
return Vector3.Lerp(_prevPhysicsPos, _currPhysicsPos, alpha);
}
public MovementResult Update(float dt, MovementInput input)