Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Fix regression with mouse wheel input not clearing properly
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField committed Jul 7, 2024
1 parent c3987d4 commit 450a525
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
overflow-y: auto;
top: 0;
z-index: 100000;
height: 95vh;
max-height: 95vh;
padding: 7px;
width: calc(100vw - 50px);
max-width: 600px;
Expand Down
6 changes: 6 additions & 0 deletions packages/spatial/src/input/systems/ClientInputSystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,12 @@ const cleanupInputs = () => {
for (const key in source.buttons) {
cleanupButton(key, source.buttons, hasFocus)
}

// clear non-spatial emulated axes data end of each frame
// this is used to clear wheel speed each frame
if (!hasComponent(eid, XRSpaceComponent) && hasComponent(eid, InputPointerComponent)) {
;(source.source.gamepad!.axes as number[]).fill(0)
}
}
}

Expand Down

0 comments on commit 450a525

Please sign in to comment.