fixed a few things
This commit is contained in:
@@ -1068,7 +1068,7 @@ pub fn update_hand_skeletons(
|
|||||||
Without<OpenXRTrackingRoot>,
|
Without<OpenXRTrackingRoot>,
|
||||||
)>,
|
)>,
|
||||||
input_source: Option<Res<HandInputSource>>,
|
input_source: Option<Res<HandInputSource>>,
|
||||||
hand_tracking: Res<HandTrackingTracker>,
|
hand_tracking: Option<Res<HandTrackingTracker>>,
|
||||||
xr_input: Res<XrInput>,
|
xr_input: Res<XrInput>,
|
||||||
xr_frame_state: Res<XrFrameState>,
|
xr_frame_state: Res<XrFrameState>,
|
||||||
) {
|
) {
|
||||||
@@ -1104,13 +1104,15 @@ pub fn update_hand_skeletons(
|
|||||||
None => info!("hand states resource not initialized yet"),
|
None => info!("hand states resource not initialized yet"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HandInputSource::OpenXr => {
|
HandInputSource::OpenXr => match hand_tracking {
|
||||||
let hand_ref = hand_tracking.get_ref(&xr_input, &xr_frame_state);
|
Some(tracking) => {
|
||||||
|
let hand_ref = tracking.get_ref(&xr_input, &xr_frame_state);
|
||||||
let (root_transform, _) = tracking_root_query.get_single().unwrap();
|
let (root_transform, _) = tracking_root_query.get_single().unwrap();
|
||||||
let left_data = hand_ref.get_left_poses();
|
let left_data = hand_ref.get_left_poses();
|
||||||
let right_data = hand_ref.get_right_poses();
|
let right_data = hand_ref.get_right_poses();
|
||||||
|
|
||||||
for (entity, mut transform, bone, hand, radius, _) in hand_bone_query.iter_mut() {
|
for (entity, mut transform, bone, hand, radius, _) in hand_bone_query.iter_mut()
|
||||||
|
{
|
||||||
let bone_data = match (hand, left_data, right_data) {
|
let bone_data = match (hand, left_data, right_data) {
|
||||||
(Hand::Left, Some(data), _) => data[bone.get_index_from_bone()],
|
(Hand::Left, Some(data), _) => data[bone.get_index_from_bone()],
|
||||||
(Hand::Right, _, Some(data)) => data[bone.get_index_from_bone()],
|
(Hand::Right, _, Some(data)) => data[bone.get_index_from_bone()],
|
||||||
@@ -1133,6 +1135,8 @@ pub fn update_hand_skeletons(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
None => {}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
info!("hand input source not initialized");
|
info!("hand input source not initialized");
|
||||||
|
|||||||
Reference in New Issue
Block a user