From 7bd9a13458509cdefb231124826d529a5ec4e7fa Mon Sep 17 00:00:00 2001 From: awtterpip Date: Wed, 27 Dec 2023 20:35:42 -0600 Subject: [PATCH] fix wasm compile error --- xr_api/src/backend/webxr.rs | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/xr_api/src/backend/webxr.rs b/xr_api/src/backend/webxr.rs index 16dd19b..cfa6f71 100644 --- a/xr_api/src/backend/webxr.rs +++ b/xr_api/src/backend/webxr.rs @@ -167,37 +167,38 @@ impl WebXrInput { } impl InputTrait for WebXrInput { - fn get_haptics(&self, path: ActionId) -> Result> { - let haptics = self - .get_controller(path.handedness) - .ok_or(XrError::Placeholder)? - .gamepad() - .ok_or(XrError::Placeholder)? - .haptic_actuators() - .iter() - .next() - .ok_or(XrError::Placeholder)? - .into(); - Ok(WebXrHaptics(haptics, path).into()) - } - - fn get_pose(&self, _path: ActionId) -> Result> { + fn get_haptics(&self, path: ActionPath) -> Result> { + // let haptics = self + // .get_controller(path.handedness) + // .ok_or(XrError::Placeholder)? + // .gamepad() + // .ok_or(XrError::Placeholder)? + // .haptic_actuators() + // .iter() + // .next() + // .ok_or(XrError::Placeholder)? + // .into(); + // Ok(WebXrHaptics(haptics, path).into()) todo!() } - fn get_float(&self, _path: ActionId) -> Result> { + fn get_pose(&self, _path: ActionPath) -> Result> { todo!() } - fn get_bool(&self, _path: ActionId) -> Result> { + fn get_float(&self, _path: ActionPath) -> Result> { + todo!() + } + + fn get_bool(&self, _path: ActionPath) -> Result> { todo!() } } -pub struct WebXrHaptics(web_sys::GamepadHapticActuator, ActionId); +pub struct WebXrHaptics(web_sys::GamepadHapticActuator, ActionPath); impl ActionTrait for WebXrHaptics { - fn id(&self) -> ActionId { + fn id(&self) -> ActionPath { self.1 } }