working pipelined rendering
This commit is contained in:
@@ -6,6 +6,7 @@ use bevy_xr::{
|
||||
};
|
||||
use openxr::SpaceLocationFlags;
|
||||
|
||||
use crate::resources::Pipelined;
|
||||
use crate::{
|
||||
init::OxrTrackingRoot,
|
||||
reference_space::{OxrPrimaryReferenceSpace, OxrReferenceSpace},
|
||||
@@ -139,12 +140,22 @@ fn locate_hands(
|
||||
&OxrHandBoneEntities,
|
||||
)>,
|
||||
mut bone_query: Query<(&HandBone, &mut HandBoneRadius, &mut Transform)>,
|
||||
pipelined: Option<Res<Pipelined>>,
|
||||
) {
|
||||
for (tracker, ref_space, hand_entities) in &tracker_query {
|
||||
let ref_space = ref_space.map(|v| &v.0).unwrap_or(&default_ref_space.0);
|
||||
// relate_hand_joints also provides velocities
|
||||
let joints = match ref_space.locate_hand_joints(tracker, frame_state.predicted_display_time)
|
||||
{
|
||||
let joints = match ref_space.locate_hand_joints(
|
||||
tracker,
|
||||
if pipelined.is_some() {
|
||||
openxr::Time::from_nanos(
|
||||
frame_state.predicted_display_time.as_nanos()
|
||||
+ frame_state.predicted_display_period.as_nanos(),
|
||||
)
|
||||
} else {
|
||||
frame_state.predicted_display_time
|
||||
},
|
||||
) {
|
||||
Ok(Some(v)) => v,
|
||||
Ok(None) => continue,
|
||||
Err(openxr::sys::Result::ERROR_EXTENSION_NOT_PRESENT) => {
|
||||
|
||||
Reference in New Issue
Block a user