Smooth docking traversal (#10822)

This commit is contained in:
metalgearsloth
2022-08-29 15:05:53 +10:00
committed by GitHub
parent 0ebc733b3a
commit 5b42861539
14 changed files with 515 additions and 204 deletions

View File

@@ -40,8 +40,30 @@ namespace Content.Shared.Movement.Components
public MoveButtons HeldMoveButtons = MoveButtons.None;
/// <summary>
/// Entity our movement is relative to.
/// </summary>
public EntityUid? RelativeEntity;
/// <summary>
/// Although our movement might be relative to a particular entity we may have an additional relative rotation
/// e.g. if we've snapped to a different cardinal direction
/// </summary>
[ViewVariables]
public Angle LastGridAngle { get; set; } = new(0);
public Angle TargetRelativeRotation = Angle.Zero;
/// <summary>
/// The current relative rotation. This will lerp towards the <see cref="TargetRelativeRotation"/>.
/// </summary>
[ViewVariables] public Angle RelativeRotation;
/// <summary>
/// If we traverse on / off a grid then set a timer to update our relative inputs.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
public float LerpAccumulator;
public const float LerpTime = 1.0f;
public bool Sprinting => (HeldMoveButtons & MoveButtons.Walk) == 0x0;