Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit 2e3fc64

Browse files
committed
- Range can now be configured per-axis.
- Ready for release 1.09
1 parent 8b7219e commit 2e3fc64

9 files changed

+42
-38
lines changed

AyaGyroAiming/AyaGyroAiming.csproj

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
<OutputType>Exe</OutputType>
55
<TargetFrameworks>net461</TargetFrameworks>
66
<TargetPlatformVersion>8.0</TargetPlatformVersion>
7-
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
8-
<Version>0.18</Version>
7+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
8+
<Version>0.19</Version>
99
<NoWin32Manifest>true</NoWin32Manifest>
10+
<PackageProjectUrl>https://github.com/Valkirie/AyaGyroAiming</PackageProjectUrl>
11+
<RepositoryUrl>https://github.com/Valkirie/AyaGyroAiming</RepositoryUrl>
1012
</PropertyGroup>
1113

1214
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net461|AnyCPU'">

AyaGyroAiming/Program.cs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using Nefarius.ViGEm.Client;
22
using Nefarius.ViGEm.Client.Targets;
3-
using Nefarius.ViGEm.Client.Targets.Xbox360;
43
using System;
54
using System.Collections.Specialized;
65
using System.Configuration;
76
using System.Diagnostics;
8-
using System.Drawing;
97
using System.Globalization;
108
using System.IO;
119
using System.Linq;
@@ -218,7 +216,7 @@ static void MonitorBatteryLife()
218216
UDPServer.padMeta.BatteryStatus = DsBattery.Charging;
219217
else if (ChargeStatus.HasFlag(BatteryChargeStatus.NoSystemBattery))
220218
UDPServer.padMeta.BatteryStatus = DsBattery.None;
221-
else if(ChargeStatus.HasFlag(BatteryChargeStatus.High))
219+
else if (ChargeStatus.HasFlag(BatteryChargeStatus.High))
222220
UDPServer.padMeta.BatteryStatus = DsBattery.High;
223221
else if (ChargeStatus.HasFlag(BatteryChargeStatus.Low))
224222
UDPServer.padMeta.BatteryStatus = DsBattery.Low;
@@ -320,12 +318,13 @@ static void UpdateSettings()
320318
PullRate = 10,
321319
MaxSample = 1,
322320
Aggressivity = 0.5f,
323-
Range = 10000.0f,
321+
RangeAxisX = 1.0f,
322+
RangeAxisY = 1.0f,
323+
RangeAxisZ = 1.0f,
324324
InvertAxisX = false,
325325
InvertAxisY = false,
326326
InvertAxisZ = false,
327-
Trigger = "",
328-
MonitorRatio = false
327+
Trigger = ""
329328
};
330329
}
331330

AyaGyroAiming/Settings.cs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
using Nefarius.ViGEm.Client.Targets.Xbox360;
2-
3-
namespace AyaGyroAiming
1+
namespace AyaGyroAiming
42
{
53
public class Settings
64
{
75
public bool GyroAiming { get; set; }
86
public float Aggressivity { get; set; }
9-
public float Range { get; set; }
7+
8+
public float RangeAxisX { get; set; }
9+
public float RangeAxisY { get; set; }
10+
public float RangeAxisZ { get; set; }
11+
1012
public bool InvertAxisX { get; set; }
1113
public bool InvertAxisY { get; set; }
1214
public bool InvertAxisZ { get; set; }
15+
1316
public string Trigger { get; set; }
1417
public uint PullRate { get; set; }
1518
public uint MaxSample { get; set; }
16-
public bool MonitorRatio { get; set; }
1719
}
1820
}

AyaGyroAiming/XInputGirometer.cs

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
using SharpDX.XInput;
22
using System;
3-
using System.Drawing;
43
using System.Linq;
54
using System.Numerics;
6-
using System.Windows.Forms;
75
using Windows.Devices.Sensors;
86

97
namespace AyaGyroAiming
@@ -32,7 +30,7 @@ public class XInputGirometer
3230
float GyroStickAlpha = 0.2f;
3331
float GyroStickMagnitude = 3.5f;
3432
float GyroStickThreshold = 0.1f;
35-
float GyroStickRatio = 1.7f;
33+
float GyroStickRange = 10000.0f;
3634

