fix wasm compile error

This commit is contained in:
awtterpip
2023-12-27 20:35:42 -06:00
parent 995138ddc9
commit 7bd9a13458

View File

@@ -167,37 +167,38 @@ impl WebXrInput {
} }
impl InputTrait for WebXrInput { impl InputTrait for WebXrInput {
fn get_haptics(&self, path: ActionId) -> Result<Action<Haptic>> { fn get_haptics(&self, path: ActionPath) -> Result<Action<Haptic>> {
let haptics = self // let haptics = self
.get_controller(path.handedness) // .get_controller(path.handedness)
.ok_or(XrError::Placeholder)? // .ok_or(XrError::Placeholder)?
.gamepad() // .gamepad()
.ok_or(XrError::Placeholder)? // .ok_or(XrError::Placeholder)?
.haptic_actuators() // .haptic_actuators()
.iter() // .iter()
.next() // .next()
.ok_or(XrError::Placeholder)? // .ok_or(XrError::Placeholder)?
.into(); // .into();
Ok(WebXrHaptics(haptics, path).into()) // Ok(WebXrHaptics(haptics, path).into())
}
fn get_pose(&self, _path: ActionId) -> Result<Action<Pose>> {
todo!() todo!()
} }
fn get_float(&self, _path: ActionId) -> Result<Action<f32>> { fn get_pose(&self, _path: ActionPath) -> Result<Action<Pose>> {
todo!() todo!()
} }
fn get_bool(&self, _path: ActionId) -> Result<Action<bool>> { fn get_float(&self, _path: ActionPath) -> Result<Action<f32>> {
todo!()
}
fn get_bool(&self, _path: ActionPath) -> Result<Action<bool>> {
todo!() todo!()
} }
} }
pub struct WebXrHaptics(web_sys::GamepadHapticActuator, ActionId); pub struct WebXrHaptics(web_sys::GamepadHapticActuator, ActionPath);
impl ActionTrait for WebXrHaptics { impl ActionTrait for WebXrHaptics {
fn id(&self) -> ActionId { fn id(&self) -> ActionPath {
self.1 self.1
} }
} }