diff --git a/AyaGyroAiming/AyaGyroAiming.csproj b/AyaGyroAiming/AyaGyroAiming.csproj index b8051a7..84cfc37 100644 --- a/AyaGyroAiming/AyaGyroAiming.csproj +++ b/AyaGyroAiming/AyaGyroAiming.csproj @@ -4,9 +4,11 @@ Exe net461 8.0 - true - 0.18 + false + 0.19 true + https://github.com/Valkirie/AyaGyroAiming + https://github.com/Valkirie/AyaGyroAiming diff --git a/AyaGyroAiming/Program.cs b/AyaGyroAiming/Program.cs index d80718f..9898635 100644 --- a/AyaGyroAiming/Program.cs +++ b/AyaGyroAiming/Program.cs @@ -1,11 +1,9 @@ using Nefarius.ViGEm.Client; using Nefarius.ViGEm.Client.Targets; -using Nefarius.ViGEm.Client.Targets.Xbox360; using System; using System.Collections.Specialized; using System.Configuration; using System.Diagnostics; -using System.Drawing; using System.Globalization; using System.IO; using System.Linq; @@ -218,7 +216,7 @@ static void MonitorBatteryLife() UDPServer.padMeta.BatteryStatus = DsBattery.Charging; else if (ChargeStatus.HasFlag(BatteryChargeStatus.NoSystemBattery)) UDPServer.padMeta.BatteryStatus = DsBattery.None; - else if(ChargeStatus.HasFlag(BatteryChargeStatus.High)) + else if (ChargeStatus.HasFlag(BatteryChargeStatus.High)) UDPServer.padMeta.BatteryStatus = DsBattery.High; else if (ChargeStatus.HasFlag(BatteryChargeStatus.Low)) UDPServer.padMeta.BatteryStatus = DsBattery.Low; @@ -320,12 +318,13 @@ static void UpdateSettings() PullRate = 10, MaxSample = 1, Aggressivity = 0.5f, - Range = 10000.0f, + RangeAxisX = 1.0f, + RangeAxisY = 1.0f, + RangeAxisZ = 1.0f, InvertAxisX = false, InvertAxisY = false, InvertAxisZ = false, - Trigger = "", - MonitorRatio = false + Trigger = "" }; } diff --git a/AyaGyroAiming/Settings.cs b/AyaGyroAiming/Settings.cs index bdc156f..a185a4b 100644 --- a/AyaGyroAiming/Settings.cs +++ b/AyaGyroAiming/Settings.cs @@ -1,18 +1,20 @@ -using Nefarius.ViGEm.Client.Targets.Xbox360; - -namespace AyaGyroAiming +namespace AyaGyroAiming { public class Settings { public bool GyroAiming { get; set; } public float Aggressivity { get; set; } - public float Range { get; set; } + + public float RangeAxisX { get; set; } + public float RangeAxisY { get; set; } + public float RangeAxisZ { get; set; } + public bool InvertAxisX { get; set; } public bool InvertAxisY { get; set; } public bool InvertAxisZ { get; set; } + public string Trigger { get; set; } public uint PullRate { get; set; } public uint MaxSample { get; set; } - public bool MonitorRatio { get; set; } } } diff --git a/AyaGyroAiming/XInputGirometer.cs b/AyaGyroAiming/XInputGirometer.cs index 1a90810..1fb02b0 100644 --- a/AyaGyroAiming/XInputGirometer.cs +++ b/AyaGyroAiming/XInputGirometer.cs @@ -1,9 +1,7 @@ using SharpDX.XInput; using System; -using System.Drawing; using System.Linq; using System.Numerics; -using System.Windows.Forms; using Windows.Devices.Sensors; namespace AyaGyroAiming @@ -32,7 +30,7 @@ public class XInputGirometer float GyroStickAlpha = 0.2f; float GyroStickMagnitude = 3.5f; float GyroStickThreshold = 0.1f; - float GyroStickRatio = 1.7f; + float GyroStickRange = 10000.0f; // Settings Settings settings; @@ -60,10 +58,6 @@ public void UpdateSettings(Settings _settings) { settings = _settings; - // resolution settings - Rectangle resolution = Screen.PrimaryScreen.Bounds; - GyroStickRatio = settings.MonitorRatio ? ((float)resolution.Width / (float)resolution.Height) : 1.0f; - poolsize = settings.MaxSample; gyroPool = new Vector3[poolsize]; @@ -126,8 +120,10 @@ void GyroReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args) Z = (float)(settings.InvertAxisZ ? 1.0f : -1.0f) * (float)gyroPool.Select(a => a.Z).Average(), }; - posAverage *= settings.Range; - posAverage.X *= GyroStickRatio; // take screen ratio in consideration 1.7f (16:9) + posAverage *= GyroStickRange; + posAverage.X *= settings.RangeAxisX; + posAverage.Y *= settings.RangeAxisY; + posAverage.Z *= settings.RangeAxisZ; posAverage.X = (float)(Math.Sign(posAverage.X) * Math.Pow(Math.Abs(posAverage.X) / Gamepad.RightThumbDeadZone, settings.Aggressivity) * Gamepad.RightThumbDeadZone); posAverage.Y = (float)(Math.Sign(posAverage.Y) * Math.Pow(Math.Abs(posAverage.Y) / Gamepad.RightThumbDeadZone, settings.Aggressivity) * Gamepad.RightThumbDeadZone); diff --git a/AyaGyroAiming/profiles/Kena-Win64-Shipping.json b/AyaGyroAiming/profiles/Kena-Win64-Shipping.json index 1761ae7..8865a28 100644 --- a/AyaGyroAiming/profiles/Kena-Win64-Shipping.json +++ b/AyaGyroAiming/profiles/Kena-Win64-Shipping.json @@ -1,12 +1,13 @@ { "GyroAiming": true, "Aggressivity": 0.5, - "Range": 15000, + "RangeAxisX": 1.5, + "RangeAxisY": 1.5, + "RangeAxisZ": 1.5, "InvertAxisX": false, "InvertAxisY": false, "InvertAxisZ": false, - "Trigger": "", + "Trigger": "LeftTrigger", "PullRate": 10, - "MaxSample": 1, - "MonitorRatio": false + "MaxSample": 1 } \ No newline at end of file diff --git a/AyaGyroAiming/profiles/cemu.json b/AyaGyroAiming/profiles/cemu.json index 9d96ea9..041b2b5 100644 --- a/AyaGyroAiming/profiles/cemu.json +++ b/AyaGyroAiming/profiles/cemu.json @@ -1,12 +1,13 @@ { "GyroAiming": false, "Aggressivity": 0.5, - "Range": 10000, + "RangeAxisX": 1.0, + "RangeAxisY": 1.0, + "RangeAxisZ": 1.0, "InvertAxisX": false, "InvertAxisY": false, "InvertAxisZ": false, "Trigger": "", "PullRate": 10, - "MaxSample": 1, - "MonitorRatio": false + "MaxSample": 1 } \ No newline at end of file diff --git a/AyaGyroAiming/profiles/default.json b/AyaGyroAiming/profiles/default.json index 2781d80..afe7bce 100644 --- a/AyaGyroAiming/profiles/default.json +++ b/AyaGyroAiming/profiles/default.json @@ -1,12 +1,13 @@ { "GyroAiming": true, "Aggressivity": 0.5, - "Range": 10000, + "RangeAxisX": 1.0, + "RangeAxisY": 1.0, + "RangeAxisZ": 1.0, "InvertAxisX": false, "InvertAxisY": false, "InvertAxisZ": false, "Trigger": "", "PullRate": 10, - "MaxSample": 1, - "MonitorRatio": false + "MaxSample": 1 } \ No newline at end of file diff --git a/AyaGyroAiming/profiles/ryujinx.json b/AyaGyroAiming/profiles/ryujinx.json index 9d96ea9..041b2b5 100644 --- a/AyaGyroAiming/profiles/ryujinx.json +++ b/AyaGyroAiming/profiles/ryujinx.json @@ -1,12 +1,13 @@ { "GyroAiming": false, "Aggressivity": 0.5, - "Range": 10000, + "RangeAxisX": 1.0, + "RangeAxisY": 1.0, + "RangeAxisZ": 1.0, "InvertAxisX": false, "InvertAxisY": false, "InvertAxisZ": false, "Trigger": "", "PullRate": 10, - "MaxSample": 1, - "MonitorRatio": false + "MaxSample": 1 } \ No newline at end of file diff --git a/AyaGyroAiming/profiles/yuzu.json b/AyaGyroAiming/profiles/yuzu.json index 9d96ea9..041b2b5 100644 --- a/AyaGyroAiming/profiles/yuzu.json +++ b/AyaGyroAiming/profiles/yuzu.json @@ -1,12 +1,13 @@ { "GyroAiming": false, "Aggressivity": 0.5, - "Range": 10000, + "RangeAxisX": 1.0, + "RangeAxisY": 1.0, + "RangeAxisZ": 1.0, "InvertAxisX": false, "InvertAxisY": false, "InvertAxisZ": false, "Trigger": "", "PullRate": 10, - "MaxSample": 1, - "MonitorRatio": false + "MaxSample": 1 } \ No newline at end of file