3735
// Settings
3836
Settings settings;
@@ -60,10 +58,6 @@ public void UpdateSettings(Settings _settings)
6058
{
6159
settings = _settings;
6260

63-
// resolution settings
64-
Rectangle resolution = Screen.PrimaryScreen.Bounds;
65-
GyroStickRatio = settings.MonitorRatio ? ((float)resolution.Width / (float)resolution.Height) : 1.0f;
66-
6761
poolsize = settings.MaxSample;
6862
gyroPool = new Vector3[poolsize];
6963

@@ -126,8 +120,10 @@ void GyroReadingChanged(Gyrometer sender, GyrometerReadingChangedEventArgs args)
126120
Z = (float)(settings.InvertAxisZ ? 1.0f : -1.0f) * (float)gyroPool.Select(a => a.Z).Average(),
127121
};
128122

129-
posAverage *= settings.Range;
130-
posAverage.X *= GyroStickRatio; // take screen ratio in consideration 1.7f (16:9)
123+
posAverage *= GyroStickRange;
124+
posAverage.X *= settings.RangeAxisX;
125+
posAverage.Y *= settings.RangeAxisY;
126+
posAverage.Z *= settings.RangeAxisZ;
131127

132128
posAverage.X = (float)(Math.Sign(posAverage.X) * Math.Pow(Math.Abs(posAverage.X) / Gamepad.RightThumbDeadZone, settings.Aggressivity) * Gamepad.RightThumbDeadZone);
133129
posAverage.Y = (float)(Math.Sign(posAverage.Y) * Math.Pow(Math.Abs(posAverage.Y) / Gamepad.RightThumbDeadZone, settings.Aggressivity) * Gamepad.RightThumbDeadZone);
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"GyroAiming": true,
33
"Aggressivity": 0.5,
4-
"Range": 15000,
4+
"RangeAxisX": 1.5,
5+
"RangeAxisY": 1.5,
6+
"RangeAxisZ": 1.5,
57
"InvertAxisX": false,
68
"InvertAxisY": false,
79
"InvertAxisZ": false,
8-
"Trigger": "",
10+
"Trigger": "LeftTrigger",
911
"PullRate": 10,
10-
"MaxSample": 1,
11-
"MonitorRatio": false
12+
"MaxSample": 1
1213
}

AyaGyroAiming/profiles/cemu.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"GyroAiming": false,
33
"Aggressivity": 0.5,
4-
"Range": 10000,
4+
"RangeAxisX": 1.0,
5+
"RangeAxisY": 1.0,
6+
"RangeAxisZ": 1.0,
57
"InvertAxisX": false,
68
"InvertAxisY": false,
79
"InvertAxisZ": false,
810
"Trigger": "",
911
"PullRate": 10,
10-
"MaxSample": 1,
11-
"MonitorRatio": false
12+
"MaxSample": 1
1213
}

AyaGyroAiming/profiles/default.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"GyroAiming": true,
33
"Aggressivity": 0.5,
4-
"Range": 10000,
4+
"RangeAxisX": 1.0,
5+
"RangeAxisY": 1.0,
6+
"RangeAxisZ": 1.0,
57
"InvertAxisX": false,
68
"InvertAxisY": false,
79
"InvertAxisZ": false,
810
"Trigger": "",
911
"PullRate": 10,
10-
"MaxSample": 1,
11-
"MonitorRatio": false
12+
"MaxSample": 1
1213
}

AyaGyroAiming/profiles/ryujinx.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"GyroAiming": false,
33
"Aggressivity": 0.5,
4-
"Range": 10000,
4+
"RangeAxisX": 1.0,
5+
"RangeAxisY": 1.0,
6+
"RangeAxisZ": 1.0,
57
"InvertAxisX": false,
68
"InvertAxisY": false,
79
"InvertAxisZ": false,
810
"Trigger": "",
911
"PullRate": 10,
10-
"MaxSample": 1,
11-
"MonitorRatio": false
12+
"MaxSample": 1
1213
}

AyaGyroAiming/profiles/yuzu.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"GyroAiming": false,
33
"Aggressivity": 0.5,
4-
"Range": 10000,
4+
"RangeAxisX": 1.0,
5+
"RangeAxisY": 1.0,
6+
"RangeAxisZ": 1.0,
57
"InvertAxisX": false,
68
"InvertAxisY": false,
79
"InvertAxisZ": false,
810
"Trigger": "",
911
"PullRate": 10,
10-
"MaxSample": 1,
11-
"MonitorRatio": false
12+
"MaxSample": 1
1213
}

0 commit comments

Comments
 (0)