doesn't really work, but some good ideas
This commit is contained in:
parent
52cac4a3eb
commit
35655d3f3c
4 changed files with 305 additions and 150 deletions
197
Cargo.lock
generated
197
Cargo.lock
generated
|
@ -219,14 +219,15 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "async-executor"
|
||||
version = "1.13.1"
|
||||
version = "1.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec"
|
||||
checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa"
|
||||
dependencies = [
|
||||
"async-task",
|
||||
"concurrent-queue",
|
||||
"fastrand",
|
||||
"futures-lite",
|
||||
"pin-project-lite",
|
||||
"slab",
|
||||
]
|
||||
|
||||
|
@ -288,8 +289,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
|
|||
|
||||
[[package]]
|
||||
name = "avian3d"
|
||||
version = "0.2.0"
|
||||
source = "git+https://github.com/Jondolf/avian?branch=main#50d01bc837f3e1a95bba03673925848a543c3c5e"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e8ba10c23fee3d432f3c6cf8d036e269d952b8840c1ca4fa6a021ab926786dc4"
|
||||
dependencies = [
|
||||
"avian_derive",
|
||||
"bevy",
|
||||
|
@ -306,7 +308,8 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "avian_derive"
|
||||
version = "0.2.2"
|
||||
source = "git+https://github.com/Jondolf/avian?branch=main#50d01bc837f3e1a95bba03673925848a543c3c5e"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "12b257f601a1535e0d4a7a7796f535e3a13de62fd422b16dff7c14d27f0d4048"
|
||||
dependencies = [
|
||||
"proc-macro-error2",
|
||||
"proc-macro2",
|
||||
|
@ -715,8 +718,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "bevy_heavy"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/Jondolf/bevy_heavy#3905efe581700296de8f48d33388c5471dfca785"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "34ccc861fea2ff58c67f4df119512e204050bd7631a3a9c65e1a5e9d162cce28"
|
||||
dependencies = [
|
||||
"bevy_math",
|
||||
"bevy_reflect",
|
||||
|
@ -1265,8 +1269,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "bevy_transform_interpolation"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/Jondolf/bevy_transform_interpolation#9fd7fe92c32e2d30e38b80566dfa7b740119b593"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "72c7c6c4e6a3d5415b3a29a17bd20c17cd0e2f068b96b24e263316d58d5346ea"
|
||||
dependencies = [
|
||||
"bevy",
|
||||
]
|
||||
|
@ -1485,9 +1490,9 @@ checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf"
|
|||
|
||||
[[package]]
|
||||
name = "bytemuck"
|
||||
version = "1.22.0"
|
||||
version = "1.23.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540"
|
||||
checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c"
|
||||
dependencies = [
|
||||
"bytemuck_derive",
|
||||
]
|
||||
|
@ -1537,9 +1542,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.20"
|
||||
version = "1.2.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04da6a0d40b948dfc4fa8f5bbf402b0fc1a64a28dbf7d12ffd683550f2c1b63a"
|
||||
checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1"
|
||||
dependencies = [
|
||||
"jobserver",
|
||||
"libc",
|
||||
|
@ -1820,11 +1825,11 @@ checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929"
|
|||
|
||||
[[package]]
|
||||
name = "ctrlc"
|
||||
version = "3.4.6"
|
||||
version = "3.4.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "697b5419f348fd5ae2478e8018cb016c00a5881c7f46c717de98ffd135a5651c"
|
||||
checksum = "46f93780a459b7d656ef7f071fe699c4d3d2cb201c4b24d085b6ddc505276e73"
|
||||
dependencies = [
|
||||
"nix",
|
||||
"nix 0.30.1",
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
|
@ -1911,9 +1916,9 @@ checksum = "ea8a8b81cacc08888170eef4d13b775126db426d0b348bee9d18c2c1eaf123cf"
|
|||
|
||||
[[package]]
|
||||
name = "dpi"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f25c0e292a7ca6d6498557ff1df68f32c99850012b6ea401cf8daf771f22ff53"
|
||||
checksum = "d8b14ccef22fc6f5a8f4d7d768562a182c04ce9a3b3157b91390b52ddfdf1a76"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
|
@ -2063,9 +2068,9 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
|||
|
||||
[[package]]
|
||||
name = "font-types"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fa6a5e5a77b5f3f7f9e32879f484aa5b3632ddfbe568a16266c904a6f32cdaf"
|
||||
checksum = "02a596f5713680923a2080d86de50fe472fb290693cf0f701187a1c8b36996b7"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
]
|
||||
|
@ -2179,9 +2184,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "getrandom"
|
||||
version = "0.3.2"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0"
|
||||
checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
|
@ -2215,7 +2220,7 @@ dependencies = [
|
|||
"libc",
|
||||
"libudev-sys",
|
||||
"log",
|
||||
"nix",
|
||||
"nix 0.29.0",
|
||||
"uuid",
|
||||
"vec_map",
|
||||
"wasm-bindgen",
|
||||
|
@ -2397,9 +2402,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "hashbrown"
|
||||
version = "0.15.2"
|
||||
version = "0.15.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
|
||||
checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3"
|
||||
dependencies = [
|
||||
"allocator-api2",
|
||||
"equivalent",
|
||||
|
@ -2567,7 +2572,7 @@ version = "0.1.33"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a"
|
||||
dependencies = [
|
||||
"getrandom 0.3.2",
|
||||
"getrandom 0.3.3",
|
||||
"libc",
|
||||
]
|
||||
|
||||
|
@ -2632,19 +2637,19 @@ checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
|
|||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
version = "0.8.6"
|
||||
version = "0.8.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
|
||||
checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"windows-targets 0.52.6",
|
||||
"windows-targets 0.53.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libm"
|
||||
version = "0.2.13"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9627da5196e5d8ed0b0495e61e518847578da83483c37288316d9b2e03a7f72"
|
||||
checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
|
||||
|
||||
[[package]]
|
||||
name = "libredox"
|
||||
|
@ -2654,7 +2659,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
|
|||
dependencies = [
|
||||
"bitflags 2.9.0",
|
||||
"libc",
|
||||
"redox_syscall 0.5.11",
|
||||
"redox_syscall 0.5.12",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2914,6 +2919,18 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.30.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
|
||||
dependencies = [
|
||||
"bitflags 2.9.0",
|
||||
"cfg-if",
|
||||
"cfg_aliases",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "7.1.3"
|
||||
|
@ -3347,7 +3364,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
|
|||
dependencies = [
|
||||
"cfg-if",
|
||||
"libc",
|
||||
"redox_syscall 0.5.11",
|
||||
"redox_syscall 0.5.12",
|
||||
"smallvec",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
@ -3663,9 +3680,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
|
|||
|
||||
[[package]]
|
||||
name = "read-fonts"
|
||||
version = "0.25.3"
|
||||
version = "0.29.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f6f9e8a4f503e5c8750e4cd3b32a4e090035c46374b305a15c70bad833dca05f"
|
||||
checksum = "5ce8e2ca6b24313587a03ca61bb74c384e2a815bd90cf2866cfc9f5fb7a11fa0"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"font-types",
|
||||
|
@ -3688,9 +3705,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "redox_syscall"
|
||||
version = "0.5.11"
|
||||
version = "0.5.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3"
|
||||
checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af"
|
||||
dependencies = [
|
||||
"bitflags 2.9.0",
|
||||
]
|
||||
|
@ -3747,9 +3764,9 @@ checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832"
|
|||
|
||||
[[package]]
|
||||
name = "robust"
|
||||
version = "1.1.0"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cbf4a6aa5f6d6888f39e980649f3ad6b666acdce1d78e95b8a2cb076e687ae30"
|
||||
checksum = "4e27ee8bb91ca0adcf0ecb116293afa12d393f9c2b9b9cd54d33e8078fe19839"
|
||||
|
||||
[[package]]
|
||||
name = "rodio"
|
||||
|
@ -3840,9 +3857,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "ruzstd"
|
||||
version = "0.8.0"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c581601827da5c717bfae77d7b187e54293d23d8fb6b700b4b5e9b5828a13cc3"
|
||||
checksum = "3640bec8aad418d7d03c72ea2de10d5c646a598f9883c7babc160d91e3c1b26c"
|
||||
dependencies = [
|
||||
"twox-hash",
|
||||
]
|
||||
|
@ -3957,9 +3974,9 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
|
|||
|
||||
[[package]]
|
||||
name = "skrifa"
|
||||
version = "0.26.6"
|
||||
version = "0.31.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8cc1aa86c26dbb1b63875a7180aa0819709b33348eb5b1491e4321fae388179d"
|
||||
checksum = "bbe6666ab11018ab91ff7b03f1a3b9fdbecfb610848436fefa5ce50343d3d913"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"read-fonts",
|
||||
|
@ -4076,9 +4093,9 @@ checksum = "0193cc4331cfd2f3d2011ef287590868599a2f33c3e69bc22c1a3d3acf9e02fb"
|
|||
|
||||
[[package]]
|
||||
name = "swash"
|
||||
version = "0.2.2"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fae9a562c7b46107d9c78cd78b75bbe1e991c16734c0aee8ff0ee711fb8b620a"
|
||||
checksum = "5dce3f0af95643c855cdc449fbaa17d8c2cd08e0b00a49a6babcbe6e71667f3d"
|
||||
dependencies = [
|
||||
"skrifa",
|
||||
"yazi",
|
||||
|
@ -4087,9 +4104,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.100"
|
||||
version = "2.0.101"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"
|
||||
checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -4212,9 +4229,9 @@ checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3"
|
|||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.22.25"
|
||||
version = "0.22.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "10558ed0bd2a1562e630926a2d1f0b98c827da99fabd3fe20920a59642504485"
|
||||
checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"toml_datetime",
|
||||
|
@ -4404,7 +4421,7 @@ version = "1.16.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9"
|
||||
dependencies = [
|
||||
"getrandom 0.3.2",
|
||||
"getrandom 0.3.3",
|
||||
"js-sys",
|
||||
"serde",
|
||||
"wasm-bindgen",
|
||||
|
@ -5010,13 +5027,29 @@ dependencies = [
|
|||
"windows_aarch64_gnullvm 0.52.6",
|
||||
"windows_aarch64_msvc 0.52.6",
|
||||
"windows_i686_gnu 0.52.6",
|
||||
"windows_i686_gnullvm",
|
||||
"windows_i686_gnullvm 0.52.6",
|
||||
"windows_i686_msvc 0.52.6",
|
||||
"windows_x86_64_gnu 0.52.6",
|
||||
"windows_x86_64_gnullvm 0.52.6",
|
||||
"windows_x86_64_msvc 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.53.0",
|
||||
"windows_aarch64_msvc 0.53.0",
|
||||
"windows_i686_gnu 0.53.0",
|
||||
"windows_i686_gnullvm 0.53.0",
|
||||
"windows_i686_msvc 0.53.0",
|
||||
"windows_x86_64_gnu 0.53.0",
|
||||
"windows_x86_64_gnullvm 0.53.0",
|
||||
"windows_x86_64_msvc 0.53.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.42.2"
|
||||
|
@ -5035,6 +5068,12 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.42.2"
|
||||
|
@ -5053,6 +5092,12 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.42.2"
|
||||
|
@ -5071,12 +5116,24 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.42.2"
|
||||
|
@ -5095,6 +5152,12 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.42.2"
|
||||
|
@ -5113,6 +5176,12 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.42.2"
|
||||
|
@ -5131,6 +5200,12 @@ version = "0.52.6"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.42.2"
|
||||
|
@ -5150,10 +5225,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||
|
||||
[[package]]
|
||||
name = "winit"
|
||||
version = "0.30.9"
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.53.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a809eacf18c8eca8b6635091543f02a5a06ddf3dad846398795460e6e0ae3cc0"
|
||||
checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486"
|
||||
|
||||
[[package]]
|
||||
name = "winit"
|
||||
version = "0.30.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0d05bd8908e14618c9609471db04007e644fd9cce6529756046cfc577f9155e"
|
||||
dependencies = [
|
||||
"android-activity",
|
||||
"atomic-waker",
|
||||
|
@ -5195,9 +5276,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "winnow"
|
||||
version = "0.7.7"
|
||||
version = "0.7.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6cb8234a863ea0e8cd7284fcdd4f145233eb00fee02bbdd9861aec44e6477bc5"
|
||||
checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
|
@ -5276,9 +5357,9 @@ checksum = "e01738255b5a16e78bbb83e7fbba0a1e7dd506905cfc53f4622d89015a03fbb5"
|
|||
|
||||
[[package]]
|
||||
name = "zeno"
|
||||
version = "0.3.2"
|
||||
version = "0.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cc0de2315dc13d00e5df3cd6b8d2124a6eaec6a2d4b6a1c5f37b7efad17fcc17"
|
||||
checksum = "6df3dc4292935e51816d896edcd52aa30bc297907c26167fec31e2b0c6a32524"
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
|
|
|
@ -9,10 +9,8 @@ bevy = { version = "0.16", features = ["bevy_dev_tools", "configurable_error_han
|
|||
|
||||
[dependencies.avian3d]
|
||||
default-features = false
|
||||
#version = "0.2"
|
||||
git = "https://github.com/Jondolf/avian"
|
||||
branch = "main"
|
||||
features = ["3d", "f32", "parry-f32", "debug-plugin", "default-collider", "collider-from-mesh"]
|
||||
version = "0.3"
|
||||
features = ["3d", "parry-f32", "debug-plugin", "collider-from-mesh", "diagnostic_ui"]
|
||||
|
||||
|
||||
[features]
|
||||
|
|
12
src/bike.rs
12
src/bike.rs
|
@ -21,10 +21,10 @@ use crate::physics::CatControllerState;
|
|||
pub const SPRING_CONSTANT: Scalar = 40.0;
|
||||
pub const DAMPING_CONSTANT: Scalar = 10.0;
|
||||
pub const WHEEL_RADIUS: Scalar = 0.4;
|
||||
pub const REST_DISTANCE: Scalar = 1.5 + WHEEL_RADIUS;
|
||||
pub const REST_DISTANCE: Scalar = 1.0 + WHEEL_RADIUS;
|
||||
pub const FRICTION_COEFF: Scalar = 0.9;
|
||||
pub const FRONT_ATTACH: Vec3 = Vec3::new(0.0, 0.0, -0.5);
|
||||
pub const REAR_ATTACH: Vec3 = Vec3::new(0.0, 0.0, 0.5);
|
||||
pub const FRONT_ATTACH: Vec3 = Vec3::new(0.0, 0.0, -1.5);
|
||||
pub const REAR_ATTACH: Vec3 = Vec3::new(0.0, 0.0, 1.5);
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct CyberBikeBody;
|
||||
|
@ -141,9 +141,9 @@ fn spawn_children(
|
|||
let mesh = meshes.add(mesh);
|
||||
let material = materials.add(wheel_material);
|
||||
|
||||
let front_rake = Vec3::new(0.0, -1.0, -0.9).normalize(); // about 30 degrees
|
||||
let front_rake = Vec3::new(0.0, -1.0, 0.0); // about 30 degrees
|
||||
let front_wheel_pos = FRONT_ATTACH + (front_rake * REST_DISTANCE);
|
||||
let rear_rake = Vec3::new(0.0, -1.0, 0.9).normalize();
|
||||
let rear_rake = Vec3::new(0.0, -1.0, 0.0);
|
||||
let rear_wheel_pos = REAR_ATTACH + (rear_rake * REST_DISTANCE);
|
||||
|
||||
children![
|
||||
|
@ -161,7 +161,7 @@ fn spawn_children(
|
|||
WheelConfig::new(
|
||||
FRONT_ATTACH,
|
||||
REST_DISTANCE,
|
||||
SPRING_CONSTANT - 5.0,
|
||||
SPRING_CONSTANT - 25.0,
|
||||
DAMPING_CONSTANT,
|
||||
FRICTION_COEFF,
|
||||
WHEEL_RADIUS,
|
||||
|
|
240
src/physics.rs
240
src/physics.rs
|
@ -20,9 +20,9 @@ pub struct CatControllerSettings {
|
|||
impl Default for CatControllerSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
kp: 60.0,
|
||||
kd: 30.0,
|
||||
ki: 0.0,
|
||||
kp: 40.0,
|
||||
kd: 14.0,
|
||||
ki: 2.0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ impl Default for CatControllerState {
|
|||
|
||||
impl CatControllerState {
|
||||
pub fn update_roll(&mut self, error: f32, dt: f32) -> (f32, f32) {
|
||||
dbg!(error);
|
||||
let lim = self.roll_limit;
|
||||
self.roll_integral = (self.roll_integral + (error * dt)).min(lim).max(-lim);
|
||||
let derivative = (error - self.roll_prev) / dt;
|
||||
|
@ -55,14 +56,15 @@ impl CatControllerState {
|
|||
}
|
||||
|
||||
mod systems {
|
||||
use std::f32::consts::{FRAC_PI_3, FRAC_PI_4};
|
||||
use std::f32::consts::FRAC_PI_4;
|
||||
|
||||
use avian3d::prelude::{
|
||||
ComputedCenterOfMass, ExternalForce, ExternalTorque, Gravity, LinearVelocity, RayCaster,
|
||||
RayHits, RigidBodyQueryReadOnly,
|
||||
AngularVelocity, Collider, ComputedCenterOfMass, ExternalForce, ExternalTorque, Gravity,
|
||||
LinearVelocity, PhysicsDiagnosticsUiSettings, RayCaster, RayHits, RigidBodyQueryReadOnly,
|
||||
};
|
||||
use bevy::{
|
||||
ecs::system::{Populated, Single},
|
||||
ecs::system::{Populated, Query, Single},
|
||||
gizmos::retained::Gizmo,
|
||||
prelude::{
|
||||
ButtonInput, Color, Gizmos, GlobalTransform, KeyCode, Quat, Res, ResMut, Time,
|
||||
Transform, Vec, Vec3, With, Without,
|
||||
|
@ -87,60 +89,105 @@ mod systems {
|
|||
}
|
||||
|
||||
pub(super) fn calculate_lean(
|
||||
bike_state: Single<(&LinearVelocity, &Transform), With<CyberBikeBody>>,
|
||||
wheels: Populated<&GlobalTransform, With<CyberWheel>>,
|
||||
input: Res<InputState>,
|
||||
velocities: Single<(&LinearVelocity, &AngularVelocity), With<CyberBikeBody>>,
|
||||
wheels: Populated<(&GlobalTransform, &CyberWheel), With<Collider>>,
|
||||
gravity: Res<Gravity>,
|
||||
mut lean: ResMut<CyberLean>,
|
||||
mut gizmos: Gizmos,
|
||||
) {
|
||||
let mut wheels = wheels.iter();
|
||||
let w1 = wheels.next().unwrap();
|
||||
let w2 = wheels.next().unwrap();
|
||||
let base = (w1.translation() - w2.translation()).length().abs();
|
||||
let (velocity, xform) = bike_state.into_inner();
|
||||
let vel = velocity.dot(*xform.forward());
|
||||
let v_squared = vel.powi(2);
|
||||
let steering_angle = yaw_to_angle(input.yaw);
|
||||
let radius = base / steering_angle.tan();
|
||||
let gravity = gravity.0.length();
|
||||
let v2_r = v_squared / radius;
|
||||
let tan_theta = (v2_r / gravity).clamp(-FRAC_PI_3, FRAC_PI_3);
|
||||
let mut w1 = GlobalTransform::default();
|
||||
let mut w2 = GlobalTransform::default();
|
||||
for (xform, wheel) in wheels.iter() {
|
||||
match wheel {
|
||||
CyberWheel::Front => w1 = *xform,
|
||||
CyberWheel::Rear => w2 = *xform,
|
||||
}
|
||||
}
|
||||
let wheelbase = (w2.translation() - w1.translation()).normalize();
|
||||
|
||||
let (lin_vel, ang_vel) = velocities.into_inner();
|
||||
|
||||
let right = wheelbase.cross(gravity.0).normalize();
|
||||
let up = -right.cross(wheelbase).normalize();
|
||||
let spin = ang_vel.dot(up);
|
||||
|
||||
let mid = (w2.translation() + w1.translation()) / 2.0;
|
||||
|
||||
gizmos.arrow(mid, mid + (up * 5.0), Color::linear_rgb(0.0, 1.0, 1.0));
|
||||
|
||||
let period = if spin.is_normal() {
|
||||
1.0 / spin
|
||||
} else {
|
||||
f32::MAX
|
||||
};
|
||||
|
||||
let radius = lin_vel.length() * period;
|
||||
let gravity = gravity.0.dot(up);
|
||||
let tan_theta = lin_vel.length_squared() / (radius * gravity);
|
||||
|
||||
if tan_theta.is_normal() {
|
||||
lean.lean = tan_theta.atan().clamp(-FRAC_PI_3, FRAC_PI_3);
|
||||
lean.lean = tan_theta.atan();
|
||||
} else {
|
||||
//lean.lean = 0.0;
|
||||
lean.lean = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn clear(
|
||||
mut forces: Query<&mut ExternalForce>,
|
||||
mut torques: Query<&mut ExternalTorque>,
|
||||
) {
|
||||
for mut force in forces.iter_mut() {
|
||||
force.clear();
|
||||
}
|
||||
for mut torq in torques.iter_mut() {
|
||||
torq.clear();
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn apply_lean(
|
||||
bike_query: Single<(&Transform, &mut ExternalTorque, &mut CatControllerState)>,
|
||||
wheels: Populated<(&WheelState, &GlobalTransform, &CyberWheel)>,
|
||||
bike_query: Single<(
|
||||
&Transform,
|
||||
&mut ExternalTorque,
|
||||
&mut CatControllerState,
|
||||
&ComputedCenterOfMass,
|
||||
)>,
|
||||
wheels: Populated<(&WheelState, &CyberWheel)>,
|
||||
time: Res<Time>,
|
||||
settings: Res<CatControllerSettings>,
|
||||
lean: Res<CyberLean>,
|
||||
mut gizmos: Gizmos,
|
||||
) {
|
||||
let (xform, mut torque, mut control_vars) = bike_query.into_inner();
|
||||
let (xform, mut force, mut control_vars, ComputedCenterOfMass(com)) =
|
||||
bike_query.into_inner();
|
||||
|
||||
let mut factor = 1.0;
|
||||
let mut rxform = GlobalTransform::default();
|
||||
let mut fxform = GlobalTransform::default();
|
||||
for (wheel_state, xform, cwheel) in wheels.iter() {
|
||||
if wheel_state.contact_point.is_none() {
|
||||
factor -= 0.25;
|
||||
}
|
||||
match cwheel {
|
||||
CyberWheel::Front => {
|
||||
fxform = *xform;
|
||||
}
|
||||
CyberWheel::Rear => {
|
||||
rxform = *xform;
|
||||
let mut front = None;
|
||||
let mut rear = None;
|
||||
let mut normal = None;
|
||||
for (state, wheel) in wheels.iter() {
|
||||
if state.contact_point.is_none() {
|
||||
factor -= 0.5;
|
||||
} else {
|
||||
normal = Some(state.contact_normal.unwrap());
|
||||
match wheel {
|
||||
CyberWheel::Front => {
|
||||
front = Some(state.contact_point.unwrap());
|
||||
}
|
||||
CyberWheel::Rear => {
|
||||
rear = Some(state.contact_point.unwrap());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let tork_axis = (rxform.translation() - fxform.translation()).normalize();
|
||||
let axis = match (front, rear) {
|
||||
(Some(f), Some(r)) => (r - f).normalize(),
|
||||
(None, Some(_)) | (Some(_), None) => {
|
||||
let normal = normal.unwrap();
|
||||
normal.cross(*xform.left())
|
||||
}
|
||||
_ => return,
|
||||
};
|
||||
|
||||
let world_up = Vec3::Y; //xform.translation.normalize();
|
||||
let rot = Quat::from_axis_angle(*xform.back(), lean.lean);
|
||||
|
@ -171,10 +218,9 @@ mod systems {
|
|||
let mag =
|
||||
(settings.kp * roll_error) + (settings.ki * integral) + (settings.kd * derivative);
|
||||
if mag.is_finite() {
|
||||
//let lean_force = factor * mag * *xform.left();
|
||||
let tork = factor * mag * tork_axis;
|
||||
let lean_torq = factor * mag * axis;
|
||||
|
||||
torque.apply_torque(tork);
|
||||
force.apply_torque(lean_torq);
|
||||
|
||||
gizmos.arrow(
|
||||
xform.translation + *xform.up(),
|
||||
|
@ -287,7 +333,7 @@ mod systems {
|
|||
let bike_vel = bike_vel.0;
|
||||
|
||||
let dt = time.delta().as_secs_f32();
|
||||
let max_thrust = 500.0;
|
||||
let max_thrust = 8000.0;
|
||||
let yaw_angle = -yaw_to_angle(input.yaw);
|
||||
|
||||
for (mut state, config, wheel) in wheels.iter_mut() {
|
||||
|
@ -301,7 +347,7 @@ mod systems {
|
|||
let thrust_mag = input.throttle * max_thrust * dt;
|
||||
let (thrust_dir, thrust_force) = match wheel {
|
||||
CyberWheel::Rear => (forward, thrust_mag),
|
||||
CyberWheel::Front => (rot * forward, thrust_mag * 0.1),
|
||||
CyberWheel::Front => (rot * forward, 0.0),
|
||||
};
|
||||
|
||||
let thrust = thrust_force * thrust_dir;
|
||||
|
@ -318,15 +364,14 @@ mod systems {
|
|||
let diff = bike_vel - vel;
|
||||
bevy::log::debug!("{wheel:?}: vel diff: {diff:?} ({})", diff.length(),);
|
||||
|
||||
let mut force = thrust + friction;
|
||||
force *= dt * 50.0;
|
||||
let force_mag = force.length();
|
||||
if force_mag > max_force_mag {
|
||||
state.sliding = true;
|
||||
force = force.normalize_or_zero() * max_force_mag;
|
||||
} else {
|
||||
state.sliding = false;
|
||||
}
|
||||
let force = thrust + friction * dt;
|
||||
// let force_mag = force.length();
|
||||
// if force_mag > max_force_mag {
|
||||
// state.sliding = true;
|
||||
// force = force.normalize_or_zero() * max_force_mag;
|
||||
// } else {
|
||||
// state.sliding = false;
|
||||
// }
|
||||
|
||||
bike_force.apply_force_at_point(
|
||||
force,
|
||||
|
@ -376,8 +421,6 @@ mod systems {
|
|||
);
|
||||
}
|
||||
|
||||
bevy::log::debug!("speed: {}, drag force: {}", vel.length(), drag.length());
|
||||
|
||||
gizmos.arrow(
|
||||
xform.translation,
|
||||
xform.translation + drag * 10.,
|
||||
|
@ -385,37 +428,58 @@ mod systems {
|
|||
);
|
||||
}
|
||||
|
||||
pub(super) fn ef(
|
||||
bike: Single<(&ExternalForce, &GlobalTransform), With<CyberBikeBody>>,
|
||||
mut gizmos: Gizmos,
|
||||
) {
|
||||
let (force, xform) = bike.into_inner();
|
||||
|
||||
let start = xform.translation() + (2.0 * Vec3::Y);
|
||||
let force = force.length() * force.normalize_or_zero();
|
||||
gizmos.arrow(start, start + force, Color::linear_rgb(1.0, 0.0, 0.0));
|
||||
}
|
||||
|
||||
pub(super) fn tweak(
|
||||
mut config: Populated<&mut WheelConfig>,
|
||||
mut config: ResMut<CatControllerSettings>,
|
||||
mut keys: ResMut<ButtonInput<KeyCode>>,
|
||||
mut ui: ResMut<PhysicsDiagnosticsUiSettings>,
|
||||
) {
|
||||
let keyset: std::collections::HashSet<_> = keys.get_pressed().collect();
|
||||
let shifted = keyset.contains(&KeyCode::ShiftLeft) || keyset.contains(&KeyCode::ShiftRight);
|
||||
let config = config.iter_mut();
|
||||
for ref mut c in config {
|
||||
for key in &keyset {
|
||||
match key {
|
||||
KeyCode::KeyS => {
|
||||
if shifted {
|
||||
c.konstant += 0.2;
|
||||
} else {
|
||||
c.konstant -= 0.2;
|
||||
}
|
||||
bevy::log::info!(c.konstant);
|
||||
}
|
||||
KeyCode::KeyD => {
|
||||
if shifted {
|
||||
c.damping += 0.1;
|
||||
} else {
|
||||
c.damping -= 0.1;
|
||||
}
|
||||
bevy::log::info!(c.damping);
|
||||
}
|
||||
|
||||
_ => continue,
|
||||
for key in &keyset {
|
||||
match key {
|
||||
KeyCode::KeyP => {
|
||||
if shifted {
|
||||
config.kp += 1.0;
|
||||
} else {
|
||||
config.kp -= 1.0;
|
||||
}
|
||||
}
|
||||
KeyCode::KeyD => {
|
||||
if shifted {
|
||||
config.kd += 1.0;
|
||||
} else {
|
||||
config.kd -= 1.0;
|
||||
}
|
||||
}
|
||||
KeyCode::KeyI => {
|
||||
if shifted {
|
||||
config.ki += 1.0;
|
||||
} else {
|
||||
config.ki -= 1.0;
|
||||
}
|
||||
}
|
||||
KeyCode::KeyU => {
|
||||
let enabled = ui.enabled;
|
||||
ui.enabled = !enabled;
|
||||
}
|
||||
|
||||
_ => continue,
|
||||
}
|
||||
}
|
||||
bevy::log::info!(?config);
|
||||
|
||||
let released: Vec<_> = keys.get_just_released().copied().collect();
|
||||
for key in released {
|
||||
keys.clear_just_released(key);
|
||||
|
@ -423,7 +487,7 @@ mod systems {
|
|||
}
|
||||
}
|
||||
|
||||
use systems::{apply_lean, calculate_lean, drag, suspension, tweak, wheel_action};
|
||||
use systems::{apply_lean, calculate_lean, clear, drag, ef, suspension, tweak, wheel_action};
|
||||
|
||||
pub struct CyberPhysicsPlugin;
|
||||
|
||||
|
@ -431,14 +495,26 @@ impl Plugin for CyberPhysicsPlugin {
|
|||
fn build(&self, app: &mut App) {
|
||||
app.init_resource::<CatControllerSettings>()
|
||||
.init_resource::<CyberLean>()
|
||||
.add_plugins((PhysicsPlugins::default(), PhysicsDebugPlugin::default()))
|
||||
.insert_resource(SubstepCount(12))
|
||||
.add_plugins((
|
||||
PhysicsPlugins::default(),
|
||||
PhysicsDebugPlugin::default(),
|
||||
PhysicsDiagnosticsUiPlugin,
|
||||
))
|
||||
.insert_resource(SubstepCount(24))
|
||||
.add_systems(Startup, |mut gravity: ResMut<Gravity>| {
|
||||
gravity.0 *= 1.0;
|
||||
})
|
||||
.add_systems(
|
||||
FixedUpdate,
|
||||
(calculate_lean, apply_lean, suspension, wheel_action, drag).chain(),
|
||||
(
|
||||
calculate_lean,
|
||||
apply_lean,
|
||||
suspension,
|
||||
wheel_action,
|
||||
drag,
|
||||
ef,
|
||||
)
|
||||
.chain(),
|
||||
)
|
||||
.add_systems(Update, tweak);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue