AndroidMotionManager.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2013 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef _CONSOLEINTERNAL_H_
  23. #include "console/consoleInternal.h"
  24. #endif
  25. //TODO: convert objc
  26. /*
  27. #import <Foundation/Foundation.h>
  28. #import <GameKit/GameKit.h>
  29. #import <CoreMotion/CoreMotion.h>
  30. @interface AndroidMotionManager: NSObject
  31. {
  32. // The sole CMMotionManager reference
  33. CMMotionManager* motionManager;
  34. // The starting attitude reference DeviceMotion will use
  35. CMAttitude* referenceAttitude;
  36. bool accelerometerEnabled;
  37. bool gyroscopeEnabled;
  38. }
  39. @property (readwrite, assign) bool accelerometerEnabled;
  40. @property (readwrite, assign) bool gyroscopeEnabled;
  41. @property (strong) CMAttitude* referenceAttitude;
  42. // Accelerometer related functions
  43. - (void) enableAccelerometer;
  44. - (void) disableAccelerometer;
  45. - (bool) isAccelerometerActive;
  46. // Gyroscope related functions
  47. - (bool) enableGyroscope;
  48. - (bool) disableGyroscope;
  49. - (bool) isGyroAvailable;
  50. - (bool) isGyroActive;
  51. // Motion device related functions
  52. - (bool) startDeviceMotion;
  53. - (bool) stopDeviceMotion;
  54. - (bool) resetDeviceMotionReference;
  55. - (bool) isDeviceMotionAvailable;
  56. - (bool) isDeviceMotionActive;
  57. @end
  58. static AndroidMotionManager* gMotionManager;
  59. */