Watch rotation + galister fixes (Keyboard mapping fix, OpenXR hand transform fix) (#4)

* Watch rotation + galister fixes (Keyboard mapping fix, OpenXR hand transform fix)

* Use from_scale_rotation_translation
This commit is contained in:
Aleksander
2024-01-30 21:22:18 +01:00
committed by GitHub
parent dded4f6398
commit 6999a4b277
5 changed files with 17 additions and 7 deletions

View File

@@ -353,7 +353,10 @@ fn quat_lerp(a: Quat, mut b: Quat, t: f32) -> Quat {
fn transform_to_posef(transform: &Affine3A) -> xr::Posef {
let translation = transform.translation;
let rotation = Quat::from_affine3(transform).normalize();
let norm_mat3 = transform
.matrix3
.mul_scalar(1.0 / transform.matrix3.x_axis.length());
let rotation = Quat::from_mat3a(&norm_mat3).normalize();
xr::Posef {
orientation: xr::Quaternionf {