@@ -153,14 +153,9 @@ namespace Babylon::Plugins
153
153
void NativeInput::Impl::PointerDown (uint32_t pointerId, uint32_t buttonIndex, int32_t x, int32_t y, DeviceType deviceType)
154
154
{
155
155
m_runtime.Dispatch ([pointerId, buttonIndex, x, y, deviceType, this ](auto ) {
156
- const uint32_t inputIndex{ GetPointerButtonInputIndex (buttonIndex) };
157
- std::vector<int32_t >& deviceInputs{ GetOrCreateInputMap (deviceType, pointerId, {
158
- inputIndex,
159
- POINTER_X_INPUT_INDEX,
160
- POINTER_Y_INPUT_INDEX,
161
- POINTER_DELTA_HORIZONTAL_INDEX,
162
- POINTER_DELTA_VERTICAL_INDEX
163
- })};
156
+ const uint32_t inputIndex{GetPointerButtonInputIndex (buttonIndex)};
157
+ std::vector<int32_t >& deviceInputs{GetOrCreateInputMap (deviceType, pointerId,
158
+ {inputIndex, POINTER_X_INPUT_INDEX, POINTER_Y_INPUT_INDEX, POINTER_DELTA_HORIZONTAL_INDEX, POINTER_DELTA_VERTICAL_INDEX})};
164
159
165
160
// Record the x/y, but don't raise associated events (this matches the behavior in the browser).
166
161
SetInputState (deviceType, pointerId, POINTER_DELTA_HORIZONTAL_INDEX, 0 , deviceInputs, false );
@@ -176,14 +171,9 @@ namespace Babylon::Plugins
176
171
void NativeInput::Impl::PointerUp (uint32_t pointerId, uint32_t buttonIndex, int32_t x, int32_t y, DeviceType deviceType)
177
172
{
178
173
m_runtime.Dispatch ([pointerId, buttonIndex, x, y, deviceType, this ](auto ) {
179
- const uint32_t inputIndex{ GetPointerButtonInputIndex (buttonIndex) };
180
- std::vector<int32_t >& deviceInputs{ GetOrCreateInputMap (deviceType, pointerId, {
181
- inputIndex,
182
- POINTER_X_INPUT_INDEX,
183
- POINTER_Y_INPUT_INDEX,
184
- POINTER_DELTA_HORIZONTAL_INDEX,
185
- POINTER_DELTA_VERTICAL_INDEX
186
- })};
174
+ const uint32_t inputIndex{GetPointerButtonInputIndex (buttonIndex)};
175
+ std::vector<int32_t >& deviceInputs{GetOrCreateInputMap (deviceType, pointerId,
176
+ {inputIndex, POINTER_X_INPUT_INDEX, POINTER_Y_INPUT_INDEX, POINTER_DELTA_HORIZONTAL_INDEX, POINTER_DELTA_VERTICAL_INDEX})};
187
177
188
178
// Record the x/y, but don't raise associated events (this matches the behavior in the browser).
189
179
SetInputState (deviceType, pointerId, POINTER_DELTA_HORIZONTAL_INDEX, 0 , deviceInputs, false );
@@ -208,13 +198,8 @@ namespace Babylon::Plugins
208
198
void NativeInput::Impl::PointerMove (uint32_t pointerId, int32_t x, int32_t y, DeviceType deviceType)
209
199
{
210
200
m_runtime.Dispatch ([pointerId, x, y, deviceType, this ](auto ) {
211
- std::vector<int32_t >& deviceInputs{GetOrCreateInputMap (deviceType, pointerId, {
212
- POINTER_X_INPUT_INDEX,
213
- POINTER_Y_INPUT_INDEX,
214
- POINTER_DELTA_HORIZONTAL_INDEX,
215
- POINTER_DELTA_VERTICAL_INDEX,
216
- POINTER_MOVE_INDEX
217
- })};
201
+ std::vector<int32_t >& deviceInputs{GetOrCreateInputMap (deviceType, pointerId,
202
+ {POINTER_X_INPUT_INDEX, POINTER_Y_INPUT_INDEX, POINTER_DELTA_HORIZONTAL_INDEX, POINTER_DELTA_VERTICAL_INDEX, POINTER_MOVE_INDEX})};
218
203
int32_t deltaX = 0 ;
219
204
int32_t deltaY = 0 ;
220
205
@@ -245,8 +230,7 @@ namespace Babylon::Plugins
245
230
246
231
void NativeInput::Impl::PointerScroll (uint32_t pointerId, uint32_t scrollAxis, int32_t scrollValue, DeviceType deviceType)
247
232
{
248
- m_runtime.Dispatch ([pointerId, scrollAxis, scrollValue, deviceType, this ](auto )
249
- {
233
+ m_runtime.Dispatch ([pointerId, scrollAxis, scrollValue, deviceType, this ](auto ) {
250
234
std::vector<int32_t >& deviceInputs{GetOrCreateInputMap (deviceType, pointerId, {scrollAxis})};
251
235
SetInputState (deviceType, pointerId, scrollAxis, scrollValue, deviceInputs, true );
252
236
0 commit comments