Move Eye Lerping to content and fix/improve it a bunch. (#5900)

This commit is contained in:
Vera Aguilera Puerto
2021-12-27 18:50:00 +01:00
committed by GitHub
parent b0bdc0336e
commit 525c38b794
4 changed files with 142 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ using Content.Shared.Pulling.Components;
using Robust.Client.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Physics;
namespace Content.Client.Physics.Controllers
@@ -19,11 +20,15 @@ namespace Content.Client.Physics.Controllers
if (_playerManager.LocalPlayer?.ControlledEntity is not {Valid: true} player ||
!EntityManager.TryGetComponent(player, out IMoverComponent? mover) ||
!EntityManager.TryGetComponent(player, out PhysicsComponent? body))
!EntityManager.TryGetComponent(player, out PhysicsComponent? body) ||
!EntityManager.TryGetComponent(player, out TransformComponent? xform))
{
return;
}
if (xform.GridID != GridId.Invalid)
mover.LastGridAngle = GetParentGridAngle(xform, mover);
// Essentially we only want to set our mob to predicted so every other entity we just interpolate
// (i.e. only see what the server has sent us).
// The exception to this is joints.