Files
RobustToolbox/Robust.Client/GameObjects/EntitySystems/TransformSystem.Component.cs
metalgearsloth 0e97e3000f Add robust method for no lerp (#3040)
* Add robust method for no lerp

Also updated rotation lerping.

* a

* a

* Fix sleeping while I'm here + context

* I hate contexts I hate contexts
2022-07-16 13:50:18 +10:00

33 lines
985 B
C#

using Robust.Shared.GameObjects;
using Robust.Shared.Maths;
namespace Robust.Client.GameObjects;
public sealed partial class TransformSystem
{
public override void SetLocalPosition(TransformComponent xform, Vector2 value)
{
xform._prevPosition = xform._localPosition;
xform._nextPosition = value;
xform.LerpParent = xform.ParentUid;
base.SetLocalPosition(xform, value);
ActivateLerp(xform);
}
public override void SetLocalPositionNoLerp(TransformComponent xform, Vector2 value)
{
xform._nextPosition = null;
xform.LerpParent = EntityUid.Invalid;
base.SetLocalPositionNoLerp(xform, value);
}
public override void SetLocalRotation(TransformComponent xform, Angle angle)
{
xform._prevRotation = xform._localRotation;
xform._nextRotation = angle;
xform.LerpParent = xform.ParentUid;
base.SetLocalRotation(xform, angle);
ActivateLerp(xform);
}
}