This commit is contained in:
galister
2024-02-20 20:55:14 +01:00
parent d31b3ca6c0
commit e7b415ae4e
12 changed files with 34 additions and 45 deletions

View File

@@ -128,15 +128,13 @@ impl OpenVrInputSource {
system: &mut SystemManager,
app: &mut AppState,
) {
let aas = ActiveActionSet {
0: ovr_overlay::sys::VRActiveActionSet_t {
let aas = ActiveActionSet(ovr_overlay::sys::VRActiveActionSet_t {
ulActionSet: self.set_hnd.0,
ulRestrictedToDevice: 0,
ulSecondaryActionSet: 0,
unPadding: 0,
nPriority: 0,
},
};
});
let _ = input.update_actions(&mut [aas]);
@@ -155,10 +153,10 @@ impl OpenVrInputSource {
0.005,
INPUT_ANY,
)
.and_then(|pose| {
.map(|pose| {
app_hand.pose = pose.0.pose.mDeviceToAbsoluteTracking.to_affine();
hand.has_pose = true;
Ok(())
});
app_hand.now.click = input
@@ -237,9 +235,9 @@ impl OpenVrInputSource {
_ => continue,
};
get_tracked_device(system, device, role).and_then(|device| {
get_tracked_device(system, device, role).map(|device| {
app.input_state.devices.push(device);
Some(())
});
}

View File

@@ -95,7 +95,7 @@ impl LinePool {
) {
let rotation = Affine3A::from_axis_angle(Vec3::X, -PI * 0.5);
from.translation = from.translation + from.transform_vector3a(Vec3A::NEG_Z) * (len * 0.5);
from.translation += from.transform_vector3a(Vec3A::NEG_Z) * (len * 0.5);
let mut transform = from * rotation * Affine3A::from_scale(Vec3::new(1., len / 0.002, 1.));
let to_hmd = hmd.translation - from.translation;
@@ -114,7 +114,7 @@ impl LinePool {
}
}
transform = transform * rotations[closest.0];
transform *= rotations[closest.0];
debug_assert!(color < self.colors.len());