Skip to content

Commit

Permalink
use new model for Logitech Extreme 3D Pro
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjarv committed Mar 14, 2018
1 parent dbd81d3 commit de14af8
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 116 deletions.
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

120 changes: 4 additions & 116 deletions JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech3DPro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,10 @@

public class Logitech3DPro: MonoBehaviour {
public const string USB_ID = "046d:c215";
//public const string USB_ID = "044f:0402";

public GameObject Model;
public GameObject StickGimbal;

public GameObject DMS;
public GameObject CMS;
public GameObject MasterMode;
public GameObject Pickle;
public GameObject PinkyButton;
public GameObject PinkyLever;
public GameObject TMS;
public GameObject Trigger;
public GameObject Trim;
public GameObject Joystick;

// Use this for initialization
void Start()
Expand Down Expand Up @@ -49,114 +40,11 @@ void StickEvent(JoystickState state)
break;

case "X":
// Rotate Z between -30 and 30
StickGimbal.transform.eulerAngles = new Vector3(StickGimbal.transform.eulerAngles.x, StickGimbal.transform.eulerAngles.y, ConvertRange(entry.Value, 0, 65535, 20, -20));
Joystick.transform.localEulerAngles = new Vector3(Joystick.transform.localEulerAngles.x, ConvertRange(entry.Value, 0, 65535, -20, 20), Joystick.transform.localEulerAngles.z);
break;
case "Y":
// Rotate X between -30 and 30
StickGimbal.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 20, -20), StickGimbal.transform.eulerAngles.y, StickGimbal.transform.eulerAngles.z);
Joystick.transform.localEulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 20, -20), Joystick.transform.localEulerAngles.y, Joystick.transform.localEulerAngles.z);
break;


/*
case "Buttons10":
DMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), DMS.transform.localEulerAngles.y, DMS.transform.localEulerAngles.z);
break;
case "Buttons11":
DMS.transform.localEulerAngles = new Vector3(DMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : -10.0f), DMS.transform.localEulerAngles.z);
break;
case "Buttons12":
DMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), DMS.transform.localEulerAngles.y, DMS.transform.localEulerAngles.z);
break;
case "Buttons13":
DMS.transform.localEulerAngles = new Vector3(DMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : 10.0f), DMS.transform.localEulerAngles.z);
break;
case "Buttons14":
CMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), CMS.transform.localEulerAngles.y, CMS.transform.localEulerAngles.z);
break;
case "Buttons15":
CMS.transform.localEulerAngles = new Vector3(CMS.transform.localEulerAngles.x, CMS.transform.localEulerAngles.y, ((entry.Value == 0) ? 0.0f : -10.0f));
break;
case "Buttons16":
CMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), CMS.transform.localEulerAngles.y, CMS.transform.localEulerAngles.z);
break;
case "Buttons17":
CMS.transform.localEulerAngles = new Vector3(CMS.transform.localEulerAngles.x, CMS.transform.localEulerAngles.y, ((entry.Value == 0) ? 0.0f : 10.0f));
break;
case "Buttons18":
CMS.transform.localPosition = new Vector3(CMS.transform.localPosition.x, ((entry.Value == 0) ? 0.0f : -0.10f), CMS.transform.localPosition.z);
break;
case "Buttons6":
TMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), TMS.transform.localEulerAngles.y, TMS.transform.localEulerAngles.z);
break;
case "Buttons7":
TMS.transform.localEulerAngles = new Vector3(TMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : -10.0f), TMS.transform.localEulerAngles.z);
break;
case "Buttons8":
TMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), TMS.transform.localEulerAngles.y, TMS.transform.localEulerAngles.z);
break;
case "Buttons9":
TMS.transform.localEulerAngles = new Vector3(TMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : 10.0f), TMS.transform.localEulerAngles.z);
break;
case "Buttons1":
Pickle.transform.localPosition = new Vector3(Pickle.transform.localPosition.x, Pickle.transform.localPosition.y, ((entry.Value == 0) ? 0.0f : 0.25f));
break;
case "Buttons4":
MasterMode.transform.localPosition = new Vector3(((entry.Value == 0) ? 0.0f : -0.20f), MasterMode.transform.localPosition.y, MasterMode.transform.localPosition.z);
break;
case "Buttons2":
PinkyButton.transform.localPosition = new Vector3(PinkyButton.transform.localPosition.x, PinkyButton.transform.localPosition.y, ((entry.Value == 0) ? 0.0f : -0.20f));
break;
case "Buttons3":
PinkyLever.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), PinkyLever.transform.localEulerAngles.y, PinkyLever.transform.localEulerAngles.z);
break;
case "Buttons0":
Trigger.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), Trigger.transform.localEulerAngles.y, Trigger.transform.localEulerAngles.z);
break;
case "Buttons5":
Trigger.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 10.0f : 20.0f), Trigger.transform.localEulerAngles.y, Trigger.transform.localEulerAngles.z);
break;
case "PointOfViewControllers0":
switch (entry.Value)
{
case -1: // zero
Trim.transform.localEulerAngles = Vector3.zero;
break;
case 0: // up
Trim.transform.localEulerAngles = Vector3.right * 10.0f;
break;
case 4500: // up/right
Trim.transform.localEulerAngles = Vector3.right * 10.0f + Vector3.down * 10.0f;
break;
case 9000: // right
Trim.transform.localEulerAngles = Vector3.down * 10.0f;
break;
case 13500: // down/right
Trim.transform.localEulerAngles = Vector3.down * 10.0f + Vector3.left * 10.0f;
break;
case 18000: // down
Trim.transform.localEulerAngles = Vector3.left * 10.0f;
break;
case 22500: // down/left
Trim.transform.localEulerAngles = Vector3.left * 10.0f + Vector3.up * 10.0f;
break;
case 27000: // left
Trim.transform.localEulerAngles = Vector3.up * 10.0f;
break;
case 31500: // up/left
Trim.transform.localEulerAngles = Vector3.up * 10.0f + Vector3.right * 10.0f;
break;
}
break;
*/
}
}
}
Expand Down
Binary file modified JoystickVisualizer/Assets/JoystickVisualizer.unity
Binary file not shown.

0 comments on commit de14af8

Please sign in to comment.