-
Notifications
You must be signed in to change notification settings - Fork 56
Migrating to bevy 0.19. #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9b1774f
df6425c
58dbe21
37e384d
3eaf7da
f69bdde
a774d5f
5ea4313
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| use avian2d::prelude::*; | ||
| use bevy::{ecs::system::SystemParam, prelude::*}; | ||
| use crate::{Collider, Position, Rotation}; | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait what? These are Avian types - why are you importing them from |
||
| use avian2d::collision::collider::{CollisionLayers, Sensor}; | ||
| use bevy::ecs::{query::Has, system::Query}; | ||
| use bevy_tnua_physics_integration_layer::{ | ||
| math::{Float, Vector3}, | ||
| spatial_ext::{TnuaPointProjectionResult, TnuaSpatialExt}, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,7 +43,7 @@ avian2d = ["avian", "dep:avian2d", "dep:bevy-tnua-avian2d"] | |
| avian3d = ["avian", "dep:avian3d", "dep:bevy-tnua-avian3d"] | ||
|
|
||
| [dependencies] | ||
| bevy = { version = "^0.18", default-features = false, features = [ | ||
| bevy = { version = "^0.19", default-features = false, features = [ | ||
| "gltf_animation", | ||
| "bevy_asset", | ||
| # "bevy_audio", | ||
|
|
@@ -52,6 +52,8 @@ bevy = { version = "^0.18", default-features = false, features = [ | |
| # "bevy_winit", | ||
| "bevy_render", | ||
| "bevy_gltf", | ||
| "system_font_discovery", | ||
| "bevy_pbr", | ||
| "ktx2", | ||
| "zstd_rust", | ||
| "tonemapping_luts", | ||
|
|
@@ -71,27 +73,28 @@ bevy = { version = "^0.18", default-features = false, features = [ | |
| bevy-tnua = { path = ".." } | ||
| bevy-tnua-physics-integration-layer = { path = "../physics-integration-layer" } | ||
|
|
||
| bevy_rapier2d = { version = "^0.33", features = ["debug-render-2d"], optional = true } | ||
| bevy_rapier2d = { version = "^0.34", features = ["debug-render-2d"], optional = true } | ||
| bevy-tnua-rapier2d = { path = "../rapier2d", optional = true } | ||
|
|
||
| bevy_rapier3d = { version = "^0.33", features = ["debug-render-3d"], optional = true } | ||
| bevy_rapier3d = { version = "^0.34", features = ["debug-render-3d"], optional = true } | ||
| bevy-tnua-rapier3d = { path = "../rapier3d", optional = true } | ||
| avian2d = { version = "^0.7", default-features = false, features = ["2d","debug-plugin", "parry-f32", "parallel"], optional = true} | ||
|
|
||
| avian2d = { version = "^0.6", default-features = false, features = ["2d","debug-plugin", "parallel"], optional = true} | ||
| bevy-tnua-avian2d = { path = "../avian2d", default-features = false, optional = true } | ||
|
|
||
| avian3d = { version = "^0.6", default-features = false, features = ["3d","debug-plugin", "parallel"], optional = true } | ||
| avian3d = { version = "^0.7", default-features = false, features = ["3d", "debug-plugin", "parallel", "parry-f32"], optional=true } | ||
| bevy-tnua-avian3d = { path = "../avian3d", default-features = false, optional = true } | ||
|
|
||
| bevy_egui = { version = "0.39", optional = true, default-features = false, features = ["default_fonts", "render"] } | ||
| egui_plot = { version = "0.34", optional = true } | ||
| egui_extras = { version = "0.33", optional = true } | ||
| bevy_egui = { version = "0.40", optional = true, default-features = false, features = ["bevy_ui", "default_fonts", "render"] } | ||
| egui_plot = { version = "0.35", optional = true } | ||
| egui_extras = { version = "0.34", optional = true } | ||
|
|
||
| bevy_framepace = { version = "0.21", optional = true } | ||
|
|
||
| clap = { version = "^4", features = ["derive"] } | ||
| ordered-float = "5.0.0" | ||
| serde = { version = "1.0.228", features = ["derive"] } | ||
| bevy_ecs = "0.19.0" | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don't. When you need to import something from |
||
|
|
||
| [target.'cfg(target_arch = "wasm32")'.dependencies] | ||
| web-sys = { version = "^0.3", features = ["Window", "Location", "Url", "UrlSearchParams"] } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -203,13 +203,13 @@ fn setup_player( | |
| "Sensor Shape", | ||
| 1, | ||
| &[ | ||
| ("Point", |mut cmd| { | ||
| ("Point", |_cmd| { | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uh... no? |
||
| #[cfg(feature = "rapier2d")] | ||
| cmd.remove::<TnuaRapier2dSensorShape>(); | ||
| #[cfg(feature = "avian2d")] | ||
| cmd.remove::<TnuaAvian2dSensorShape>(); | ||
| }), | ||
| ("Flat (underfit)", |mut cmd| { | ||
| ("Flat (underfit)", |_cmd| { | ||
| #[cfg(feature = "rapier2d")] | ||
| cmd.insert(TnuaRapier2dSensorShape( | ||
| bevy_rapier2d::parry::shape::SharedShape::cuboid(0.49, 0.0), | ||
|
|
@@ -219,15 +219,15 @@ fn setup_player( | |
| 0.99, 0.0, | ||
| ))); | ||
| }), | ||
| ("Flat (exact)", |mut cmd| { | ||
| ("Flat (exact)", |_cmd| { | ||
| #[cfg(feature = "rapier2d")] | ||
| cmd.insert(TnuaRapier2dSensorShape( | ||
| bevy_rapier2d::parry::shape::SharedShape::cuboid(0.5, 0.0), | ||
| )); | ||
| #[cfg(feature = "avian2d")] | ||
| cmd.insert(TnuaAvian2dSensorShape(avian::Collider::rectangle(1.0, 0.0))); | ||
| }), | ||
| ("flat (overfit)", |mut cmd| { | ||
| ("flat (overfit)", |_cmd| { | ||
| #[cfg(feature = "rapier2d")] | ||
| cmd.insert(TnuaRapier2dSensorShape( | ||
| bevy_rapier2d::parry::shape::SharedShape::cuboid(0.51, 0.0), | ||
|
|
@@ -237,15 +237,15 @@ fn setup_player( | |
| 1.01, 0.0, | ||
| ))); | ||
| }), | ||
| ("Ball (underfit)", |mut cmd| { | ||
| ("Ball (underfit)", |_cmd| { | ||
| #[cfg(feature = "rapier2d")] | ||
| cmd.insert(TnuaRapier2dSensorShape( | ||
| bevy_rapier2d::parry::shape::SharedShape::ball(0.49), | ||
| )); | ||
| #[cfg(feature = "avian2d")] | ||
| cmd.insert(TnuaAvian2dSensorShape(avian::Collider::circle(0.49))); | ||
| }), | ||
| ("Ball (exact)", |mut cmd| { | ||
| ("Ball (exact)", |_cmd| { | ||
| #[cfg(feature = "rapier2d")] | ||
| cmd.insert(TnuaRapier2dSensorShape( | ||
| bevy_rapier2d::parry::shape::SharedShape::ball(0.5), | ||
|
|
@@ -255,7 +255,7 @@ fn setup_player( | |
| }), | ||
| ], | ||
| ) | ||
| .with_checkbox("Lock Tilt", false, |mut cmd, lock_tilt| { | ||
| .with_checkbox("Lock Tilt", false, |_cmd, lock_tilt| { | ||
| // Tnua will automatically apply angular impulses/forces to fix the tilt and make | ||
| // the character stand upward, but it is also possible to just let the physics | ||
| // engine prevent rotation (other than around the Y axis, for turning) | ||
|
|
@@ -274,7 +274,7 @@ fn setup_player( | |
| .with_checkbox( | ||
| "Phase Through Collision Groups", | ||
| true, | ||
| |mut cmd, use_collision_groups| { | ||
| |_cmd, _use_collision_groups| { | ||
| #[cfg(feature = "rapier2d")] | ||
| if use_collision_groups { | ||
| cmd.insert(CollisionGroups { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove the prelude import? This is the usual way to do import these things in Rust.