upgrade all code except d3d12 and upgrade all examples except demo

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2024-06-22 17:21:13 +02:00
parent d461594f9b
commit c1528d612f
15 changed files with 2026 additions and 725 deletions

View File

@@ -12,7 +12,7 @@ crate-type = ["rlib", "cdylib"]
[dependencies]
bevy = "0.13"
bevy.workspace = true
bevy_oxr.path = "../.."
openxr = { workspace = true, features = ["mint"] }

View File

@@ -1,3 +1,4 @@
use bevy::color::palettes;
use bevy::diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin};
use bevy::prelude::*;
use bevy::transform::components::Transform;
@@ -44,7 +45,7 @@ fn main() {
fn debug_hand_render(query: Query<&GlobalTransform, With<HandBone>>, mut gizmos: Gizmos) {
for transform in &query {
gizmos.sphere(transform.translation(), Quat::IDENTITY, 0.01, Color::RED);
gizmos.sphere(transform.translation(), Quat::IDENTITY, 0.01, palettes::css::RED);
}
}
@@ -56,21 +57,21 @@ fn setup(
) {
// plane
commands.spawn(PbrBundle {
mesh: meshes.add(Plane3d::new(Vec3::Y)),
material: materials.add(StandardMaterial::from(Color::rgb(0.3, 0.5, 0.3))),
mesh: meshes.add(Plane3d::new(Vec3::Y,Vec2::splat(2.5))),
material: materials.add(StandardMaterial::from(Color::srgb(0.3, 0.5, 0.3))),
..default()
});
// cube
commands.spawn(PbrBundle {
mesh: meshes.add(Cuboid::from_size(Vec3::splat(0.1)).mesh()),
material: materials.add(StandardMaterial::from(Color::rgb(0.8, 0.7, 0.6))),
material: materials.add(StandardMaterial::from(Color::srgb(0.8, 0.7, 0.6))),
transform: Transform::from_xyz(0.0, 0.5, 0.0),
..default()
});
// cube
commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(Cuboid::from_size(Vec3::splat(0.1)))),
material: materials.add(StandardMaterial::from(Color::rgb(0.8, 0.0, 0.0))),
material: materials.add(StandardMaterial::from(Color::srgb(0.8, 0.0, 0.0))),
transform: Transform::from_xyz(0.0, 0.5, 1.0),
..default()
});

View File

@@ -95,7 +95,7 @@ fn setup(
// cube
commands.spawn(PbrBundle {
mesh: meshes.add(Cuboid::from_size(Vec3::splat(0.1)).mesh()),
material: materials.add(StandardMaterial::from(Color::rgb(0.8, 0.7, 0.6))),
material: materials.add(StandardMaterial::from(Color::srgb(0.8, 0.7, 0.6))),
transform: Transform::from_xyz(0.0, 0.5, 0.0),
..default()
});

View File

@@ -92,14 +92,14 @@ fn setup(
) {
// plane
commands.spawn(PbrBundle {
mesh: meshes.add(Plane3d::new(Vec3::Y).mesh()),
material: materials.add(StandardMaterial::from(Color::rgb(0.3, 0.5, 0.3))),
mesh: meshes.add(Plane3d::new(Vec3::Y, Vec2::splat(2.5)).mesh()),
material: materials.add(StandardMaterial::from(Color::srgb(0.3, 0.5, 0.3))),
..default()
});
// cube
commands.spawn(PbrBundle {
mesh: meshes.add(Cuboid::from_size(Vec3::splat(0.1)).mesh()),
material: materials.add(StandardMaterial::from(Color::rgb(0.8, 0.7, 0.6))),
material: materials.add(StandardMaterial::from(Color::srgb(0.8, 0.7, 0.6))),
transform: Transform::from_xyz(0.0, 0.5, 0.0),
..default()
});