@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "bevy_mod_xr"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ impl<A: Action> Plugin for ActionPlugin<A> {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.init_resource::<ActionList>()
|
||||
.init_resource::<ActionState<A>>();
|
||||
app.world.resource_mut::<ActionList>().0.push(A::info());
|
||||
app.world_mut().resource_mut::<ActionList>().0.push(A::info());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ impl Plugin for XrCameraPlugin {
|
||||
PostUpdate,
|
||||
update_frusta::<XrProjection>
|
||||
.after(TransformSystem::TransformPropagate)
|
||||
.before(VisibilitySystems::UpdatePerspectiveFrusta),
|
||||
.before(VisibilitySystems::UpdateFrusta),
|
||||
);
|
||||
app.add_plugins((
|
||||
ExtractComponentPlugin::<XrProjection>::default(),
|
||||
@@ -58,10 +58,6 @@ impl Default for XrProjection {
|
||||
pub struct XrCamera(pub u32);
|
||||
|
||||
impl CameraProjection for XrProjection {
|
||||
fn get_projection_matrix(&self) -> Mat4 {
|
||||
self.projection_matrix
|
||||
}
|
||||
|
||||
fn update(&mut self, _width: f32, _height: f32) {}
|
||||
|
||||
fn far(&self) -> f32 {
|
||||
@@ -92,6 +88,10 @@ impl CameraProjection for XrProjection {
|
||||
|
||||
view_space_corners
|
||||
}
|
||||
|
||||
fn get_clip_from_view(&self) -> Mat4 {
|
||||
self.projection_matrix
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Bundle)]
|
||||
|
||||
@@ -128,7 +128,7 @@ impl Plugin for XrSessionPlugin {
|
||||
.in_set(XrHandleEvents),
|
||||
);
|
||||
|
||||
app.world
|
||||
app.world_mut()
|
||||
.resource_mut::<MainScheduleOrder>()
|
||||
.labels
|
||||
.insert(0, XrFirst.intern());
|
||||
@@ -139,7 +139,7 @@ impl Plugin for XrSessionPlugin {
|
||||
}
|
||||
|
||||
fn finish(&self, app: &mut App) {
|
||||
if app.get_sub_app(RenderApp).is_err() {
|
||||
if app.get_sub_app(RenderApp).is_none() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user