back to square one with the gun on the hand
This commit is contained in:
parent
5e7f1407f0
commit
6d0012c782
346
Cargo.lock
generated
346
Cargo.lock
generated
@ -200,6 +200,25 @@ dependencies = [
|
|||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arboard"
|
||||||
|
version = "3.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ac57f2b058a76363e357c056e4f74f1945bf734d37b8b3ef49066c4787dde0fc"
|
||||||
|
dependencies = [
|
||||||
|
"clipboard-win",
|
||||||
|
"core-graphics",
|
||||||
|
"image",
|
||||||
|
"log",
|
||||||
|
"objc",
|
||||||
|
"objc-foundation",
|
||||||
|
"objc_id",
|
||||||
|
"parking_lot",
|
||||||
|
"thiserror",
|
||||||
|
"winapi",
|
||||||
|
"x11rb",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arrayvec"
|
name = "arrayvec"
|
||||||
version = "0.7.4"
|
version = "0.7.4"
|
||||||
@ -255,6 +274,12 @@ version = "4.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae"
|
checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "atomic_refcell"
|
||||||
|
version = "0.1.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "112ef6b3f6cb3cb6fc5b6b494ef7a848492cff1ab0ef4de10b0f7d572861c905"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
@ -298,6 +323,45 @@ dependencies = [
|
|||||||
"bevy_internal",
|
"bevy_internal",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bevy-inspector-egui"
|
||||||
|
version = "0.19.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fd2523be5ae7d482e5435dc75509b80a320989175768fb4b711603b9d2ab8fff"
|
||||||
|
dependencies = [
|
||||||
|
"bevy-inspector-egui-derive",
|
||||||
|
"bevy_app",
|
||||||
|
"bevy_asset",
|
||||||
|
"bevy_core",
|
||||||
|
"bevy_core_pipeline",
|
||||||
|
"bevy_ecs",
|
||||||
|
"bevy_egui",
|
||||||
|
"bevy_hierarchy",
|
||||||
|
"bevy_log",
|
||||||
|
"bevy_math",
|
||||||
|
"bevy_pbr",
|
||||||
|
"bevy_reflect",
|
||||||
|
"bevy_render",
|
||||||
|
"bevy_utils",
|
||||||
|
"bevy_window",
|
||||||
|
"egui",
|
||||||
|
"image",
|
||||||
|
"once_cell",
|
||||||
|
"pretty-type-name",
|
||||||
|
"smallvec",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bevy-inspector-egui-derive"
|
||||||
|
version = "0.19.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0edba455601861b8e8b76128ae5d46dd968114edde60f0ac3d2c21535a947548"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.32",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bevy_a11y"
|
name = "bevy_a11y"
|
||||||
version = "0.11.2"
|
version = "0.11.2"
|
||||||
@ -498,6 +562,19 @@ dependencies = [
|
|||||||
"syn 2.0.32",
|
"syn 2.0.32",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bevy_egui"
|
||||||
|
version = "0.21.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1a73a93a8cf6b8c744281d1b88f5b0fa278d608e909af9bbf4eb491a7cb1ad2c"
|
||||||
|
dependencies = [
|
||||||
|
"arboard",
|
||||||
|
"bevy",
|
||||||
|
"egui",
|
||||||
|
"thread_local",
|
||||||
|
"webbrowser",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bevy_encase_derive"
|
name = "bevy_encase_derive"
|
||||||
version = "0.11.2"
|
version = "0.11.2"
|
||||||
@ -1199,6 +1276,17 @@ dependencies = [
|
|||||||
"libloading 0.7.4",
|
"libloading 0.7.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "clipboard-win"
|
||||||
|
version = "4.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362"
|
||||||
|
dependencies = [
|
||||||
|
"error-code",
|
||||||
|
"str-buf",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "codespan-reporting"
|
name = "codespan-reporting"
|
||||||
version = "0.11.1"
|
version = "0.11.1"
|
||||||
@ -1415,7 +1503,7 @@ dependencies = [
|
|||||||
"autocfg",
|
"autocfg",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
"memoffset",
|
"memoffset 0.9.0",
|
||||||
"scopeguard",
|
"scopeguard",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1473,12 +1561,41 @@ version = "1.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
|
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ecolor"
|
||||||
|
version = "0.22.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2e479a7fa3f23d4e794f8b2f8b3568dd4e47886ad1b12c9c095e141cb591eb63"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "egui"
|
||||||
|
version = "0.22.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a3aef8ec3ae1b772f340170c65bf27d5b8c28f543a0116c844d2ac08d01123e7"
|
||||||
|
dependencies = [
|
||||||
|
"ahash 0.8.3",
|
||||||
|
"epaint",
|
||||||
|
"nohash-hasher",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "either"
|
name = "either"
|
||||||
version = "1.9.0"
|
version = "1.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
|
checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "emath"
|
||||||
|
version = "0.22.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3857d743a6e0741cdd60b622a74c7a36ea75f5f8f11b793b41d905d2c9721a4b"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "encase"
|
name = "encase"
|
||||||
version = "0.6.1"
|
version = "0.6.1"
|
||||||
@ -1511,6 +1628,22 @@ dependencies = [
|
|||||||
"syn 2.0.32",
|
"syn 2.0.32",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "epaint"
|
||||||
|
version = "0.22.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "09333964d4d57f40a85338ba3ca5ed4716070ab184dcfed966b35491c5c64f3b"
|
||||||
|
dependencies = [
|
||||||
|
"ab_glyph",
|
||||||
|
"ahash 0.8.3",
|
||||||
|
"atomic_refcell",
|
||||||
|
"bytemuck",
|
||||||
|
"ecolor",
|
||||||
|
"emath",
|
||||||
|
"nohash-hasher",
|
||||||
|
"parking_lot",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "equivalent"
|
name = "equivalent"
|
||||||
version = "1.0.1"
|
version = "1.0.1"
|
||||||
@ -1526,6 +1659,16 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "error-code"
|
||||||
|
version = "2.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"str-buf",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "euclid"
|
name = "euclid"
|
||||||
version = "0.22.9"
|
version = "0.22.9"
|
||||||
@ -1546,6 +1689,7 @@ name = "experiment"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bevy",
|
"bevy",
|
||||||
|
"bevy-inspector-egui",
|
||||||
"bevy_rapier3d",
|
"bevy_rapier3d",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1616,6 +1760,15 @@ version = "0.1.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
|
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "form_urlencoded"
|
||||||
|
version = "1.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652"
|
||||||
|
dependencies = [
|
||||||
|
"percent-encoding",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fsevent-sys"
|
name = "fsevent-sys"
|
||||||
version = "4.1.0"
|
version = "4.1.0"
|
||||||
@ -1652,6 +1805,16 @@ dependencies = [
|
|||||||
"waker-fn",
|
"waker-fn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gethostname"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.2.10"
|
version = "0.2.10"
|
||||||
@ -1897,6 +2060,25 @@ version = "0.2.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"
|
checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "home"
|
||||||
|
version = "0.5.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb"
|
||||||
|
dependencies = [
|
||||||
|
"windows-sys 0.48.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "idna"
|
||||||
|
version = "0.4.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-bidi",
|
||||||
|
"unicode-normalization",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "image"
|
name = "image"
|
||||||
version = "0.24.7"
|
version = "0.24.7"
|
||||||
@ -1909,6 +2091,7 @@ dependencies = [
|
|||||||
"num-rational",
|
"num-rational",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"png",
|
"png",
|
||||||
|
"tiff",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2013,6 +2196,22 @@ dependencies = [
|
|||||||
"walkdir",
|
"walkdir",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "jni"
|
||||||
|
version = "0.21.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97"
|
||||||
|
dependencies = [
|
||||||
|
"cesu8",
|
||||||
|
"cfg-if",
|
||||||
|
"combine",
|
||||||
|
"jni-sys",
|
||||||
|
"log",
|
||||||
|
"thiserror",
|
||||||
|
"walkdir",
|
||||||
|
"windows-sys 0.45.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jni-sys"
|
name = "jni-sys"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
@ -2028,6 +2227,12 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "jpeg-decoder"
|
||||||
|
version = "0.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.64"
|
version = "0.3.64"
|
||||||
@ -2201,6 +2406,15 @@ version = "2.6.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c"
|
checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memoffset"
|
||||||
|
version = "0.6.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce"
|
||||||
|
dependencies = [
|
||||||
|
"autocfg",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memoffset"
|
name = "memoffset"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
@ -2359,6 +2573,7 @@ dependencies = [
|
|||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
|
"memoffset 0.6.5",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2372,6 +2587,12 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "nohash-hasher"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "7.1.3"
|
version = "7.1.3"
|
||||||
@ -2523,6 +2744,17 @@ dependencies = [
|
|||||||
"objc_exception",
|
"objc_exception",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "objc-foundation"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"
|
||||||
|
dependencies = [
|
||||||
|
"block",
|
||||||
|
"objc",
|
||||||
|
"objc_id",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "objc-sys"
|
name = "objc-sys"
|
||||||
version = "0.2.0-beta.2"
|
version = "0.2.0-beta.2"
|
||||||
@ -2558,6 +2790,15 @@ dependencies = [
|
|||||||
"cc",
|
"cc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "objc_id"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b"
|
||||||
|
dependencies = [
|
||||||
|
"objc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "object"
|
name = "object"
|
||||||
version = "0.32.1"
|
version = "0.32.1"
|
||||||
@ -2747,6 +2988,12 @@ dependencies = [
|
|||||||
"unicode-xid",
|
"unicode-xid",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pretty-type-name"
|
||||||
|
version = "1.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f0f73cdaf19b52e6143685c3606206e114a4dfa969d6b14ec3894c88eb38bd4b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-crate"
|
name = "proc-macro-crate"
|
||||||
version = "1.3.1"
|
version = "1.3.1"
|
||||||
@ -3100,6 +3347,12 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "str-buf"
|
||||||
|
version = "1.0.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "svg_fmt"
|
name = "svg_fmt"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
@ -3213,6 +3466,17 @@ dependencies = [
|
|||||||
"once_cell",
|
"once_cell",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tiff"
|
||||||
|
version = "0.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211"
|
||||||
|
dependencies = [
|
||||||
|
"flate2",
|
||||||
|
"jpeg-decoder",
|
||||||
|
"weezl",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tinyvec"
|
name = "tinyvec"
|
||||||
version = "1.6.0"
|
version = "1.6.0"
|
||||||
@ -3340,12 +3604,27 @@ version = "1.16.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
|
checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-bidi"
|
||||||
|
version = "0.3.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
version = "1.0.11"
|
version = "1.0.11"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
|
checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-normalization"
|
||||||
|
version = "0.1.22"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
|
||||||
|
dependencies = [
|
||||||
|
"tinyvec",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "unicode-width"
|
||||||
version = "0.1.10"
|
version = "0.1.10"
|
||||||
@ -3358,6 +3637,17 @@ version = "0.2.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
|
checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "url"
|
||||||
|
version = "2.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5"
|
||||||
|
dependencies = [
|
||||||
|
"form_urlencoded",
|
||||||
|
"idna",
|
||||||
|
"percent-encoding",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uuid"
|
name = "uuid"
|
||||||
version = "1.4.1"
|
version = "1.4.1"
|
||||||
@ -3495,6 +3785,29 @@ dependencies = [
|
|||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "webbrowser"
|
||||||
|
version = "0.8.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b2c79b77f525a2d670cb40619d7d9c673d09e0666f72c591ebd7861f84a87e57"
|
||||||
|
dependencies = [
|
||||||
|
"core-foundation",
|
||||||
|
"home",
|
||||||
|
"jni 0.21.1",
|
||||||
|
"log",
|
||||||
|
"ndk-context",
|
||||||
|
"objc",
|
||||||
|
"raw-window-handle",
|
||||||
|
"url",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "weezl"
|
||||||
|
version = "0.1.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu"
|
name = "wgpu"
|
||||||
version = "0.16.3"
|
version = "0.16.3"
|
||||||
@ -3636,6 +3949,15 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-wsapoll"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e"
|
||||||
|
dependencies = [
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi-x86_64-pc-windows-gnu"
|
name = "winapi-x86_64-pc-windows-gnu"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
@ -3894,6 +4216,28 @@ dependencies = [
|
|||||||
"pkg-config",
|
"pkg-config",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "x11rb"
|
||||||
|
version = "0.10.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "592b4883219f345e712b3209c62654ebda0bb50887f330cbd018d0f654bfd507"
|
||||||
|
dependencies = [
|
||||||
|
"gethostname",
|
||||||
|
"nix 0.24.3",
|
||||||
|
"winapi",
|
||||||
|
"winapi-wsapoll",
|
||||||
|
"x11rb-protocol",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "x11rb-protocol"
|
||||||
|
version = "0.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "56b245751c0ac9db0e006dc812031482784e434630205a93c73cfefcaabeac67"
|
||||||
|
dependencies = [
|
||||||
|
"nix 0.24.3",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xi-unicode"
|
name = "xi-unicode"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
@ -16,4 +16,5 @@ opt-level = 3
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bevy = { version = "0.11.2", features = ["dynamic_linking"]}
|
bevy = { version = "0.11.2", features = ["dynamic_linking"]}
|
||||||
|
bevy-inspector-egui = "0.19.0"
|
||||||
bevy_rapier3d = { version = "0.22.0", features = ["debug-render-3d"] }
|
bevy_rapier3d = { version = "0.22.0", features = ["debug-render-3d"] }
|
17
src/comps/core/markers/firearm.rs
Normal file
17
src/comps/core/markers/firearm.rs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
use bevy::prelude::{Component, Vec3};
|
||||||
|
|
||||||
|
use crate::logic::core::guns::caliber::Caliber;
|
||||||
|
|
||||||
|
#[derive(Component)]
|
||||||
|
pub struct FirearmData<'a> {
|
||||||
|
/// Where the bullets will come out of
|
||||||
|
pub firing_point: Vec3,
|
||||||
|
pub caliber: Caliber,
|
||||||
|
/// Placeholder until mags get implemented
|
||||||
|
pub max_capacity: u32,
|
||||||
|
/// Rounds per minute
|
||||||
|
pub fire_rate: u32,
|
||||||
|
/// Amount of ms it takes for gun to come down from shooting
|
||||||
|
pub rebound_time_millis: i64,
|
||||||
|
pub asset_path: &'a str,
|
||||||
|
}
|
@ -2,7 +2,7 @@ use bevy::prelude::*;
|
|||||||
|
|
||||||
/// Anything that can go in the player's hands.
|
/// Anything that can go in the player's hands.
|
||||||
#[derive(Component, Default, Debug)]
|
#[derive(Component, Default, Debug)]
|
||||||
pub struct HoldableObject {
|
pub struct HoldableObjectData {
|
||||||
/// Where this object should be placed relative to the hand.
|
/// Where this object should be placed relative to the hand.
|
||||||
pub held_at: Vec3,
|
pub held_at: Vec3,
|
||||||
/// Initial Rotation in degrees
|
/// Initial Rotation in degrees
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
pub mod player;
|
|
||||||
pub mod holdable;
|
|
||||||
pub mod camera;
|
pub mod camera;
|
||||||
|
pub mod firearm;
|
||||||
|
pub mod holdable;
|
||||||
|
pub mod player;
|
||||||
|
@ -1,2 +1 @@
|
|||||||
|
|
||||||
|
|
@ -1 +1 @@
|
|||||||
pub mod ar_15_rifle;
|
pub mod m4a1;
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
|
use crate::logic::core::guns::firearm::Firearm;
|
||||||
|
|
||||||
pub const MAX_LINEAR_PLAYER_VELOCITY: f32 = 20.0;
|
pub const MAX_LINEAR_PLAYER_VELOCITY: f32 = 20.0;
|
||||||
pub const PLAYER_ACCELERATION: f32 = 20.0;
|
pub const PLAYER_ACCELERATION: f32 = 20.0;
|
||||||
pub const PLAYER_JUMP_FORCE: f32 = 900.0;
|
pub const PLAYER_JUMP_FORCE: f32 = 900.0;
|
||||||
/// Time in ms that player must be grounded in order to jump again
|
/// Time in ms that player must be grounded in order to jump again
|
||||||
pub const PLAYER_JUMP_COOLDOWN_MS: u128 = 75;
|
pub const PLAYER_JUMP_COOLDOWN_MS: u128 = 75;
|
||||||
pub const PLAYER_SPRINT_SPEED_MULTIPLIER: f32 = 2.5;
|
pub const PLAYER_SPRINT_SPEED_MULTIPLIER: f32 = 3.5;
|
||||||
pub const PLAYER_CROUCH_SPEED_MULTIPLIER: f32 = 0.25;
|
pub const PLAYER_CROUCH_SPEED_MULTIPLIER: f32 = 0.25;
|
||||||
pub const PLAYER_INITIAL_WEIGHT: f32 = 75.0;
|
pub const PLAYER_INITIAL_WEIGHT: f32 = 75.0;
|
||||||
pub const PLAYER_GRAVITY_SCALE: f32 = 4.0;
|
pub const PLAYER_GRAVITY_SCALE: f32 = 4.0;
|
||||||
@ -21,6 +23,7 @@ pub const PLAYER_LATERAL_ACCELERATION_MULTIPLIER: f32 = 1.0;
|
|||||||
|
|
||||||
pub const PLAYER_LINEAR_DAMPING_TIME_OFFSET_AFTER_JUMP_IN_MS: u128 = 20;
|
pub const PLAYER_LINEAR_DAMPING_TIME_OFFSET_AFTER_JUMP_IN_MS: u128 = 20;
|
||||||
|
|
||||||
|
pub const DEFAULT_PLAYER_FIREARM: Firearm = Firearm::M4A1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
pub const PLAYER_CAMERA_HEADBOB_Y_POS: f32 = 0.2;
|
pub const PLAYER_CAMERA_HEADBOB_Y_POS: f32 = 0.2;
|
||||||
|
4
src/logic/core/guns/caliber.rs
Normal file
4
src/logic/core/guns/caliber.rs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#[allow(unused)]
|
||||||
|
pub enum Caliber {
|
||||||
|
NATO556,
|
||||||
|
}
|
27
src/logic/core/guns/firearm.rs
Normal file
27
src/logic/core/guns/firearm.rs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
use crate::comps::core::markers::{firearm::FirearmData, holdable::HoldableObjectData};
|
||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
use super::caliber::Caliber;
|
||||||
|
|
||||||
|
pub enum Firearm {
|
||||||
|
M4A1,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Firearm {
|
||||||
|
pub fn firearm_data(&self) -> FirearmData {
|
||||||
|
FirearmData {
|
||||||
|
firing_point: Vec3::ZERO,
|
||||||
|
caliber: Caliber::NATO556,
|
||||||
|
max_capacity: 30,
|
||||||
|
fire_rate: 800,
|
||||||
|
rebound_time_millis: 10,
|
||||||
|
asset_path: "weapons/m4a1_rifle.glb#Scene0",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pub fn holdable_object_data(&self) -> HoldableObjectData {
|
||||||
|
HoldableObjectData {
|
||||||
|
held_at: Vec3::ZERO,
|
||||||
|
y_rot: -90.0,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
3
src/logic/core/guns/mod.rs
Normal file
3
src/logic/core/guns/mod.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
pub mod caliber;
|
||||||
|
pub mod firearm;
|
||||||
|
pub mod spawn_firearm;
|
34
src/logic/core/guns/spawn_firearm.rs
Normal file
34
src/logic/core/guns/spawn_firearm.rs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
comps::core::markers::player::PlayerHand, constants::player_values::DEFAULT_PLAYER_FIREARM,
|
||||||
|
utils,
|
||||||
|
};
|
||||||
|
|
||||||
|
pub fn spawn_firearm_on_player_hands(
|
||||||
|
mut commands: Commands,
|
||||||
|
query: Query<Entity, With<PlayerHand>>,
|
||||||
|
asset_server: Res<AssetServer>,
|
||||||
|
) {
|
||||||
|
for entity in query.iter() {
|
||||||
|
println!("A");
|
||||||
|
let mut firearm_transform = Transform::from_xyz(0.0, 0.0, 0.0);
|
||||||
|
firearm_transform.rotate_y(utils::rad_deg::radians_from_degrees(
|
||||||
|
DEFAULT_PLAYER_FIREARM.holdable_object_data().y_rot,
|
||||||
|
));
|
||||||
|
let firearm = commands
|
||||||
|
.spawn((
|
||||||
|
SceneBundle {
|
||||||
|
scene: asset_server.load(DEFAULT_PLAYER_FIREARM.firearm_data().asset_path),
|
||||||
|
visibility: Visibility::Inherited,
|
||||||
|
transform: firearm_transform,
|
||||||
|
..default()
|
||||||
|
},
|
||||||
|
DEFAULT_PLAYER_FIREARM.firearm_data(),
|
||||||
|
DEFAULT_PLAYER_FIREARM.holdable_object_data(),
|
||||||
|
))
|
||||||
|
.id();
|
||||||
|
|
||||||
|
commands.entity(entity).push_children(&[firearm]);
|
||||||
|
}
|
||||||
|
}
|
@ -1 +1,2 @@
|
|||||||
|
pub mod guns;
|
||||||
pub mod player;
|
pub mod player;
|
||||||
|
@ -2,7 +2,7 @@ use bevy::{input::mouse::MouseMotion, prelude::*};
|
|||||||
//use bevy_rapier3d::prelude::*;
|
//use bevy_rapier3d::prelude::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
comps::core::markers::{player::Player, camera::MainCamera},
|
comps::core::markers::{camera::MainCamera, player::Player},
|
||||||
constants::player_values::{PLAYER_CAMERA_HEIGHT, PLAYER_CROUCH_HEIGHT, PLAYER_CROUCH_TIME_MS},
|
constants::player_values::{PLAYER_CAMERA_HEIGHT, PLAYER_CROUCH_HEIGHT, PLAYER_CROUCH_TIME_MS},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -30,8 +30,12 @@ pub fn update_camera_vertical_position(
|
|||||||
mut camera: Query<&mut Transform, (With<MainCamera>, Without<Player>)>,
|
mut camera: Query<&mut Transform, (With<MainCamera>, Without<Player>)>,
|
||||||
time: Res<Time>,
|
time: Res<Time>,
|
||||||
) {
|
) {
|
||||||
let Ok((_, player_linear_xz_state)) = player.get_single_mut() else { return };
|
let Ok((_, player_linear_xz_state)) = player.get_single_mut() else {
|
||||||
let Ok(mut camera_transform) = camera.get_single_mut() else { return };
|
return;
|
||||||
|
};
|
||||||
|
let Ok(mut camera_transform) = camera.get_single_mut() else {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
if let PlayerLinearXZState::Crouched(since) = player_linear_xz_state {
|
if let PlayerLinearXZState::Crouched(since) = player_linear_xz_state {
|
||||||
// Lerp/Smooth out this movement
|
// Lerp/Smooth out this movement
|
||||||
@ -40,7 +44,8 @@ pub fn update_camera_vertical_position(
|
|||||||
camera_transform.translation.y = PLAYER_CROUCH_HEIGHT;
|
camera_transform.translation.y = PLAYER_CROUCH_HEIGHT;
|
||||||
} else {
|
} else {
|
||||||
// Starts at player_camera_height -> ends at player_crouch_height (Only works if player_crouch_height is 0)
|
// Starts at player_camera_height -> ends at player_crouch_height (Only works if player_crouch_height is 0)
|
||||||
camera_transform.translation.y = PLAYER_CAMERA_HEIGHT * (1.0 - (delta as f32 / PLAYER_CROUCH_TIME_MS as f32))
|
camera_transform.translation.y =
|
||||||
|
PLAYER_CAMERA_HEIGHT * (1.0 - (delta as f32 / PLAYER_CROUCH_TIME_MS as f32))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
camera_transform.translation.y = PLAYER_CAMERA_HEIGHT;
|
camera_transform.translation.y = PLAYER_CAMERA_HEIGHT;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
pub mod camera_effects;
|
pub mod camera_effects;
|
||||||
pub mod camera_player_sync;
|
pub mod camera_player_sync;
|
||||||
|
pub mod hands;
|
||||||
pub mod player_movement;
|
pub mod player_movement;
|
||||||
pub mod player_vertical_sync;
|
pub mod player_vertical_sync;
|
||||||
pub mod spawn_player;
|
pub mod spawn_player;
|
||||||
pub mod hands;
|
|
@ -133,7 +133,8 @@ pub fn move_player(
|
|||||||
} else {
|
} else {
|
||||||
1.0
|
1.0
|
||||||
};
|
};
|
||||||
let sprint_multiplier = if player_movement_input.sprint && !player_linear_xz_state.is_crouched() {
|
let sprint_multiplier =
|
||||||
|
if player_movement_input.sprint && !player_linear_xz_state.is_crouched() {
|
||||||
PLAYER_SPRINT_SPEED_MULTIPLIER
|
PLAYER_SPRINT_SPEED_MULTIPLIER
|
||||||
} else {
|
} else {
|
||||||
1.0
|
1.0
|
||||||
@ -146,7 +147,8 @@ pub fn move_player(
|
|||||||
if player_movement_input.front {
|
if player_movement_input.front {
|
||||||
if sprint_multiplier == PLAYER_SPRINT_SPEED_MULTIPLIER {
|
if sprint_multiplier == PLAYER_SPRINT_SPEED_MULTIPLIER {
|
||||||
*player_linear_xz_state = PlayerLinearXZState::Sprinting;
|
*player_linear_xz_state = PlayerLinearXZState::Sprinting;
|
||||||
} else if crouch_multiplier == PLAYER_CROUCH_SPEED_MULTIPLIER {} else {
|
} else if crouch_multiplier == PLAYER_CROUCH_SPEED_MULTIPLIER {
|
||||||
|
} else {
|
||||||
*player_linear_xz_state = PlayerLinearXZState::Walking;
|
*player_linear_xz_state = PlayerLinearXZState::Walking;
|
||||||
}
|
}
|
||||||
player_velocity.linvel = apply_movement_acceleration_to_vec(
|
player_velocity.linvel = apply_movement_acceleration_to_vec(
|
||||||
@ -157,7 +159,8 @@ pub fn move_player(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if player_movement_input.back {
|
if player_movement_input.back {
|
||||||
if crouch_multiplier == PLAYER_CROUCH_SPEED_MULTIPLIER {} else {
|
if crouch_multiplier == PLAYER_CROUCH_SPEED_MULTIPLIER {
|
||||||
|
} else {
|
||||||
*player_linear_xz_state = PlayerLinearXZState::Walking;
|
*player_linear_xz_state = PlayerLinearXZState::Walking;
|
||||||
}
|
}
|
||||||
player_velocity.linvel = apply_movement_acceleration_to_vec(
|
player_velocity.linvel = apply_movement_acceleration_to_vec(
|
||||||
@ -168,7 +171,8 @@ pub fn move_player(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if player_movement_input.right {
|
if player_movement_input.right {
|
||||||
if crouch_multiplier == PLAYER_CROUCH_SPEED_MULTIPLIER {} else {
|
if crouch_multiplier == PLAYER_CROUCH_SPEED_MULTIPLIER {
|
||||||
|
} else {
|
||||||
*player_linear_xz_state = PlayerLinearXZState::Walking;
|
*player_linear_xz_state = PlayerLinearXZState::Walking;
|
||||||
}
|
}
|
||||||
player_velocity.linvel = apply_movement_acceleration_to_vec(
|
player_velocity.linvel = apply_movement_acceleration_to_vec(
|
||||||
@ -183,7 +187,8 @@ pub fn move_player(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if player_movement_input.left {
|
if player_movement_input.left {
|
||||||
if crouch_multiplier == PLAYER_CROUCH_SPEED_MULTIPLIER {} else {
|
if crouch_multiplier == PLAYER_CROUCH_SPEED_MULTIPLIER {
|
||||||
|
} else {
|
||||||
*player_linear_xz_state = PlayerLinearXZState::Walking;
|
*player_linear_xz_state = PlayerLinearXZState::Walking;
|
||||||
}
|
}
|
||||||
player_velocity.linvel = apply_movement_acceleration_to_vec(
|
player_velocity.linvel = apply_movement_acceleration_to_vec(
|
||||||
|
@ -2,32 +2,29 @@ use bevy::{core_pipeline::Skybox, prelude::*};
|
|||||||
use bevy_rapier3d::prelude::*;
|
use bevy_rapier3d::prelude::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
comps::core::markers::{player::{Player, PlayerHand}, camera::MainCamera},
|
comps::core::markers::{
|
||||||
|
camera::MainCamera,
|
||||||
|
player::{Player, PlayerHand},
|
||||||
|
},
|
||||||
constants::player_values::{
|
constants::player_values::{
|
||||||
PLAYER_GRAVITY_SCALE, PLAYER_HEIGHT, PLAYER_INITIAL_WEIGHT, PLAYER_LINEAR_DAMPING,
|
PLAYER_GRAVITY_SCALE, PLAYER_HEIGHT, PLAYER_INITIAL_WEIGHT, PLAYER_LINEAR_DAMPING,
|
||||||
},
|
},
|
||||||
scenes::scene1::skybox::{Cubemap, CUBEMAPS}, utils,
|
scenes::scene1::skybox::{Cubemap, CUBEMAPS},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::player_movement::{PlayerLinearXZState, PlayerLinearYState};
|
use super::player_movement::{PlayerLinearXZState, PlayerLinearYState};
|
||||||
|
|
||||||
pub fn spawn_player(mut commands: Commands, asset_server: Res<AssetServer>) {
|
pub fn spawn_player(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||||
let skybox_handle = asset_server.load(CUBEMAPS[0].0);
|
let player_hand = commands
|
||||||
|
.spawn(PlayerHand)
|
||||||
let mut ar_15_transform = Transform::from_xyz(0.0, 0.0, 0.0);
|
.insert(TransformBundle::from(Transform::from_xyz(0.6, -0.45, -2.7)))
|
||||||
ar_15_transform.rotate_y(utils::rad_deg::radians_from_degrees(-90.0));
|
.insert(VisibilityBundle {
|
||||||
let ar_15 = commands.spawn(SceneBundle {
|
|
||||||
scene: asset_server.load("weapons/m4a1_rifle.glb#Scene0"),
|
|
||||||
visibility: Visibility::Inherited,
|
|
||||||
transform: ar_15_transform,
|
|
||||||
..default()
|
|
||||||
},).id();
|
|
||||||
|
|
||||||
let player_hand = commands.spawn(PlayerHand).insert(TransformBundle::from(Transform::from_xyz(1.0, -0.25, -3.0))).insert(VisibilityBundle {
|
|
||||||
visibility: Visibility::Inherited,
|
visibility: Visibility::Inherited,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}).push_children(&[ar_15]).id();
|
})
|
||||||
|
.id();
|
||||||
|
|
||||||
|
let skybox_handle = asset_server.load(CUBEMAPS[0].0);
|
||||||
let camera = commands
|
let camera = commands
|
||||||
.spawn(MainCamera)
|
.spawn(MainCamera)
|
||||||
.insert(Camera3dBundle {
|
.insert(Camera3dBundle {
|
||||||
@ -39,7 +36,8 @@ pub fn spawn_player(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
visibility: Visibility::Inherited,
|
visibility: Visibility::Inherited,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
})
|
})
|
||||||
.push_children(&[player_hand]).id();
|
.push_children(&[player_hand])
|
||||||
|
.id();
|
||||||
|
|
||||||
commands
|
commands
|
||||||
.spawn(Player)
|
.spawn(Player)
|
||||||
@ -78,10 +76,6 @@ pub fn spawn_player(mut commands: Commands, asset_server: Res<AssetServer>) {
|
|||||||
})
|
})
|
||||||
.push_children(&[camera]);
|
.push_children(&[camera]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
commands.insert_resource(Cubemap {
|
commands.insert_resource(Cubemap {
|
||||||
is_loaded: false,
|
is_loaded: false,
|
||||||
image_handle: skybox_handle,
|
image_handle: skybox_handle,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
use bevy_inspector_egui::quick::WorldInspectorPlugin;
|
||||||
use bevy_rapier3d::prelude::*;
|
use bevy_rapier3d::prelude::*;
|
||||||
use scenes::scene1;
|
use scenes::scene1;
|
||||||
|
|
||||||
@ -22,7 +23,8 @@ fn main() {
|
|||||||
fn setup_plugins(application: &mut App) {
|
fn setup_plugins(application: &mut App) {
|
||||||
application
|
application
|
||||||
.add_plugins(DefaultPlugins)
|
.add_plugins(DefaultPlugins)
|
||||||
.add_plugins(RapierPhysicsPlugin::<NoUserData>::default()); // Rapier Physics
|
.add_plugins(RapierPhysicsPlugin::<NoUserData>::default())
|
||||||
|
.add_plugins(WorldInspectorPlugin::new()); // Rapier Physics
|
||||||
//.add_plugins(RapierDebugRenderPlugin::default()); // Uncomment this to see physics objects as wireframes
|
//.add_plugins(RapierDebugRenderPlugin::default()); // Uncomment this to see physics objects as wireframes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,13 +2,16 @@ use bevy::prelude::*;
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
comps::core::controller::{capture_cursor, capture_input},
|
comps::core::controller::{capture_cursor, capture_input},
|
||||||
logic::core::player::{
|
logic::core::{
|
||||||
|
guns::spawn_firearm::spawn_firearm_on_player_hands,
|
||||||
|
player::{
|
||||||
camera_player_sync::{
|
camera_player_sync::{
|
||||||
follow_cursor_with_camera, MouseMovementSettings, update_camera_vertical_position,
|
follow_cursor_with_camera, update_camera_vertical_position, MouseMovementSettings,
|
||||||
},
|
},
|
||||||
player_vertical_sync::sync_player_y_state,
|
player_vertical_sync::sync_player_y_state,
|
||||||
spawn_player::spawn_player,
|
spawn_player::spawn_player,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
@ -22,7 +25,7 @@ pub fn load_scene(application: &mut App) {
|
|||||||
application.add_systems(Startup, spawn_ground);
|
application.add_systems(Startup, spawn_ground);
|
||||||
application.add_systems(Startup, spawn_obstacles);
|
application.add_systems(Startup, spawn_obstacles);
|
||||||
application.add_systems(Startup, spawn_player);
|
application.add_systems(Startup, spawn_player);
|
||||||
|
application.add_systems(PostStartup, spawn_firearm_on_player_hands.after(spawn_player));
|
||||||
|
|
||||||
// Update
|
// Update
|
||||||
application.add_systems(Update, capture_input);
|
application.add_systems(Update, capture_input);
|
||||||
|
@ -5,7 +5,7 @@ pub fn spawn_obstacles(
|
|||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
mut meshes: ResMut<Assets<Mesh>>,
|
mut meshes: ResMut<Assets<Mesh>>,
|
||||||
mut materials: ResMut<Assets<StandardMaterial>>,
|
mut materials: ResMut<Assets<StandardMaterial>>,
|
||||||
asset_server: Res<AssetServer>
|
asset_server: Res<AssetServer>,
|
||||||
) {
|
) {
|
||||||
let box_1_mesh = shape::Box::new(3.0, 7.0, 3.0).into();
|
let box_1_mesh = shape::Box::new(3.0, 7.0, 3.0).into();
|
||||||
let box_2_mesh = shape::Box::new(3.0, 7.0, 3.0).into();
|
let box_2_mesh = shape::Box::new(3.0, 7.0, 3.0).into();
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
use bevy::prelude::*;
|
// use bevy::prelude::*;
|
||||||
|
|
||||||
use bevy::gltf::Gltf;
|
// use bevy::gltf::Gltf;
|
||||||
|
|
||||||
#[derive(Resource)]
|
// #[derive(Resource)]
|
||||||
pub struct LoadedAsset(Handle<Gltf>);
|
// pub struct LoadedAssetMap(Handle<Gltf>);
|
||||||
|
|
||||||
/// Loads gltf asset into AssetServer. Inserts Resource as a LoadedAsset
|
// /// Loads gltf asset into AssetServer. Inserts Resource as a LoadedAsset
|
||||||
pub fn load_gltf(
|
// pub fn load_gltf(mut commands: Commands, ass: Res<AssetServer>) {
|
||||||
mut commands: Commands,
|
// let gltf = ass.load("my_asset_pack.glb");
|
||||||
ass: Res<AssetServer>,
|
// commands.insert_resource(LoadedAsset(gltf));
|
||||||
) {
|
// }
|
||||||
let gltf = ass.load("my_asset_pack.glb");
|
|
||||||
commands.insert_resource(LoadedAsset(gltf));
|
|
||||||
}
|
|
||||||
|
@ -1,2 +1 @@
|
|||||||
|
|
||||||
pub mod gltf_assets;
|
pub mod gltf_assets;
|
Loading…
Reference in New Issue
Block a user