Skip to content

Commit

Permalink
Fixed some lints
Browse files Browse the repository at this point in the history
  • Loading branch information
TheButlah committed Feb 23, 2024
1 parent b4b36f9 commit 44c5884
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 23 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ openxr = { workspace = true, features = [ "mint", "static" ] }
ndk-context = "0.1"
jni = "0.20"

[dev-dependencies]
color-eyre.workspace = true

[[example]]
name = "xr"
path = "examples/xr.rs"
Expand Down
32 changes: 11 additions & 21 deletions examples/demo/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
use std::{f32::consts::PI, ops::Mul, time::Duration};
use std::{time::Duration};

use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
ecs::schedule::ScheduleLabel,
input::{keyboard::KeyCode, ButtonInput},
log::info,
math::primitives::{Capsule3d, Cuboid},
prelude::{
bevy_main, default, shape, App, Assets, Color, Commands, Component, Entity, Event,
bevy_main, default, App, Assets, Color, Commands, Component, Entity, Event,
EventReader, EventWriter, FixedUpdate, Gizmos, GlobalTransform, IntoSystemConfigs,
IntoSystemSetConfigs, Mesh, PbrBundle, PostUpdate, Quat, Query, Res, ResMut, Resource,
Schedule, SpatialBundle, StandardMaterial, Startup, Transform, Update, Vec3, Vec3Swizzles,
IntoSystemSetConfigs, Mesh, PbrBundle, PostUpdate, Query, Res, ResMut, Resource,
Schedule, SpatialBundle, StandardMaterial, Startup, Transform, Update, Vec3,
With, Without, World,
},
render::mesh::Meshable,
time::{Fixed, Time, Timer, TimerMode},
transform::TransformSystem,
};
use bevy_oxr::{
graphics::{extensions::XrExtensions, XrAppInfo, XrPreferdBlendMode},
graphics::{extensions::XrExtensions, XrAppInfo},
input::XrInput,
resources::{XrFrameState, XrInstance, XrSession},
xr_init::{xr_only, XrStatus},
resources::{XrFrameState, XrSession},
xr_init::{xr_only},
xr_input::{
actions::XrActionSets,
debug_gizmos::OpenXrDebugRenderer,
Expand All @@ -36,7 +35,6 @@ use bevy_oxr::{
prototype_locomotion::{proto_locomotion, PrototypeLocomotionConfig},
trackers::{
OpenXRController, OpenXRLeftController, OpenXRRightController, OpenXRTracker,
OpenXRTrackingRoot,
},
Hand,
},
Expand Down Expand Up @@ -376,7 +374,7 @@ fn update_physics_hands(
)>,
hand_query: Query<(&Transform, &HandBone, &Hand), Without<PhysicsHandBone>>,
time: Res<Time>,
mut gizmos: Gizmos,
_gizmos: Gizmos,
) {
let matching = MatchingType::VelocityMatching;
//sanity check do we even have hands?
Expand Down Expand Up @@ -532,13 +530,6 @@ fn get_start_and_end_entities(
};
}

fn get_hand_res(res: &Res<'_, HandsResource>, hand: Hand) -> HandResource {
match hand {
Hand::Left => res.left.clone(),
Hand::Right => res.right.clone(),
}
}

#[derive(Event, Default)]
pub struct SpawnCubeRequest;

Expand All @@ -549,7 +540,6 @@ fn request_cube_spawn(
oculus_controller: Res<OculusController>,
frame_state: Res<XrFrameState>,
xr_input: Res<XrInput>,
instance: Res<XrInstance>,
session: Res<XrSession>,
mut writer: EventWriter<SpawnCubeRequest>,
time: Res<Time>,
Expand Down Expand Up @@ -580,7 +570,7 @@ fn cube_spawner(
mut materials: ResMut<Assets<StandardMaterial>>,
mut events: EventReader<SpawnCubeRequest>,
) {
for request in events.read() {
for _request in events.read() {
// cube
commands.spawn((
PbrBundle {
Expand All @@ -607,15 +597,15 @@ fn prototype_interaction_input(
xr_input: Res<XrInput>,
session: Res<XrSession>,
mut right_interactor_query: Query<
(&mut XRInteractorState),
&mut XRInteractorState,
(
With<XRDirectInteractor>,
With<OpenXRRightController>,
Without<OpenXRLeftController>,
),
>,
mut left_interactor_query: Query<
(&mut XRInteractorState),
&mut XRInteractorState,
(
With<XRDirectInteractor>,
With<OpenXRLeftController>,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub enum Backend {
#[derive(Resource)]
struct DoPipelinedRendering;

fn clean_resources_render(mut cmds: &mut World) {
fn clean_resources_render(cmds: &mut World) {
// let session = cmds.remove_resource::<XrSession>().unwrap();
cmds.remove_resource::<XrSession>();
cmds.remove_resource::<XrResolution>();
Expand All @@ -207,7 +207,7 @@ fn clean_resources_render(mut cmds: &mut World) {
// }
warn!("Cleanup Resources Render");
}
fn clean_resources(mut cmds: &mut World) {
fn clean_resources(cmds: &mut World) {
cmds.remove_resource::<XrSession>();
cmds.remove_resource::<XrResolution>();
cmds.remove_resource::<XrFormat>();
Expand Down

0 comments on commit 44c5884

Please sign in to comment.