using System.Numerics; using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.MouseRotator; /// /// This component allows overriding an entities local rotation based on the client's mouse movement /// /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class MouseRotatorComponent : Component { /// /// How much the desired angle needs to change before a predictive event is sent /// [DataField] [ViewVariables(VVAccess.ReadWrite)] public Angle AngleTolerance = Angle.FromDegrees(5.0); /// /// The angle that will be lerped to /// [AutoNetworkedField, DataField] public Angle? GoalRotation; /// /// Max degrees the entity can rotate per second /// [DataField] [ViewVariables(VVAccess.ReadWrite)] public double RotationSpeed = float.MaxValue; } /// /// Raised on an entity with as a predictive event on the client /// when mouse rotation changes /// [Serializable, NetSerializable] public sealed class RequestMouseRotatorRotationEvent : EntityEventArgs { public Angle Rotation; }