Skip to content

Commit 0c99dcb

Browse files
committed
feat(input): only send input to 10 closest things (MASSIVE speedup)
1 parent 9cc98d5 commit 0c99dcb

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/objects/input/mouse_pointer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ impl MousePointer {
373373
.into_iter()
374374
.filter(|(handler, distance)| (distance - first_distance).abs() <= 0.001)
375375
.map(|(handler, _)| handler)
376+
.take(10)
376377
.collect();
377378
self.input.set_handler_capture_order(order, vec![]);
378379
}

src/objects/input/oxr_controller.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ impl OxrControllerInput {
567567
let order: Vec<Arc<InputHandler>> = sorted_handlers
568568
.into_iter()
569569
.map(|(handler, _)| handler)
570+
.take(10)
570571
.collect();
571572
self.input.set_handler_capture_order(order, vec![]);
572573
}

src/objects/input/oxr_hand.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ impl OxrHandInput {
410410
let order: Vec<Arc<InputHandler>> = sorted_handlers
411411
.into_iter()
412412
.map(|(handler, _)| handler)
413+
.take(10)
413414
.collect();
414415
self.input.set_handler_capture_order(order, vec![]);
415416
}

0 commit comments

Comments
 (0)