Function face_user_yaw_only

Source
pub fn face_user_yaw_only(
    panel_pos: Vec3,
    head_pos: Vec3,
    fallback: Quaternionf,
) -> (Quaternionf, bool)
Expand description

Computes yaw-only orientation whose local positive Z faces the viewer.

Vertical separation is ignored. If horizontal squared distance is at most 1e-6, returns (fallback, false); otherwise the second value is true.

ยงExamples

use ailloli_ui_openxr::openxr_runtime::face_user_yaw_only;
use ailloli_ui_openxr::math::Vec3;
let (rotation, applied) = face_user_yaw_only(Vec3::new(0.0, 0.0, -2.0), Vec3::default(), openxr::Posef::IDENTITY.orientation);
assert!(applied);
assert_eq!(rotation, openxr::Posef::IDENTITY.orientation);