Function apply_yaw_only_stable_grab

Source
pub fn apply_yaw_only_stable_grab(
    layer: OpenXrQuadLayerOptions,
    grab: &mut OpenXrPanelGrabState,
    grab_world: Vec3,
    head_pos: Option<Vec3>,
) -> OpenXrPanelGrabUpdate
Expand description

Reorients a dragged panel in yaw while preserving the grabbed world point.

Without a head position the layer is unchanged and hmd_pose_seen is false. Stability is reported when reconstruction error is at most one millimetre.

ยงExamples

use ailloli_ui_openxr::OpenXrQuadLayerOptions;
use ailloli_ui_openxr::math::Vec3;
use ailloli_ui_openxr::openxr_runtime::{OpenXrPanelGrabState, panel::apply_yaw_only_stable_grab};
let layer = OpenXrQuadLayerOptions::default();
let mut grab = OpenXrPanelGrabState::new(Vec3::default(), layer.pose.orientation);
let update = apply_yaw_only_stable_grab(layer, &mut grab, Vec3::new(0.0, 0.0, -2.0), Some(Vec3::default()));
assert!(update.hmd_pose_seen && update.grab_point_stable);