summaryrefslogtreecommitdiffstats
path: root/src/core/frontend/emu_window.h
diff options
context:
space:
mode:
authorwwylele <wwylele@gmail.com>2017-08-06 23:04:06 +0200
committerwwylele <wwylele@gmail.com>2017-08-11 10:05:08 +0200
commit188194908c2785bd1e03485941b9148777cdddd7 (patch)
treeab6cd04195f5e18bd1e7dd21a7c2896066827a6f /src/core/frontend/emu_window.h
parentHID: use MotionDevice for Accelerometer and Gyroscope (diff)
downloadyuzu-188194908c2785bd1e03485941b9148777cdddd7.tar
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.gz
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.bz2
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.lz
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.xz
yuzu-188194908c2785bd1e03485941b9148777cdddd7.tar.zst
yuzu-188194908c2785bd1e03485941b9148777cdddd7.zip
Diffstat (limited to 'src/core/frontend/emu_window.h')
-rw-r--r--src/core/frontend/emu_window.h83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h
index 9414123a4..7bdee251c 100644
--- a/src/core/frontend/emu_window.h
+++ b/src/core/frontend/emu_window.h
@@ -69,27 +69,6 @@ public:
void TouchMoved(unsigned framebuffer_x, unsigned framebuffer_y);
/**
- * Signal accelerometer state has changed.
- * @param x X-axis accelerometer value
- * @param y Y-axis accelerometer value
- * @param z Z-axis accelerometer value
- * @note all values are in unit of g (gravitational acceleration).
- * e.g. x = 1.0 means 9.8m/s^2 in x direction.
- * @see GetAccelerometerState for axis explanation.
- */
- void AccelerometerChanged(float x, float y, float z);
-
- /**
- * Signal gyroscope state has changed.
- * @param x X-axis accelerometer value
- * @param y Y-axis accelerometer value
- * @param z Z-axis accelerometer value
- * @note all values are in deg/sec.
- * @see GetGyroscopeState for axis explanation.
- */
- void GyroscopeChanged(float x, float y, float z);
-
- /**
* Gets the current touch screen state (touch X/Y coordinates and whether or not it is pressed).
* @note This should be called by the core emu thread to get a state set by the window thread.
* @todo Fix this function to be thread-safe.
@@ -101,52 +80,6 @@ public:
}
/**
- * Gets the current accelerometer state (acceleration along each three axis).
- * Axis explained:
- * +x is the same direction as LEFT on D-pad.
- * +y is normal to the touch screen, pointing outward.
- * +z is the same direction as UP on D-pad.
- * Units:
- * 1 unit of return value = 1/512 g (measured by hw test),
- * where g is the gravitational acceleration (9.8 m/sec2).
- * @note This should be called by the core emu thread to get a state set by the window thread.
- * @return std::tuple of (x, y, z)
- */
- std::tuple<s16, s16, s16> GetAccelerometerState() {
- std::lock_guard<std::mutex> lock(accel_mutex);
- return std::make_tuple(accel_x, accel_y, accel_z);
- }
-
- /**
- * Gets the current gyroscope state (angular rates about each three axis).
- * Axis explained:
- * +x is the same direction as LEFT on D-pad.
- * +y is normal to the touch screen, pointing outward.
- * +z is the same direction as UP on D-pad.
- * Orientation is determined by right-hand rule.
- * Units:
- * 1 unit of return value = (1/coef) deg/sec,
- * where coef is the return value of GetGyroscopeRawToDpsCoefficient().
- * @note This should be called by the core emu thread to get a state set by the window thread.
- * @return std::tuple of (x, y, z)
- */
- std::tuple<s16, s16, s16> GetGyroscopeState() {
- std::lock_guard<std::mutex> lock(gyro_mutex);
- return std::make_tuple(gyro_x, gyro_y, gyro_z);
- }
-
- /**
- * Gets the coefficient for units conversion of gyroscope state.
- * The conversion formula is r = coefficient * v,
- * where v is angular rate in deg/sec,
- * and r is the gyroscope state.
- * @return float-type coefficient
- */
- f32 GetGyroscopeRawToDpsCoefficient() const {
- return 14.375f; // taken from hw test, and gyroscope's document
- }
-
- /**
* Returns currently active configuration.
* @note Accesses to the returned object need not be consistent because it may be modified in
* another thread
@@ -187,12 +120,6 @@ protected:
touch_x = 0;
touch_y = 0;
touch_pressed = false;
- accel_x = 0;
- accel_y = -512;
- accel_z = 0;
- gyro_x = 0;
- gyro_y = 0;
- gyro_z = 0;
}
virtual ~EmuWindow() {}
@@ -255,16 +182,6 @@ private:
u16 touch_x; ///< Touchpad X-position in native 3DS pixel coordinates (0-320)
u16 touch_y; ///< Touchpad Y-position in native 3DS pixel coordinates (0-240)
- std::mutex accel_mutex;
- s16 accel_x; ///< Accelerometer X-axis value in native 3DS units
- s16 accel_y; ///< Accelerometer Y-axis value in native 3DS units
- s16 accel_z; ///< Accelerometer Z-axis value in native 3DS units
-
- std::mutex gyro_mutex;
- s16 gyro_x; ///< Gyroscope X-axis value in native 3DS units
- s16 gyro_y; ///< Gyroscope Y-axis value in native 3DS units
- s16 gyro_z; ///< Gyroscope Z-axis value in native 3DS units
-
/**
* Clip the provided coordinates to be inside the touchscreen area.
*/