Smooth docking traversal (#10822)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user