Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit 20408f2

Browse files
committed
Add constant for menu gesture sustain
1 parent b9a36b3 commit 20408f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

webxr/openxr/input.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ use webxr_api::InputId;
1111
use webxr_api::Native;
1212
use webxr_api::SelectEvent;
1313

14+
/// Number of frames to wait with the menu gesture before
15+
/// opening the menu.
16+
const MENU_GESTURE_SUSTAIN_THRESHOLD: u8 = 60;
17+
1418
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
1519
enum ClickState {
1620
Clicking,
@@ -257,7 +261,7 @@ impl OpenXRInput {
257261
// close to 1
258262
if angle > 0.9 {
259263
self.menu_gesture_sustain += 1;
260-
if self.menu_gesture_sustain > 60 {
264+
if self.menu_gesture_sustain > MENU_GESTURE_SUSTAIN_THRESHOLD {
261265
menu_selected = true;
262266
self.menu_gesture_sustain = 0;
263267
}

0 commit comments

Comments
 (0)