Merge pull request #129 from Schmarni-Dev/rename_crates_and_move_hand_bones_to_xr

Rename Crate and move OxrHandBoneEntities to bevy_mod_xr
This commit is contained in:
Schmarni
2024-07-05 01:11:46 +02:00
committed by GitHub
35 changed files with 100 additions and 249 deletions

View File

@@ -1,5 +1,5 @@
[package]
name = "bevy_oxr"
name = "bevy_mod_xr_backends"
version = "0.1.0"
edition = "2021"
description = "Community crate for OpenXR in Bevy"
@@ -7,9 +7,9 @@ repository = "https://github.com/awtterpip/bevy_oxr"
license = "MIT/Apache-2.0"
[dependencies]
bevy_openxr.path = "./crates/bevy_openxr"
bevy_xr.path = "./crates/bevy_xr"
bevy = "0.13.0"
bevy_mod_openxr.path = "./crates/bevy_openxr"
bevy_mod_xr.path = "./crates/bevy_xr"
bevy.workspace = true
[workspace]
members = ["crates/*", "crates/bevy_openxr/examples/android"]

View File

@@ -1,5 +1,5 @@
[package]
name = "bevy_openxr"
name = "bevy_mod_openxr"
version = "0.1.0"
edition = "2021"
@@ -26,7 +26,7 @@ openxr = "0.18.0"
thiserror = "1.0.57"
wgpu = "0.19.3"
wgpu-hal = "0.19.3"
bevy_xr.path = "../bevy_xr"
bevy_mod_xr.path = "../bevy_xr"
ash = { version = "0.37.3", optional = true }

View File

