added files do build android?

This commit is contained in:
Schmarni
2023-10-27 19:53:59 +02:00
parent f867b1290b
commit c982f0f658
9 changed files with 48 additions and 3891 deletions

4
.gitignore vendored
View File

@@ -1,2 +1,2 @@
/target **/target
/Cargo.lock **/Cargo.lock

View File

@@ -36,7 +36,7 @@ openxr = { git = "https://github.com/Ralith/openxrs", features = ["mint"] }
[profile.release] [profile.release]
lto = "fat" lto = "fat"
codegen-units = 1 codegen-units = 1
panic = "abort" # panic = "abort"
[package.metadata.android.application.activity] [package.metadata.android.application.activity]
theme = "@android:style/Theme.Black.NoTitleBar.Fullscreen" theme = "@android:style/Theme.Black.NoTitleBar.Fullscreen"

3878
examples/demo/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,14 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
bevy = "0.11.3" bevy = { git = "https://github.com/bevyengine/bevy.git" }
bevy_openxr = "0.0.1" # bevy = "0.11.3"
bevy_rapier3d = { git = "https://github.com/alexichepura/bevy_rapier", version = "0.22.0" } bevy_openxr = { git = "file:///home/schmarni/Code/adeptus_bevy_oxr", default-features = false}
bevy_rapier3d = { git = "https://github.com/Schmarni-Dev/bevy_rapier" }
color-eyre = "0.6.2"
[profile.release]
lto = "fat"
codegen-units = 1
panic = "abort"

Binary file not shown.

View File

@@ -0,0 +1,25 @@
android:
runtime_libs:
- "runtime_libs"
manifest:
package: "org.bevyengine.demo_openxr_android"
application:
label: "Bevy Openxr Android"
theme: "@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen"
meta_data:
- name: "com.samsung.android.vr.application.mode"
value: "vr_only"
- name: "com.oculus.supportedDevices"
value: "quest|quest2|quest3"
activities:
- config_changes: "density|keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode"
launch_mode: "singleTask"
orientation: "landscape"
intent_filters:
- actions:
- "android.intent.action.MAIN"
categories:
- "com.oculus.intent.category.VR"
- "android.intent.category.LAUNCHER"
sdk:
target_sdk_version: 32

Binary file not shown.

View File

@@ -2,10 +2,10 @@ use bevy::{
diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin},
log::info, log::info,
prelude::{ prelude::{
default, shape, App, Assets, Color, Commands, Component, Event, EventReader, EventWriter, bevy_main, default, shape, App, Assets, Color, Commands, Component, Event, EventReader,
GlobalTransform, IntoSystemConfigs, IntoSystemSetConfigs, Mesh, PbrBundle, PostUpdate, EventWriter, GlobalTransform, IntoSystemConfigs, IntoSystemSetConfigs, Mesh, PbrBundle,
Query, Res, ResMut, Resource, SpatialBundle, StandardMaterial, Startup, Transform, Update, PostUpdate, Query, Res, ResMut, Resource, SpatialBundle, StandardMaterial, Startup,
With, Without, Transform, Update, With, Without,
}, },
time::{Time, Timer}, time::{Time, Timer},
transform::TransformSystem, transform::TransformSystem,
@@ -32,6 +32,7 @@ mod setup;
use crate::setup::setup_scene; use crate::setup::setup_scene;
use bevy_rapier3d::prelude::*; use bevy_rapier3d::prelude::*;
#[bevy_main]
fn main() { fn main() {
color_eyre::install().unwrap(); color_eyre::install().unwrap();
@@ -79,8 +80,7 @@ fn main() {
bevy::time::TimerMode::Once, bevy::time::TimerMode::Once,
))) )))
.add_systems(Update, request_cube_spawn) .add_systems(Update, request_cube_spawn)
.add_systems(Update, cube_spawner.after(request_cube_spawn)) .add_systems(Update, cube_spawner.after(request_cube_spawn));
;
//configure rapier sets //configure rapier sets
app.configure_sets( app.configure_sets(
@@ -175,7 +175,7 @@ fn cube_spawner(
mut materials: ResMut<Assets<StandardMaterial>>, mut materials: ResMut<Assets<StandardMaterial>>,
mut events: EventReader<SpawnCubeRequest>, mut events: EventReader<SpawnCubeRequest>,
) { ) {
for request in events.read() { for request in events.iter() {
// cube // cube
commands.spawn(( commands.spawn((
PbrBundle { PbrBundle {

View File

@@ -5,6 +5,7 @@ pub mod resources;
pub mod xr_input; pub mod xr_input;
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use std::time::Duration;
use crate::xr_input::oculus_touch::ActionSets; use crate::xr_input::oculus_touch::ActionSets;
use bevy::app::PluginGroupBuilder; use bevy::app::PluginGroupBuilder;
@@ -79,6 +80,7 @@ impl Plugin for OpenXrPlugin {
views, views,
frame_state, frame_state,
) = graphics::initialize_xr_graphics(primary_window).unwrap(); ) = graphics::initialize_xr_graphics(primary_window).unwrap();
std::thread::sleep(Duration::from_secs(5));
debug!("Configured wgpu adapter Limits: {:#?}", device.limits()); debug!("Configured wgpu adapter Limits: {:#?}", device.limits());
debug!("Configured wgpu adapter Features: {:#?}", device.features()); debug!("Configured wgpu adapter Features: {:#?}", device.features());
let mut future_xr_resources_inner = future_xr_resources_wrapper.lock().unwrap(); let mut future_xr_resources_inner = future_xr_resources_wrapper.lock().unwrap();