playspace mover

This commit is contained in:
galister
2024-01-31 02:16:49 +01:00
parent 4867809575
commit 9f0856998a
5 changed files with 169 additions and 42 deletions

View File

@@ -30,9 +30,11 @@ use self::{input::action_manifest_path, overlay::OpenVrOverlayData};
use super::common::{BackendError, OverlayContainer, TaskType};
pub mod helpers;
pub mod input;
pub mod lines;
pub mod overlay;
pub mod playspace;
pub fn openvr_run(running: Arc<AtomicBool>) -> Result<(), BackendError> {
let app_type = EVRApplicationType::VRApplication_Overlay;
@@ -47,6 +49,7 @@ pub fn openvr_run(running: Arc<AtomicBool>) -> Result<(), BackendError> {
//let mut settings_mngr = context.settings_mngr();
let mut input_mngr = context.input_mngr();
let mut system_mngr = context.system_mngr();
let mut chaperone_mgr = context.chaperone_setup_mngr();
let mut compositor_mngr = context.compositor_mngr();
let device_extensions_fn = |device: &PhysicalDevice| {
@@ -68,6 +71,8 @@ pub fn openvr_run(running: Arc<AtomicBool>) -> Result<(), BackendError> {
let mut overlays = OverlayContainer::<OpenVrOverlayData>::new(&mut state);
let mut space_mover = playspace::PlayspaceMover::new();
state.hid_provider.set_desktop_extent(overlays.extent);
if let Err(e) = input_mngr.set_action_manifest(action_manifest_path()) {
@@ -146,6 +151,8 @@ pub fn openvr_run(running: Arc<AtomicBool>) -> Result<(), BackendError> {
.iter_mut()
.for_each(|o| o.state.auto_movement(&mut state));
space_mover.update(&mut chaperone_mgr, &mut overlays, &state);
let pointer_lengths = interact(&mut overlays, &mut state);
for (idx, len) in pointer_lengths.iter().enumerate() {
lines.draw_from(