diff --git a/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend new file mode 100644 index 0000000..f045d3f Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend differ diff --git a/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend.meta b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend.meta new file mode 100644 index 0000000..df0f03e --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend.meta @@ -0,0 +1,169 @@ +fileFormatVersion: 2 +guid: 39fb169c8757c784d81a1611e1d50950 +timeCreated: 1520978685 +licenseType: Free +ModelImporter: + serializedVersion: 22 + fileIDToRecycleName: + 100000: Base + 100002: Gimbal_Center + 100004: Hole + 100006: //RootNode + 100008: Cylinder + 100010: Circle + 100012: Stick + 100014: Buttons + 100016: Gimbal_Rubber + 100018: Stick_001 + 100020: Sphere + 100022: Stick_Buttons + 100024: Hat + 100026: Side_Button + 100028: Trigger + 400000: Base + 400002: Gimbal_Center + 400004: Hole + 400006: //RootNode + 400008: Cylinder + 400010: Circle + 400012: Stick + 400014: Buttons + 400016: Gimbal_Rubber + 400018: Stick_001 + 400020: Sphere + 400022: Stick_Buttons + 400024: Hat + 400026: Side_Button + 400028: Trigger + 2100000: Grey_Plastic_002 + 2100002: Grey_Plastic_001 + 2100004: Black_Plastic_001 + 2100006: Black_Plastic + 2100008: Grey_Plastic + 2100010: Very_Black_Plastic + 2300000: Base + 2300002: Gimbal_Center + 2300004: Hole + 2300006: //RootNode + 2300008: Cylinder + 2300010: Circle + 2300012: Stick + 2300014: Buttons + 2300016: Gimbal_Rubber + 2300018: Stick_001 + 2300020: Sphere + 2300022: Stick_Buttons + 2300024: Hat + 2300026: Side_Button + 2300028: Trigger + 3300000: Base + 3300002: Gimbal_Center + 3300004: Hole + 3300006: //RootNode + 3300008: Cylinder + 3300010: Circle + 3300012: Stick + 3300014: Buttons + 3300016: Gimbal_Rubber + 3300018: Stick_001 + 3300020: Sphere + 3300022: Stick_Buttons + 3300024: Hat + 3300026: Side_Button + 3300028: Trigger + 4300000: Hole + 4300002: Base + 4300004: Gimbal_Center + 4300006: Cylinder + 4300008: Stick + 4300010: Circle + 4300012: Buttons + 4300014: Gimbal_Rubber + 4300016: Stick_001 + 4300018: Sphere + 4300020: Stick_Buttons + 4300022: Hat + 4300024: Side_Button + 4300026: Trigger + 7400000: Default Take + 9500000: //RootNode + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + optimizeMeshForGPU: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + 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/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend1 b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend1 new file mode 100644 index 0000000..272c50c Binary files /dev/null and b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend1 differ diff --git a/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend1.meta b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend1.meta new file mode 100644 index 0000000..7b181a0 --- /dev/null +++ b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech Extreme 3D Pro.blend1.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ace8bb19bc6fac54db1c088c31a60705 +timeCreated: 1520978742 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech3DPro.cs b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech3DPro.cs index 4ca3462..b726d86 100644 --- a/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech3DPro.cs +++ b/JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech3DPro.cs @@ -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() @@ -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; - */ } } } diff --git a/JoystickVisualizer/Assets/JoystickVisualizer.unity b/JoystickVisualizer/Assets/JoystickVisualizer.unity index 7916156..519a297 100644 Binary files a/JoystickVisualizer/Assets/JoystickVisualizer.unity and b/JoystickVisualizer/Assets/JoystickVisualizer.unity differ