diff --git a/Cargo.lock b/Cargo.lock index 78e8bcff..49b9bc2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -309,7 +309,6 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "avian3d" version = "0.1.2" -source = "git+https://github.com/Jondolf/avian#a5616dd194aecfef294d70ad9294d20ac68a49d4" dependencies = [ "avian_derive", "bevy", @@ -327,7 +326,6 @@ dependencies = [ [[package]] name = "avian_derive" version = "0.1.0" -source = "git+https://github.com/Jondolf/avian#a5616dd194aecfef294d70ad9294d20ac68a49d4" dependencies = [ "proc-macro-error", "proc-macro2", @@ -338,7 +336,6 @@ dependencies = [ [[package]] name = "avian_interpolation3d" version = "0.1.0" -source = "git+https://github.com/janhohenheim/avian_interpolation#d51dca2e8601d45d8f04cb7e9da0362d9a0b3186" dependencies = [ "avian3d", "bevy", @@ -413,7 +410,6 @@ dependencies = [ [[package]] name = "bevy-tnua" version = "0.19.0" -source = "git+https://github.com/janhohenheim/bevy-tnua?branch=fix-minor-avian-stuff#6099a73bfb1b550345dec7ac3802c91aaa3d579a" dependencies = [ "bevy", "bevy-tnua-physics-integration-layer", @@ -423,7 +419,6 @@ dependencies = [ [[package]] name = "bevy-tnua-avian3d" version = "0.1.1" -source = "git+https://github.com/janhohenheim/bevy-tnua?branch=fix-minor-avian-stuff#6099a73bfb1b550345dec7ac3802c91aaa3d579a" dependencies = [ "avian3d", "bevy", @@ -433,7 +428,6 @@ dependencies = [ [[package]] name = "bevy-tnua-physics-integration-layer" version = "0.4.0" -source = "git+https://github.com/janhohenheim/bevy-tnua?branch=fix-minor-avian-stuff#6099a73bfb1b550345dec7ac3802c91aaa3d579a" dependencies = [ "bevy", ] @@ -1407,7 +1401,7 @@ dependencies = [ [[package]] name = "blenvy" version = "0.1.0-alpha.1" -source = "git+https://github.com/janhohenheim/blenvy?branch=scheduling#98010b116d7475c082fda6c9d2d01537b28fd8f7" +source = "git+https://github.com/janhohenheim/blenvy?branch=initialization#21142bf84655c3d2b5f6d04e361336afe7ca8078" dependencies = [ "bevy", "bevy_common_assets", diff --git a/Cargo.toml b/Cargo.toml index 2da4b72a..67415675 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,14 +7,14 @@ edition = "2021" [dependencies] # Bevy dependencies bevy = { version = "0.14.2", features = ["wayland"] } -blenvy = { version = "0.1.0-alpha.1", git = "https://github.com/janhohenheim/blenvy", branch = "scheduling"} -avian3d = { git = "https://github.com/Jondolf/avian" } -avian_interpolation3d = { git = "https://github.com/janhohenheim/avian_interpolation", version = "0.1.0" } +blenvy = { version = "0.1.0-alpha.1", git = "https://github.com/janhohenheim/blenvy", branch = "initialization" } +avian3d = { path = "../avian/crates/avian3d" } +avian_interpolation3d = { path = "../avian_interpolation/crates/avian_interpolation3d" } bevy-inspector-egui = { version = "0.25.2", optional = true } leafwing-input-manager = { git = "https://github.com/Leafwing-Studios/leafwing_input_manager" } bevy_dolly = "0.0.4" -bevy-tnua-avian3d = { version = "0.1.1", git = "https://github.com/janhohenheim/bevy-tnua", branch = "fix-minor-avian-stuff" } -bevy-tnua = { version = "0.19.0", git = "https://github.com/janhohenheim/bevy-tnua", branch = "fix-minor-avian-stuff"} +bevy-tnua-avian3d = { version = "0.1.1", path = "../bevy-tnua/avian3d" } +bevy-tnua = { version = "0.19.0", path = "../bevy-tnua/"} # Generic dependencies rand = "0.8" diff --git a/assets/registry.json b/assets/registry.json index ce266230..3cce2f3f 100644 --- a/assets/registry.json +++ b/assets/registry.json @@ -3159,6 +3159,11 @@ "$ref": "#/$defs/bool" } }, + "transform_to_collider_scale": { + "type": { + "$ref": "#/$defs/bool" + } + }, "transform_to_position": { "type": { "$ref": "#/$defs/bool" @@ -3167,7 +3172,8 @@ }, "required": [ "position_to_transform", - "transform_to_position" + "transform_to_position", + "transform_to_collider_scale" ], "short_name": "SyncConfig", "type": "object", @@ -16483,6 +16489,28 @@ "type": "string", "typeInfo": "Enum" }, + "blenvy::save_load::Dynamic": { + "additionalProperties": false, + "isComponent": true, + "isResource": false, + "long_name": "blenvy::save_load::Dynamic", + "properties": {}, + "required": [], + "short_name": "Dynamic", + "type": "object", + "typeInfo": "Struct" + }, + "blenvy::save_load::StaticEntitiesRoot": { + "additionalProperties": false, + "isComponent": true, + "isResource": false, + "long_name": "blenvy::save_load::StaticEntitiesRoot", + "properties": {}, + "required": [], + "short_name": "StaticEntitiesRoot", + "type": "object", + "typeInfo": "Struct" + }, "bool": { "isComponent": false, "isResource": false, diff --git a/src/hacks.rs b/src/hacks.rs index 80366612..1c0c5b4c 100644 --- a/src/hacks.rs +++ b/src/hacks.rs @@ -1,17 +1,6 @@ -use avian3d::prelude::*; -use bevy::prelude::*; +use avian3d::{prelude::*, sync::SyncConfig}; +use bevy::{ecs::system::RunSystemOnce as _, prelude::*}; -pub(super) fn plugin(app: &mut App) { - app.observe(fix_collider); +pub(super) fn plugin(_app: &mut App) { } -fn fix_collider( - trigger: Trigger, - mut q_floor: Query<(&GlobalTransform, &mut Collider)>, -) { - let Ok((transform, mut collider)) = q_floor.get_mut(trigger.entity()) else { - return; - }; - let transform = transform.compute_transform(); - collider.set_scale(transform.scale, 10); -} diff --git a/src/lib.rs b/src/lib.rs index de14680b..af5b0751 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,7 +13,7 @@ mod system_set; mod theme; mod ui_camera; -use avian3d::PhysicsPlugins; +use avian3d::{prelude::SyncPlugin, sync::SyncConfig, PhysicsPlugins}; use avian_interpolation3d::prelude::*; use bevy::{ asset::AssetMetaCheck, @@ -79,9 +79,10 @@ impl Plugin for AppPlugin { ); // Add third party plugins. + app.init_resource::(); app.add_plugins(( BlenvyPlugin::default(), - PhysicsPlugins::default(), + PhysicsPlugins::default().build().disable::(), AvianInterpolationPlugin::default(), )); diff --git a/src/player/camera/first_person.rs b/src/player/camera/first_person.rs index de2b36ec..67be7fd1 100644 --- a/src/player/camera/first_person.rs +++ b/src/player/camera/first_person.rs @@ -57,19 +57,14 @@ pub fn first_person_camera_bundle() -> impl Bundle { } fn follow_player( - time: Res