summaryrefslogtreecommitdiff
path: root/src/common/emu_window.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/emu_window.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/common/emu_window.h b/src/common/emu_window.h
index a0ae4c9fa..b6b7bfd26 100644
--- a/src/common/emu_window.h
+++ b/src/common/emu_window.h
@@ -121,6 +121,54 @@ public:
121 } 121 }
122 122
123 /** 123 /**
124 * Gets the current accelerometer state (acceleration along each three axis).
125 * Axis explained:
126 * +x is the same direction as LEFT on D-pad.
127 * +y is normal to the touch screen, pointing outward.
128 * +z is the same direction as UP on D-pad.
129 * Units:
130 * 1 unit of return value = 1/512 g (measured by hw test),
131 * where g is the gravitational acceleration (9.8 m/sec2).
132 * @note This should be called by the core emu thread to get a state set by the window thread.
133 * @todo Implement accelerometer input in front-end.
134 * @return std::tuple of (x, y, z)
135 */
136 std::tuple<s16, s16, s16> GetAccelerometerState() const {
137 // stubbed
138 return std::make_tuple(0, -512, 0);
139 }
140
141 /**
142 * Gets the current gyroscope state (angular rates about each three axis).
143 * Axis explained:
144 * +x is the same direction as LEFT on D-pad.
145 * +y is normal to the touch screen, pointing outward.
146 * +z is the same direction as UP on D-pad.
147 * Orientation is determined by right-hand rule.
148 * Units:
149 * 1 unit of return value = (1/coef) deg/sec,
150 * where coef is the return value of GetGyroscopeRawToDpsCoefficient().
151 * @note This should be called by the core emu thread to get a state set by the window thread.
152 * @todo Implement gyroscope input in front-end.
153 * @return std::tuple of (x, y, z)
154 */
155 std::tuple<s16, s16, s16> GetGyroscopeState() const {
156 // stubbed
157 return std::make_tuple(0, 0, 0);
158 }
159
160 /**
161 * Gets the coefficient for units conversion of gyroscope state.
162 * The conversion formula is r = coefficient * v,
163 * where v is angular rate in deg/sec,
164 * and r is the gyroscope state.
165 * @return float-type coefficient
166 */
167 f32 GetGyroscopeRawToDpsCoefficient() const {
168 return 14.375f; // taken from hw test, and gyroscope's document
169 }
170
171 /**
124 * Returns currently active configuration. 172 * Returns currently active configuration.
125 * @note Accesses to the returned object need not be consistent because it may be modified in another thread 173 * @note Accesses to the returned object need not be consistent because it may be modified in another thread
126 */ 174 */