@@ -1,7 +1,7 @@
//! A simple 3D scene with light shining over a cube sitting on a plane.
use bevy::prelude::*;
use bevy_openxr::add_xr_plugins;
use bevy_mod_openxr::add_xr_plugins;
fn main() {
App::new()

View File

@@ -1,7 +1,7 @@
// a simple example showing basic actions using the xr utils actions
use bevy::{math::vec3, prelude::*};
use bevy_openxr::{add_xr_plugins, helper_traits::ToQuat, resources::OxrViews};
use bevy_xr::session::XrTrackingRoot;
use bevy_mod_openxr::{add_xr_plugins, helper_traits::ToQuat, resources::OxrViews};
use bevy_mod_xr::session::XrTrackingRoot;
use bevy_xr_utils::xr_utils_actions::{
ActiveSet, XRUtilsAction, XRUtilsActionSet, XRUtilsActionState, XRUtilsActionSystemSet,
XRUtilsActionsPlugin, XRUtilsBinding,
@@ -75,7 +75,7 @@ fn create_action_entities(mut commands: Commands) {
XRUtilsAction {
action_name: "flight_input".into(),
localized_name: "flight_input_localized".into(),
action_type: bevy_xr::actions::ActionType::Vector,
action_type: bevy_mod_xr::actions::ActionType::Vector,
},
FlightActionMarker, //lets try a marker component
))

View File

@@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bevy_openxr.path = "../.."
bevy_mod_openxr.path = "../.."
bevy.workspace = true
bevy_xr_utils.path = "../../../bevy_xr_utils"

View File

@@ -1,7 +1,7 @@
//! A simple 3D scene with light shining over a cube sitting on a plane.
use bevy::prelude::*;
use bevy_openxr::{add_xr_plugins, init::OxrInitPlugin, types::OxrExtensions};
use bevy_mod_openxr::{add_xr_plugins, init::OxrInitPlugin, types::OxrExtensions};
#[bevy_main]
fn main() {

View File

@@ -1,8 +1,8 @@
//! A simple 3D scene with light shining over a cube sitting on a plane.
use bevy::prelude::*;
use bevy_openxr::{add_xr_plugins, init::OxrInitPlugin, types::OxrExtensions};
use bevy_xr::session::XrState;
use bevy_mod_openxr::{add_xr_plugins, init::OxrInitPlugin, types::OxrExtensions};
use bevy_mod_xr::session::XrState;
// use openxr::EnvironmentBlendMode;
// use wgpu::TextureFormat;
@@ -40,11 +40,11 @@ fn main() {
fn handle_input(
keys: Res<ButtonInput<KeyCode>>,
mut end: EventWriter<bevy_xr::session::XrEndSessionEvent>,
mut destroy: EventWriter<bevy_xr::session::XrDestroySessionEvent>,
mut begin: EventWriter<bevy_xr::session::XrBeginSessionEvent>,
mut create: EventWriter<bevy_xr::session::XrCreateSessionEvent>,
mut request_exit: EventWriter<bevy_xr::session::XrRequestExitEvent>,
mut end: EventWriter<bevy_mod_xr::session::XrEndSessionEvent>,
mut destroy: EventWriter<bevy_mod_xr::session::XrDestroySessionEvent>,
mut begin: EventWriter<bevy_mod_xr::session::XrBeginSessionEvent>,
mut create: EventWriter<bevy_mod_xr::session::XrCreateSessionEvent>,
mut request_exit: EventWriter<bevy_mod_xr::session::XrRequestExitEvent>,
state: Res<XrState>,
) {
if keys.just_pressed(KeyCode::KeyE) {

View File

@@ -1,7 +1,7 @@
use std::ops::Deref;
use bevy::prelude::*;
use bevy_openxr::{
use bevy_mod_openxr::{
action_binding::{OxrSendActionBindings, OxrSuggestActionBinding},
action_set_attaching::OxrAttachActionSet,
action_set_syncing::{OxrActionSetSyncSet, OxrSyncActionSet},
@@ -11,7 +11,7 @@ use bevy_openxr::{
session::OxrSession,
spaces::OxrSpaceExt,
};
use bevy_xr::{
use bevy_mod_xr::{
session::{session_available, XrCreateSession, XrTrackingRoot},
spaces::XrSpace,
types::XrPose,

View File

@@ -1,8 +1,8 @@
//! A simple 3D scene with light shining over a cube sitting on a plane.
use bevy::prelude::*;
use bevy_openxr::add_xr_plugins;
use bevy_xr::session::{XrSessionPlugin, XrState};
use bevy_mod_openxr::add_xr_plugins;
use bevy_mod_xr::session::{XrSessionPlugin, XrState};
fn main() {
App::new()
@@ -16,11 +16,11 @@ fn main() {
fn handle_input(
keys: Res<ButtonInput<KeyCode>>,
mut end: EventWriter<bevy_xr::session::XrEndSessionEvent>,
mut destroy: EventWriter<bevy_xr::session::XrDestroySessionEvent>,
mut begin: EventWriter<bevy_xr::session::XrBeginSessionEvent>,
mut create: EventWriter<bevy_xr::session::XrCreateSessionEvent>,
mut request_exit: EventWriter<bevy_xr::session::XrRequestExitEvent>,
mut end: EventWriter<bevy_mod_xr::session::XrEndSessionEvent>,
mut destroy: EventWriter<bevy_mod_xr::session::XrDestroySessionEvent>,
mut begin: EventWriter<bevy_mod_xr::session::XrBeginSessionEvent>,
mut create: EventWriter<bevy_mod_xr::session::XrCreateSessionEvent>,
mut request_exit: EventWriter<bevy_mod_xr::session::XrRequestExitEvent>,
state: Res<XrState>,
) {
if keys.just_pressed(KeyCode::KeyE) {

View File

@@ -1,7 +1,7 @@
//! A simple example of how to use the transform utils to set the players position and orientation
use bevy::prelude::*;
use bevy_openxr::add_xr_plugins;
use bevy_mod_openxr::add_xr_plugins;
use bevy_xr_utils::transform_utils::{self, SnapToPosition, SnapToRotation};
use bevy_xr_utils::xr_utils_actions::{
ActiveSet, XRUtilsAction, XRUtilsActionSet, XRUtilsActionState, XRUtilsActionSystemSet,
@@ -110,7 +110,7 @@ fn create_action_entities(mut commands: Commands) {
XRUtilsAction {
action_name: "face_red".into(),
localized_name: "face_red_localized".into(),
action_type: bevy_xr::actions::ActionType::Bool,
action_type: bevy_mod_xr::actions::ActionType::Bool,
},
FaceRedAction, //lets try a marker component
))
@@ -134,7 +134,7 @@ fn create_action_entities(mut commands: Commands) {
XRUtilsAction {
action_name: "center".into(),
localized_name: "center_localized".into(),
action_type: bevy_xr::actions::ActionType::Bool,
action_type: bevy_mod_xr::actions::ActionType::Bool,
},
Center, //lets try a marker component
))

View File

@@ -5,7 +5,7 @@ use bevy::ecs::schedule::ScheduleLabel;
use bevy::ecs::system::RunSystemOnce;
use bevy::prelude::*;
use bevy::utils::HashMap;
use bevy_xr::session::XrSessionCreatedEvent;
use bevy_mod_xr::session::XrSessionCreatedEvent;
use openxr::sys::ActionSuggestedBinding;
use crate::resources::OxrInstance;

View File

@@ -1,6 +1,6 @@
use crate::{action_binding::run_action_binding_sugestion, session::OxrSession};
use bevy::prelude::*;
use bevy_xr::session::XrSessionCreatedEvent;
use bevy_mod_xr::session::XrSessionCreatedEvent;
impl Plugin for OxrActionAttachingPlugin {
fn build(&self, app: &mut App) {

View File

@@ -1,6 +1,6 @@
use crate::session::OxrSession;
use bevy::prelude::*;
use bevy_xr::session::session_running;
use bevy_mod_xr::session::session_running;
#[derive(SystemSet, Debug, Hash, PartialEq, Eq, Clone, Copy)]
pub struct OxrActionSetSyncSet;

View File

@@ -1,8 +1,8 @@
use bevy::prelude::*;
use bevy_xr::hands::{LeftHand, RightHand};
use bevy_xr::session::{XrCreateSession, XrDestroySession, XrTrackingRoot};
use bevy_xr::spaces::{XrPrimaryReferenceSpace, XrReferenceSpace};
use bevy_xr::{
use bevy_mod_xr::hands::{LeftHand, RightHand, XrHandBoneEntities, HAND_JOINT_COUNT};
use bevy_mod_xr::session::{XrCreateSession, XrDestroySession, XrTrackingRoot};
use bevy_mod_xr::spaces::{XrPrimaryReferenceSpace, XrReferenceSpace};
use bevy_mod_xr::{
hands::{HandBone, HandBoneRadius},
session::session_running,
};
@@ -39,6 +39,22 @@ impl Plugin for HandTrackingPlugin {
}
}
pub fn spawn_hand_bones<T: Bundle + Clone>(
cmds: &mut Commands,
bundle: T,
) -> [Entity; HAND_JOINT_COUNT] {
let mut bones: [Entity; HAND_JOINT_COUNT] = [Entity::PLACEHOLDER; HAND_JOINT_COUNT];
// screw you clippy, i don't see a better way to init this array
#[allow(clippy::needless_range_loop)]
for bone in HandBone::get_all_bones().into_iter() {
bones[bone as usize] = cmds
.spawn((SpatialBundle::default(), bone, HandBoneRadius(0.0)))
.insert(bundle.clone())
.id();
}
bones
}
fn spawn_default_hands(
mut cmds: Commands,
session: Res<OxrSession>,
@@ -71,49 +87,27 @@ fn spawn_default_hands(
return;
}
};
let mut left_bones = [Entity::PLACEHOLDER; 26];
let mut right_bones = [Entity::PLACEHOLDER; 26];
for bone in HandBone::get_all_bones() {
let bone_left = cmds
.spawn((
DefaultHandBone,
SpatialBundle::default(),
bone,
HandBoneRadius(0.0),
LeftHand,
))
.id();
let bone_right = cmds
.spawn((
DefaultHandBone,
SpatialBundle::default(),
bone,
HandBoneRadius(0.0),
RightHand,
))
.id();
cmds.entity(root).push_children(&[bone_left]);
cmds.entity(root).push_children(&[bone_right]);
left_bones[bone as usize] = bone_left;
right_bones[bone as usize] = bone_right;
}
let left_bones = spawn_hand_bones(&mut cmds, (DefaultHandBone, LeftHand));
let right_bones = spawn_hand_bones(&mut cmds, (DefaultHandBone, RightHand));
cmds.entity(root).push_children(&left_bones);
cmds.entity(root).push_children(&right_bones);
cmds.spawn((
DefaultHandTracker,
OxrHandTracker(tracker_left),
OxrHandBoneEntities(left_bones),
XrHandBoneEntities(left_bones),
LeftHand,
));
cmds.spawn((
DefaultHandTracker,
OxrHandTracker(tracker_right),
OxrHandBoneEntities(right_bones),
XrHandBoneEntities(right_bones),
RightHand,
));
}
#[derive(Component)]
#[derive(Component, Clone, Copy)]
struct DefaultHandTracker;
#[derive(Component)]
#[derive(Component, Clone, Copy)]
struct DefaultHandBone;
#[allow(clippy::type_complexity)]
@@ -127,9 +121,6 @@ fn clean_up_default_hands(
}
}
#[derive(Deref, DerefMut, Component, Clone, Copy)]
pub struct OxrHandBoneEntities(pub [Entity; 26]);
#[derive(Deref, DerefMut, Component)]
pub struct OxrHandTracker(pub openxr::HandTracker);
@@ -139,7 +130,7 @@ fn locate_hands(
tracker_query: Query<(
&OxrHandTracker,
Option<&XrReferenceSpace>,
&OxrHandBoneEntities,
&XrHandBoneEntities,
)>,
session: Res<OxrSession>,
mut bone_query: Query<(&HandBone, &mut HandBoneRadius, &mut Transform)>,

View File

@@ -1,7 +1,7 @@
use std::{mem, ptr};
use bevy::prelude::*;
use bevy_xr::session::session_available;
use bevy_mod_xr::session::session_available;
use openxr::sys;
use crate::{

View File

@@ -1,5 +1,5 @@
use bevy::prelude::*;
use bevy_xr::types::XrPose;
use bevy_mod_xr::types::XrPose;
pub trait ToPosef {
fn to_posef(&self) -> openxr::Posef;

View File

@@ -11,7 +11,7 @@ use bevy::render::RenderApp;
use bevy::render::RenderPlugin;
use bevy::winit::UpdateMode;
use bevy::winit::WinitSettings;
use bevy_xr::session::*;
use bevy_mod_xr::session::*;
use crate::error::OxrError;
use crate::features::overlay::OxrOverlaySessionEvent;

View File

@@ -1,7 +1,7 @@
use std::mem;
use bevy::ecs::world::World;
use bevy_xr::spaces::{XrPrimaryReferenceSpace, XrSpace};
use bevy_mod_xr::spaces::{XrPrimaryReferenceSpace, XrSpace};
use openxr::{sys, CompositionLayerFlags, Fovf, Posef, Rect2Di};
use crate::graphics::graphics_match;

View File

@@ -5,8 +5,8 @@ use bevy::{
utils::default,
window::{PresentMode, Window, WindowPlugin},
};
use bevy_xr::camera::XrCameraPlugin;
use bevy_xr::session::XrSessionPlugin;
use bevy_mod_xr::camera::XrCameraPlugin;
use bevy_mod_xr::session::XrSessionPlugin;
use init::OxrInitPlugin;
use render::OxrRenderPlugin;

View File

@@ -2,7 +2,7 @@ use bevy::{
prelude::*,
render::{extract_resource::ExtractResourcePlugin, RenderApp},
};
use bevy_xr::{
use bevy_mod_xr::{
session::{XrCreateSession, XrDestroySession},
spaces::{XrPrimaryReferenceSpace, XrReferenceSpace},
};

View File

@@ -10,7 +10,7 @@ use bevy::{
},
transform::TransformSystem,
};
use bevy_xr::{
use bevy_mod_xr::{
camera::{XrCamera, XrCameraBundle, XrProjection},
session::{
XrDestroySession, XrFirst, XrHandleEvents, XrRenderSet, XrRootTransform, XrTrackingRoot,

View File

@@ -1,7 +1,7 @@
use std::{mem::MaybeUninit, ptr, sync::Mutex};
use bevy::{prelude::*, utils::hashbrown::HashSet};
use bevy_xr::{
use bevy_mod_xr::{
session::{session_available, session_running, XrFirst, XrHandleEvents},
spaces::{XrDestroySpace, XrPrimaryReferenceSpace, XrReferenceSpace, XrSpace, XrSpatialOffset},
types::XrPose,

View File

@@ -1,5 +1,5 @@
[package]
name = "bevy_webxr"
name = "bevy_mod_webxr"
version = "0.1.0"
edition = "2021"
@@ -13,4 +13,4 @@ thiserror = "1.0.57"
wgpu = "0.19.3"
wgpu-hal = "0.19.3"
bevy_xr.path = "../bevy_xr"
bevy_mod_xr.path = "../bevy_xr"

View File

@@ -0,0 +1,2 @@
# Bevy WebXR
currently not yet in a working state

View File

@@ -1,5 +1,5 @@
[package]
name = "bevy_xr"
name = "bevy_mod_xr"
version = "0.1.0"
edition = "2021"
@@ -7,4 +7,3 @@ edition = "2021"
[dependencies]
bevy.workspace = true
bevy_xr_macros.path = "macros"

View File

@@ -1,12 +0,0 @@
[package]
name = "bevy_xr_macros"
version = "0.1.0"
edition = "2021"
[lib]
proc-macro = true
[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = "2.0"

View File

@@ -1,136 +0,0 @@
use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::quote;
use syn::parse::{Parse, ParseStream};
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::token::{Comma, Eq};
use syn::{parse_macro_input, parse_quote, AttrStyle, DeriveInput, Expr, Type};
mod kw {
syn::custom_keyword!(action_type);
syn::custom_keyword!(name);
syn::custom_keyword!(pretty_name);
}
enum AttributeInput {
Kind(Type, Span),
Name(Expr, Span),
PrettyName(Expr, Span),
}
impl Parse for AttributeInput {
fn parse(input: ParseStream) -> syn::Result<Self> {
if let Ok(field) = input.parse::<kw::action_type>() {
input.parse::<Eq>()?;
Ok(Self::Kind(input.parse()?, field.span()))
} else if let Ok(field) = input.parse::<kw::name>() {
input.parse::<Eq>()?;
Ok(Self::Name(input.parse()?, field.span()))
} else if let Ok(field) = input.parse::<kw::pretty_name>() {
input.parse::<Eq>()?;
Ok(Self::PrettyName(input.parse()?, field.span()))
} else {
Err(input.error("expected 'action_type', 'name' or 'pretty_name'"))
}
}
}
#[proc_macro_derive(Action, attributes(action))]
pub fn derive_action(input: TokenStream) -> TokenStream {
let input = parse_macro_input!(input as DeriveInput);
let item = input.ident;
let mut attributes = vec![];
for attribute in input.attrs {
if let AttrStyle::Inner(token) = attribute.style {
return TokenStream::from(
syn::Error::new(
token.span,
"This derive macro does not accept inner attributes",
)
.to_compile_error(),
);
};
let parsed_attributes = match attribute
.parse_args_with(Punctuated::<AttributeInput, Comma>::parse_terminated)
{
Ok(inner) => inner,
Err(e) => return TokenStream::from(e.to_compile_error()),
};
for attr in parsed_attributes {
attributes.push(attr);
}
}
let mut kind: Option<Type> = None;
let mut name: Option<Expr> = None;
let mut pretty_name: Option<Expr> = None;
for attribute in attributes {
match attribute {
AttributeInput::Kind(ty, span) => {
if kind.is_some() {
return syn::Error::new(
span,
"attribute 'action_type' is defined more than once",
)
.to_compile_error()
.into();
}
kind = Some(ty);
}
AttributeInput::Name(expr, span) => {
if name.is_some() {
return syn::Error::new(span, "attribute 'name' is defined more than once")
.to_compile_error()
.into();
}
name = Some(expr);
}
AttributeInput::PrettyName(expr, span) => {
if pretty_name.is_some() {
return syn::Error::new(
span,
"attribute 'pretty_name' is defined more than once",
)
.to_compile_error()
.into();
}
pretty_name = Some(expr);
}
}
}
if kind.is_none() {
panic!("action_type isn't specified")
}
if name.is_none() {
name = Some(parse_quote! {
std::stringify!(#item)
});
}
if pretty_name.is_none() {
pretty_name = name.clone();
}
let kind = kind.unwrap();
let name = name.unwrap();
let pretty_name = pretty_name.unwrap();
let expanded = quote! {
impl bevy_xr::actions::Action for #item {
type ActionType = #kind;
fn info() -> bevy_xr::actions::ActionInfo {
bevy_xr::actions::ActionInfo {
pretty_name: #pretty_name,
name: #name,
action_type: <Self::ActionType as bevy_xr::actions::ActionTy>::TYPE,
type_id: std::any::TypeId::of::<Self>(),
}
}
}
};
TokenStream::from(expanded)
}

View File

@@ -3,7 +3,6 @@ use std::{any::TypeId, marker::PhantomData};
use bevy::app::{App, Plugin};
use bevy::ecs::system::Resource;
use bevy::math::Vec2;
pub use bevy_xr_macros::Action;
pub struct ActionPlugin<A: Action>(PhantomData<A>);

View File

@@ -1,8 +1,9 @@
use bevy::{
ecs::component::Component,
ecs::{component::Component, entity::Entity},
math::bool,
prelude::{Deref, DerefMut},
};
pub const HAND_JOINT_COUNT: usize = 26;
#[derive(Clone, Copy, Component, Debug)]
pub struct LeftHand;
@@ -10,6 +11,9 @@ pub struct LeftHand;
#[derive(Clone, Copy, Component, Debug)]
pub struct RightHand;
#[derive(Deref, DerefMut, Component, Clone, Copy)]
pub struct XrHandBoneEntities(pub [Entity; HAND_JOINT_COUNT]);
#[repr(transparent)]
#[derive(Clone, Copy, Component, Debug, DerefMut, Deref)]
pub struct HandBoneRadius(pub f32);

View File

@@ -7,6 +7,8 @@ edition = "2021"
[dependencies]
bevy.workspace = true
bevy_xr.path = "../bevy_xr"
bevy_mod_xr.path = "../bevy_xr"
bevy_mod_openxr.path = "../bevy_openxr"
[target.'cfg(not(target_family = "wasm"))'.dependencies]
openxr = "0.18.0"
bevy_openxr.path = "../bevy_openxr"

View File

@@ -1,5 +1,5 @@
use bevy::{prelude::*, transform::TransformSystem};
use bevy_xr::hands::{HandBone, HandBoneRadius};
use bevy_mod_xr::hands::{HandBone, HandBoneRadius};
pub struct HandGizmosPlugin;
impl Plugin for HandGizmosPlugin {
fn build(&self, app: &mut App) {

View File

@@ -1,4 +1,6 @@
// use bevy::prelude::*;
pub mod hand_gizmos;
#[cfg(not(target_family = "wasm"))]
pub mod xr_utils_actions;
#[cfg(not(target_family = "wasm"))]
pub mod transform_utils;

View File

@@ -1,9 +1,9 @@
use bevy::prelude::*;
use bevy_openxr::{
use bevy_mod_openxr::{
helper_traits::{ToQuat, ToVec3},
resources::OxrViews,
};
use bevy_xr::session::XrTrackingRoot;
use bevy_mod_xr::session::XrTrackingRoot;
pub struct TransformUtilitiesPlugin;

View File

@@ -21,7 +21,7 @@
//! XRUtilsAction {
//! action_name: "flight_input".into(),
//! localized_name: "flight_input_localized".into(),
//! action_type: bevy_xr::actions::ActionType::Vector,
//! action_type: bevy_mod_xr::actions::ActionType::Vector,
//! },
//! FlightActionMarker, //lets try a marker component
//! ))
@@ -54,12 +54,12 @@
//!
//!
use bevy::prelude::*;
use bevy_openxr::{
use bevy_mod_openxr::{
action_binding::OxrSuggestActionBinding, action_set_attaching::OxrAttachActionSet,
action_set_syncing::OxrActionSetSyncSet, action_set_syncing::OxrSyncActionSet,
resources::OxrInstance, session::OxrSession,
};
use bevy_xr::session::{session_available, session_running};
use bevy_mod_xr::session::{session_available, session_running};
use openxr::{Path, Vector2f};
use std::borrow::Cow;
@@ -131,7 +131,7 @@ fn create_openxr_events(
let (create_action, bindings) = actions_query.get(child).unwrap();
//lets create dat action
match create_action.action_type {
bevy_xr::actions::ActionType::Bool => {
bevy_mod_xr::actions::ActionType::Bool => {
let action: openxr::Action<bool> = action_set
.create_action::<bool>(
&create_action.action_name,
@@ -169,7 +169,7 @@ fn create_openxr_events(
binding_writer.send(sugestion);
}
}
bevy_xr::actions::ActionType::Float => {
bevy_mod_xr::actions::ActionType::Float => {
let action: openxr::Action<f32> = action_set
.create_action::<f32>(
&create_action.action_name,
@@ -208,7 +208,7 @@ fn create_openxr_events(
binding_writer.send(sugestion);
}
}
bevy_xr::actions::ActionType::Vector => {
bevy_mod_xr::actions::ActionType::Vector => {
let action: openxr::Action<Vector2f> = action_set
.create_action::<Vector2f>(
&create_action.action_name,
@@ -368,7 +368,7 @@ pub struct ActiveSet;
pub struct XRUtilsAction {
pub action_name: Cow<'static, str>,
pub localized_name: Cow<'static, str>,
pub action_type: bevy_xr::actions::ActionType,
pub action_type: bevy_mod_xr::actions::ActionType,
}
#[derive(Component)]

View File

@@ -1,2 +1,2 @@
pub use bevy_openxr;
pub use bevy_xr;
pub use bevy_mod_openxr;
pub use bevy_mod_xr;