diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..39f7dc5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,338 @@ + +# Created by https://www.gitignore.io/api/unity,visualstudio,visualstudiocode + +### Unity ### +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/Assets/AssetStoreTools* + +# Visual Studio 2015 cache directory +/.vs/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb + +# Unity3D generated meta files +*.pidb.meta + +# Unity3D Generated File On Crash Reports +sysinfo.txt + +# Builds +*.apk +*.unitypackage + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history + +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +*_i.c +*_p.c +*_i.h +*.ilk +#*.meta +*.obj +*.pch +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Uncomment the next line to ignore your web deploy settings. +# By default, sensitive information, such as encrypted password +# should be stored in the .pubxml.user file. +#*.pubxml +*.pubxml.user +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Typescript v1 declaration files +typings/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +### VisualStudio Patch ### +# By default, sensitive information, such as encrypted password +# should be stored in the .pubxml.user file. + +# End of https://www.gitignore.io/api/unity,visualstudio,visualstudiocode diff --git a/JoystickProxy/JoystickProxy/FodyWeavers.xml b/JoystickProxy/JoystickProxy/FodyWeavers.xml new file mode 100644 index 0000000..c6e1b7c --- /dev/null +++ b/JoystickProxy/JoystickProxy/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/JoystickProxy/JoystickProxy/JoystickProxy.csproj b/JoystickProxy/JoystickProxy/JoystickProxy.csproj index 90364fd..e8f0dba 100644 --- a/JoystickProxy/JoystickProxy/JoystickProxy.csproj +++ b/JoystickProxy/JoystickProxy/JoystickProxy.csproj @@ -1,81 +1,99 @@ - - - - - Debug - AnyCPU - {E18B3EBB-51B4-4B73-9F13-1998B32FE319} - Exe - Properties - JoystickProxy - JoystickProxy - v4.5.2 - 512 - true - - - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - $(SharpDXPackageBinDir)\SharpDX.dll - False - - - $(SharpDXPackageBinDir)\SharpDX.DirectInput.dll - False - - - - - - - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + + + + + Debug + AnyCPU + {E18B3EBB-51B4-4B73-9F13-1998B32FE319} + Exe + Properties + JoystickProxy + JoystickProxy + v4.5.2 + 512 + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Costura.Fody.1.6.2\lib\dotnet\Costura.dll + False + + + ..\packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll + + + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\SharpDX.4.1.0-ci184\lib\net45\SharpDX.dll + + + ..\packages\SharpDX.DirectInput.4.1.0-ci184\lib\net45\SharpDX.DirectInput.dll + + + ..\packages\SharpDX.RawInput.4.1.0-ci184\lib\net45\SharpDX.RawInput.dll + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + --> \ No newline at end of file diff --git a/JoystickProxy/JoystickProxy/Program.cs b/JoystickProxy/JoystickProxy/Program.cs index 70d1c51..fc447bb 100644 --- a/JoystickProxy/JoystickProxy/Program.cs +++ b/JoystickProxy/JoystickProxy/Program.cs @@ -5,80 +5,105 @@ using System.Net; using System.Collections.Generic; using System.IO; +using System.Text.RegularExpressions; +using System.Text; +using System.Linq; +using System.Linq.Expressions; +using IniParser; +using IniParser.Model; +using System.Collections.Concurrent; namespace JoystickProxy { class Program { + private bool Debug = true; + private static Dictionary SupportedDevices = new Dictionary(); + private static IPAddress host; + private static int port; + static void Main(string[] args) { - new Program(); - } + var parser = new FileIniDataParser(); + IniData data = parser.ReadFile("settings.ini"); - private byte[] pingMessage = System.Text.Encoding.ASCII.GetBytes("ping\n"); - private DateTime lastMessage = new DateTime(); + host = IPAddress.Parse(data["Config"]["Host"]); + port = Int32.Parse(data["Config"]["Port"]); - private int messageCounter = 0; - private DateTime lastStatusMessage = new DateTime(); + Console.WriteLine("JoystickProxy"); + Console.WriteLine("============="); + Console.WriteLine("Outgoing destination: " + host + ":" + port); + Console.WriteLine("Supported Devices:"); - private WarthogJoystick warthogJoystick = new WarthogJoystick(); - private WarthogThrottle warthogThrottle = new WarthogThrottle(); + foreach(KeyData supportedDevice in data["Devices"]) + { + SupportedDevices.Add(supportedDevice.KeyName, supportedDevice.Value); + Console.WriteLine(" * " + supportedDevice.Value); + } - private Joystick joystick; - private Joystick throttle; + // TODO Validate config and handle errors nicely + Console.WriteLine(""); + new Program(); + } - private TcpClient tcpClient; - private NetworkStream stream; - private TcpListener listener; + private ConcurrentDictionary connectedJoysticks = new ConcurrentDictionary(); - public Program() + private string GuidToUsbID(Guid guid) { - Console.WriteLine("Reading devices..."); + return Regex.Replace(guid.ToString(), @"(^....)(....).*$", "$2:$1"); + } - DirectInput di = new DirectInput(); + private string GetUsbId(Joystick joystick) + { + return GuidToUsbID(joystick.Information.ProductGuid); + } + private DirectInput di = new DirectInput(); + private Socket sock; + private IPEndPoint endPoint; - foreach (DeviceInstance device in di.GetDevices()) - { - //Console.WriteLine(device.InstanceName); - switch (device.InstanceName) - { - case "Joystick - HOTAS Warthog": - joystick = new Joystick(di, device.ProductGuid); - break; - case "Throttle - HOTAS Warthog": - throttle = new Joystick(di, device.ProductGuid); - break; - } - } + public Program() + { - if (joystick != null) - { - Console.WriteLine("Found Warthog Joystick"); - joystick.Properties.BufferSize = 32; - joystick.Acquire(); - } - if (throttle != null) - { - Console.WriteLine("Found Warthog Throttle"); - throttle.Properties.BufferSize = 32; - throttle.Acquire(); - } try { + sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); + endPoint = new IPEndPoint(host, port); + + System.Timers.Timer deviceFinderTimer = new System.Timers.Timer(2000); + deviceFinderTimer.Elapsed += DeviceFinderTimer_Elapsed; + deviceFinderTimer.Enabled = true; + ScanJoysticks(); + while (true) { - listener = new TcpListener(IPAddress.Any, 9998); - Console.WriteLine("Waiting for connection..."); - listener.Start(); - tcpClient = listener.AcceptTcpClient(); - stream = tcpClient.GetStream(); + foreach(Joystick joystick in connectedJoysticks.Values) + { + try + { + joystick.Poll(); + JoystickUpdate[] updates = joystick.GetBufferedData(); + + if (updates.Length > 0) + { + string usbID = GetUsbId(joystick); + List events = new List(); + + foreach (var state in updates) + { + events.Add(state.Offset + "=" + state.Value); + } + + SendEvent(sock, endPoint, usbID, events); + } + } + catch (SharpDX.SharpDXException) + {} - Console.WriteLine("Connected!"); + } - PollController(); - Disconnect(); + Thread.Sleep(20); } } catch (Exception e) @@ -86,113 +111,75 @@ public Program() Console.WriteLine("Error: " + e.ToString()); Console.ReadLine(); } + + + foreach (Joystick joystick in connectedJoysticks.Values) + { + Console.WriteLine("Closing connection to " + joystick.Information.InstanceName); + joystick.Unacquire(); + } + + Console.WriteLine("\nPress any key to close"); + Console.ReadLine(); } - private void Disconnect() + private void SendEvent(Socket sock, IPEndPoint endPoint, string usbID, List events) { - try - { - stream.Close(); - stream = null; - } - catch (Exception) { } - try - { - tcpClient.Close(); - tcpClient = null; - } - catch (Exception) { } - try + if (sock == null || endPoint == null) + return; + + string outgoingString = String.Format("{0},{1},{2}", usbID, SupportedDevices[usbID], String.Join(",", events)); + byte[] send_buffer = Encoding.ASCII.GetBytes(outgoingString); + sock.SendTo(send_buffer, endPoint); + if (Debug) { - listener.Stop(); - listener = null; + Console.WriteLine(outgoingString); } - catch (Exception) { } - Console.WriteLine("Disconnected"); } - private void PollController() + private void DeviceFinderTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { - JoystickUpdate[] updates; - bool sendJoystick = false; - bool sendThrottle = false; + ScanJoysticks(); + } - while (true) - { - if (joystick != null) - { - joystick.Poll(); + private void ScanJoysticks() + { + Dictionary foundJoysticks = new Dictionary(); - updates = joystick.GetBufferedData(); - if (updates.Length > 0) - { - sendJoystick = true; - foreach (var state in updates) - { - warthogJoystick.UpdateState(state.Offset, state.Value); - } - } - } + foreach (DeviceInstance device in di.GetDevices()) + { + string usbId = GuidToUsbID(device.ProductGuid); - if (throttle != null) + if (SupportedDevices.ContainsKey(usbId)) { - throttle.Poll(); - updates = throttle.GetBufferedData(); - if (updates.Length > 0) - { - sendThrottle = true; - foreach (var state in updates) - { - warthogThrottle.UpdateState(state.Offset, state.Value); - } - } + foundJoysticks.Add(usbId, new Joystick(di, device.ProductGuid)); } + } + // Find removed devices + foreach(string removed in connectedJoysticks.Keys.Except(foundJoysticks.Keys)) + { + connectedJoysticks[removed].Unacquire(); - try - { - if (sendJoystick) - { - byte[] joystickData = warthogJoystick.GetBytes(); - stream.Write(joystickData, 0, joystickData.Length); - lastMessage = DateTime.Now; - sendJoystick = false; - messageCounter++; - } + connectedJoysticks.TryRemove(removed, out Joystick ignored); + Console.WriteLine(SupportedDevices[removed] + " disconnected"); + } - if (sendThrottle) - { - byte[] throttleData = warthogThrottle.GetBytes(); - stream.Write(throttleData, 0, throttleData.Length); - lastMessage = DateTime.Now; - sendThrottle = false; - messageCounter++; - } + // Find added devices - TimeSpan ts = DateTime.Now - lastMessage; - if (ts.TotalSeconds > 1) - { - stream.Write(pingMessage, 0, pingMessage.Length); - lastMessage = DateTime.Now; - } + foreach (string added in foundJoysticks.Keys.Except(connectedJoysticks.Keys)) + { + foundJoysticks[added].Properties.BufferSize = 32; + foundJoysticks[added].Acquire(); - ts = DateTime.Now - lastStatusMessage; - if(ts.TotalSeconds >= 20) - { - Console.WriteLine(messageCounter + " messages sent"); - lastStatusMessage = DateTime.Now; - messageCounter = 0; - } - } - catch (Exception) + if (connectedJoysticks.TryAdd(added, foundJoysticks[added])) { - return; + Console.WriteLine(SupportedDevices[added] + " connected"); + List events = new List(); + SendEvent(sock, endPoint, GetUsbId(foundJoysticks[added]), events); } - - Thread.Sleep(20); } - } } } diff --git a/JoystickProxy/JoystickProxy/Warthog.cs b/JoystickProxy/JoystickProxy/Warthog.cs deleted file mode 100644 index 91a8778..0000000 --- a/JoystickProxy/JoystickProxy/Warthog.cs +++ /dev/null @@ -1,480 +0,0 @@ -using SharpDX.DirectInput; -using System; - -namespace JoystickProxy -{ - abstract class Warthog - { - public const string FLOAT_PRECISION = "0.0000"; - - public abstract void UpdateState(JoystickOffset offset, int value); - - public static float Remap(float value, float from1, float to1, float from2, float to2) - { - return (value - from1) / (to1 - from1) * (to2 - from2) + from2; - } - - public int GetButtonValue(int value) - { - return (value > 0) ? 1 : 0; - } - - public byte[] GetBytes() - { - return System.Text.Encoding.ASCII.GetBytes(this.ToString() + '\n'); - } - } - - class FourWayHatSwitch - { - public int Up = 0; - public int Down = 0; - public int Left = 0; - public int Right = 0; - - public int X - { - get { return Up + (Down * -1); } - } - - public int Y - { - get { return Right + (Left * -1); } - } - - public override string ToString() - { - String state = ""; - if (Up == 1) - state += "U"; - if (Down == 1) - state += "D"; - if (Left == 1) - state += "L"; - if (Right == 1) - state += "R"; - return state; - } - - public void Parse(string state) - { - Up = 0; - Down = 0; - Left = 0; - Right = 0; - - if (state.Contains("U")) - Up = 1; - if (state.Contains("D")) - Down = 1; - if (state.Contains("L")) - Left = 1; - if (state.Contains("R")) - Right = 1; - - Console.WriteLine("Parsed \"{0}\" into \"{1}\"", state, this.ToString()); - } - } - - class EightWayHatSwitch : FourWayHatSwitch - { - public void Update(float value) - { - Up = 0; - Down = 0; - Left = 0; - Right = 0; - - switch ((int)value) - { - case 0: - Up = 1; - break; - case 4500: - Up = 1; - Right = 1; - break; - case 9000: - Right = 1; - break; - case 13500: - Right = 1; - Down = 1; - break; - case 18000: - Down = 1; - break; - case 22500: - Down = 1; - Left = 1; - break; - case 27000: - Left = 1; - break; - case 31500: - Left = 1; - Up = 1; - break; - } - } - } - - class WarthogJoystick : Warthog - { - public float X = 0.0f; - public float Y = 0.0f; - public int Trigger1 = 0; - public int Trigger2 = 0; - public int MasterMode = 0; - public int Pickle = 0; - public int PinkySwitch = 0; - public int PinkyLever = 0; - - public EightWayHatSwitch Trim = new EightWayHatSwitch(); - public FourWayHatSwitch DMS = new FourWayHatSwitch(); - public FourWayHatSwitch TMS = new FourWayHatSwitch(); - public FourWayHatSwitch CMS = new FourWayHatSwitch(); - public int CMS_Push = 0; - - public override void UpdateState(JoystickOffset offset, int value) - { - switch (offset.ToString()) - { - case "X": - X = Remap(value, 0, 65535, -1.0f, 1.0f); - break; - case "Y": - Y = Remap(value, 0, 65535, -1.0f, 1.0f); - break; - case "Buttons0": - Trigger1 = GetButtonValue(value); - break; - case "Buttons5": - Trigger2 = GetButtonValue(value); - break; - case "Buttons4": - MasterMode = GetButtonValue(value); - break; - case "Buttons1": - Pickle = GetButtonValue(value); - break; - case "Buttons2": - PinkySwitch = GetButtonValue(value); - break; - case "Buttons3": - PinkyLever = GetButtonValue(value); - break; - case "PointOfViewControllers0": - Trim.Update(value); - break; - case "Buttons6": - TMS.Up = GetButtonValue(value); - break; - case "Buttons8": - TMS.Down = GetButtonValue(value); - break; - case "Buttons9": - TMS.Left = GetButtonValue(value); - break; - case "Buttons7": - TMS.Right = GetButtonValue(value); - break; - case "Buttons10": - DMS.Up = GetButtonValue(value); - break; - case "Buttons12": - DMS.Down = GetButtonValue(value); - break; - case "Buttons13": - DMS.Left = GetButtonValue(value); - break; - case "Buttons11": - DMS.Right = GetButtonValue(value); - break; - case "Buttons14": - CMS.Up = GetButtonValue(value); - break; - case "Buttons16": - CMS.Down = GetButtonValue(value); - break; - case "Buttons17": - CMS.Left = GetButtonValue(value); - break; - case "Buttons15": - CMS.Right = GetButtonValue(value); - break; - case "Buttons18": - CMS_Push = GetButtonValue(value); - break; - default: - Console.WriteLine("Unknown Joystick state: " + offset.ToString() + " value: " + value); - break; - } - } - - public override string ToString() - { - return String.Format("Joystick|{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}", - X.ToString(FLOAT_PRECISION, System.Globalization.CultureInfo.InvariantCulture), - Y.ToString(FLOAT_PRECISION, System.Globalization.CultureInfo.InvariantCulture), - Trigger1.ToString(), - Trigger2.ToString(), - MasterMode.ToString(), - Pickle.ToString(), - PinkySwitch.ToString(), - PinkyLever.ToString(), - Trim.ToString(), - DMS.ToString(), - TMS.ToString(), - CMS.ToString(), - CMS_Push.ToString()); - } - - public void FromString(string state) - { - string[] values = state.Split('|'); - if (values.Length != 14) - throw new Exception("Invalid Joystick state length, should be 14 but was " + values.Length); - if (values[0] != "Joystick") - throw new Exception("Invalid state: " + values[0]); - - X = float.Parse(values[1]); - Y = float.Parse(values[2]); - Trigger1 = int.Parse(values[3]); - Trigger2 = int.Parse(values[4]); - MasterMode = int.Parse(values[5]); - Pickle = int.Parse(values[6]); - PinkySwitch = int.Parse(values[7]); - PinkyLever = int.Parse(values[8]); - Trim.Parse(values[9]); - DMS.Parse(values[10]); - TMS.Parse(values[11]); - CMS.Parse(values[12]); - CMS_Push = int.Parse(values[13]); - } - } - - class WarthogThrottle : Warthog - { - public float LeftThrottle = 0.0f; - public float RightThrottle = 0.0f; - public float Friction = 0.0f; - public float SlewX = 0.0f; - public float SlewY = 0.0f; - public int SlewPush = 0; - public EightWayHatSwitch CoolieSwitch = new EightWayHatSwitch(); - public FourWayHatSwitch MicSwitch = new FourWayHatSwitch(); - public int MicSwitchPush = 0; - public int LeftThrottleButton = 0; - public int PinkySwitch = 0; - public int SpeedBreak = 0; - public int BoatSwitch = 0; - public int ChinaHat = 0; - public int EAC = 0; - public int RDR_ALT = 0; - public int AutopilotEngageDisengage = 0; - public int AutopilotSelect = 0; - public int LandingGearHornSilence = 0; - public int RightThrottleOff = 0; - public int LeftThrottleOff = 0; - public int APU = 0; - public int EngineOperateLeft = 0; - public int EngineOperateRight = 0; - public int EngineFuelFlowLeft = 0; - public int EngineFuelFlowRight = 0; - public int Flaps = 0; - - public override void UpdateState(JoystickOffset offset, int value) - { - switch (offset.ToString()) - { - case "RotationZ": - LeftThrottle = Remap(value, 0, 65535, -1.0f, 1.0f); - break; - case "Z": - RightThrottle = Remap(value, 0, 65535, -1.0f, 1.0f); - break; - case "Sliders0": - Friction = Remap(value, 0, 65535, -1.0f, 1.0f); - break; - case "X": - SlewX = Remap(value, 0, 65535, -1.0f, 1.0f); - break; - case "Y": - SlewY = Remap(value, 0, 65535, -1.0f, 1.0f); - break; - case "PointOfViewControllers0": - CoolieSwitch.Update(value); - break; - case "Buttons0": - SlewPush = GetButtonValue(value); - break; - case "Buttons1": - MicSwitchPush = GetButtonValue(value); - break; - case "Buttons2": - MicSwitch.Up = GetButtonValue(value); - break; - case "Buttons3": - MicSwitch.Right = GetButtonValue(value); - break; - case "Buttons4": - MicSwitch.Down = GetButtonValue(value); - break; - case "Buttons5": - MicSwitch.Left = GetButtonValue(value); - break; - case "Buttons6": - SpeedBreak = GetButtonValue(value); - break; - case "Buttons7": - SpeedBreak = -GetButtonValue(value); - break; - case "Buttons8": - BoatSwitch = GetButtonValue(value); - break; - case "Buttons9": - BoatSwitch = -GetButtonValue(value); - break; - case "Buttons10": - ChinaHat = GetButtonValue(value); - break; - case "Buttons11": - ChinaHat = -GetButtonValue(value); - break; - case "Buttons12": - PinkySwitch = GetButtonValue(value); - break; - case "Buttons13": - PinkySwitch = -GetButtonValue(value); - break; - case "Buttons14": - LeftThrottleButton = GetButtonValue(value); - break; - case "Buttons15": - EngineFuelFlowLeft = GetButtonValue(value); - break; - case "Buttons16": - EngineFuelFlowRight = GetButtonValue(value); - break; - case "Buttons19": - APU = GetButtonValue(value); - break; - case "Buttons20": - LandingGearHornSilence = GetButtonValue(value); - break; - case "Buttons23": - EAC = GetButtonValue(value); - break; - case "Buttons24": - RDR_ALT = GetButtonValue(value); - break; - case "Buttons25": - AutopilotEngageDisengage = GetButtonValue(value); - break; - case "Buttons26": - AutopilotSelect = GetButtonValue(value); - break; - case "Buttons27": - AutopilotSelect = -GetButtonValue(value); - break; - case "Buttons28": - RightThrottleOff = GetButtonValue(value); - break; - case "Buttons29": - LeftThrottleOff = GetButtonValue(value); - break; - case "Buttons30": - EngineOperateLeft = GetButtonValue(value); - break; - case "Buttons17": - EngineOperateLeft = -GetButtonValue(value); - break; - case "Buttons31": - EngineOperateRight = GetButtonValue(value); - break; - case "Buttons18": - EngineOperateRight = -GetButtonValue(value); - break; - case "Buttons21": - Flaps = GetButtonValue(value); - break; - case "Buttons22": - Flaps = -GetButtonValue(value); - break; - default: - Console.WriteLine("Unknown Throttle state: " + offset.ToString()); - break; - } - } - - public override string ToString() - { - return String.Format("Throttle|{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}|{14}|{15}|{16}|{17}|{18}|{19}|{20}|{21}|{22}|{23}|{24}|{25}|{26}", - LeftThrottle.ToString(FLOAT_PRECISION, System.Globalization.CultureInfo.InvariantCulture), - RightThrottle.ToString(FLOAT_PRECISION, System.Globalization.CultureInfo.InvariantCulture), - Friction.ToString(FLOAT_PRECISION, System.Globalization.CultureInfo.InvariantCulture), - SlewX.ToString(FLOAT_PRECISION, System.Globalization.CultureInfo.InvariantCulture), - SlewY.ToString(FLOAT_PRECISION, System.Globalization.CultureInfo.InvariantCulture), - SlewPush.ToString(), - CoolieSwitch.ToString(), - MicSwitch.ToString(), - MicSwitchPush.ToString(), - LeftThrottleButton.ToString(), - PinkySwitch.ToString(), - SpeedBreak.ToString(), - BoatSwitch.ToString(), - ChinaHat.ToString(), - EAC.ToString(), - RDR_ALT.ToString(), - AutopilotEngageDisengage.ToString(), - AutopilotSelect.ToString(), - LandingGearHornSilence.ToString(), - RightThrottleOff.ToString(), - LeftThrottleOff.ToString(), - APU.ToString(), - EngineOperateLeft.ToString(), - EngineOperateRight.ToString(), - EngineFuelFlowLeft.ToString(), - EngineFuelFlowRight.ToString(), - Flaps.ToString()); - } - - public void FromString(string state) - { - string[] values = state.Split('|'); - if (values.Length != 28) - throw new Exception("Invalid Throttle state length, should be 28 but was " + values.Length); - if (values[0] != "Throttle") - throw new Exception("Invalid state: " + values[0]); - - LeftThrottle = float.Parse(values[1]); - RightThrottle = float.Parse(values[2]); - Friction = float.Parse(values[3]); - SlewX = float.Parse(values[4]); - SlewY = float.Parse(values[5]); - SlewPush = int.Parse(values[6]); - CoolieSwitch.Parse(values[7]); - MicSwitch.Parse(values[8]); - MicSwitchPush = int.Parse(values[9]); - LeftThrottleButton = int.Parse(values[10]); - PinkySwitch = int.Parse(values[11]); - SpeedBreak = int.Parse(values[12]); - BoatSwitch = int.Parse(values[13]); - ChinaHat = int.Parse(values[14]); - EAC = int.Parse(values[15]); - RDR_ALT = int.Parse(values[16]); - AutopilotEngageDisengage = int.Parse(values[17]); - AutopilotSelect = int.Parse(values[18]); - LandingGearHornSilence = int.Parse(values[19]); - RightThrottleOff = int.Parse(values[20]); - LeftThrottleOff = int.Parse(values[21]); - APU = int.Parse(values[22]); - EngineOperateLeft = int.Parse(values[23]); - EngineOperateRight = int.Parse(values[24]); - EngineFuelFlowLeft = int.Parse(values[25]); - EngineFuelFlowRight = int.Parse(values[26]); - Flaps = int.Parse(values[27]); - } - } -} diff --git a/JoystickProxy/JoystickProxy/packages.config b/JoystickProxy/JoystickProxy/packages.config index 0aaa8b8..b20f954 100644 --- a/JoystickProxy/JoystickProxy/packages.config +++ b/JoystickProxy/JoystickProxy/packages.config @@ -1,6 +1,12 @@  - - - + + + + + + + + + \ No newline at end of file diff --git a/JoystickProxy/JoystickProxy/settings.ini b/JoystickProxy/JoystickProxy/settings.ini new file mode 100644 index 0000000..cd81b02 --- /dev/null +++ b/JoystickProxy/JoystickProxy/settings.ini @@ -0,0 +1,9 @@ +[Config] +Host = 127.0.0.1 +Port = 11000 + +[Devices] +044f:0402 = Warthog Joystick +044f:0404 = Warthog Throttle +044f:b10a = T.16000M +06a3:0764 = Saitek Pro Combat Rudder \ No newline at end of file diff --git a/JoystickVisualizer/Assets/CameraControls.cs b/JoystickVisualizer/Assets/CameraControls.cs new file mode 100644 index 0000000..9164aa3 --- /dev/null +++ b/JoystickVisualizer/Assets/CameraControls.cs @@ -0,0 +1,70 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class CameraControls : MonoBehaviour { + public Transform target; + public float distance = 35.0f; + public float xSpeed = 1.0f; + public float ySpeed = 6.0f; + public float yMinLimit = -90f; + public float yMaxLimit = 90f; + public float distanceMin = 20f; + public float distanceMax = 120f; + public float smoothTime = 10f; + float rotationYAxis = 0.0f; + float rotationXAxis = 0.0f; + float velocityX = 0.0f; + float velocityY = 0.0f; + // Use this for initialization + void Start() + { + Vector3 angles = transform.eulerAngles; + rotationYAxis = angles.y; + rotationXAxis = angles.x; + // Make the rigid body not change rotation + if (GetComponent()) + { + GetComponent().freezeRotation = true; + } + } + void LateUpdate() + { + if (target) + { + if (Input.GetMouseButton(1)) + { + velocityX += xSpeed * Input.GetAxis("Mouse X") * distance * 0.02f; + velocityY += ySpeed * Input.GetAxis("Mouse Y") * 0.02f; + } + rotationYAxis += velocityX; + rotationXAxis -= velocityY; + rotationXAxis = ClampAngle(rotationXAxis, yMinLimit, yMaxLimit); + //Quaternion fromRotation = Quaternion.Euler(transform.rotation.eulerAngles.x, transform.rotation.eulerAngles.y, 0); + Quaternion toRotation = Quaternion.Euler(rotationXAxis, rotationYAxis, 0); + Quaternion rotation = toRotation; + + distance = Mathf.Clamp(distance - Input.GetAxis("Mouse ScrollWheel") * 5, distanceMin, distanceMax); + RaycastHit hit; + if (Physics.Linecast(target.position, transform.position, out hit)) + { + distance -= hit.distance; + } + Vector3 negDistance = new Vector3(0.0f, 0.0f, -distance); + Vector3 position = rotation * negDistance + target.position; + + transform.rotation = rotation; + transform.position = position; + velocityX = Mathf.Lerp(velocityX, 0, Time.deltaTime * smoothTime); + velocityY = Mathf.Lerp(velocityY, 0, Time.deltaTime * smoothTime); + } + } + public static float ClampAngle(float angle, float min, float max) + { + if (angle < -360F) + angle += 360F; + if (angle > 360F) + angle -= 360F; + return Mathf.Clamp(angle, min, max); + } +} diff --git a/JoystickVisualizer/Assets/CameraControls.cs.meta b/JoystickVisualizer/Assets/CameraControls.cs.meta new file mode 100644 index 0000000..72c96dd --- /dev/null +++ b/JoystickVisualizer/Assets/CameraControls.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 61b2164be0ffff54fbcf7c1d834929c2 +timeCreated: 1509735579 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/ConnectionError.png b/JoystickVisualizer/Assets/ConnectionError.png deleted file mode 100644 index e987cc3..0000000 Binary files a/JoystickVisualizer/Assets/ConnectionError.png and /dev/null differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Textures.meta b/JoystickVisualizer/Assets/Devices.meta similarity index 67% rename from JoystickVisualizer/Assets/HOTAS Warthog/Textures.meta rename to JoystickVisualizer/Assets/Devices.meta index 67ba7cb..310ec64 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Textures.meta +++ b/JoystickVisualizer/Assets/Devices.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 9213257da80847249983b9389c3595f5 +guid: da151936bcd663f4183cbabf84c9bc7e folderAsset: yes -timeCreated: 1450039303 +timeCreated: 1509547912 licenseType: Free DefaultImporter: userData: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog.meta new file mode 100644 index 0000000..c1815a3 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: cc7b79b69686b3e4e84dae1293eae097 +folderAsset: yes +timeCreated: 1510079443 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Joystick - HOTAS Warthog.skp b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Joystick - HOTAS Warthog.skp similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Joystick - HOTAS Warthog.skp rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Joystick - HOTAS Warthog.skp diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Joystick - HOTAS Warthog.skp.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Joystick - HOTAS Warthog.skp.meta similarity index 60% rename from JoystickVisualizer/Assets/HOTAS Warthog/Joystick - HOTAS Warthog.skp.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Joystick - HOTAS Warthog.skp.meta index 86159fd..ee84f25 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Joystick - HOTAS Warthog.skp.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Joystick - HOTAS Warthog.skp.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: b2870ad2a9c418142b9bd5b64375a740 -timeCreated: 1450039304 +guid: 149c3bcbe04f90247984337a9a71220a +timeCreated: 1510079451 licenseType: Free SketchUpImporter: generateBackFace: 0 @@ -8,22 +8,22 @@ SketchUpImporter: selectedNodes: 000000000100000002000000030000000400000005000000060000000700000008000000090000000a0000000b0000000c0000000d0000000e0000000f000000100000001100000012000000130000001400000015000000160000001700000018000000190000001a0000001b0000001c0000001d0000001e0000001f0000002000000021000000 assetHash: serializedVersion: 2 - Hash: cd98fbb1b93488785d80bee6fccdbe0a - longitude: -105.24213899999999 - latitude: 40.018309000000002 + Hash: 9b7957fcd054636e64410e9d2de11b7e + longitude: -105.242139 + latitude: 40.018309 northCorrection: -0 fileUnit: 0 sketchUpImportData: defaultCamera: - position: {x: -8.03225708, y: 82.0069046, z: -111.072647} - lookAt: {x: -7.1653471, y: 75.2402267, z: -99.0423355} - up: {x: .0351663418, y: .872128546, z: .488011509} + position: {x: -8.032257, y: 82.006905, z: -111.07265} + lookAt: {x: -7.165347, y: 75.24023, z: -99.042336} + up: {x: 0.03516634, y: 0.87212855, z: 0.4880115} fov: 35 aspectRatio: 0 orthoSize: 1 isPerspective: 1 scenes: [] - serializedVersion: 18 + serializedVersion: 22 fileIDToRecycleName: 100000: CMS 100002: DMS @@ -109,33 +109,83 @@ SketchUpImporter: 4300026: Mesh Trim 4300028: Mesh TMS 4300030: Mesh TM Warthog Base + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Metal_Aluminum_Anodized + second: {fileID: 2100000, guid: 64316eb7d719f0044a5555cbc2128d50, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: _1 + second: {fileID: 2100000, guid: 10622d7b219e9c64496249c54713b05d, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: _2 + second: {fileID: 2100000, guid: 791a3a72c0061ef4caeaf2c870fbe187, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: _3 + second: {fileID: 2100000, guid: 340ca14c279254349850688a2bc1bdad, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: _4 + second: {fileID: 2100000, guid: d367729c58cd3ac4d9af073fc374947d, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: _5 + second: {fileID: 2100000, guid: 7e3682a8d4ed80146a8756e713c6c7d6, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: _6 + second: {fileID: 2100000, guid: 840f24417477e804796e13423de068a5, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: _defaultMat + second: {fileID: 2100000, guid: bb8a7ea0530a00040aaa42d837dfa046, type: 2} materials: importMaterials: 1 materialName: 2 materialSearch: 0 + materialLocation: 0 animations: legacyGenerateAnimations: 4 bakeSimulation: 0 + resampleCurves: 1 optimizeGameObjects: 0 motionNodeName: + rigImportErrors: + rigImportWarnings: animationImportErrors: animationImportWarnings: animationRetargetingWarnings: animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 animationWrapMode: 0 extraExposedTransformPaths: [] + extraUserProperties: [] clipAnimations: [] isReadable: 1 meshes: lODScreenPercentages: [] - globalScale: .0253999997 + globalScale: 0.0254 meshCompression: 0 addColliders: 0 + importVisibility: 1 importBlendShapes: 1 + importCameras: 1 + importLights: 1 swapUVChannels: 0 generateSecondaryUV: 0 useFileUnits: 1 @@ -149,23 +199,27 @@ SketchUpImporter: useFileScale: 1 tangentSpace: normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 normalImportMode: 0 - tangentImportMode: 1 + tangentImportMode: 3 + normalCalculationMode: 4 importAnimation: 0 copyAvatar: 0 humanDescription: + serializedVersion: 2 human: [] skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 feetSpacing: 0 rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 lastHumanDescriptionAvatarSource: {instanceID: 0} animationType: 0 humanoidOversampling: 1 diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials.meta new file mode 100644 index 0000000..65cdb9c --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 59ec905cbb7c9e74f8e172a1ca73ae00 +folderAsset: yes +timeCreated: 1510079443 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-Metal_Aluminum_Anodized.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-Metal_Aluminum_Anodized.mat new file mode 100644 index 0000000..c4143ab Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-Metal_Aluminum_Anodized.mat differ diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-Metal_Aluminum_Anodized.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-Metal_Aluminum_Anodized.mat.meta new file mode 100644 index 0000000..778f0d0 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-Metal_Aluminum_Anodized.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 64316eb7d719f0044a5555cbc2128d50 +timeCreated: 1510079448 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_1.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_1.mat new file mode 100644 index 0000000..fb66109 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_1.mat differ diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_1.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_1.mat.meta new file mode 100644 index 0000000..60fb82c --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_1.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 10622d7b219e9c64496249c54713b05d +timeCreated: 1510079447 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_2.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_2.mat new file mode 100644 index 0000000..1f13566 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_2.mat differ diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_2.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_2.mat.meta new file mode 100644 index 0000000..5a600e0 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_2.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 791a3a72c0061ef4caeaf2c870fbe187 +timeCreated: 1510079448 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_3.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_3.mat new file mode 100644 index 0000000..4d04711 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_3.mat differ diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_3.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_3.mat.meta new file mode 100644 index 0000000..88064cd --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_3.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 340ca14c279254349850688a2bc1bdad +timeCreated: 1510079447 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_4.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_4.mat new file mode 100644 index 0000000..3ac3016 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_4.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_4.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_4.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_4.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_4.mat.meta index 081c534..d211f30 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_4.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_4.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 4d6d4d398d8fc0d49bc0edd4237313c5 -timeCreated: 1450039304 +guid: d367729c58cd3ac4d9af073fc374947d +timeCreated: 1510079449 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_5.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_5.mat new file mode 100644 index 0000000..b2de6a6 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_5.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_5.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_5.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_5.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_5.mat.meta index 921204b..e6a8f4a 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_5.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_5.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 5e2b69869acb3194f909d06b3fb31174 -timeCreated: 1450039304 +guid: 7e3682a8d4ed80146a8756e713c6c7d6 +timeCreated: 1510079448 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_6.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_6.mat new file mode 100644 index 0000000..63ca42c Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_6.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_6.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_6.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_6.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_6.mat.meta index db6ee28..32f6041 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_6.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_6.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 75aa1bc7a04b540439a2b58acc2d6cd9 -timeCreated: 1450039304 +guid: 840f24417477e804796e13423de068a5 +timeCreated: 1510079448 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_defaultMat.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_defaultMat.mat new file mode 100644 index 0000000..ec26c2d Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_defaultMat.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_defaultMat.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_defaultMat.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_defaultMat.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_defaultMat.mat.meta index 053a2d9..b1d332e 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_defaultMat.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Joystick - HOTAS Warthog-_defaultMat.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 431528054101db0408d556b8bf5bcb3e -timeCreated: 1450039304 +guid: bb8a7ea0530a00040aaa42d837dfa046 +timeCreated: 1510079449 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat new file mode 100644 index 0000000..b33148f Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat.meta index b2fb47c..c616392 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 0ef72c24fd29e8841983033bf78b21c6 -timeCreated: 1450039303 +guid: 8c738642db972d841a025aef9795ac0e +timeCreated: 1510079448 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat new file mode 100644 index 0000000..030a47e Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat.meta index 1ee1e70..6bcc417 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 13d4890589395524097fdb8c2c0d223f -timeCreated: 1450039303 +guid: e6d710315d82c8e42b34da3846db543c +timeCreated: 1510079450 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat.meta index 52df198..b66f37e 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 6e5795e4beb7c96488ebc09575e839cd -timeCreated: 1450039303 +guid: 528f8d0f0a68c2443af3cace6a2a8332 +timeCreated: 1510079448 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat.meta index 7e3e3e7..01ae9c8 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_A06.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: a0c8fefbdeebfa4479cd2959e0782b27 -timeCreated: 1450039303 +guid: a68a88b63bf965840855b444a0956688 +timeCreated: 1510079449 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat.meta index 1590698..eebe05c 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Corrogated_Shiny.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 59d4c729e514d7c418f92f11ac22c2f1 -timeCreated: 1450039303 +guid: beece3722d9d20c44bd3cfce4ec2043a +timeCreated: 1510079449 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Embossed.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Embossed.mat new file mode 100644 index 0000000..b20cb27 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Embossed.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Embossed.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Embossed.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Embossed.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Embossed.mat.meta index 012d9bc..e4db9d3 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Embossed.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Metal_Embossed.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 5715ab7bce2e1d945be31fbd0d1678fa -timeCreated: 1450039303 +guid: 0cde83f225e5ed9409a0f490b40c48ef +timeCreated: 1510079446 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat new file mode 100644 index 0000000..a0f6c13 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat.meta index 4bbaebc..41e3741 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 4442410ae68652d489bf5cfc0532804d -timeCreated: 1450039303 +guid: 20e5b72fe62fc69458121809065c4129 +timeCreated: 1510079447 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat new file mode 100644 index 0000000..109cbf3 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat.meta index bebf246..43331dc 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: e092ea246ca81ea41b4f8326a21de0e6 -timeCreated: 1450039303 +guid: 1eb882c85320bff43a55d5b49da8d4d4 +timeCreated: 1510079447 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Metal_Corrogated_Shiny]1.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Metal_Corrogated_Shiny]1.mat new file mode 100644 index 0000000..2e8486f Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Metal_Corrogated_Shiny]1.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Metal_Corrogated_Shiny]1.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Metal_Corrogated_Shiny]1.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Metal_Corrogated_Shiny]1.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Metal_Corrogated_Shiny]1.mat.meta index 6a597a2..bd61546 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Metal_Corrogated_Shiny]1.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Metal_Corrogated_Shiny]1.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: 0f2f9ebb225aece469dcccb9e1c7a845 -timeCreated: 1450039303 +guid: f331755604fa805448d47fa0582e4270 +timeCreated: 1510079450 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-_defaultMat.mat b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-_defaultMat.mat new file mode 100644 index 0000000..d14b927 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-_defaultMat.mat differ diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-_defaultMat.mat.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-_defaultMat.mat.meta similarity index 52% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-_defaultMat.mat.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-_defaultMat.mat.meta index faff5ce..bd0d554 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-_defaultMat.mat.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-_defaultMat.mat.meta @@ -1,8 +1,10 @@ fileFormatVersion: 2 -guid: a3c57197b4931324585594840f2784e6 -timeCreated: 1450039303 +guid: d2d27dc5607e1d6419a4b48dcf31de11 +timeCreated: 1510079449 licenseType: Free NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogJoystick.cs b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogJoystick.cs new file mode 100644 index 0000000..d8b293b --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogJoystick.cs @@ -0,0 +1,57 @@ +using Assets; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TMWarthogJoystick : MonoBehaviour { + public const string USB_ID = "044f:0402"; + + public GameObject Model; + public GameObject Gimbal; + + // Use this for initialization + void Start() + { + UDPListener.StickEventListener += StickEvent; + } + + // Update is called once per frame + void Update() + { + } + + void StickEvent(JoystickState state) + { + if (state.UsbID != USB_ID) + { + return; + } + + Model.SetActive(true); + + foreach (KeyValuePair entry in state.Data) + { + switch (entry.Key) + { + case "X": + // Rotate Z between -30 and 30 + Gimbal.transform.eulerAngles = new Vector3(Gimbal.transform.eulerAngles.x, Gimbal.transform.eulerAngles.y, ConvertRange(entry.Value, 0, 65535, 20, -20)); + break; + case "Y": + // Rotate X between -30 and 30 + Gimbal.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 20, -20), Gimbal.transform.eulerAngles.y, Gimbal.transform.eulerAngles.z); + break; + } + } + } + + public static float ConvertRange( + double value, // value to convert + double originalStart, double originalEnd, // original range + double newStart, double newEnd) // desired range + { + double scale = (double)(newEnd - newStart) / (originalEnd - originalStart); + return (float)(newStart + ((value - originalStart) * scale)); + } + +} diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogJoystick.cs.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogJoystick.cs.meta new file mode 100644 index 0000000..0d08151 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogJoystick.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 9194a13e57f505b44bc35eb5a4209179 +timeCreated: 1510079444 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogThrottle.cs b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogThrottle.cs new file mode 100644 index 0000000..1f75f65 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogThrottle.cs @@ -0,0 +1,74 @@ +using Assets; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TMWarthogThrottle : MonoBehaviour { + public const string USB_ID = "044f:0404"; + + public GameObject Model; + public GameObject GimbalLeft; + public GameObject GimbalRight; + public GameObject GimbalFriction; + + // Use this for initialization + void Start() + { + UDPListener.StickEventListener += StickEvent; + } + + // Update is called once per frame + void Update() + { + } + + void StickEvent(JoystickState state) + { + if (state.UsbID != USB_ID) + { + return; + } + + Model.SetActive(true); + + foreach (KeyValuePair entry in state.Data) + { + switch (entry.Key) + { + case "RotationZ": // Left Throttle + // Rotate Z between -30 and 30 + GimbalLeft.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 40, -25), GimbalLeft.transform.eulerAngles.y, GimbalLeft.transform.eulerAngles.z); + break; + case "Z": // Right Throttle + // Rotate X between -30 and 30 + GimbalRight.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 40, -25), GimbalRight.transform.eulerAngles.y, GimbalRight.transform.eulerAngles.z); + break; + case "Buttons29": // Left Throttle Idle/Off + if (entry.Value == 0) + GimbalLeft.transform.eulerAngles = new Vector3(-25, GimbalLeft.transform.eulerAngles.y, GimbalLeft.transform.eulerAngles.z); + else + GimbalLeft.transform.eulerAngles = new Vector3(-35, GimbalLeft.transform.eulerAngles.y, GimbalLeft.transform.eulerAngles.z); + break; + case "Buttons28": // Left Throttle Idle/Off + if (entry.Value == 0) + GimbalRight.transform.eulerAngles = new Vector3(-25, GimbalRight.transform.eulerAngles.y, GimbalRight.transform.eulerAngles.z); + else + GimbalRight.transform.eulerAngles = new Vector3(-35, GimbalRight.transform.eulerAngles.y, GimbalRight.transform.eulerAngles.z); + break; + case "Sliders0": // Friction + GimbalFriction.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 40, -40), GimbalFriction.transform.eulerAngles.y, GimbalFriction.transform.eulerAngles.z); + break; + } + } + } + + public static float ConvertRange( + double value, // value to convert + double originalStart, double originalEnd, // original range + double newStart, double newEnd) // desired range + { + double scale = (double)(newEnd - newStart) / (originalEnd - originalStart); + return (float)(newStart + ((value - originalStart) * scale)); + } + +} diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogThrottle.cs.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogThrottle.cs.meta new file mode 100644 index 0000000..fec8fde --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/TMWarthogThrottle.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 0e8678e9326b2ef4ea266752af6022a2 +timeCreated: 1510079443 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures.meta new file mode 100644 index 0000000..339dbb8 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4194fd4ebdbdf6649b318605fbd67816 +folderAsset: yes +timeCreated: 1510079443 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Textures/Metal_Aluminum_Anodized.jpg b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Aluminum_Anodized.jpg similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Textures/Metal_Aluminum_Anodized.jpg rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Aluminum_Anodized.jpg diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Aluminum_Anodized.jpg.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Aluminum_Anodized.jpg.meta new file mode 100644 index 0000000..c1d2589 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Aluminum_Anodized.jpg.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 592d18ac2e3d6924db6b8128cfd6e8a5 +timeCreated: 1510079446 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Textures/Metal_Corrogated_Shiny.jpg b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Corrogated_Shiny.jpg similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Textures/Metal_Corrogated_Shiny.jpg rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Corrogated_Shiny.jpg diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Corrogated_Shiny.jpg.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Corrogated_Shiny.jpg.meta new file mode 100644 index 0000000..e5fe417 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Corrogated_Shiny.jpg.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 44668a4fdc52c694d872d7ada3f8847c +timeCreated: 1510079446 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Textures/Metal_Embossed.jpg b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Embossed.jpg similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Textures/Metal_Embossed.jpg rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Embossed.jpg diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Embossed.jpg.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Embossed.jpg.meta new file mode 100644 index 0000000..d92d22b --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/Metal_Embossed.jpg.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 4bd274b8eff011545b1c54b7e54b391c +timeCreated: 1510079446 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Textures/TMwarthogbase.png b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/TMwarthogbase.png similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Textures/TMwarthogbase.png rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/TMwarthogbase.png diff --git a/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/TMwarthogbase.png.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/TMwarthogbase.png.meta new file mode 100644 index 0000000..b26af93 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/TMwarthogbase.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 17ba2d1b384ac9a4d84f5948f0c2f285 +timeCreated: 1510079445 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Textures/warthog-up-tex.jpg b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/warthog-up-tex.jpg similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Textures/warthog-up-tex.jpg rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/warthog-up-tex.jpg diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Textures/warthog-up-tex.jpg.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/warthog-up-tex.jpg.meta similarity index 50% rename from JoystickVisualizer/Assets/HOTAS Warthog/Textures/warthog-up-tex.jpg.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/warthog-up-tex.jpg.meta index 4ae6625..e03c2ed 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Textures/warthog-up-tex.jpg.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Textures/warthog-up-tex.jpg.meta @@ -1,55 +1,75 @@ fileFormatVersion: 2 -guid: ff199fe48ca3f4d4bafc971307cba6ba -timeCreated: 1450039303 +guid: ffd9914284ed04848bf056a967894f66 +timeCreated: 1510079446 licenseType: Free TextureImporter: fileIDToRecycleName: {} - serializedVersion: 2 + externalObjects: {} + serializedVersion: 4 mipmaps: mipMapMode: 0 enableMipMap: 1 + sRGBTexture: 1 linearTexture: 0 - correctGamma: 0 fadeOut: 0 borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 - heightScale: .25 + heightScale: 0.25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 - generateCubemap: 0 + generateCubemap: 6 cubemapConvolution: 0 - cubemapConvolutionSteps: 8 - cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 - textureFormat: -1 + textureFormat: 1 maxTextureSize: 2048 textureSettings: + serializedVersion: 2 filterMode: -1 aniso: -1 mipBias: -1 - wrapMode: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 nPOTScale: 1 lightmap: 0 - rGBM: 0 compressionQuality: 50 - allowsAlphaSplitting: 0 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 - spritePivot: {x: .5, y: .5} + spritePivot: {x: 0.5, y: 0.5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 + alphaUsage: 1 alphaIsTransparency: 0 - textureType: -1 - buildTargetSettings: [] + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 spriteSheet: + serializedVersion: 2 sprites: [] + outline: [] + physicsShape: [] spritePackingTag: userData: assetBundleName: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Throttle - HOTAS Warthog.skp b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Throttle - HOTAS Warthog.skp similarity index 100% rename from JoystickVisualizer/Assets/HOTAS Warthog/Throttle - HOTAS Warthog.skp rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Throttle - HOTAS Warthog.skp diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Throttle - HOTAS Warthog.skp.meta b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Throttle - HOTAS Warthog.skp.meta similarity index 65% rename from JoystickVisualizer/Assets/HOTAS Warthog/Throttle - HOTAS Warthog.skp.meta rename to JoystickVisualizer/Assets/Devices/HOTAS Warthog/Throttle - HOTAS Warthog.skp.meta index c190f0b..a6eecd1 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Throttle - HOTAS Warthog.skp.meta +++ b/JoystickVisualizer/Assets/Devices/HOTAS Warthog/Throttle - HOTAS Warthog.skp.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 22856e000d1717b47a41188ac8bcd6da -timeCreated: 1450123944 +guid: 8d58b23d7bef23048b00e24657d81675 +timeCreated: 1510079452 licenseType: Free SketchUpImporter: generateBackFace: 0 @@ -8,22 +8,22 @@ SketchUpImporter: selectedNodes: 000000000100000002000000030000000400000005000000060000000700000008000000090000000a0000000b0000000c0000000d0000000e0000000f000000100000001100000012000000130000001400000015000000160000001700000018000000190000001a0000001b0000001c0000001d0000001e0000001f000000200000002100000022000000230000002400000025000000260000002700000028000000290000002a0000002b0000002c0000002d0000002e0000002f00000030000000310000003200000033000000340000003500000036000000370000003800000039000000 assetHash: serializedVersion: 2 - Hash: 84630a3d8b9c47756821f5136c91347b - longitude: 2.3330000000000002 - latitude: 48.866999999999997 + Hash: fd6db9549cb562affa4146340ee8298c + longitude: 2.333 + latitude: 48.867 northCorrection: -0 fileUnit: 0 sketchUpImportData: defaultCamera: - position: {x: 2.0418458, y: 34.0978012, z: -31.0821667} - lookAt: {x: 1.97658265, y: 26.7183743, z: -24.316967} - up: {x: -.00711042155, y: .67578119, z: .737067997} + position: {x: 2.0418458, y: 34.0978, z: -31.082167} + lookAt: {x: 1.9765826, y: 26.718374, z: -24.316967} + up: {x: -0.0071104215, y: 0.6757812, z: 0.737068} fov: 35 aspectRatio: 0 orthoSize: 1 isPerspective: 1 scenes: [] - serializedVersion: 18 + serializedVersion: 22 fileIDToRecycleName: 100000: APU 100002: Autopilot Eng/Dis @@ -169,33 +169,93 @@ SketchUpImporter: 4300050: Mesh Group 52 4300052: Mesh Left Throttle Button 4300054: Mesh Pinky Switch + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Color_002 + second: {fileID: 2100000, guid: 8c738642db972d841a025aef9795ac0e, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Color_008 + second: {fileID: 2100000, guid: e6d710315d82c8e42b34da3846db543c, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Color_009 + second: {fileID: 2100000, guid: 528f8d0f0a68c2443af3cace6a2a8332, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Color_A06 + second: {fileID: 2100000, guid: a68a88b63bf965840855b444a0956688, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Metal_Corrogated_Shiny + second: {fileID: 2100000, guid: beece3722d9d20c44bd3cfce4ec2043a, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Metal_Embossed + second: {fileID: 2100000, guid: 0cde83f225e5ed9409a0f490b40c48ef, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: TM Warthog Trottle + second: {fileID: 2100000, guid: 20e5b72fe62fc69458121809065c4129, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: '[Color_007]1' + second: {fileID: 2100000, guid: 1eb882c85320bff43a55d5b49da8d4d4, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: '[Metal_Corrogated_Shiny]1' + second: {fileID: 2100000, guid: f331755604fa805448d47fa0582e4270, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: _defaultMat + second: {fileID: 2100000, guid: d2d27dc5607e1d6419a4b48dcf31de11, type: 2} materials: importMaterials: 1 materialName: 2 materialSearch: 0 + materialLocation: 0 animations: legacyGenerateAnimations: 4 bakeSimulation: 0 + resampleCurves: 1 optimizeGameObjects: 0 motionNodeName: + rigImportErrors: + rigImportWarnings: animationImportErrors: animationImportWarnings: animationRetargetingWarnings: animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 animationCompression: 1 - animationRotationError: .5 - animationPositionError: .5 - animationScaleError: .5 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 animationWrapMode: 0 extraExposedTransformPaths: [] + extraUserProperties: [] clipAnimations: [] isReadable: 1 meshes: lODScreenPercentages: [] - globalScale: .0253999997 + globalScale: 0.0254 meshCompression: 0 addColliders: 0 + importVisibility: 1 importBlendShapes: 1 + importCameras: 1 + importLights: 1 swapUVChannels: 0 generateSecondaryUV: 0 useFileUnits: 1 @@ -209,23 +269,27 @@ SketchUpImporter: useFileScale: 1 tangentSpace: normalSmoothAngle: 60 - splitTangentsAcrossUV: 1 normalImportMode: 0 - tangentImportMode: 1 + tangentImportMode: 3 + normalCalculationMode: 4 importAnimation: 0 copyAvatar: 0 humanDescription: + serializedVersion: 2 human: [] skeleton: [] - armTwist: .5 - foreArmTwist: .5 - upperLegTwist: .5 - legTwist: .5 - armStretch: .0500000007 - legStretch: .0500000007 + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 feetSpacing: 0 rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 lastHumanDescriptionAvatarSource: {instanceID: 0} animationType: 0 humanoidOversampling: 1 diff --git a/JoystickVisualizer/Assets/HOTAS Warthog.meta b/JoystickVisualizer/Assets/Devices/T-16000M.meta similarity index 67% rename from JoystickVisualizer/Assets/HOTAS Warthog.meta rename to JoystickVisualizer/Assets/Devices/T-16000M.meta index 8adc595..dbebead 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog.meta +++ b/JoystickVisualizer/Assets/Devices/T-16000M.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: fc46b05a2d426aa41b512c673d359809 +guid: 17f4ddb19f4846e4b93e44bda7fcc14e folderAsset: yes -timeCreated: 1450039298 +timeCreated: 1509547919 licenseType: Free DefaultImporter: userData: diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/JS.FBX b/JoystickVisualizer/Assets/Devices/T-16000M/JS.FBX new file mode 100644 index 0000000..c71e40f Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/T-16000M/JS.FBX differ diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/JS.FBX.meta b/JoystickVisualizer/Assets/Devices/T-16000M/JS.FBX.meta new file mode 100644 index 0000000..30eb1b2 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/T-16000M/JS.FBX.meta @@ -0,0 +1,175 @@ +fileFormatVersion: 2 +guid: 28cb2bc1f3d7e0f49874521951ce3e35 +timeCreated: 1509547923 +licenseType: Free +ModelImporter: + serializedVersion: 19 + fileIDToRecycleName: + 100000: Box001 + 100002: Cylinder001 + 100004: Cylinder002 + 100006: //RootNode + 100008: Object001 + 100010: Object002 + 100012: Object003 + 100014: Object004 + 100016: Object005 + 100018: Object006 + 100020: Object007 + 100022: Object008 + 100024: Object009 + 100026: Object010 + 100028: Object011 + 100030: Object012 + 100032: Object013 + 100034: Pyramid001 + 100036: Sphere001 + 100038: Sphere002 + 400000: Box001 + 400002: Cylinder001 + 400004: Cylinder002 + 400006: //RootNode + 400008: Object001 + 400010: Object002 + 400012: Object003 + 400014: Object004 + 400016: Object005 + 400018: Object006 + 400020: Object007 + 400022: Object008 + 400024: Object009 + 400026: Object010 + 400028: Object011 + 400030: Object012 + 400032: Object013 + 400034: Pyramid001 + 400036: Sphere001 + 400038: Sphere002 + 2300000: Box001 + 2300002: Cylinder001 + 2300004: Cylinder002 + 2300006: Object001 + 2300008: Object002 + 2300010: Object003 + 2300012: Object004 + 2300014: Object005 + 2300016: Object006 + 2300018: Object007 + 2300020: Object008 + 2300022: Object009 + 2300024: Object010 + 2300026: Object011 + 2300028: Object012 + 2300030: Object013 + 2300032: Pyramid001 + 2300034: Sphere001 + 2300036: Sphere002 + 3300000: Box001 + 3300002: Cylinder001 + 3300004: Cylinder002 + 3300006: Object001 + 3300008: Object002 + 3300010: Object003 + 3300012: Object004 + 3300014: Object005 + 3300016: Object006 + 3300018: Object007 + 3300020: Object008 + 3300022: Object009 + 3300024: Object010 + 3300026: Object011 + 3300028: Object012 + 3300030: Object013 + 3300032: Pyramid001 + 3300034: Sphere001 + 3300036: Sphere002 + 4300000: Cylinder001 + 4300002: Sphere001 + 4300004: Sphere002 + 4300006: Pyramid001 + 4300008: Cylinder002 + 4300010: Object001 + 4300012: Box001 + 4300014: Object002 + 4300016: Object003 + 4300018: Object004 + 4300020: Object005 + 4300022: Object006 + 4300024: Object007 + 4300026: Object008 + 4300028: Object009 + 4300030: Object010 + 4300032: Object011 + 4300034: Object012 + 4300036: Object013 + 9500000: //RootNode + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importBlendShapes: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 2 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + rootMotionBoneName: + rootMotionBoneRotation: {x: 0, y: 0, z: 0, w: 1} + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 2 + humanoidOversampling: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/HOTAS Warthog/Materials.meta b/JoystickVisualizer/Assets/Devices/T-16000M/Materials.meta similarity index 67% rename from JoystickVisualizer/Assets/HOTAS Warthog/Materials.meta rename to JoystickVisualizer/Assets/Devices/T-16000M/Materials.meta index ebeab30..fb17c70 100644 --- a/JoystickVisualizer/Assets/HOTAS Warthog/Materials.meta +++ b/JoystickVisualizer/Assets/Devices/T-16000M/Materials.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 77c74d3281949554c87066b065dd7bab +guid: ae5308dcdbe2ab84c8e65582e37e5c38 folderAsset: yes -timeCreated: 1450039303 +timeCreated: 1509547923 licenseType: Free DefaultImporter: userData: diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Black Plastic.mat b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Black Plastic.mat new file mode 100644 index 0000000..9f706c3 Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Black Plastic.mat differ diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Black Plastic.mat.meta b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Black Plastic.mat.meta new file mode 100644 index 0000000..e68374f --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Black Plastic.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: d826677424d231d4bbe8d526e1b1b9e2 +timeCreated: 1510079449 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Grey Plastic.mat b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Grey Plastic.mat new file mode 100644 index 0000000..50c108b Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Grey Plastic.mat differ diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Grey Plastic.mat.meta b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Grey Plastic.mat.meta new file mode 100644 index 0000000..a775779 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Grey Plastic.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 210ffd2f199095f41b278520dfdbf082 +timeCreated: 1510079447 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Orange Plastic.mat b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Orange Plastic.mat new file mode 100644 index 0000000..652a2ba Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Orange Plastic.mat differ diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Orange Plastic.mat.meta b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Orange Plastic.mat.meta new file mode 100644 index 0000000..7173264 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/Orange Plastic.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 3ab35da2bac0350418c3db3f2a0f43c5 +timeCreated: 1510079448 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/Materials/WhiteNoise.jpeg b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/WhiteNoise.jpeg new file mode 100644 index 0000000..568c76a Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/WhiteNoise.jpeg differ diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/Materials/WhiteNoise.jpeg.meta b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/WhiteNoise.jpeg.meta new file mode 100644 index 0000000..9987b38 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/T-16000M/Materials/WhiteNoise.jpeg.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: a06683d375e6b4a45bd28179585d11ea +timeCreated: 1510091371 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: -1 + wrapV: -1 + wrapW: -1 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/T16000M.cs b/JoystickVisualizer/Assets/Devices/T-16000M/T16000M.cs new file mode 100644 index 0000000..1d55882 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/T-16000M/T16000M.cs @@ -0,0 +1,70 @@ +using Assets; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class T16000M : MonoBehaviour { + public const string USB_ID = "044f:b10a"; + + //private static string USB_ID = "044f:0402"; // TM Stick (test) + //private static string USB_ID = "044f:0404"; // TM Throttle (test) + + public GameObject Gimbal; + public GameObject StickHandle; + + // Use this for initialization + void Start() + { + UDPListener.StickEventListener += StickEvent; + } + + // Update is called once per frame + void Update() + { + } + + void StickEvent(JoystickState state) + { + if (state.UsbID != USB_ID) + { + return; + } + + + foreach (KeyValuePair entry in state.Data) + { + switch (entry.Key) + { + case "RotationZ": + StickHandle.transform.localEulerAngles = new Vector3(StickHandle.transform.localEulerAngles.x, ConvertRange(entry.Value, 0, 65535, -30, 30), StickHandle.transform.localEulerAngles.z); + //q = Quaternion.AngleAxis(angle, Vector3.up); + //Gimbal.transform.eulerAngles = q.eulerAngles; + break; + case "X": + // Rotate Z between -30 and 30 + Gimbal.transform.eulerAngles = new Vector3(Gimbal.transform.eulerAngles.x, Gimbal.transform.eulerAngles.y, ConvertRange(entry.Value, 0, 65535, -30, 30)); + + //q = Quaternion.AngleAxis(angle, Vector3.forward); + //Gimbal.transform.eulerAngles = q.eulerAngles; + break; + case "Y": + // Rotate X between -30 and 30 + Gimbal.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, -30, 30), Gimbal.transform.eulerAngles.y, Gimbal.transform.eulerAngles.z); + + //q = Quaternion.AngleAxis(angle, Vector3.right); + //Gimbal.transform.eulerAngles = q.eulerAngles; + break; + } + } + } + + public static float ConvertRange( + double value, // value to convert + double originalStart, double originalEnd, // original range + double newStart, double newEnd) // desired range + { + double scale = (double)(newEnd - newStart) / (originalEnd - originalStart); + return (float)(newStart + ((value - originalStart) * scale)); + } + +} diff --git a/JoystickVisualizer/Assets/Devices/T-16000M/T16000M.cs.meta b/JoystickVisualizer/Assets/Devices/T-16000M/T16000M.cs.meta new file mode 100644 index 0000000..521ce7b --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/T-16000M/T16000M.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: 73c276fbc2f670541a033e99a29a9bad +timeCreated: 1509721627 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/GUIEvents.cs b/JoystickVisualizer/Assets/GUIEvents.cs deleted file mode 100644 index 0fca1b4..0000000 --- a/JoystickVisualizer/Assets/GUIEvents.cs +++ /dev/null @@ -1,22 +0,0 @@ -using UnityEngine; -using System.Collections; -using UnityEngine.UI; - -public class GUIEvents : MonoBehaviour { - private bool uiVisible = true; - public GameObject buttonContainer; - - void Start () { - } - - void Update () { - if(Input.GetButtonDown("GUI Toggle")) - { - uiVisible = !uiVisible; - foreach (Button button in buttonContainer.GetComponentsInChildren