mirror of https://github.com/wayvr-org/wayvr.git
openvr: Hide lasers and unblock input when dashboard is open
This commit is contained in:
parent
48d58f61d2
commit
e39085aa2b
|
|
@ -414,6 +414,8 @@ where
|
|||
let pending_haptics = pointer.pending_haptics.take();
|
||||
|
||||
if !pointer.tracked {
|
||||
pointer.interaction.should_block_input = false;
|
||||
pointer.interaction.should_block_poses = false;
|
||||
return (None, pending_haptics); // no hit
|
||||
}
|
||||
|
||||
|
|
@ -644,6 +646,10 @@ where
|
|||
O: Default,
|
||||
{
|
||||
let pointer = &mut app.input_state.pointers[pointer_idx];
|
||||
if !pointer.tracked {
|
||||
return (None, None);
|
||||
}
|
||||
|
||||
let ray_origin = pointer.pose;
|
||||
let mode = pointer.interaction.mode;
|
||||
let edit_mode = overlays.get_edit_mode();
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ use anyhow::bail;
|
|||
use ovr_overlay::{
|
||||
TrackedDeviceIndex,
|
||||
input::{ActionHandle, ActionSetHandle, ActiveActionSet, InputManager, InputValueHandle},
|
||||
overlay::OverlayManager,
|
||||
sys::{
|
||||
ETrackedControllerRole, ETrackedDeviceClass, ETrackedDeviceProperty,
|
||||
ETrackingUniverseOrigin,
|
||||
|
|
@ -144,6 +145,7 @@ impl OpenVrInputSource {
|
|||
&mut self,
|
||||
universe: ETrackingUniverseOrigin,
|
||||
input: &mut InputManager,
|
||||
overlay: &mut OverlayManager,
|
||||
system: &mut SystemManager,
|
||||
app: &mut AppState,
|
||||
) {
|
||||
|
|
@ -189,7 +191,7 @@ impl OpenVrInputSource {
|
|||
let hand = &mut self.hands[i];
|
||||
let app_hand = &mut app.input_state.pointers[i];
|
||||
|
||||
if let Some(device) = hand.device {
|
||||
if let Some(device) = hand.device.filter(|_| !overlay.is_dashboard_visible()) {
|
||||
app_hand.raw_pose = devices[device.0 as usize]
|
||||
.mDeviceToAbsoluteTracking
|
||||
.to_affine();
|
||||
|
|
|
|||
|
|
@ -244,7 +244,13 @@ pub fn openvr_run(
|
|||
let universe = playspace.get_universe();
|
||||
|
||||
app.input_state.pre_update();
|
||||
input_source.update(universe.clone(), &mut input_mgr, &mut system_mgr, &mut app);
|
||||
input_source.update(
|
||||
universe.clone(),
|
||||
&mut input_mgr,
|
||||
&mut overlay_mgr,
|
||||
&mut system_mgr,
|
||||
&mut app,
|
||||
);
|
||||
app.input_state.post_update(&app.session);
|
||||
|
||||
if app
|
||||
|
|
|
|||
Loading…
Reference in New Issue