3DConnexionDriver.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #ifndef CRYINCLUDE_EDITOR_UTIL_3DCONNEXIONDRIVER_H
  9. #define CRYINCLUDE_EDITOR_UTIL_3DCONNEXIONDRIVER_H
  10. #pragma once
  11. #include "Include/IPlugin.h"
  12. struct S3DConnexionMessage
  13. {
  14. bool bGotTranslation;
  15. bool bGotRotation;
  16. int raw_translation[3];
  17. int raw_rotation[3];
  18. Vec3 vTranslate;
  19. Vec3 vRotate;
  20. unsigned char buttons[3];
  21. S3DConnexionMessage()
  22. : bGotRotation(false)
  23. , bGotTranslation(false)
  24. {
  25. raw_translation[0] = raw_translation[1] = raw_translation[2] = 0;
  26. raw_rotation[0] = raw_rotation[1] = raw_rotation[2] = 0;
  27. vTranslate.Set(0, 0, 0);
  28. vRotate.Set(0, 0, 0);
  29. buttons[0] = buttons[1] = buttons[2] = 0;
  30. };
  31. };
  32. #if defined(AZ_PLATFORM_WINDOWS)
  33. AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING
  34. class SANDBOX_API C3DConnexionDriver
  35. : public IPlugin
  36. {
  37. AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
  38. public:
  39. C3DConnexionDriver();
  40. ~C3DConnexionDriver();
  41. bool InitDevice();
  42. bool GetInputMessageData(LPARAM lParam, S3DConnexionMessage& msg);
  43. void Release() { delete this; };
  44. void ShowAbout() {};
  45. const char* GetPluginGUID() { return "{AD109901-9128-4ffd-8E67-137CB2B1C41B}"; };
  46. DWORD GetPluginVersion() { return 1; };
  47. const char* GetPluginName() { return "3DConnexionDriver"; };
  48. bool CanExitNow() { return true; };
  49. void OnEditorNotify([[maybe_unused]] EEditorNotifyEvent aEventId){}
  50. private:
  51. class C3DConnexionDriverImpl* m_pImpl;
  52. PRAWINPUTDEVICELIST m_pRawInputDeviceList;
  53. PRAWINPUTDEVICE m_pRawInputDevices;
  54. int m_nUsagePage1Usage8Devices;
  55. float m_fMultiplier;
  56. };
  57. #endif
  58. #endif // CRYINCLUDE_EDITOR_UTIL_3DCONNEXIONDRIVER_H