update to bevy 0.13. TODO: fix view weirdness and do a pass over most of xr_input to turn the modules into plugins
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use std::ffi::{c_void, CString};
|
||||
use std::sync::atomic::AtomicBool;
|
||||
use std::sync::Mutex;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
// use anyhow::Context;
|
||||
use ash::vk::{self, Handle};
|
||||
@@ -130,9 +130,8 @@ pub fn initialize_xr_instance(
|
||||
}
|
||||
|
||||
let vk_entry = unsafe { ash::Entry::load() }?;
|
||||
let flags = wgpu_hal::InstanceFlags::empty();
|
||||
let extensions =
|
||||
<V as Api>::Instance::required_extensions(&vk_entry, vk_target_version, flags)?;
|
||||
let flags = wgpu::InstanceFlags::from_build_config();
|
||||
let extensions = <V as Api>::Instance::desired_extensions(&vk_entry, vk_target_version, flags)?;
|
||||
let device_extensions = vec![
|
||||
ash::extensions::khr::Swapchain::name(),
|
||||
ash::extensions::khr::DrawIndirectCount::name(),
|
||||
@@ -282,8 +281,8 @@ pub fn initialize_xr_instance(
|
||||
wgpu_open_device,
|
||||
&wgpu::DeviceDescriptor {
|
||||
label: None,
|
||||
features: wgpu_features,
|
||||
limits: wgpu::Limits {
|
||||
required_features: wgpu_features,
|
||||
required_limits: wgpu::Limits {
|
||||
max_bind_groups: 8,
|
||||
max_storage_buffer_binding_size: wgpu_adapter
|
||||
.limits()
|
||||
@@ -358,7 +357,7 @@ pub fn start_xr_session(
|
||||
// SAFETY: Plugins should be set up on the main thread.
|
||||
let handle = wrapper.get_handle();
|
||||
wgpu_instance
|
||||
.create_surface(&handle)
|
||||
.create_surface(handle)
|
||||
.expect("Failed to create wgpu surface")
|
||||
});
|
||||
let swapchain_format = surface
|
||||
|
||||
@@ -94,6 +94,8 @@ impl Plugin for OpenXrPlugin {
|
||||
render_adapter,
|
||||
render_instance,
|
||||
),
|
||||
// Expose this? if yes we also have to set this in the non xr case
|
||||
synchronous_pipeline_compilation: true,
|
||||
});
|
||||
app.insert_resource(XrStatus::Disabled);
|
||||
app.world.send_event(StartXrSession);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use bevy::ecs::schedule::IntoSystemConfigs;
|
||||
use bevy::log::{debug, info};
|
||||
use bevy::math::primitives::Direction3d;
|
||||
use bevy::prelude::{
|
||||
Color, Gizmos, GlobalTransform, Plugin, Quat, Query, Res, Transform, Update, Vec2, Vec3, With,
|
||||
Without,
|
||||
@@ -104,7 +105,7 @@ pub fn draw_gizmos(
|
||||
y: 0.01,
|
||||
z: 0.0,
|
||||
},
|
||||
Vec3::Y,
|
||||
Direction3d::Y,
|
||||
0.2,
|
||||
Color::RED,
|
||||
);
|
||||
@@ -168,7 +169,7 @@ fn draw_hand_gizmo(
|
||||
//draw face
|
||||
gizmos.circle(
|
||||
face_translation_vec3,
|
||||
face_quat_normal,
|
||||
Direction3d::new_unchecked(face_quat_normal),
|
||||
0.04,
|
||||
Color::YELLOW_GREEN,
|
||||
);
|
||||
@@ -185,7 +186,7 @@ fn draw_hand_gizmo(
|
||||
let b_offset_quat = face_quat;
|
||||
let b_translation_vec3 =
|
||||
face_translation_vec3 + b_offset_quat.mul_vec3(Vec3::new(0.025, -0.01, 0.0));
|
||||
gizmos.circle(b_translation_vec3, face_quat_normal, 0.0075, b_color);
|
||||
gizmos.circle(b_translation_vec3, Direction3d::new_unchecked(face_quat_normal), 0.0075, b_color);
|
||||
|
||||
//button a
|
||||
let mut a_color = off_color;
|
||||
@@ -199,7 +200,7 @@ fn draw_hand_gizmo(
|
||||
let a_offset_quat = face_quat;
|
||||
let a_translation_vec3 =
|
||||
face_translation_vec3 + a_offset_quat.mul_vec3(Vec3::new(0.025, 0.01, 0.0));
|
||||
gizmos.circle(a_translation_vec3, face_quat_normal, 0.0075, a_color);
|
||||
gizmos.circle(a_translation_vec3, Direction3d::new_unchecked(face_quat_normal), 0.0075, a_color);
|
||||
|
||||
//joystick
|
||||
let joystick_offset_quat = face_quat;
|
||||
@@ -211,7 +212,7 @@ fn draw_hand_gizmo(
|
||||
}
|
||||
|
||||
//base
|
||||
gizmos.circle(joystick_base_vec, face_quat_normal, 0.014, joystick_color);
|
||||
gizmos.circle(joystick_base_vec, Direction3d::new_unchecked(face_quat_normal), 0.014, joystick_color);
|
||||
|
||||
let stick = controller.thumbstick(Hand::Left);
|
||||
let input = Vec3::new(stick.x, -stick.y, 0.0);
|
||||
@@ -219,7 +220,7 @@ fn draw_hand_gizmo(
|
||||
+ joystick_offset_quat.mul_vec3(Vec3::new(-0.02, 0.0, -0.01))
|
||||
+ joystick_offset_quat.mul_vec3(input * 0.01);
|
||||
//top
|
||||
gizmos.circle(joystick_top_vec, face_quat_normal, 0.005, joystick_color);
|
||||
gizmos.circle(joystick_top_vec, Direction3d::new_unchecked(face_quat_normal), 0.005, joystick_color);
|
||||
|
||||
//trigger
|
||||
let trigger_state = controller.trigger(Hand::Left);
|
||||
@@ -277,7 +278,7 @@ fn draw_hand_gizmo(
|
||||
//draw face
|
||||
gizmos.circle(
|
||||
face_translation_vec3,
|
||||
face_quat_normal,
|
||||
Direction3d::new_unchecked(face_quat_normal),
|
||||
0.04,
|
||||
Color::YELLOW_GREEN,
|
||||
);
|
||||
@@ -294,7 +295,7 @@ fn draw_hand_gizmo(
|
||||
let b_offset_quat = face_quat;
|
||||
let b_translation_vec3 =
|
||||
face_translation_vec3 + b_offset_quat.mul_vec3(Vec3::new(-0.025, -0.01, 0.0));
|
||||
gizmos.circle(b_translation_vec3, face_quat_normal, 0.0075, b_color);
|
||||
gizmos.circle(b_translation_vec3, Direction3d::new_unchecked(face_quat_normal), 0.0075, b_color);
|
||||
|
||||
//button a
|
||||
let mut a_color = off_color;
|
||||
@@ -308,7 +309,7 @@ fn draw_hand_gizmo(
|
||||
let a_offset_quat = face_quat;
|
||||
let a_translation_vec3 =
|
||||
face_translation_vec3 + a_offset_quat.mul_vec3(Vec3::new(-0.025, 0.01, 0.0));
|
||||
gizmos.circle(a_translation_vec3, face_quat_normal, 0.0075, a_color);
|
||||
gizmos.circle(a_translation_vec3, Direction3d::new_unchecked(face_quat_normal), 0.0075, a_color);
|
||||
|
||||
//joystick time
|
||||
let joystick_offset_quat = face_quat;
|
||||
@@ -320,7 +321,7 @@ fn draw_hand_gizmo(
|
||||
}
|
||||
|
||||
//base
|
||||
gizmos.circle(joystick_base_vec, face_quat_normal, 0.014, joystick_color);
|
||||
gizmos.circle(joystick_base_vec, Direction3d::new_unchecked(face_quat_normal), 0.014, joystick_color);
|
||||
|
||||
let stick = controller.thumbstick(Hand::Right);
|
||||
let input = Vec3::new(stick.x, -stick.y, 0.0);
|
||||
@@ -328,7 +329,7 @@ fn draw_hand_gizmo(
|
||||
+ joystick_offset_quat.mul_vec3(Vec3::new(0.02, 0.0, -0.01))
|
||||
+ joystick_offset_quat.mul_vec3(input * 0.01);
|
||||
//top
|
||||
gizmos.circle(joystick_top_vec, face_quat_normal, 0.005, joystick_color);
|
||||
gizmos.circle(joystick_top_vec, Direction3d::new_unchecked(face_quat_normal), 0.005, joystick_color);
|
||||
|
||||
//trigger
|
||||
let trigger_state = controller.trigger(Hand::Right);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::f32::consts::PI;
|
||||
|
||||
use bevy::log::info;
|
||||
use bevy::log::{info, warn};
|
||||
use bevy::prelude::{
|
||||
Color, Component, Entity, Event, EventReader, EventWriter, Gizmos, GlobalTransform, Quat,
|
||||
Query, Transform, Vec3, With, Without,
|
||||
@@ -93,9 +93,12 @@ pub fn draw_interaction_gizmos(
|
||||
),
|
||||
Without<XRInteractable>,
|
||||
>,
|
||||
tracking_root_query: Query<(&mut Transform, With<OpenXRTrackingRoot>)>,
|
||||
tracking_root_query: Query<&mut Transform, With<OpenXRTrackingRoot>>,
|
||||
) {
|
||||
let root = tracking_root_query.get_single().unwrap().0;
|
||||
let Ok(root) = tracking_root_query.get_single() else {
|
||||
warn!("no or more than one tracking root");
|
||||
return;
|
||||
};
|
||||
for (global_transform, interactable_state) in interactable_query.iter() {
|
||||
let transform = global_transform.compute_transform();
|
||||
let color = match interactable_state {
|
||||
@@ -137,7 +140,7 @@ pub fn draw_interaction_gizmos(
|
||||
};
|
||||
gizmos.ray(
|
||||
root.translation + root.rotation.mul_vec3(aim.0.translation),
|
||||
root.rotation.mul_vec3(aim.0.forward()),
|
||||
root.rotation.mul_vec3(*aim.0.forward()),
|
||||
color,
|
||||
);
|
||||
}
|
||||
@@ -229,7 +232,7 @@ pub fn interactions(
|
||||
),
|
||||
Without<XRInteractable>,
|
||||
>,
|
||||
tracking_root_query: Query<(&mut Transform, With<OpenXRTrackingRoot>)>,
|
||||
tracking_root_query: Query<&mut Transform, With<OpenXRTrackingRoot>>,
|
||||
mut writer: EventWriter<InteractionEvent>,
|
||||
) {
|
||||
for (xr_interactable_global_transform, interactable_entity) in interactable_query.iter() {
|
||||
@@ -280,12 +283,12 @@ pub fn interactions(
|
||||
let center = sphere_transform.translation;
|
||||
let radius: f32 = 0.1;
|
||||
//I hate this but the aim pose needs the root for now
|
||||
let root = tracking_root_query.get_single().unwrap().0;
|
||||
let root = tracking_root_query.get_single().unwrap();
|
||||
match aim {
|
||||
Some(aim) => {
|
||||
let ray_origin =
|
||||
root.translation + root.rotation.mul_vec3(aim.0.translation);
|
||||
let ray_dir = root.rotation.mul_vec3(aim.0.forward());
|
||||
let ray_dir = root.rotation.mul_vec3(*aim.0.forward());
|
||||
|
||||
if ray_sphere_intersection(
|
||||
center,
|
||||
|
||||
@@ -37,7 +37,7 @@ use self::trackers::{
|
||||
adopt_open_xr_trackers, update_open_xr_controllers, OpenXRLeftEye, OpenXRRightEye,
|
||||
OpenXRTrackingRoot,
|
||||
};
|
||||
use self::xr_camera::{GlobalTransformExtract, TransformExtract, XrCamera};
|
||||
use self::xr_camera::{/* GlobalTransformExtract, TransformExtract, */ XrCamera};
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct OpenXrInput {
|
||||
|
||||
@@ -59,11 +59,10 @@ impl Default for PrototypeLocomotionConfig {
|
||||
|
||||
pub fn proto_locomotion(
|
||||
time: Res<Time>,
|
||||
mut tracking_root_query: Query<(&mut Transform, With<OpenXRTrackingRoot>)>,
|
||||
mut tracking_root_query: Query<&mut Transform, With<OpenXRTrackingRoot>>,
|
||||
oculus_controller: Res<OculusController>,
|
||||
frame_state: Res<XrFrameState>,
|
||||
xr_input: Res<XrInput>,
|
||||
instance: Res<XrInstance>,
|
||||
session: Res<XrSession>,
|
||||
views: ResMut<XrViews>,
|
||||
mut gizmos: Gizmos,
|
||||
@@ -84,7 +83,7 @@ pub fn proto_locomotion(
|
||||
Ok(mut position) => {
|
||||
//get the stick input and do some maths
|
||||
let stick = controller.thumbstick(Hand::Left);
|
||||
let input = stick.x * position.0.right() + stick.y * position.0.forward();
|
||||
let input = stick.x * *position.right() + stick.y * *position.forward();
|
||||
let reference_quat;
|
||||
match config.locomotion_type {
|
||||
LocomotionType::Head => {
|
||||
@@ -102,10 +101,9 @@ pub fn proto_locomotion(
|
||||
}
|
||||
}
|
||||
let (yaw, _pitch, _roll) = reference_quat.to_euler(EulerRot::YXZ);
|
||||
let reference_quat = Quat::from_axis_angle(position.0.up(), yaw);
|
||||
let reference_quat = Quat::from_axis_angle(*position.up(), yaw);
|
||||
let locomotion_vec = reference_quat.mul_vec3(input);
|
||||
position.0.translation +=
|
||||
locomotion_vec * config.locomotion_speed * time.delta_seconds();
|
||||
position.translation += locomotion_vec * config.locomotion_speed * time.delta_seconds();
|
||||
|
||||
//now time for rotation
|
||||
|
||||
@@ -118,7 +116,7 @@ pub fn proto_locomotion(
|
||||
return;
|
||||
}
|
||||
let smoth_rot = Quat::from_axis_angle(
|
||||
position.0.up(),
|
||||
*position.up(),
|
||||
rot_input * config.smooth_rotation_speed * time.delta_seconds(),
|
||||
);
|
||||
//apply rotation
|
||||
@@ -127,10 +125,10 @@ pub fn proto_locomotion(
|
||||
Some(view) => {
|
||||
let mut hmd_translation = view.pose.position.to_vec3();
|
||||
hmd_translation.y = 0.0;
|
||||
let local = position.0.translation;
|
||||
let global = position.0.rotation.mul_vec3(hmd_translation) + local;
|
||||
gizmos.circle(global, position.0.up(), 0.1, Color::GREEN);
|
||||
position.0.rotate_around(global, smoth_rot);
|
||||
let local = position.translation;
|
||||
let global = position.rotation.mul_vec3(hmd_translation) + local;
|
||||
gizmos.circle(global, position.up(), 0.1, Color::GREEN);
|
||||
position.rotate_around(global, smoth_rot);
|
||||
}
|
||||
None => return,
|
||||
}
|
||||
@@ -151,7 +149,7 @@ pub fn proto_locomotion(
|
||||
false => -1.0,
|
||||
};
|
||||
let smoth_rot =
|
||||
Quat::from_axis_angle(position.0.up(), config.snap_angle * dir);
|
||||
Quat::from_axis_angle(*position.up(), config.snap_angle * dir);
|
||||
//apply rotation
|
||||
let v = views;
|
||||
let views = v.first();
|
||||
@@ -159,10 +157,10 @@ pub fn proto_locomotion(
|
||||
Some(view) => {
|
||||
let mut hmd_translation = view.pose.position.to_vec3();
|
||||
hmd_translation.y = 0.0;
|
||||
let local = position.0.translation;
|
||||
let global = position.0.rotation.mul_vec3(hmd_translation) + local;
|
||||
gizmos.circle(global, position.0.up(), 0.1, Color::GREEN);
|
||||
position.0.rotate_around(global, smoth_rot);
|
||||
let local = position.translation;
|
||||
let global = position.rotation.mul_vec3(hmd_translation) + local;
|
||||
gizmos.circle(global, position.up(), 0.1, Color::GREEN);
|
||||
position.rotate_around(global, smoth_rot);
|
||||
}
|
||||
None => return,
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use bevy::hierarchy::Parent;
|
||||
use bevy::log::{debug, info};
|
||||
use bevy::math::Quat;
|
||||
use bevy::prelude::{
|
||||
Added, BuildChildren, Commands, Component, Entity, Query, Res, Transform, Vec3, With, Without,
|
||||
};
|
||||
@@ -48,20 +49,23 @@ pub fn adopt_open_xr_trackers(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn verify_quat(mut quat: Quat) -> Quat {
|
||||
if quat.length() == 0.0 || !quat.is_finite() {
|
||||
quat = Quat::IDENTITY;
|
||||
}
|
||||
quat.normalize()
|
||||
}
|
||||
|
||||
pub fn update_open_xr_controllers(
|
||||
oculus_controller: Res<OculusController>,
|
||||
mut left_controller_query: Query<(
|
||||
&mut Transform,
|
||||
Option<&mut AimPose>,
|
||||
With<OpenXRLeftController>,
|
||||
Without<OpenXRRightController>,
|
||||
)>,
|
||||
mut right_controller_query: Query<(
|
||||
&mut Transform,
|
||||
Option<&mut AimPose>,
|
||||
With<OpenXRRightController>,
|
||||
Without<OpenXRLeftController>,
|
||||
)>,
|
||||
mut left_controller_query: Query<
|
||||
(&mut Transform, Option<&mut AimPose>),
|
||||
(With<OpenXRLeftController>, Without<OpenXRRightController>),
|
||||
>,
|
||||
mut right_controller_query: Query<
|
||||
(&mut Transform, Option<&mut AimPose>),
|
||||
(With<OpenXRRightController>, Without<OpenXRLeftController>),
|
||||
>,
|
||||
frame_state: Res<XrFrameState>,
|
||||
xr_input: Res<XrInput>,
|
||||
session: Res<XrSession>,
|
||||
@@ -81,7 +85,7 @@ pub fn update_open_xr_controllers(
|
||||
Some(mut pose) => {
|
||||
*pose = AimPose(Transform {
|
||||
translation: left_aim_space.0.pose.position.to_vec3(),
|
||||
rotation: left_aim_space.0.pose.orientation.to_quat(),
|
||||
rotation: verify_quat(left_aim_space.0.pose.orientation.to_quat()),
|
||||
scale: Vec3::splat(1.0),
|
||||
});
|
||||
}
|
||||
@@ -99,7 +103,7 @@ pub fn update_open_xr_controllers(
|
||||
let left_rotataion = left_controller_query.get_single_mut();
|
||||
match left_rotataion {
|
||||
Ok(mut left_entity) => {
|
||||
left_entity.0.rotation = left_grip_space.0.pose.orientation.to_quat()
|
||||
left_entity.0.rotation = verify_quat(left_grip_space.0.pose.orientation.to_quat())
|
||||
}
|
||||
Err(_) => (),
|
||||
}
|
||||
@@ -114,7 +118,7 @@ pub fn update_open_xr_controllers(
|
||||
Some(mut pose) => {
|
||||
*pose = AimPose(Transform {
|
||||
translation: right_aim_space.0.pose.position.to_vec3(),
|
||||
rotation: right_aim_space.0.pose.orientation.to_quat(),
|
||||
rotation: verify_quat(right_aim_space.0.pose.orientation.to_quat()),
|
||||
scale: Vec3::splat(1.0),
|
||||
});
|
||||
}
|
||||
@@ -132,7 +136,7 @@ pub fn update_open_xr_controllers(
|
||||
let right_rotataion = right_controller_query.get_single_mut();
|
||||
match right_rotataion {
|
||||
Ok(mut right_entity) => {
|
||||
right_entity.0.rotation = right_grip_space.0.pose.orientation.to_quat()
|
||||
right_entity.0.rotation = verify_quat(right_grip_space.0.pose.orientation.to_quat())
|
||||
}
|
||||
Err(_) => (),
|
||||
}
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
use crate::xr_init::{xr_only, XrCleanup, XrSetup};
|
||||
use crate::xr_input::{QuatConv, Vec3Conv};
|
||||
use crate::{locate_views, xr_wait_frame, LEFT_XR_TEXTURE_HANDLE, RIGHT_XR_TEXTURE_HANDLE};
|
||||
use bevy::core_pipeline::core_3d::graph::Core3d;
|
||||
use bevy::core_pipeline::tonemapping::{DebandDither, Tonemapping};
|
||||
use bevy::ecs::system::lifetimeless::Read;
|
||||
use bevy::math::Vec3A;
|
||||
use bevy::prelude::*;
|
||||
use bevy::render::camera::{
|
||||
CameraProjection, CameraProjectionPlugin, CameraRenderGraph, RenderTarget,
|
||||
CameraMainTextureUsages, CameraProjection, CameraProjectionPlugin, CameraRenderGraph, RenderTarget
|
||||
};
|
||||
use bevy::render::extract_component::{ExtractComponent, ExtractComponentPlugin};
|
||||
use bevy::render::primitives::Frustum;
|
||||
use bevy::render::view::{
|
||||
update_frusta, ColorGrading, ExtractedView, VisibilitySystems, VisibleEntities,
|
||||
update_frusta, ColorGrading, VisibilitySystems, VisibleEntities,
|
||||
};
|
||||
use bevy::transform::TransformSystem;
|
||||
use openxr::Fovf;
|
||||
use wgpu::TextureUsages;
|
||||
|
||||
use super::trackers::{OpenXRLeftEye, OpenXRRightEye, OpenXRTracker, OpenXRTrackingRoot};
|
||||
use super::trackers::{OpenXRLeftEye, OpenXRRightEye, OpenXRTracker};
|
||||
|
||||
pub struct XrCameraPlugin;
|
||||
|
||||
@@ -100,40 +101,41 @@ pub struct XrCameraBundle {
|
||||
pub tonemapping: Tonemapping,
|
||||
pub dither: DebandDither,
|
||||
pub color_grading: ColorGrading,
|
||||
pub main_texture_usages: CameraMainTextureUsages,
|
||||
pub xr_camera_type: XrCamera,
|
||||
}
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd, Component, ExtractComponent)]
|
||||
pub struct XrCamera(Eye);
|
||||
|
||||
#[derive(Component)]
|
||||
pub(super) struct TransformExtract;
|
||||
|
||||
impl ExtractComponent for TransformExtract {
|
||||
type Query = Read<Transform>;
|
||||
|
||||
type Filter = ();
|
||||
|
||||
type Out = Transform;
|
||||
|
||||
fn extract_component(item: bevy::ecs::query::QueryItem<'_, Self::Query>) -> Option<Self::Out> {
|
||||
Some(*item)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Component)]
|
||||
pub(super) struct GlobalTransformExtract;
|
||||
|
||||
impl ExtractComponent for GlobalTransformExtract {
|
||||
type Query = Read<GlobalTransform>;
|
||||
|
||||
type Filter = ();
|
||||
|
||||
type Out = GlobalTransform;
|
||||
|
||||
fn extract_component(item: bevy::ecs::query::QueryItem<'_, Self::Query>) -> Option<Self::Out> {
|
||||
Some(*item)
|
||||
}
|
||||
}
|
||||
// #[derive(Component)]
|
||||
// pub(super) struct TransformExtract;
|
||||
//
|
||||
// impl ExtractComponent for TransformExtract {
|
||||
// type Query = Read<Transform>;
|
||||
//
|
||||
// type Filter = ();
|
||||
//
|
||||
// type Out = Transform;
|
||||
//
|
||||
// fn extract_component(item: bevy::ecs::query::QueryItem<'_, Self::Query>) -> Option<Self::Out> {
|
||||
// Some(*item)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// #[derive(Component)]
|
||||
// pub(super) struct GlobalTransformExtract;
|
||||
//
|
||||
// impl ExtractComponent for GlobalTransformExtract {
|
||||
// type Query = Read<GlobalTransform>;
|
||||
//
|
||||
// type Filter = ();
|
||||
//
|
||||
// type Out = GlobalTransform;
|
||||
//
|
||||
// fn extract_component(item: bevy::ecs::query::QueryItem<'_, Self::Query>) -> Option<Self::Out> {
|
||||
// Some(*item)
|
||||
// }
|
||||
// }
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
|
||||
pub enum Eye {
|
||||
@@ -153,7 +155,7 @@ impl XrCameraBundle {
|
||||
viewport: None,
|
||||
..default()
|
||||
},
|
||||
camera_render_graph: CameraRenderGraph::new(bevy::core_pipeline::core_3d::graph::NAME),
|
||||
camera_render_graph: CameraRenderGraph::new(Core3d),
|
||||
xr_projection: Default::default(),
|
||||
visible_entities: Default::default(),
|
||||
frustum: Default::default(),
|
||||
@@ -164,6 +166,11 @@ impl XrCameraBundle {
|
||||
dither: DebandDither::Enabled,
|
||||
color_grading: Default::default(),
|
||||
xr_camera_type: XrCamera(eye),
|
||||
main_texture_usages: CameraMainTextureUsages(
|
||||
TextureUsages::RENDER_ATTACHMENT
|
||||
| TextureUsages::TEXTURE_BINDING
|
||||
| TextureUsages::COPY_SRC,
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user