From 576a9b1d40f18ffd32c3b30c8330994ce8fa2cf7 Mon Sep 17 00:00:00 2001 From: NIMFER Date: Thu, 16 May 2024 01:57:10 +0200 Subject: [PATCH] disabled running `cargo check` on save in rust analizer, did a little bit of work on character controller --- .lapce/run.toml | 29 ----- .vscode/launch.json | 6 + .vscode/settings.json | 1 + Cargo.toml | 5 + src/player_utils/character_controller.rs | 145 +++++++++++------------ 5 files changed, 84 insertions(+), 102 deletions(-) delete mode 100644 .lapce/run.toml diff --git a/.lapce/run.toml b/.lapce/run.toml deleted file mode 100644 index 6133a35..0000000 --- a/.lapce/run.toml +++ /dev/null @@ -1,29 +0,0 @@ -# The run config is used for both run mode and debug mode - -[[configs]] -# the name of this task -name = "[Dev] Build and run" - -# the type of the debugger. If not set, it can't be debugged but can still be run -# type = "lldb" - -# the program to run -program = "nix-shell" - -# the program arguments, e.g. args = ["arg1", "arg2"], optional -args = ["--run"] - -# current working directory, optional -# cwd = "${workspace}" - -# enviroment variables, optional -# [configs.env] -# VAR1 = "VAL1" -# VAR2 = "VAL2" - -# task to run before the run/debug session is started, optional -# [configs.prelaunch] -# program = "cargo" -# args = [ -# "build", -# ] diff --git a/.vscode/launch.json b/.vscode/launch.json index 1325cc7..d26a71a 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -17,6 +17,12 @@ "request": "launch", "type": "node-terminal" }, + { + "command": "nix-shell --run 'cargo check'", + "name": "Check for errors", + "request": "launch", + "type": "node-terminal" + }, { "type": "lldb", "request": "launch", diff --git a/.vscode/settings.json b/.vscode/settings.json index ab4fd48..ef2f863 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,4 +6,5 @@ "Substep", "xpbd" ], + "rust-analyzer.checkOnSave": false, } \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index d6f4a87..5d0da92 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,11 @@ lto = true codegen-units = 1 strip = true + +[build] +rustflags = ["-Z", "threads=7"] + + [features] dev = [ "bevy/dynamic_linking", diff --git a/src/player_utils/character_controller.rs b/src/player_utils/character_controller.rs index 252e5e2..40e75bb 100644 --- a/src/player_utils/character_controller.rs +++ b/src/player_utils/character_controller.rs @@ -226,7 +226,7 @@ fn move_character( character_transform, ) in &mut query { - character_controller.friction = f32::max(0.0f, character_controller.friction); + //character_controller.friction = f32::max(0.0, character_controller.friction); let forward = character_transform.forward().xyz().normalize(); match event { @@ -248,6 +248,77 @@ fn move_character( } } +fn move_character( + time: Res