diff --git a/Cargo.lock b/Cargo.lock index 1ac5a88..29da2c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,7 +6,6 @@ version = 3 name = "SolarSim" version = "0.1.0" dependencies = [ - "anise", "bevy", "bevy-inspector-egui", "bevy_easings", @@ -15,7 +14,9 @@ dependencies = [ "blocking", "chrono", "egui-toast", + "egui_extras", "image 0.24.7", + "reqwest", "serde", "serde_json", "tinyfiledialogs", @@ -39,34 +40,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] -name = "abnf" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33741baa462d86e43fdec5e8ffca7c6ac82847ad06cbfb382c1bdbf527de9e6b" -dependencies = [ - "abnf-core", - "nom", -] - -[[package]] -name = "abnf-core" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c44e09c43ae1c368fb91a03a566472d0087c26cf7e1b9e8e289c14ede681dd7d" -dependencies = [ - "nom", -] - -[[package]] -name = "abnf_to_pest" -version = "0.5.1" +name = "accesskit" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "939d59666dd9a7964a3a5312b9d24c9c107630752ee64f2dd5038189a23fe331" +checksum = "74a4b14f3d99c1255dcba8f45621ab1a2e7540a0009652d33989005a4d0bfc6b" dependencies = [ - "abnf", - "indexmap 1.9.3", - "itertools", - "pretty", + "enumn", + "serde", ] [[package]] @@ -81,7 +61,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bdfa1638ddd6eb9c752def95568df8b3ad832df252e9156d2eb783b201ca8a9" dependencies = [ - "accesskit", + "accesskit 0.14.0", "immutable-chunkmap", ] @@ -91,7 +71,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c236a84ff1111defc280cee755eaa953d0b24398786851b9d28322c6d3bb1ebd" dependencies = [ - "accesskit", + "accesskit 0.14.0", "accesskit_consumer", "objc2 0.5.2", "objc2-app-kit", @@ -105,7 +85,7 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d7f43d24b16b3e76bef248124fbfd2493c3a9860edb5aae1010c890e826de5e" dependencies = [ - "accesskit", + "accesskit 0.14.0", "accesskit_consumer", "paste", "static_assertions", @@ -118,7 +98,7 @@ version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "755535e6bf711a42dac28b888b884b10fc00ff4010d9d3bd871c5f5beae5aa78" dependencies = [ - "accesskit", + "accesskit 0.14.0", "accesskit_macos", "accesskit_windows", "raw-window-handle 0.6.2", @@ -155,6 +135,7 @@ dependencies = [ "cfg-if", "getrandom", "once_cell", + "serde", "version_check", "zerocopy", ] @@ -262,46 +243,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anise" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d953b5256f189a3cd2903516e788f62ce1db7b58b379690f636618f1145755" -dependencies = [ - "approx", - "bytes", - "const_format", - "crc32fast", - "der", - "heapless", - "hifitime", - "lexical-core", - "log", - "memmap2 0.9.5", - "nalgebra", - "platform-dirs", - "pretty_env_logger", - "regex", - "reqwest 0.12.7", - "rstest", - "serde", - "serde_derive", - "serde_dhall", - "snafu", - "tabled", - "url", - "zerocopy", -] - -[[package]] -name = "annotate-snippets" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e" -dependencies = [ - "unicode-width", -] - [[package]] name = "approx" version = "0.5.1" @@ -336,12 +277,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "arrayvec" version = "0.7.4" @@ -524,7 +459,7 @@ version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1a976cb539d6a5a3ff579cdb78187a6bcfbffa7e8224ea28f23d8b983d9389" dependencies = [ - "accesskit", + "accesskit 0.14.0", "bevy_app", "bevy_derive", "bevy_ecs", @@ -738,7 +673,7 @@ version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ee4222406637f3c8e3991a99788cfcde76097bf997c311f1b6297364057483f" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "bevy_ecs_macros", "bevy_ptr", "bevy_reflect", @@ -1311,7 +1246,7 @@ dependencies = [ "ahash", "bevy_utils_proc_macros", "getrandom", - "hashbrown 0.14.1", + "hashbrown", "thread_local", "tracing", "web-time", @@ -1435,7 +1370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec", "cc", "cfg-if", "constant_time_eq", @@ -1447,15 +1382,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - [[package]] name = "block-sys" version = "0.1.0-beta.1" @@ -1506,12 +1432,6 @@ version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" -[[package]] -name = "bytecount" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" - [[package]] name = "bytemuck" version = "1.18.0" @@ -1761,26 +1681,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32b13ea120a812beba79e34316b3942a857c86ec1593cb34f27bb28272ce2cca" -[[package]] -name = "const_format" -version = "0.2.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - [[package]] name = "const_panic" version = "0.2.8" @@ -1920,15 +1820,6 @@ dependencies = [ "windows 0.54.0", ] -[[package]] -name = "cpufeatures" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" -dependencies = [ - "libc", -] - [[package]] name = "crc32fast" version = "1.4.2" @@ -1987,16 +1878,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - [[package]] name = "cursor-icon" version = "1.1.0" @@ -2026,95 +1907,6 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "der_derive", - "zeroize", -] - -[[package]] -name = "der_derive" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - -[[package]] -name = "dhall" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec26264de25a8e3642fbb37abb24a6c6be9e19795444e6cf1bb88be5c2d55cc7" -dependencies = [ - "abnf_to_pest", - "annotate-snippets", - "elsa", - "half 2.2.1", - "hex", - "home", - "itertools", - "lazy_static", - "minicbor", - "once_cell", - "percent-encoding", - "pest", - "pest_consume", - "pest_generator", - "quote", - "reqwest 0.11.27", - "sha2", - "url", -] - -[[package]] -name = "dhall_proc_macros" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efcdb228bf802b21cd843e5ac3959b6255966238e5ec06d2e4bc6b9935475653" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "dirs-next" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf36e65a80337bea855cd4ef9b8401ffce06a7baedf2e85ec467b1ac3f6e82b6" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - [[package]] name = "dispatch" version = "0.2.0" @@ -2130,12 +1922,6 @@ dependencies = [ "libloading 0.8.1", ] -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - [[package]] name = "document-features" version = "0.2.10" @@ -2165,6 +1951,7 @@ checksum = "2e6b451ff1143f6de0f33fc7f1b68fecfd2c7de06e104de96c4514de3f5396f8" dependencies = [ "bytemuck", "emath", + "serde", ] [[package]] @@ -2173,10 +1960,12 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20c97e70a2768de630f161bb5392cbd3874fcf72868f14df0e002e82e06cb798" dependencies = [ + "accesskit 0.12.3", "ahash", "emath", "epaint", "nohash-hasher", + "serde", ] [[package]] @@ -2189,19 +1978,25 @@ dependencies = [ ] [[package]] -name = "either" -version = "1.9.0" +name = "egui_extras" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "5bb783d9fa348f69ed5c340aa25af78b5472043090e8b809040e30960cc2a746" +dependencies = [ + "ahash", + "chrono", + "egui", + "enum-map", + "log", + "mime_guess2", + "serde", +] [[package]] -name = "elsa" -version = "1.10.0" +name = "either" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d98e71ae4df57d214182a2e5cb90230c0192c6ddfcaa05c36453d46a54713e10" -dependencies = [ - "stable_deref_trait", -] +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "emath" @@ -2210,6 +2005,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6a21708405ea88f63d8309650b4d77431f4bc28fb9d8e6f77d3963b51249e6" dependencies = [ "bytemuck", + "serde", ] [[package]] @@ -2254,16 +2050,35 @@ dependencies = [ ] [[package]] -name = "env_logger" -version = "0.10.2" +name = "enum-map" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", + "enum-map-derive", + "serde", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "enumn" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -2279,6 +2094,7 @@ dependencies = [ "emath", "nohash-hasher", "parking_lot", + "serde", ] [[package]] @@ -2382,7 +2198,7 @@ checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8" dependencies = [ "bit_field", "flume", - "half 2.2.1", + "half", "lebe", "miniz_oxide 0.7.1", "rayon-core", @@ -2493,21 +2309,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.28" @@ -2524,17 +2325,6 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" -[[package]] -name = "futures-executor" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - [[package]] name = "futures-io" version = "0.3.28" @@ -2555,17 +2345,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "futures-sink" version = "0.3.30" @@ -2578,22 +2357,14 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - [[package]] name = "futures-util" version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ - "futures-channel", "futures-core", "futures-io", - "futures-macro", "futures-sink", "futures-task", "memchr", @@ -2611,16 +2382,6 @@ dependencies = [ "thread_local", ] -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "gethostname" version = "0.2.3" @@ -2839,7 +2600,7 @@ checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557" dependencies = [ "bitflags 2.6.0", "gpu-descriptor-types", - "hashbrown 0.14.1", + "hashbrown", ] [[package]] @@ -2867,25 +2628,6 @@ dependencies = [ "svg_fmt", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.5.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.6" @@ -2897,20 +2639,14 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", - "indexmap 2.5.0", + "http", + "indexmap", "slab", "tokio", "tokio-util", "tracing", ] -[[package]] -name = "half" -version = "1.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" - [[package]] name = "half" version = "2.2.1" @@ -2920,21 +2656,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "hash32" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.1" @@ -2962,30 +2683,8 @@ dependencies = [ ] [[package]] -name = "heapless" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" -dependencies = [ - "hash32", - "stable_deref_trait", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" +name = "hermit-abi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" @@ -2995,12 +2694,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "hexasphere" version = "12.0.0" @@ -3017,23 +2710,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" -[[package]] -name = "hifitime" -version = "4.0.0-alpha" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1234bcbfc5d693515132f49d5b0a4ce0ca807fa150428d85103ea78e1f7100c4" -dependencies = [ - "js-sys", - "lexical-core", - "num-traits", - "serde", - "serde_derive", - "snafu", - "wasm-bindgen", - "web-sys", - "web-time", -] - [[package]] name = "home" version = "0.5.5" @@ -3043,17 +2719,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.1.0" @@ -3065,17 +2730,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.1" @@ -3083,7 +2737,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -3094,8 +2748,8 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", - "http-body 1.0.1", + "http", + "http-body", "pin-project-lite", ] @@ -3105,42 +2759,6 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.1.0" @@ -3150,9 +2768,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", - "http 1.1.0", - "http-body 1.0.1", + "h2", + "http", + "http-body", "httparse", "itoa", "pin-project-lite", @@ -3167,8 +2785,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.1.0", + "http", + "hyper", "hyper-util", "rustls", "rustls-pki-types", @@ -3177,19 +2795,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.30", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "hyper-tls" version = "0.6.0" @@ -3198,7 +2803,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.1.0", + "hyper", "hyper-util", "native-tls", "tokio", @@ -3215,9 +2820,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "hyper 1.1.0", + "http", + "http-body", + "hyper", "pin-project-lite", "socket2", "tokio", @@ -3288,6 +2893,8 @@ dependencies = [ "byteorder-lite", "num-traits", "png", + "zune-core", + "zune-jpeg", ] [[package]] @@ -3296,17 +2903,7 @@ version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4419f022e55cc63d5bbd6b44b71e1d226b9c9480a47824c706e9d54e5c40c5eb" dependencies = [ - "arrayvec 0.7.4", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", + "arrayvec", ] [[package]] @@ -3316,7 +2913,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown", ] [[package]] @@ -3359,26 +2956,6 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" -[[package]] -name = "is-terminal" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" -dependencies = [ - "hermit-abi 0.4.0", - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.9" @@ -3489,70 +3066,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "lexical-core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" -dependencies = [ - "lexical-parse-float", - "lexical-parse-integer", - "lexical-util", - "lexical-write-float", - "lexical-write-integer", -] - -[[package]] -name = "lexical-parse-float" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" -dependencies = [ - "lexical-parse-integer", - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-parse-integer" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" -dependencies = [ - "lexical-util", - "static_assertions", -] - -[[package]] -name = "lexical-util" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" -dependencies = [ - "static_assertions", -] - -[[package]] -name = "lexical-write-float" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" -dependencies = [ - "lexical-util", - "lexical-write-integer", - "static_assertions", -] - -[[package]] -name = "lexical-write-integer" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" -dependencies = [ - "lexical-util", - "static_assertions", -] - [[package]] name = "libc" version = "0.2.158" @@ -3579,12 +3092,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - [[package]] name = "libredox" version = "0.0.2" @@ -3596,16 +3103,6 @@ dependencies = [ "redox_syscall 0.4.1", ] -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "libudev-sys" version = "0.1.4" @@ -3671,16 +3168,6 @@ dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matrixmultiply" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" -dependencies = [ - "autocfg", - "rawpointer", -] - [[package]] name = "memchr" version = "2.6.4" @@ -3745,24 +3232,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] -name = "minicbor" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a20020e8e2d1881d8736f64011bb5ff99f1db9947ce3089706945c8915695cb" -dependencies = [ - "half 1.8.3", - "minicbor-derive", -] - -[[package]] -name = "minicbor-derive" -version = "0.12.0" +name = "mime_guess2" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8608fb1c805b5b6b3d5ab7bd95c40c396df622b64d77b2d621a5eae1eed050ee" +checksum = "25a3333bb1609500601edc766a39b4c1772874a4ce26022f4d866854dc020c41" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "mime", + "unicase", ] [[package]] @@ -3820,12 +3296,12 @@ version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e536ae46fcab0876853bd4a632ede5df4b1c2527a58f6c5a4150fe86be858231" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "bit-set", "bitflags 2.6.0", "codespan-reporting", "hexf-parse", - "indexmap 2.5.0", + "indexmap", "log", "num-traits", "pp-rs", @@ -3845,7 +3321,7 @@ dependencies = [ "bit-set", "codespan-reporting", "data-encoding", - "indexmap 2.5.0", + "indexmap", "naga", "once_cell", "regex", @@ -3856,34 +3332,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "nalgebra" -version = "0.33.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c4b5f057b303842cf3262c27e465f4c303572e7f6b0648f60e16248ac3397f4" -dependencies = [ - "approx", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational", - "num-traits", - "serde", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "native-tls" version = "0.2.12" @@ -4054,16 +3502,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-complex" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" -dependencies = [ - "num-traits", - "serde", -] - [[package]] name = "num-derive" version = "0.4.2" @@ -4103,7 +3541,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -4524,7 +3961,7 @@ version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52f0d54bde9774d3a51dcf281a5def240c71996bc6ca05d2c847ec8b2b216166" dependencies = [ - "libredox 0.0.2", + "libredox", ] [[package]] @@ -4542,17 +3979,6 @@ dependencies = [ "ttf-parser", ] -[[package]] -name = "papergrid" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7419ad52a7de9b60d33e11085a0fe3df1fbd5926aa3f93d3dd53afbc9e86725" -dependencies = [ - "bytecount", - "fnv", - "unicode-width", -] - [[package]] name = "parking" version = "2.2.1" @@ -4600,73 +4026,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "pest" -version = "2.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_consume" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79447402d15d18e7142e14c72f2e63fa3d155be1bc5b70b3ccbb610ac55f536b" -dependencies = [ - "pest", - "pest_consume_macros", - "pest_derive", -] - -[[package]] -name = "pest_consume_macros" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8630a7a899cb344ec1c16ba0a6b24240029af34bdc0a21f84e411d7f793f29" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "pest_derive" -version = "2.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d3a6e3394ec80feb3b6393c725571754c6188490265c61aaf260810d6b95aa0" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94429506bde1ca69d1b5601962c73f4172ab4726571a59ea95931218cb0e930e" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn 2.0.77", -] - -[[package]] -name = "pest_meta" -version = "2.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac8a071862e93690b6e34e9a5fb8e33ff3734473ac0245b27232222c4906a33f" -dependencies = [ - "once_cell", - "pest", - "sha2", -] - [[package]] name = "petgraph" version = "0.6.4" @@ -4674,7 +4033,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.5.0", + "indexmap", "serde", "serde_derive", ] @@ -4728,15 +4087,6 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" -[[package]] -name = "platform-dirs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e188d043c1a692985f78b5464853a263f1a27e5bd6322bad3a4078ee3c998a38" -dependencies = [ - "dirs-next", -] - [[package]] name = "png" version = "0.17.10" @@ -4780,34 +4130,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" -[[package]] -name = "pretty" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83f3aa1e3ca87d3b124db7461265ac176b40c277f37e503eaa29c9c75c037846" -dependencies = [ - "arrayvec 0.5.2", - "log", - "typed-arena", - "unicode-segmentation", -] - [[package]] name = "pretty-type-name" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f73cdaf19b52e6143685c3606206e114a4dfa969d6b14ec3894c88eb38bd4b" -[[package]] -name = "pretty_env_logger" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865724d4dbe39d9f3dd3b52b88d859d66bcb2d6a0acfd5ea68a65fb66d4bdc1c" -dependencies = [ - "env_logger", - "log", -] - [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -4827,30 +4155,6 @@ dependencies = [ "toml_edit 0.22.21", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.86" @@ -4932,12 +4236,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - [[package]] name = "rayon" version = "1.8.0" @@ -4982,17 +4280,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom", - "libredox 0.1.3", - "thiserror", -] - [[package]] name = "regex" version = "1.10.6" @@ -5037,58 +4324,12 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" -[[package]] -name = "relative-path" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba39f3699c378cd8970968dcbff9c43159ea4cfbd88d43c00b22f2ef10a435d2" - [[package]] name = "renderdoc-sys" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.30", - "hyper-tls 0.5.0", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration 0.5.1", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - [[package]] name = "reqwest" version = "0.12.7" @@ -5101,13 +4342,13 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.4.6", - "http 1.1.0", - "http-body 1.0.1", + "h2", + "http", + "http-body", "http-body-util", - "hyper 1.1.0", + "hyper", "hyper-rustls", - "hyper-tls 0.6.0", + "hyper-tls", "hyper-util", "ipnet", "js-sys", @@ -5117,12 +4358,12 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.3", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", - "system-configuration 0.6.1", + "sync_wrapper", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -5171,36 +4412,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "rstest" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b423f0e62bdd61734b67cd21ff50871dfaeb9cc74f869dcd6af974fbcb19936" -dependencies = [ - "futures", - "futures-timer", - "rstest_macros", - "rustc_version", -] - -[[package]] -name = "rstest_macros" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e1711e7d14f74b12a58411c542185ef7fb7f2e7f8ee6e2940a883628522b42" -dependencies = [ - "cfg-if", - "glob", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "regex", - "relative-path", - "rustc_version", - "syn 2.0.77", - "unicode-ident", -] - [[package]] name = "rustc-demangle" version = "0.1.24" @@ -5213,15 +4424,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "0.38.37" @@ -5248,15 +4450,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.1.3" @@ -5269,9 +4462,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" @@ -5299,15 +4492,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" -[[package]] -name = "safe_arch" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" -dependencies = [ - "bytemuck", -] - [[package]] name = "same-file" version = "1.0.6" @@ -5387,12 +4571,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - [[package]] name = "send_wrapper" version = "0.6.0" @@ -5419,19 +4597,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "serde_dhall" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "655a5c686ad80aef90d2e6bfea3715778623c9a659017c8346bc97eb58f9b27d" -dependencies = [ - "dhall", - "dhall_proc_macros", - "doc-comment", - "serde", - "url", -] - [[package]] name = "serde_json" version = "1.0.107" @@ -5455,17 +4620,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "sharded-slab" version = "0.1.7" @@ -5481,19 +4635,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" -[[package]] -name = "simba" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a386a501cd104797982c15ae17aafe8b9261315b5d07e3ec803f2ea26be0fa" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", - "wide", -] - [[package]] name = "simd-adler32" version = "0.3.7" @@ -5577,28 +4718,6 @@ dependencies = [ "serde", ] -[[package]] -name = "snafu" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b835cb902660db3415a672d862905e791e54d306c6e8189168c7f3d9ae1c79d" -dependencies = [ - "backtrace", - "snafu-derive", -] - -[[package]] -name = "snafu-derive" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d1e02fca405f6280643174a50c942219f0bbf4dbf7d480f1dd864d6f211ae5" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "socket2" version = "0.5.7" @@ -5627,12 +4746,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" @@ -5685,12 +4798,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.1" @@ -5714,17 +4821,6 @@ dependencies = [ "windows 0.52.0", ] -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation 0.9.4", - "system-configuration-sys 0.5.0", -] - [[package]] name = "system-configuration" version = "0.6.1" @@ -5733,17 +4829,7 @@ checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.6.0", "core-foundation 0.9.4", - "system-configuration-sys 0.6.0", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys 0.8.7", - "libc", + "system-configuration-sys", ] [[package]] @@ -5756,36 +4842,13 @@ dependencies = [ "libc", ] -[[package]] -name = "tabled" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c9303ee60b9bedf722012ea29ae3711ba13a67c9b9ae28993838b63057cb1b" -dependencies = [ - "papergrid", - "tabled_derive", -] - -[[package]] -name = "tabled_derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf0fb8bfdc709786c154e24a66777493fb63ae97e3036d914c8666774c477069" -dependencies = [ - "heck 0.4.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "taffy" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cb893bff0f80ae17d3a57e030622a967b8dbc90e38284d9b4b1442e23873c94" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "grid", "num-traits", "serde", @@ -5862,7 +4925,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df8493a203431061e901613751931f047d1971337153f96d0e5e363d6dbf6a67" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec", "bytemuck", "cfg-if", "png", @@ -5876,7 +4939,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" dependencies = [ "arrayref", - "arrayvec 0.7.4", + "arrayvec", "bytemuck", "cfg-if", "log", @@ -5991,7 +5054,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.5.0", + "indexmap", "toml_datetime", "winnow 0.5.16", ] @@ -6002,7 +5065,7 @@ version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ - "indexmap 2.5.0", + "indexmap", "toml_datetime", "winnow 0.6.18", ] @@ -6141,12 +5204,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "typed-arena" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" - [[package]] name = "typeid" version = "1.0.2" @@ -6154,16 +5211,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" [[package]] -name = "typenum" -version = "1.17.0" +name = "unicase" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "ucd-trie" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] [[package]] name = "unicode-bidi" @@ -6579,7 +5633,7 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e37c7b9921b75dfd26dd973fdcbce36f13dfa6e2dc82aece584e0ed48c355c" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "cfg-if", "cfg_aliases 0.1.1", "document-features", @@ -6605,13 +5659,13 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d50819ab545b867d8a454d1d756b90cd5f15da1f2943334ca314af10583c9d39" dependencies = [ - "arrayvec 0.7.4", + "arrayvec", "bit-vec", "bitflags 2.6.0", "cfg_aliases 0.1.1", "codespan-reporting", "document-features", - "indexmap 2.5.0", + "indexmap", "log", "naga", "once_cell", @@ -6633,7 +5687,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "172e490a87295564f3fcc0f165798d87386f6231b04d4548bca458cbbfd63222" dependencies = [ "android_system_properties", - "arrayvec 0.7.4", + "arrayvec", "ash", "bit-set", "bitflags 2.6.0", @@ -6682,16 +5736,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "wide" -version = "0.7.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690" -dependencies = [ - "bytemuck", - "safe_arch", -] - [[package]] name = "widestring" version = "1.0.2" @@ -7187,16 +6231,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.50.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" -dependencies = [ - "cfg-if", - "windows-sys 0.48.0", -] - [[package]] name = "x11-dl" version = "2.21.0" @@ -7297,7 +6331,6 @@ version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "byteorder", "zerocopy-derive", ] @@ -7318,6 +6351,12 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zune-core" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f423a2c17029964870cfaabb1f13dfab7d092a62a29a89264f4d36990ca414a" + [[package]] name = "zune-inflate" version = "0.2.54" @@ -7326,3 +6365,12 @@ checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" dependencies = [ "simd-adler32", ] + +[[package]] +name = "zune-jpeg" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" +dependencies = [ + "zune-core", +] diff --git a/Cargo.toml b/Cargo.toml index d490e58..56014d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ lto = "thin" [dependencies] #bevy = { git = "https://github.com/bevyengine/bevy", branch = "release-0.11.3", features = ["dynamic_linking"] } -bevy = { version = "0.14.2" } +bevy = { version = "0.14.2", features = ["jpeg"] } bevy_easings = "0.14" #bevy_panorbit_camera = { git = "https://github.com/jan-tennert/bevy_panorbit_camera", rev = "7e3c3f8" } bevy-inspector-egui = { version = "0.26.0"} @@ -33,6 +33,7 @@ winit = "0.28.7" image = "0.24.7" bevy_mod_billboard = "0.7.0" blocking = "1.5.1" -anise = "0.4.3" egui-toast = "0.14.0" tinyfiledialogs = "3.0" +egui_extras = { version = "0.28.0", features = ["chrono"] } +reqwest = { version = "0.12.7", features = ["blocking", "json"] } diff --git a/assets/models/earth_4k.glb b/assets/models/earth_4k.glb new file mode 100644 index 0000000..808cf62 Binary files /dev/null and b/assets/models/earth_4k.glb differ diff --git a/assets/models/earth_4k_2.glb b/assets/models/earth_4k_2.glb new file mode 100644 index 0000000..b160494 Binary files /dev/null and b/assets/models/earth_4k_2.glb differ diff --git a/assets/models/hubble.glb b/assets/models/hubble.glb new file mode 100644 index 0000000..6cc69d2 Binary files /dev/null and b/assets/models/hubble.glb differ diff --git a/assets/models/iss.glb b/assets/models/iss.glb new file mode 100644 index 0000000..2956715 Binary files /dev/null and b/assets/models/iss.glb differ diff --git a/assets/scenarios/earth_satellites.sim b/assets/scenarios/earth_satellites.sim deleted file mode 100644 index 6b2bddb..0000000 --- a/assets/scenarios/earth_satellites.sim +++ /dev/null @@ -1,851 +0,0 @@ -{ - "bodies": [ - { - "data": { - "mass": 1.9885E30, - "starting_position": { - "x": -1253558.344523507, - "y": -331931.4431501561, - "z": 31972.046837662 - }, - "starting_velocity": { - "x": 0.006931107133912123, - "y": -0.01362000313964326, - "z": -4.54388831820406E-5 - }, - "name": "Sol", - "model_path": "sun.glb", - "diameter": 1392000.0, - "rotation_speed": 38880.0, - "axial_tilt": 7.25, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 5.97219E24, - "starting_position": { - "x": 1.47358878457139E8, - "y": 1.854315256927273E7, - "z": 29904.29803438578 - }, - "starting_velocity": { - "x": -4.226365231723641, - "y": 29.41379349033467, - "z": -0.002828583292782128 - }, - "name": "Earth", - "model_path": "earth.glb", - "diameter": 12742.0, - "rotation_speed": 1436.0, - "axial_tilt": 23.4392811, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 7.348E22, - "starting_position": { - "x": 1.4768044919678E8, - "y": 1.872052246844263E7, - "z": 32437.75744153466 - }, - "starting_velocity": { - "x": -4.694794112410923, - "y": 30.37390017058626, - "z": 0.09549595923954257 - }, - "name": "Moon", - "model_path": "moon.glb", - "diameter": 1738.1, - "rotation_speed": 39343.68, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 420000.0, - "starting_position": { - "x": 1.473527157673001E8, - "y": 1.854377197753885E7, - "z": 32687.02643421665 - }, - "starting_velocity": { - "x": -1.45562616429677, - "y": 26.86558693275802, - "z": 6.676360863324918 - }, - "name": "ISS", - "model_path": "iss.glb", - "diameter": 0.11, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": false - }, - "children": [] - }, - { - "data": { - "mass": 12200.0, - "starting_position": { - "x": 1.473574824275498E8, - "y": 1.853650067043575E7, - "z": 31105.44444823079 - }, - "starting_velocity": { - "x": 2.337654024613603, - "y": 28.72201739576322, - "z": 3.768849345271146 - }, - "name": "Hubble", - "model_path": "hubble.glb", - "diameter": 0.013, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": false - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 5.6834E26, - "starting_position": { - "x": 1.317721699784666E9, - "y": -6.263762138853518E8, - "z": -4.157355925955266E7 - }, - "starting_velocity": { - "x": 3.608323540191913, - "y": 8.705880483493228, - "z": -0.2953903588682212 - }, - "name": "Saturn", - "model_path": "saturn.glb", - "diameter": 116464.0, - "rotation_speed": 633.0, - "axial_tilt": 26.73, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 1.3452E23, - "starting_position": { - "x": 1.317062395789841E9, - "y": -6.254109541976979E8, - "z": -4.200566301576936E7 - }, - "starting_velocity": { - "x": -1.060852998165573, - "y": 6.402666517530363, - "z": 1.357634287951674 - }, - "name": "Titan", - "model_path": "titan.glb", - "diameter": 5149.46, - "rotation_speed": 22920.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 2.3064854E21, - "starting_position": { - "x": 1.317198227126551E9, - "y": -6.263121286545614E8, - "z": -4.155952859529075E7 - }, - "starting_velocity": { - "x": 2.806558904291587, - "y": 1.2701482567137, - "z": 3.694364144037066 - }, - "name": "Rhea", - "model_path": "rhea.glb", - "diameter": 763.5, - "rotation_speed": 6480.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.8056591E21, - "starting_position": { - "x": 1.320855160609993E9, - "y": -6.278521340465181E8, - "z": -4.186440417667893E7 - }, - "starting_velocity": { - "x": 4.854646792968393, - "y": 11.66248870085356, - "z": -1.230081930411274 - }, - "name": "Iapetus", - "model_path": "iapetus.glb", - "diameter": 1470.0, - "rotation_speed": 113760.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.0954867999999999E21, - "starting_position": { - "x": 1.318063919760553E9, - "y": -6.26526636509911E8, - "z": -4.152808612631324E7 - }, - "starting_velocity": { - "x": 7.705841565764674, - "y": 16.66690708035977, - "z": -4.861168661971909 - }, - "name": "Dione", - "model_path": "dione.glb", - "diameter": 1123.0, - "rotation_speed": 3941.1576, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 6.174959E20, - "starting_position": { - "x": 1.317498514533114E9, - "y": -6.261968167390172E8, - "z": -4.164324520863017E7 - }, - "starting_velocity": { - "x": -3.711987600444088, - "y": 1.440318005837302, - "z": 4.443003247932851 - }, - "name": "Tethys", - "model_path": "tethys.glb", - "diameter": 1062.0, - "rotation_speed": 2718.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.75094E19, - "starting_position": { - "x": 1.317862368973109E9, - "y": -6.262736478866278E8, - "z": -4.163625521668619E7 - }, - "starting_velocity": { - "x": -5.466336813759373, - "y": 18.80368314533501, - "z": -4.960595064530139 - }, - "name": "Mimas", - "model_path": "mimas.glb", - "diameter": 396.0, - "rotation_speed": 1356.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.080318E20, - "starting_position": { - "x": 1.317897357123477E9, - "y": -6.265236953599699E8, - "z": -4.15133347885673E7 - }, - "starting_velocity": { - "x": 12.03172552201499, - "y": 16.74134008425769, - "z": -5.324491936368194 - }, - "name": "Enceladus", - "model_path": "enceladus.glb", - "diameter": 504.0, - "rotation_speed": 1973.11392, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 1.8982E27, - "starting_position": { - "x": 5.91116405042928E8, - "y": 4.48612773658671E8, - "z": -1.508610682481316E7 - }, - "starting_velocity": { - "x": -8.045068878300311, - "y": 11.02381638213635, - "z": 0.1341531152888358 - }, - "name": "Jupiter", - "model_path": "jupiter.glb", - "diameter": 139822.0, - "rotation_speed": 595.0, - "axial_tilt": 3.13, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 8.931938E22, - "starting_position": { - "x": 5.910424467821088E8, - "y": 4.481963687394117E8, - "z": -1.510185010929203E7 - }, - "starting_velocity": { - "x": 8.957736595686779, - "y": 7.959026250920237, - "z": 0.2787009746093063 - }, - "name": "Io", - "model_path": "io.glb", - "diameter": 3643.2, - "rotation_speed": 2547.36, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 4.799844E22, - "starting_position": { - "x": 5.917799042824603E8, - "y": 4.486983281930672E8, - "z": -1.506823606685701E7 - }, - "starting_velocity": { - "x": -9.693151465294227, - "y": 24.69741639214316, - "z": 0.569429680046083 - }, - "name": "Europa", - "model_path": "europa.glb", - "diameter": 1560.8, - "rotation_speed": 5113.70064, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.4819E23, - "starting_position": { - "x": 5.920393829735433E8, - "y": 4.480741128331422E8, - "z": -1.509370908536822E7 - }, - "starting_velocity": { - "x": -2.558462326557859, - "y": 20.43120719962253, - "z": 0.5697972593813327 - }, - "name": "Ganymede", - "model_path": "ganymede.glb", - "diameter": 5268.2, - "rotation_speed": 10303.2, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.075938E23, - "starting_position": { - "x": 5.928184462926141E8, - "y": 4.478344900349652E8, - "z": -1.508781974881226E7 - }, - "starting_velocity": { - "x": -4.643871215581399, - "y": 18.53965996642426, - "z": 0.4153266498041814 - }, - "name": "Callisto", - "model_path": "callisto.glb", - "diameter": 4820.6, - "rotation_speed": 24032.16, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 4.8675E24, - "starting_position": { - "x": 8.476483460935698E7, - "y": 6.527795533113867E7, - "z": -4030295.749102697 - }, - "starting_velocity": { - "x": -21.33838684070412, - "y": 27.68230884313838, - "z": 1.611943339470342 - }, - "name": "Venus", - "model_path": "venus.glb", - "diameter": 12103.6, - "rotation_speed": 349946.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.3011E23, - "starting_position": { - "x": -2.65823594034951E7, - "y": 4.047607508223532E7, - "z": 5690109.263829736 - }, - "starting_velocity": { - "x": -51.19740738494808, - "y": -23.82829179403439, - "z": 2.750476586235273 - }, - "name": "Mercury", - "model_path": "mercury.glb", - "diameter": 4880.0, - "rotation_speed": 84480.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 8.681E25, - "starting_position": { - "x": 1.876848145196212E9, - "y": 2.256742495428547E9, - "z": -1.593333878791571E7 - }, - "starting_velocity": { - "x": -5.285944969180821, - "y": 4.037177487005098, - "z": 0.0832885977451503 - }, - "name": "Uranus", - "model_path": "uranus.glb", - "diameter": 50724.0, - "rotation_speed": 1034.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 6.4E19, - "starting_position": { - "x": 1.876793591976653E9, - "y": 2.256780204161452E9, - "z": -1.582184453453541E7 - }, - "starting_velocity": { - "x": 0.5593250277603632, - "y": 3.223358609129066, - "z": 3.227082066969737 - }, - "name": "Miranda", - "model_path": "miranda.glb", - "diameter": 471.6, - "rotation_speed": 2035.40976, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.251E21, - "starting_position": { - "x": 1.87669550752492E9, - "y": 2.256760167205151E9, - "z": -1.604669083471954E7 - }, - "starting_velocity": { - "x": -8.385308784191833, - "y": 5.318928951790138, - "z": 4.453089305595049 - }, - "name": "Ariel", - "model_path": "ariel.glb", - "diameter": 1157.8, - "rotation_speed": 3629.34576, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.275E21, - "starting_position": { - "x": 1.877032097119599E9, - "y": 2.256677176877903E9, - "z": -1.611531210892296E7 - }, - "starting_velocity": { - "x": -8.506198828430891, - "y": 4.275436104814067, - "z": -3.265378937492151 - }, - "name": "Umbriel", - "model_path": "umbriel.glb", - "diameter": 1169.4, - "rotation_speed": 5904.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.4E21, - "starting_position": { - "x": 1.876446721049093E9, - "y": 2.256849468855134E9, - "z": -1.579768942792165E7 - }, - "starting_velocity": { - "x": -4.077764161868127, - "y": 4.250690343060523, - "z": 3.508220529443759 - }, - "name": "Titania", - "model_path": "titania.glb", - "diameter": 1576.8, - "rotation_speed": 12528.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.076E21, - "starting_position": { - "x": 1.876691132612216E9, - "y": 2.256854991280804E9, - "z": -1.538266894913125E7 - }, - "starting_velocity": { - "x": -2.324170074400168, - "y": 3.526797505106853, - "z": 1.030057319525953 - }, - "name": "Oberon", - "model_path": "oberon.glb", - "diameter": 1522.8, - "rotation_speed": 19440.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 1.024E26, - "starting_position": { - "x": 4.46073781433013E9, - "y": -3.117194956197202E8, - "z": -9.638308729856475E7 - }, - "starting_velocity": { - "x": 0.3424898338191547, - "y": 5.454448402599064, - "z": -0.1196973250551823 - }, - "name": "Neptune", - "model_path": "neptune.glb", - "diameter": 49244.0, - "rotation_speed": 960.0, - "axial_tilt": 28.32, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 2.139E22, - "starting_position": { - "x": 4.46043565553476E9, - "y": -3.118210796191955E8, - "z": -9.622740008927625E7 - }, - "starting_velocity": { - "x": 0.6549830743821887, - "y": 8.816651890055235, - "z": 2.683376921837763 - }, - "name": "Triton", - "model_path": "triton.glb", - "diameter": 2706.8, - "rotation_speed": 8496.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 1.303E22, - "starting_position": { - "x": 2.534605027840262E9, - "y": -4.550728311952005E9, - "z": -2.46201602553565E8 - }, - "starting_velocity": { - "x": 4.90550581768183, - "y": 1.466573354685091, - "z": -1.58125012378935 - }, - "name": "Pluto", - "model_path": "pluto.glb", - "diameter": 2376.6, - "rotation_speed": 9201.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 1.586E21, - "starting_position": { - "x": 2.534602841613384E9, - "y": -4.550740270530462E9, - "z": -2.46216972222549E8 - }, - "starting_velocity": { - "x": 4.743470035507049, - "y": 1.357540337784795, - "z": -1.47338180231602 - }, - "name": "Charon", - "model_path": "charon.glb", - "diameter": 1212.0, - "rotation_speed": 9197.28, - "axial_tilt": 0.0, - "simulate": false - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 6.4171E23, - "starting_position": { - "x": -2.046893400400904E8, - "y": -1.250136923437167E8, - "z": 2409131.185058415 - }, - "starting_velocity": { - "x": 13.57395490411145, - "y": -18.60254221026088, - "z": -0.7224152414868863 - }, - "name": "Mars", - "model_path": "mars.glb", - "diameter": 6779.0, - "rotation_speed": 1476.0, - "axial_tilt": 25.19, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 1.0659E16, - "starting_position": { - "x": -2.046811201572424E8, - "y": -1.250112401183025E8, - "z": 2405122.029878475 - }, - "starting_velocity": { - "x": 13.1724712527701, - "y": -16.55773129437739, - "z": -0.3519634910822811 - }, - "name": "Phobos", - "model_path": "phobos.glb", - "diameter": 22.16, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.4762E15, - "starting_position": { - "x": -2.046898065944895E8, - "y": -1.24990331767902E8, - "z": 2411141.282914884 - }, - "starting_velocity": { - "x": 12.33964871357277, - "y": -18.67418157402109, - "z": -0.1763597828023391 - }, - "name": "Deimos", - "model_path": "deimos.glb", - "diameter": 12.54, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 9.38392E20, - "starting_position": { - "x": -2.762371221893816E8, - "y": -2.903518150199021E8, - "z": 4.151164079416633E7 - }, - "starting_velocity": { - "x": 12.07056566717051, - "y": -13.70357563530193, - "z": -2.655445328553542 - }, - "name": "Ceres", - "model_path": "ceres.glb", - "diameter": 939.4, - "rotation_speed": 540.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.6466E22, - "starting_position": { - "x": 1.280400740948511E10, - "y": 5.796599006941406E9, - "z": -2.733004417387743E9 - }, - "starting_velocity": { - "x": -0.7745567938606255, - "y": 1.50385470985689, - "z": 1.614258646777714 - }, - "name": "Eris", - "model_path": "eris.glb", - "diameter": 2326.0, - "rotation_speed": 1554.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 2.2E14, - "starting_position": { - "x": -2.974525169762023E9, - "y": 4.071518952895051E9, - "z": -1.489577717564979E9 - }, - "starting_velocity": { - "x": 0.7036787387939378, - "y": 0.567179895714418, - "z": 0.09880162683010832 - }, - "name": "Halley's Comet", - "model_path": "deimos.glb", - "diameter": 11.0, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 721.9, - "starting_position": { - "x": 5.567899398702804E9, - "y": -1.48929564919915E10, - "z": -1.234693053386691E10 - }, - "starting_velocity": { - "x": 4.222130606182812, - "y": -9.357402996434875, - "z": -11.33474239077342 - }, - "name": "Voyager-2", - "model_path": "voyager.glb", - "diameter": 0.001, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.1E21, - "starting_position": { - "x": -6.899004382898172E9, - "y": -1.090297370986418E9, - "z": 3.649000392627125E9 - }, - "starting_velocity": { - "x": 0.2044745917565618, - "y": -3.731030512801199, - "z": -0.4904247640299213 - }, - "name": "Makemake", - "model_path": "makemake.glb", - "diameter": 1430.0, - "rotation_speed": 1350.0, - "axial_tilt": 28.96, - "simulate": true - }, - "children": [] - } - ] - } - ], - "starting_time_millis": 1696118400000, - "title": "Earth Satellites", - "description": "A scenario with all major satellites orbiting the Earth." -} \ No newline at end of file diff --git a/assets/scenarios/solar_system.sim b/assets/scenarios/solar_system.sim deleted file mode 100644 index da0217d..0000000 --- a/assets/scenarios/solar_system.sim +++ /dev/null @@ -1,857 +0,0 @@ -{ - "bodies": [ - { - "data": { - "mass": 1.9885E30, - "starting_position": { - "x": -1253558.344523507, - "y": -331931.4431501561, - "z": 31972.046837662 - }, - "starting_velocity": { - "x": 0.006931107133912123, - "y": -0.01362000313964326, - "z": -4.54388831820406E-5 - }, - "name": "Sol", - "model_path": "sun.glb", - "diameter": 1392000.0, - "rotation_speed": 38880.0, - "axial_tilt": 7.25, - "simulate": true, - "light_source": { - "intensity": 3.75E28, - "range": 4436820000000, - "color": "#ffffff", - "enabled": true - } - }, - "children": [ - { - "data": { - "mass": 5.97219E24, - "starting_position": { - "x": 1.47358878457139E8, - "y": 1.854315256927273E7, - "z": 29904.29803438578 - }, - "starting_velocity": { - "x": -4.226365231723641, - "y": 29.41379349033467, - "z": -0.002828583292782128 - }, - "name": "Earth", - "model_path": "earth.glb", - "diameter": 12742.0, - "rotation_speed": 1436.0, - "axial_tilt": 23.4392811, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 7.348E22, - "starting_position": { - "x": 1.4768044919678E8, - "y": 1.872052246844263E7, - "z": 32437.75744153466 - }, - "starting_velocity": { - "x": -4.694794112410923, - "y": 30.37390017058626, - "z": 0.09549595923954257 - }, - "name": "Moon", - "model_path": "moon.glb", - "diameter": 1738.1, - "rotation_speed": 39343.68, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 420000.0, - "starting_position": { - "x": 1.473527157673001E8, - "y": 1.854377197753885E7, - "z": 32687.02643421665 - }, - "starting_velocity": { - "x": -1.45562616429677, - "y": 26.86558693275802, - "z": 6.676360863324918 - }, - "name": "ISS", - "model_path": "iss.glb", - "diameter": 0.11, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": false - }, - "children": [] - }, - { - "data": { - "mass": 12200.0, - "starting_position": { - "x": 1.473574824275498E8, - "y": 1.853650067043575E7, - "z": 31105.44444823079 - }, - "starting_velocity": { - "x": 2.337654024613603, - "y": 28.72201739576322, - "z": 3.768849345271146 - }, - "name": "Hubble", - "model_path": "hubble.glb", - "diameter": 0.013, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": false - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 5.6834E26, - "starting_position": { - "x": 1.317721699784666E9, - "y": -6.263762138853518E8, - "z": -4.157355925955266E7 - }, - "starting_velocity": { - "x": 3.608323540191913, - "y": 8.705880483493228, - "z": -0.2953903588682212 - }, - "name": "Saturn", - "model_path": "saturn.glb", - "diameter": 116464.0, - "rotation_speed": 633.0, - "axial_tilt": 26.73, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 1.3452E23, - "starting_position": { - "x": 1.317062395789841E9, - "y": -6.254109541976979E8, - "z": -4.200566301576936E7 - }, - "starting_velocity": { - "x": -1.060852998165573, - "y": 6.402666517530363, - "z": 1.357634287951674 - }, - "name": "Titan", - "model_path": "titan.glb", - "diameter": 5149.46, - "rotation_speed": 22920.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 2.3064854E21, - "starting_position": { - "x": 1.317198227126551E9, - "y": -6.263121286545614E8, - "z": -4.155952859529075E7 - }, - "starting_velocity": { - "x": 2.806558904291587, - "y": 1.2701482567137, - "z": 3.694364144037066 - }, - "name": "Rhea", - "model_path": "rhea.glb", - "diameter": 763.5, - "rotation_speed": 6480.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.8056591E21, - "starting_position": { - "x": 1.320855160609993E9, - "y": -6.278521340465181E8, - "z": -4.186440417667893E7 - }, - "starting_velocity": { - "x": 4.854646792968393, - "y": 11.66248870085356, - "z": -1.230081930411274 - }, - "name": "Iapetus", - "model_path": "iapetus.glb", - "diameter": 1470.0, - "rotation_speed": 113760.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.0954867999999999E21, - "starting_position": { - "x": 1.318063919760553E9, - "y": -6.26526636509911E8, - "z": -4.152808612631324E7 - }, - "starting_velocity": { - "x": 7.705841565764674, - "y": 16.66690708035977, - "z": -4.861168661971909 - }, - "name": "Dione", - "model_path": "dione.glb", - "diameter": 1123.0, - "rotation_speed": 3941.1576, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 6.174959E20, - "starting_position": { - "x": 1.317498514533114E9, - "y": -6.261968167390172E8, - "z": -4.164324520863017E7 - }, - "starting_velocity": { - "x": -3.711987600444088, - "y": 1.440318005837302, - "z": 4.443003247932851 - }, - "name": "Tethys", - "model_path": "tethys.glb", - "diameter": 1062.0, - "rotation_speed": 2718.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.75094E19, - "starting_position": { - "x": 1.317862368973109E9, - "y": -6.262736478866278E8, - "z": -4.163625521668619E7 - }, - "starting_velocity": { - "x": -5.466336813759373, - "y": 18.80368314533501, - "z": -4.960595064530139 - }, - "name": "Mimas", - "model_path": "mimas.glb", - "diameter": 396.0, - "rotation_speed": 1356.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.080318E20, - "starting_position": { - "x": 1.317897357123477E9, - "y": -6.265236953599699E8, - "z": -4.15133347885673E7 - }, - "starting_velocity": { - "x": 12.03172552201499, - "y": 16.74134008425769, - "z": -5.324491936368194 - }, - "name": "Enceladus", - "model_path": "enceladus.glb", - "diameter": 504.0, - "rotation_speed": 1973.11392, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 1.8982E27, - "starting_position": { - "x": 5.91116405042928E8, - "y": 4.48612773658671E8, - "z": -1.508610682481316E7 - }, - "starting_velocity": { - "x": -8.045068878300311, - "y": 11.02381638213635, - "z": 0.1341531152888358 - }, - "name": "Jupiter", - "model_path": "jupiter.glb", - "diameter": 139822.0, - "rotation_speed": 595.0, - "axial_tilt": 3.13, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 8.931938E22, - "starting_position": { - "x": 5.910424467821088E8, - "y": 4.481963687394117E8, - "z": -1.510185010929203E7 - }, - "starting_velocity": { - "x": 8.957736595686779, - "y": 7.959026250920237, - "z": 0.2787009746093063 - }, - "name": "Io", - "model_path": "io.glb", - "diameter": 3643.2, - "rotation_speed": 2547.36, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 4.799844E22, - "starting_position": { - "x": 5.917799042824603E8, - "y": 4.486983281930672E8, - "z": -1.506823606685701E7 - }, - "starting_velocity": { - "x": -9.693151465294227, - "y": 24.69741639214316, - "z": 0.569429680046083 - }, - "name": "Europa", - "model_path": "europa.glb", - "diameter": 1560.8, - "rotation_speed": 5113.70064, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.4819E23, - "starting_position": { - "x": 5.920393829735433E8, - "y": 4.480741128331422E8, - "z": -1.509370908536822E7 - }, - "starting_velocity": { - "x": -2.558462326557859, - "y": 20.43120719962253, - "z": 0.5697972593813327 - }, - "name": "Ganymede", - "model_path": "ganymede.glb", - "diameter": 5268.2, - "rotation_speed": 10303.2, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.075938E23, - "starting_position": { - "x": 5.928184462926141E8, - "y": 4.478344900349652E8, - "z": -1.508781974881226E7 - }, - "starting_velocity": { - "x": -4.643871215581399, - "y": 18.53965996642426, - "z": 0.4153266498041814 - }, - "name": "Callisto", - "model_path": "callisto.glb", - "diameter": 4820.6, - "rotation_speed": 24032.16, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 4.8675E24, - "starting_position": { - "x": 8.476483460935698E7, - "y": 6.527795533113867E7, - "z": -4030295.749102697 - }, - "starting_velocity": { - "x": -21.33838684070412, - "y": 27.68230884313838, - "z": 1.611943339470342 - }, - "name": "Venus", - "model_path": "venus.glb", - "diameter": 12103.6, - "rotation_speed": 349946.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.3011E23, - "starting_position": { - "x": -2.65823594034951E7, - "y": 4.047607508223532E7, - "z": 5690109.263829736 - }, - "starting_velocity": { - "x": -51.19740738494808, - "y": -23.82829179403439, - "z": 2.750476586235273 - }, - "name": "Mercury", - "model_path": "mercury.glb", - "diameter": 4880.0, - "rotation_speed": 84480.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 8.681E25, - "starting_position": { - "x": 1.876848145196212E9, - "y": 2.256742495428547E9, - "z": -1.593333878791571E7 - }, - "starting_velocity": { - "x": -5.285944969180821, - "y": 4.037177487005098, - "z": 0.0832885977451503 - }, - "name": "Uranus", - "model_path": "uranus.glb", - "diameter": 50724.0, - "rotation_speed": 1034.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 6.4E19, - "starting_position": { - "x": 1.876793591976653E9, - "y": 2.256780204161452E9, - "z": -1.582184453453541E7 - }, - "starting_velocity": { - "x": 0.5593250277603632, - "y": 3.223358609129066, - "z": 3.227082066969737 - }, - "name": "Miranda", - "model_path": "miranda.glb", - "diameter": 471.6, - "rotation_speed": 2035.40976, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.251E21, - "starting_position": { - "x": 1.87669550752492E9, - "y": 2.256760167205151E9, - "z": -1.604669083471954E7 - }, - "starting_velocity": { - "x": -8.385308784191833, - "y": 5.318928951790138, - "z": 4.453089305595049 - }, - "name": "Ariel", - "model_path": "ariel.glb", - "diameter": 1157.8, - "rotation_speed": 3629.34576, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.275E21, - "starting_position": { - "x": 1.877032097119599E9, - "y": 2.256677176877903E9, - "z": -1.611531210892296E7 - }, - "starting_velocity": { - "x": -8.506198828430891, - "y": 4.275436104814067, - "z": -3.265378937492151 - }, - "name": "Umbriel", - "model_path": "umbriel.glb", - "diameter": 1169.4, - "rotation_speed": 5904.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.4E21, - "starting_position": { - "x": 1.876446721049093E9, - "y": 2.256849468855134E9, - "z": -1.579768942792165E7 - }, - "starting_velocity": { - "x": -4.077764161868127, - "y": 4.250690343060523, - "z": 3.508220529443759 - }, - "name": "Titania", - "model_path": "titania.glb", - "diameter": 1576.8, - "rotation_speed": 12528.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.076E21, - "starting_position": { - "x": 1.876691132612216E9, - "y": 2.256854991280804E9, - "z": -1.538266894913125E7 - }, - "starting_velocity": { - "x": -2.324170074400168, - "y": 3.526797505106853, - "z": 1.030057319525953 - }, - "name": "Oberon", - "model_path": "oberon.glb", - "diameter": 1522.8, - "rotation_speed": 19440.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 1.024E26, - "starting_position": { - "x": 4.46073781433013E9, - "y": -3.117194956197202E8, - "z": -9.638308729856475E7 - }, - "starting_velocity": { - "x": 0.3424898338191547, - "y": 5.454448402599064, - "z": -0.1196973250551823 - }, - "name": "Neptune", - "model_path": "neptune.glb", - "diameter": 49244.0, - "rotation_speed": 960.0, - "axial_tilt": 28.32, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 2.139E22, - "starting_position": { - "x": 4.46043565553476E9, - "y": -3.118210796191955E8, - "z": -9.622740008927625E7 - }, - "starting_velocity": { - "x": 0.6549830743821887, - "y": 8.816651890055235, - "z": 2.683376921837763 - }, - "name": "Triton", - "model_path": "triton.glb", - "diameter": 2706.8, - "rotation_speed": 8496.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 1.303E22, - "starting_position": { - "x": 2.534605027840262E9, - "y": -4.550728311952005E9, - "z": -2.46201602553565E8 - }, - "starting_velocity": { - "x": 4.90550581768183, - "y": 1.466573354685091, - "z": -1.58125012378935 - }, - "name": "Pluto", - "model_path": "pluto.glb", - "diameter": 2376.6, - "rotation_speed": 9201.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 1.586E21, - "starting_position": { - "x": 2.534602841613384E9, - "y": -4.550740270530462E9, - "z": -2.46216972222549E8 - }, - "starting_velocity": { - "x": 4.743470035507049, - "y": 1.357540337784795, - "z": -1.47338180231602 - }, - "name": "Charon", - "model_path": "charon.glb", - "diameter": 1212.0, - "rotation_speed": 9197.28, - "axial_tilt": 0.0, - "simulate": false - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 6.4171E23, - "starting_position": { - "x": -2.046893400400904E8, - "y": -1.250136923437167E8, - "z": 2409131.185058415 - }, - "starting_velocity": { - "x": 13.57395490411145, - "y": -18.60254221026088, - "z": -0.7224152414868863 - }, - "name": "Mars", - "model_path": "mars.glb", - "diameter": 6779.0, - "rotation_speed": 1476.0, - "axial_tilt": 25.19, - "simulate": true - }, - "children": [ - { - "data": { - "mass": 1.0659E16, - "starting_position": { - "x": -2.046811201572424E8, - "y": -1.250112401183025E8, - "z": 2405122.029878475 - }, - "starting_velocity": { - "x": 13.1724712527701, - "y": -16.55773129437739, - "z": -0.3519634910822811 - }, - "name": "Phobos", - "model_path": "phobos.glb", - "diameter": 22.16, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.4762E15, - "starting_position": { - "x": -2.046898065944895E8, - "y": -1.24990331767902E8, - "z": 2411141.282914884 - }, - "starting_velocity": { - "x": 12.33964871357277, - "y": -18.67418157402109, - "z": -0.1763597828023391 - }, - "name": "Deimos", - "model_path": "deimos.glb", - "diameter": 12.54, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - } - ] - }, - { - "data": { - "mass": 9.38392E20, - "starting_position": { - "x": -2.762371221893816E8, - "y": -2.903518150199021E8, - "z": 4.151164079416633E7 - }, - "starting_velocity": { - "x": 12.07056566717051, - "y": -13.70357563530193, - "z": -2.655445328553542 - }, - "name": "Ceres", - "model_path": "ceres.glb", - "diameter": 939.4, - "rotation_speed": 540.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 1.6466E22, - "starting_position": { - "x": 1.280400740948511E10, - "y": 5.796599006941406E9, - "z": -2.733004417387743E9 - }, - "starting_velocity": { - "x": -0.7745567938606255, - "y": 1.50385470985689, - "z": 1.614258646777714 - }, - "name": "Eris", - "model_path": "eris.glb", - "diameter": 2326.0, - "rotation_speed": 1554.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 2.2E14, - "starting_position": { - "x": -2.974525169762023E9, - "y": 4.071518952895051E9, - "z": -1.489577717564979E9 - }, - "starting_velocity": { - "x": 0.7036787387939378, - "y": 0.567179895714418, - "z": 0.09880162683010832 - }, - "name": "Halley's Comet", - "model_path": "deimos.glb", - "diameter": 11.0, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 721.9, - "starting_position": { - "x": 5.567899398702804E9, - "y": -1.48929564919915E10, - "z": -1.234693053386691E10 - }, - "starting_velocity": { - "x": 4.222130606182812, - "y": -9.357402996434875, - "z": -11.33474239077342 - }, - "name": "Voyager-2", - "model_path": "voyager.glb", - "diameter": 0.001, - "rotation_speed": 0.0, - "axial_tilt": 0.0, - "simulate": true - }, - "children": [] - }, - { - "data": { - "mass": 3.1E21, - "starting_position": { - "x": -6.899004382898172E9, - "y": -1.090297370986418E9, - "z": 3.649000392627125E9 - }, - "starting_velocity": { - "x": 0.2044745917565618, - "y": -3.731030512801199, - "z": -0.4904247640299213 - }, - "name": "Makemake", - "model_path": "makemake.glb", - "diameter": 1430.0, - "rotation_speed": 1350.0, - "axial_tilt": 28.96, - "simulate": true - }, - "children": [] - } - ] - } - ], - "starting_time_millis": 1696118400000, - "title": "Solar System", - "description": "A scenario with all major bodies and their major moons in the Solar System." -} \ No newline at end of file diff --git a/assets/scenarios/solar_system_copy.sim b/assets/scenarios/solar_system_copy.sim deleted file mode 100644 index fa78f20..0000000 --- a/assets/scenarios/solar_system_copy.sim +++ /dev/null @@ -1 +0,0 @@ -{"bodies":[{"children":[{"children":[],"data":{"mass":3.3011e23,"starting_position":{"x":-26582359.4034951,"y":40476075.08223532,"z":5690109.263829736},"starting_velocity":{"x":-51.19740738494808,"y":-23.82829179403439,"z":2.750476586235273},"name":"Mercury","model_path":"mercury.glb","diameter":5151.0,"rotation_speed":84480.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":4.8675e24,"starting_position":{"x":84764834.60935698,"y":65277955.33113867,"z":-4030295.749102697},"starting_velocity":{"x":-21.33838684070412,"y":27.68230884313838,"z":1.611943339470342},"name":"Venus","model_path":"venus.glb","diameter":12103.6,"rotation_speed":349946.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":7.348e22,"starting_position":{"x":147680449.19678,"y":18720522.46844263,"z":32437.75744153466},"starting_velocity":{"x":-4.694794112410923,"y":30.37390017058626,"z":0.09549595923954256},"name":"Moon","model_path":"moon.glb","diameter":1738.1,"rotation_speed":39343.68,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":5.97219e24,"starting_position":{"x":147358878.457139,"y":18543152.56927273,"z":29904.29803438578},"starting_velocity":{"x":-4.226365231723641,"y":29.41379349033467,"z":-0.002828583292782128},"name":"Earth","model_path":"earth.glb","diameter":12742.0,"rotation_speed":1436.0,"axial_tilt":23.439281,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":1.0659e16,"starting_position":{"x":-204681120.1572424,"y":-125011240.1183025,"z":2405122.029878475},"starting_velocity":{"x":13.1724712527701,"y":-16.55773129437739,"z":-0.3519634910822811},"name":"Phobos","model_path":"phobos.glb","diameter":22.16,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1476200000000000.0,"starting_position":{"x":-204689806.5944895,"y":-124990331.767902,"z":2411141.282914884},"starting_velocity":{"x":12.33964871357277,"y":-18.67418157402109,"z":-0.1763597828023391},"name":"Deimos","model_path":"deimos.glb","diameter":12.54,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":6.4171e23,"starting_position":{"x":-204689340.0400904,"y":-125013692.3437167,"z":2409131.185058415},"starting_velocity":{"x":13.57395490411145,"y":-18.60254221026088,"z":-0.7224152414868863},"name":"Mars","model_path":"mars.glb","diameter":6779.0,"rotation_speed":1476.0,"axial_tilt":25.19,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":9.38392e20,"starting_position":{"x":-276237122.1893816,"y":-290351815.0199021,"z":41511640.79416633},"starting_velocity":{"x":12.07056566717051,"y":-13.70357563530193,"z":-2.655445328553542},"name":"Ceres","model_path":"ceres.glb","diameter":939.4,"rotation_speed":540.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":8.931938e22,"starting_position":{"x":591042446.7821088,"y":448196368.7394117,"z":-15101850.10929203},"starting_velocity":{"x":8.957736595686779,"y":7.959026250920237,"z":0.2787009746093063},"name":"Io","model_path":"io.glb","diameter":3643.2,"rotation_speed":2547.36,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":4.799844e22,"starting_position":{"x":591779904.2824603,"y":448698328.1930672,"z":-15068236.06685701},"starting_velocity":{"x":-9.693151465294228,"y":24.69741639214316,"z":0.569429680046083},"name":"Europa","model_path":"europa.glb","diameter":1560.8,"rotation_speed":5113.70064,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.4819e23,"starting_position":{"x":592039382.9735433,"y":448074112.8331422,"z":-15093709.08536822},"starting_velocity":{"x":-2.558462326557859,"y":20.43120719962253,"z":0.5697972593813327},"name":"Ganymede","model_path":"ganymede.glb","diameter":5268.2,"rotation_speed":10303.2,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.075938e23,"starting_position":{"x":592818446.2926141,"y":447834490.0349652,"z":-15087819.74881226},"starting_velocity":{"x":-4.643871215581399,"y":18.53965996642426,"z":0.4153266498041814},"name":"Callisto","model_path":"callisto.glb","diameter":4820.6,"rotation_speed":24032.16,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":1.8981999999999999e27,"starting_position":{"x":591116405.042928,"y":448612773.658671,"z":-15086106.82481316},"starting_velocity":{"x":-8.045068878300311,"y":11.02381638213635,"z":0.1341531152888358},"name":"Jupiter","model_path":"jupiter.glb","diameter":139822.0,"rotation_speed":595.0,"axial_tilt":3.13,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":1.3452e23,"starting_position":{"x":1317062395.789841,"y":-625410954.1976979,"z":-42005663.01576936},"starting_velocity":{"x":-1.060852998165573,"y":6.402666517530363,"z":1.357634287951674},"name":"Titan","model_path":"titan.glb","diameter":5149.46,"rotation_speed":22920.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":2.3064854e21,"starting_position":{"x":1317198227.126551,"y":-626312128.6545614,"z":-41559528.59529075},"starting_velocity":{"x":2.806558904291587,"y":1.2701482567137,"z":3.694364144037066},"name":"Rhea","model_path":"rhea.glb","diameter":763.5,"rotation_speed":6480.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.8056591e21,"starting_position":{"x":1320855160.609993,"y":-627852134.0465181,"z":-41864404.17667893},"starting_velocity":{"x":4.854646792968393,"y":11.66248870085356,"z":-1.230081930411274},"name":"Iapetus","model_path":"iapetus.glb","diameter":1470.0,"rotation_speed":113760.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.0954868e21,"starting_position":{"x":1318063919.760553,"y":-626526636.509911,"z":-41528086.12631324},"starting_velocity":{"x":7.705841565764674,"y":16.66690708035977,"z":-4.861168661971909},"name":"Dione","model_path":"dione.glb","diameter":1123.0,"rotation_speed":3941.1576,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":6.174959e20,"starting_position":{"x":1317498514.533114,"y":-626196816.7390172,"z":-41643245.20863017},"starting_velocity":{"x":-3.711987600444088,"y":1.440318005837302,"z":4.443003247932851},"name":"Tethys","model_path":"tethys.glb","diameter":1062.0,"rotation_speed":2718.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":3.75094e19,"starting_position":{"x":1317862368.9731088,"y":-626273647.8866278,"z":-41636255.21668619},"starting_velocity":{"x":-5.466336813759373,"y":18.80368314533501,"z":-4.960595064530139},"name":"Mimas","model_path":"mimas.glb","diameter":396.0,"rotation_speed":1356.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.080318e20,"starting_position":{"x":1317897357.123477,"y":-626523695.3599699,"z":-41513334.7885673},"starting_velocity":{"x":12.03172552201499,"y":16.74134008425769,"z":-5.324491936368194},"name":"Enceladus","model_path":"enceladus.glb","diameter":504.0,"rotation_speed":1973.11392,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":5.6834e26,"starting_position":{"x":1317721699.784666,"y":-626376213.8853518,"z":-41573559.25955266},"starting_velocity":{"x":3.608323540191913,"y":8.705880483493228,"z":-0.2953903588682212},"name":"Saturn","model_path":"saturn.glb","diameter":116464.0,"rotation_speed":633.0,"axial_tilt":26.73,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":6.4e19,"starting_position":{"x":1876793591.976653,"y":2256780204.161452,"z":-15821844.53453541},"starting_velocity":{"x":0.5593250277603632,"y":3.223358609129066,"z":3.227082066969737},"name":"Miranda","model_path":"miranda.glb","diameter":471.6,"rotation_speed":2035.40976,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.251e21,"starting_position":{"x":1876695507.52492,"y":2256760167.205151,"z":-16046690.83471954},"starting_velocity":{"x":-8.385308784191833,"y":5.318928951790138,"z":4.453089305595049},"name":"Ariel","model_path":"ariel.glb","diameter":1157.8,"rotation_speed":3629.34576,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.275e21,"starting_position":{"x":1877032097.119599,"y":2256677176.877903,"z":-16115312.10892296},"starting_velocity":{"x":-8.506198828430891,"y":4.275436104814068,"z":-3.265378937492151},"name":"Umbriel","model_path":"umbriel.glb","diameter":1169.4,"rotation_speed":5904.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":3.4e21,"starting_position":{"x":1876446721.049093,"y":2256849468.855134,"z":-15797689.42792165},"starting_velocity":{"x":-4.077764161868127,"y":4.250690343060523,"z":3.508220529443759},"name":"Titania","model_path":"titania.glb","diameter":1576.8,"rotation_speed":12528.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":3.076e21,"starting_position":{"x":1876691132.612216,"y":2256854991.280804,"z":-15382668.94913125},"starting_velocity":{"x":-2.324170074400168,"y":3.526797505106853,"z":1.030057319525953},"name":"Oberon","model_path":"oberon.glb","diameter":1522.8,"rotation_speed":19440.0,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":8.681e25,"starting_position":{"x":1876848145.196212,"y":2256742495.428547,"z":-15933338.78791571},"starting_velocity":{"x":-5.285944969180821,"y":4.037177487005098,"z":0.0832885977451503},"name":"Uranus","model_path":"uranus.glb","diameter":50724.0,"rotation_speed":1034.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":2.139e22,"starting_position":{"x":4460435655.53476,"y":-311821079.6191955,"z":-96227400.08927624},"starting_velocity":{"x":0.6549830743821887,"y":8.816651890055235,"z":2.683376921837763},"name":"Triton","model_path":"triton.glb","diameter":2706.8,"rotation_speed":8496.0,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":1.024e26,"starting_position":{"x":4460737814.33013,"y":-311719495.6197202,"z":-96383087.29856476},"starting_velocity":{"x":0.3424898338191547,"y":5.454448402599064,"z":-0.1196973250551823},"name":"Neptune","model_path":"neptune.glb","diameter":49244.0,"rotation_speed":960.0,"axial_tilt":28.32,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.303e22,"starting_position":{"x":2534605027.840262,"y":-4550728311.952005,"z":-246201602.553565},"starting_velocity":{"x":4.90550581768183,"y":1.466573354685091,"z":-1.58125012378935},"name":"Pluto","model_path":"pluto.glb","diameter":2376.6,"rotation_speed":9201.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":220000000000000.0,"starting_position":{"x":-2974525169.762023,"y":4071518952.895051,"z":-1489577717.564979},"starting_velocity":{"x":0.7036787387939378,"y":0.567179895714418,"z":0.09880162683010832},"name":"Halley's Comet","model_path":"deimos.glb","diameter":11.0,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":3.1e21,"starting_position":{"x":-6899004382.898172,"y":-1090297370.986418,"z":3649000392.627125},"starting_velocity":{"x":0.2044745917565618,"y":-3.731030512801199,"z":-0.4904247640299213},"name":"Makemake","model_path":"makemake.glb","diameter":1430.0,"rotation_speed":1350.0,"axial_tilt":28.96,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.6466e22,"starting_position":{"x":12804007409.48511,"y":5796599006.941406,"z":-2733004417.387743},"starting_velocity":{"x":-0.7745567938606255,"y":1.50385470985689,"z":1.614258646777714},"name":"Eris","model_path":"eris.glb","diameter":2326.0,"rotation_speed":1554.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":721.9,"starting_position":{"x":5567899398.702804,"y":-14892956491.9915,"z":-12346930533.86691},"starting_velocity":{"x":4.222130606182812,"y":-9.357402996434876,"z":-11.33474239077342},"name":"Voyager-2","model_path":"voyager.glb","diameter":0.001,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":1.9885e30,"starting_position":{"x":-1253558.344523507,"y":-331931.4431501561,"z":31972.046837662},"starting_velocity":{"x":0.006931107133912123,"y":-0.01362000313964326,"z":-0.0000454388831820406},"name":"Sol","model_path":"sun.glb","diameter":1392000.0,"rotation_speed":38880.0,"axial_tilt":7.25,"simulate":true,"light_source":{"intensity":3.7500000351027205e28,"range":4436820000000.0,"color":"#002EFF","enabled":true}}}],"starting_time_millis":1696118400000,"title":"Solar System2dd","description":"A scenario with all major bodies and their major moons in the Solar System."} \ No newline at end of file diff --git a/assets/scenarios/earth_satellites.png b/scenarios/earth_satellites.png similarity index 100% rename from assets/scenarios/earth_satellites.png rename to scenarios/earth_satellites.png diff --git a/scenarios/earth_satellites.sim b/scenarios/earth_satellites.sim new file mode 100644 index 0000000..1cc1fb8 --- /dev/null +++ b/scenarios/earth_satellites.sim @@ -0,0 +1 @@ +{"bodies":[{"children":[{"children":[{"children":[],"data":{"mass":450000.0,"starting_position":{"x":139697751.6768489,"y":-55457691.56188262,"z":26726.49883086234},"starting_velocity":{"x":8.512277308736511,"y":20.73621312430883,"z":-2.743211831320219},"name":"ISS","model_path":"iss.glb","diameter":0.1,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":10800.0,"starting_position":{"x":139708447.6237727,"y":-55461983.31379145,"z":33786.01008588448},"starting_velocity":{"x":13.95250317957649,"y":32.23801340370306,"z":-4.892445364940268},"name":"Hubble","model_path":"hubble.glb","diameter":0.01,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-48,"light_source":null}}],"data":{"mass":5.972e24,"starting_position":{"x":139702454.0,"y":-55460536.0,"z":30732.9},"starting_velocity":{"x":10.34793,"y":27.64442411692169,"z":-0.001120445580937712},"name":"Earth","model_path":"earth_4k_2.glb","diameter":12742.0,"rotation_speed":1436.0,"axial_tilt":23.44,"simulate":true,"horizons_id":399,"light_source":null}}],"data":{"mass":1.9885e30,"starting_position":{"x":-982171.6832391358,"y":-655394.8782055749,"z":28787.74341113935},"starting_velocity":{"x":0.01127558914848326,"y":-0.008532815916463004,"z":-0.0001656555243002107},"name":"Sun","model_path":"sun.glb","diameter":1392700.032,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":{"intensity":3.75e28,"range":9e30,"color":"#FFFFFF","enabled":true}}}],"starting_time_millis":1725148800000,"title":"Earth Satellites","description":"A scenario with all major satellites orbiting the Earth.","scale":1.0,"timestep":150} \ No newline at end of file diff --git a/assets/scenarios/solar_system.png b/scenarios/solar_system.png similarity index 100% rename from assets/scenarios/solar_system.png rename to scenarios/solar_system.png diff --git a/scenarios/solar_system.sim b/scenarios/solar_system.sim new file mode 100644 index 0000000..c825238 --- /dev/null +++ b/scenarios/solar_system.sim @@ -0,0 +1 @@ +{"bodies":[{"children":[{"children":[],"data":{"mass":3.3011e23,"starting_position":{"x":-26582359.4034951,"y":40476075.08223532,"z":5690109.263829736},"starting_velocity":{"x":-51.19740738494808,"y":-23.82829179403439,"z":2.750476586235273},"name":"Mercury","model_path":"mercury.glb","diameter":4880.0,"rotation_speed":84480.0,"axial_tilt":0.0,"simulate":true,"horizons_id":199,"light_source":null}},{"children":[],"data":{"mass":4.8675e24,"starting_position":{"x":84764834.60935698,"y":65277955.33113867,"z":-4030295.749102697},"starting_velocity":{"x":-21.33838684070412,"y":27.68230884313838,"z":1.611943339470342},"name":"Venus","model_path":"venus.glb","diameter":12103.6,"rotation_speed":349946.0,"axial_tilt":0.0,"simulate":true,"horizons_id":299,"light_source":null}},{"children":[{"children":[],"data":{"mass":7.348e22,"starting_position":{"x":147680449.19678,"y":18720522.46844263,"z":32437.75744153466},"starting_velocity":{"x":-4.694794112410923,"y":30.37390017058626,"z":0.09549595923954256},"name":"Moon","model_path":"moon.glb","diameter":1738.1,"rotation_speed":39343.68,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}}],"data":{"mass":5.97219e24,"starting_position":{"x":147358878.457139,"y":18543152.56927273,"z":29904.29803438578},"starting_velocity":{"x":-4.226365231723641,"y":29.41379349033467,"z":-0.002828583292782128},"name":"Earth","model_path":"earth.glb","diameter":12742.0,"rotation_speed":1436.0,"axial_tilt":23.439281,"simulate":true,"horizons_id":399,"light_source":null}},{"children":[{"children":[],"data":{"mass":1.0659e16,"starting_position":{"x":-204681120.1572424,"y":-125011240.1183025,"z":2405122.029878475},"starting_velocity":{"x":13.1724712527701,"y":-16.55773129437739,"z":-0.3519634910822811},"name":"Phobos","model_path":"phobos.glb","diameter":22.16,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":1476200000000000.0,"starting_position":{"x":-204689806.5944895,"y":-124990331.767902,"z":2411141.282914884},"starting_velocity":{"x":12.33964871357277,"y":-18.67418157402109,"z":-0.1763597828023391},"name":"Deimos","model_path":"deimos.glb","diameter":12.54,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}}],"data":{"mass":6.4171e23,"starting_position":{"x":-204689340.0400904,"y":-125013692.3437167,"z":2409131.185058415},"starting_velocity":{"x":13.57395490411145,"y":-18.60254221026088,"z":-0.7224152414868863},"name":"Mars","model_path":"mars.glb","diameter":6779.0,"rotation_speed":1476.0,"axial_tilt":25.19,"simulate":true,"horizons_id":499,"light_source":null}},{"children":[],"data":{"mass":9.38392e20,"starting_position":{"x":-276237122.1893816,"y":-290351815.0199021,"z":41511640.79416633},"starting_velocity":{"x":12.07056566717051,"y":-13.70357563530193,"z":-2.655445328553542},"name":"Ceres","model_path":"ceres.glb","diameter":939.4,"rotation_speed":540.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[{"children":[],"data":{"mass":8.931938e22,"starting_position":{"x":591042446.7821088,"y":448196368.7394117,"z":-15101850.10929203},"starting_velocity":{"x":8.957736595686779,"y":7.959026250920237,"z":0.2787009746093063},"name":"Io","model_path":"io.glb","diameter":3643.2,"rotation_speed":2547.36,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":4.799844e22,"starting_position":{"x":591779904.2824603,"y":448698328.1930672,"z":-15068236.06685701},"starting_velocity":{"x":-9.693151465294228,"y":24.69741639214316,"z":0.569429680046083},"name":"Europa","model_path":"europa.glb","diameter":1560.8,"rotation_speed":5113.70064,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":1.4819e23,"starting_position":{"x":592039382.9735433,"y":448074112.8331422,"z":-15093709.08536822},"starting_velocity":{"x":-2.558462326557859,"y":20.43120719962253,"z":0.5697972593813327},"name":"Ganymede","model_path":"ganymede.glb","diameter":5268.2,"rotation_speed":10303.2,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":1.075938e23,"starting_position":{"x":592818446.2926141,"y":447834490.0349652,"z":-15087819.74881226},"starting_velocity":{"x":-4.643871215581399,"y":18.53965996642426,"z":0.4153266498041814},"name":"Callisto","model_path":"callisto.glb","diameter":4820.6,"rotation_speed":24032.16,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}}],"data":{"mass":1.8981999999999999e27,"starting_position":{"x":591116405.042928,"y":448612773.658671,"z":-15086106.82481316},"starting_velocity":{"x":-8.045068878300311,"y":11.02381638213635,"z":0.1341531152888358},"name":"Jupiter","model_path":"jupiter.glb","diameter":139822.0,"rotation_speed":595.0,"axial_tilt":3.13,"simulate":true,"horizons_id":599,"light_source":null}},{"children":[{"children":[],"data":{"mass":1.3452e23,"starting_position":{"x":1317062395.789841,"y":-625410954.1976979,"z":-42005663.01576936},"starting_velocity":{"x":-1.060852998165573,"y":6.402666517530363,"z":1.357634287951674},"name":"Titan","model_path":"titan.glb","diameter":5149.46,"rotation_speed":22920.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":2.3064854e21,"starting_position":{"x":1317198227.126551,"y":-626312128.6545614,"z":-41559528.59529075},"starting_velocity":{"x":2.806558904291587,"y":1.2701482567137,"z":3.694364144037066},"name":"Rhea","model_path":"rhea.glb","diameter":763.5,"rotation_speed":6480.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":1.8056591e21,"starting_position":{"x":1320855160.609993,"y":-627852134.0465181,"z":-41864404.17667893},"starting_velocity":{"x":4.854646792968393,"y":11.66248870085356,"z":-1.230081930411274},"name":"Iapetus","model_path":"iapetus.glb","diameter":1470.0,"rotation_speed":113760.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":1.0954868e21,"starting_position":{"x":1318063919.760553,"y":-626526636.509911,"z":-41528086.12631324},"starting_velocity":{"x":7.705841565764674,"y":16.66690708035977,"z":-4.861168661971909},"name":"Dione","model_path":"dione.glb","diameter":1123.0,"rotation_speed":3941.1576,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":6.174959e20,"starting_position":{"x":1317498514.533114,"y":-626196816.7390172,"z":-41643245.20863017},"starting_velocity":{"x":-3.711987600444088,"y":1.440318005837302,"z":4.443003247932851},"name":"Tethys","model_path":"tethys.glb","diameter":1062.0,"rotation_speed":2718.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":3.75094e19,"starting_position":{"x":1317862368.9731088,"y":-626273647.8866278,"z":-41636255.21668619},"starting_velocity":{"x":-5.466336813759373,"y":18.80368314533501,"z":-4.960595064530139},"name":"Mimas","model_path":"mimas.glb","diameter":396.0,"rotation_speed":1356.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":1.080318e20,"starting_position":{"x":1317897357.123477,"y":-626523695.3599699,"z":-41513334.7885673},"starting_velocity":{"x":12.03172552201499,"y":16.74134008425769,"z":-5.324491936368194},"name":"Enceladus","model_path":"enceladus.glb","diameter":504.0,"rotation_speed":1973.11392,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}}],"data":{"mass":5.6834e26,"starting_position":{"x":1317721699.784666,"y":-626376213.8853518,"z":-41573559.25955266},"starting_velocity":{"x":3.608323540191913,"y":8.705880483493228,"z":-0.2953903588682212},"name":"Saturn","model_path":"saturn.glb","diameter":116464.0,"rotation_speed":633.0,"axial_tilt":26.73,"simulate":true,"horizons_id":699,"light_source":null}},{"children":[{"children":[],"data":{"mass":6.4e19,"starting_position":{"x":1876793591.976653,"y":2256780204.161452,"z":-15821844.53453541},"starting_velocity":{"x":0.5593250277603632,"y":3.223358609129066,"z":3.227082066969737},"name":"Miranda","model_path":"miranda.glb","diameter":471.6,"rotation_speed":2035.40976,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":1.251e21,"starting_position":{"x":1876695507.52492,"y":2256760167.205151,"z":-16046690.83471954},"starting_velocity":{"x":-8.385308784191833,"y":5.318928951790138,"z":4.453089305595049},"name":"Ariel","model_path":"ariel.glb","diameter":1157.8,"rotation_speed":3629.34576,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":1.275e21,"starting_position":{"x":1877032097.119599,"y":2256677176.877903,"z":-16115312.10892296},"starting_velocity":{"x":-8.506198828430891,"y":4.275436104814068,"z":-3.265378937492151},"name":"Umbriel","model_path":"umbriel.glb","diameter":1169.4,"rotation_speed":5904.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":3.4e21,"starting_position":{"x":1876446721.049093,"y":2256849468.855134,"z":-15797689.42792165},"starting_velocity":{"x":-4.077764161868127,"y":4.250690343060523,"z":3.508220529443759},"name":"Titania","model_path":"titania.glb","diameter":1576.8,"rotation_speed":12528.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":3.076e21,"starting_position":{"x":1876691132.612216,"y":2256854991.280804,"z":-15382668.94913125},"starting_velocity":{"x":-2.324170074400168,"y":3.526797505106853,"z":1.030057319525953},"name":"Oberon","model_path":"oberon.glb","diameter":1522.8,"rotation_speed":19440.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}}],"data":{"mass":8.681e25,"starting_position":{"x":1876848145.196212,"y":2256742495.428547,"z":-15933338.78791571},"starting_velocity":{"x":-5.285944969180821,"y":4.037177487005098,"z":0.0832885977451503},"name":"Uranus","model_path":"uranus.glb","diameter":50724.0,"rotation_speed":1034.0,"axial_tilt":0.0,"simulate":true,"horizons_id":799,"light_source":null}},{"children":[{"children":[],"data":{"mass":2.139e22,"starting_position":{"x":4460435655.53476,"y":-311821079.6191955,"z":-96227400.08927624},"starting_velocity":{"x":0.6549830743821887,"y":8.816651890055235,"z":2.683376921837763},"name":"Triton","model_path":"triton.glb","diameter":2706.8,"rotation_speed":8496.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}}],"data":{"mass":1.024e26,"starting_position":{"x":4460737814.33013,"y":-311719495.6197202,"z":-96383087.29856476},"starting_velocity":{"x":0.3424898338191547,"y":5.454448402599064,"z":-0.1196973250551823},"name":"Neptune","model_path":"neptune.glb","diameter":49244.0,"rotation_speed":960.0,"axial_tilt":28.32,"simulate":true,"horizons_id":899,"light_source":null}},{"children":[],"data":{"mass":1.303e22,"starting_position":{"x":2534605027.840262,"y":-4550728311.952005,"z":-246201602.553565},"starting_velocity":{"x":4.90550581768183,"y":1.466573354685091,"z":-1.58125012378935},"name":"Pluto","model_path":"pluto.glb","diameter":2376.6,"rotation_speed":9201.0,"axial_tilt":0.0,"simulate":true,"horizons_id":999,"light_source":null}},{"children":[],"data":{"mass":220000000000000.0,"starting_position":{"x":-2974525169.762023,"y":4071518952.895051,"z":-1489577717.564979},"starting_velocity":{"x":0.7036787387939378,"y":0.567179895714418,"z":0.09880162683010832},"name":"Halley's Comet","model_path":"deimos.glb","diameter":11.0,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":3.1e21,"starting_position":{"x":-6899004382.898172,"y":-1090297370.986418,"z":3649000392.627125},"starting_velocity":{"x":0.2044745917565618,"y":-3.731030512801199,"z":-0.4904247640299213},"name":"Makemake","model_path":"makemake.glb","diameter":1430.0,"rotation_speed":1350.0,"axial_tilt":28.96,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":1.6466e22,"starting_position":{"x":12804007409.48511,"y":5796599006.941406,"z":-2733004417.387743},"starting_velocity":{"x":-0.7745567938606255,"y":1.50385470985689,"z":1.614258646777714},"name":"Eris","model_path":"eris.glb","diameter":2326.0,"rotation_speed":1554.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}},{"children":[],"data":{"mass":721.9,"starting_position":{"x":5567899398.702804,"y":-14892956491.9915,"z":-12346930533.86691},"starting_velocity":{"x":4.222130606182812,"y":-9.357402996434876,"z":-11.33474239077342},"name":"Voyager-2","model_path":"voyager.glb","diameter":0.001,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-1,"light_source":null}}],"data":{"mass":1.9885e30,"starting_position":{"x":-1253558.344523507,"y":-331931.4431501561,"z":31972.046837662},"starting_velocity":{"x":0.006931107133912123,"y":-0.01362000313964326,"z":-0.0000454388831820406},"name":"Sol","model_path":"sun.glb","diameter":1392000.0,"rotation_speed":38880.0,"axial_tilt":7.25,"simulate":true,"horizons_id":10,"light_source":{"intensity":3.75e28,"range":4436820000000.0,"color":"#FFFFFF","enabled":true}}}],"starting_time_millis":1696118400000,"title":"Solar System","description":"A scenario with all major bodies and their major moons in the Solar System.","scale":1e-7,"timestep":900} \ No newline at end of file diff --git a/assets/scenarios/solar_system_copy.png b/scenarios/solar_system_copy.png similarity index 100% rename from assets/scenarios/solar_system_copy.png rename to scenarios/solar_system_copy.png diff --git a/scenarios/solar_system_copy.sim b/scenarios/solar_system_copy.sim new file mode 100644 index 0000000..86bb6f4 --- /dev/null +++ b/scenarios/solar_system_copy.sim @@ -0,0 +1 @@ +{"bodies":[{"children":[{"children":[],"data":{"mass":238.0,"starting_position":{"x":0.0,"y":0.0,"z":0.0},"starting_velocity":{"x":0.0,"y":0.0,"z":0.0},"name":"Erde 2","model_path":"earth.glb","diameter":421.0,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":3.3011e23,"starting_position":{"x":-26582359.4034951,"y":40476075.08223532,"z":5690109.263829736},"starting_velocity":{"x":-51.19740738494808,"y":-23.82829179403439,"z":2.750476586235273},"name":"Mercury","model_path":"mercury.glb","diameter":5151.0,"rotation_speed":84480.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":4.8675e24,"starting_position":{"x":84764834.60935698,"y":65277955.33113867,"z":-4030295.749102697},"starting_velocity":{"x":-21.33838684070412,"y":27.68230884313838,"z":1.611943339470342},"name":"Venus","model_path":"venus.glb","diameter":12103.6,"rotation_speed":349946.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":7.348e22,"starting_position":{"x":147680449.19678,"y":18720522.46844263,"z":32437.75744153466},"starting_velocity":{"x":-4.694794112410923,"y":30.37390017058626,"z":0.09549595923954256},"name":"Moon","model_path":"moon.glb","diameter":1738.1,"rotation_speed":39343.68,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":5.97219e24,"starting_position":{"x":147358878.457139,"y":18543152.56927273,"z":29904.29803438578},"starting_velocity":{"x":-4.226365231723641,"y":29.41379349033467,"z":-0.002828583292782128},"name":"Earth","model_path":"earth.glb","diameter":12742.0,"rotation_speed":1436.0,"axial_tilt":23.439281,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":1.0659e16,"starting_position":{"x":-204681120.1572424,"y":-125011240.1183025,"z":2405122.029878475},"starting_velocity":{"x":13.1724712527701,"y":-16.55773129437739,"z":-0.3519634910822811},"name":"Phobos","model_path":"phobos.glb","diameter":22.16,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1476200000000000.0,"starting_position":{"x":-204689806.5944895,"y":-124990331.767902,"z":2411141.282914884},"starting_velocity":{"x":12.33964871357277,"y":-18.67418157402109,"z":-0.1763597828023391},"name":"Deimos","model_path":"deimos.glb","diameter":12.54,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":6.4171e23,"starting_position":{"x":-204689340.0400904,"y":-125013692.3437167,"z":2409131.185058415},"starting_velocity":{"x":13.57395490411145,"y":-18.60254221026088,"z":-0.7224152414868863},"name":"Mars","model_path":"mars.glb","diameter":6779.0,"rotation_speed":1476.0,"axial_tilt":25.19,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":9.38392e20,"starting_position":{"x":-276237122.1893816,"y":-290351815.0199021,"z":41511640.79416633},"starting_velocity":{"x":12.07056566717051,"y":-13.70357563530193,"z":-2.655445328553542},"name":"Ceres","model_path":"ceres.glb","diameter":939.4,"rotation_speed":540.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":8.931938e22,"starting_position":{"x":591042446.7821088,"y":448196368.7394117,"z":-15101850.10929203},"starting_velocity":{"x":8.957736595686779,"y":7.959026250920237,"z":0.2787009746093063},"name":"Io","model_path":"io.glb","diameter":3643.2,"rotation_speed":2547.36,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":4.799844e22,"starting_position":{"x":591779904.2824603,"y":448698328.1930672,"z":-15068236.06685701},"starting_velocity":{"x":-9.693151465294228,"y":24.69741639214316,"z":0.569429680046083},"name":"Europa","model_path":"europa.glb","diameter":1560.8,"rotation_speed":5113.70064,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.4819e23,"starting_position":{"x":592039382.9735433,"y":448074112.8331422,"z":-15093709.08536822},"starting_velocity":{"x":-2.558462326557859,"y":20.43120719962253,"z":0.5697972593813327},"name":"Ganymede","model_path":"ganymede.glb","diameter":5268.2,"rotation_speed":10303.2,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.075938e23,"starting_position":{"x":592818446.2926141,"y":447834490.0349652,"z":-15087819.74881226},"starting_velocity":{"x":-4.643871215581399,"y":18.53965996642426,"z":0.4153266498041814},"name":"Callisto","model_path":"callisto.glb","diameter":4820.6,"rotation_speed":24032.16,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":1.8981999999999999e27,"starting_position":{"x":591116405.042928,"y":448612773.658671,"z":-15086106.82481316},"starting_velocity":{"x":-8.045068878300311,"y":11.02381638213635,"z":0.1341531152888358},"name":"Jupiter","model_path":"jupiter.glb","diameter":139822.0,"rotation_speed":595.0,"axial_tilt":3.13,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":1.3452e23,"starting_position":{"x":1317062395.789841,"y":-625410954.1976979,"z":-42005663.01576936},"starting_velocity":{"x":-1.060852998165573,"y":6.402666517530363,"z":1.357634287951674},"name":"Titan","model_path":"titan.glb","diameter":5149.46,"rotation_speed":22920.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":2.3064854e21,"starting_position":{"x":1317198227.126551,"y":-626312128.6545614,"z":-41559528.59529075},"starting_velocity":{"x":2.806558904291587,"y":1.2701482567137,"z":3.694364144037066},"name":"Rhea","model_path":"rhea.glb","diameter":763.5,"rotation_speed":6480.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.8056591e21,"starting_position":{"x":1320855160.609993,"y":-627852134.0465181,"z":-41864404.17667893},"starting_velocity":{"x":4.854646792968393,"y":11.66248870085356,"z":-1.230081930411274},"name":"Iapetus","model_path":"iapetus.glb","diameter":1470.0,"rotation_speed":113760.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.0954868e21,"starting_position":{"x":1318063919.760553,"y":-626526636.509911,"z":-41528086.12631324},"starting_velocity":{"x":7.705841565764674,"y":16.66690708035977,"z":-4.861168661971909},"name":"Dione","model_path":"dione.glb","diameter":1123.0,"rotation_speed":3941.1576,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":6.174959e20,"starting_position":{"x":1317498514.533114,"y":-626196816.7390172,"z":-41643245.20863017},"starting_velocity":{"x":-3.711987600444088,"y":1.440318005837302,"z":4.443003247932851},"name":"Tethys","model_path":"tethys.glb","diameter":1062.0,"rotation_speed":2718.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":3.75094e19,"starting_position":{"x":1317862368.9731088,"y":-626273647.8866278,"z":-41636255.21668619},"starting_velocity":{"x":-5.466336813759373,"y":18.80368314533501,"z":-4.960595064530139},"name":"Mimas","model_path":"mimas.glb","diameter":396.0,"rotation_speed":1356.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.080318e20,"starting_position":{"x":1317897357.123477,"y":-626523695.3599699,"z":-41513334.7885673},"starting_velocity":{"x":12.03172552201499,"y":16.74134008425769,"z":-5.324491936368194},"name":"Enceladus","model_path":"enceladus.glb","diameter":504.0,"rotation_speed":1973.11392,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":5.6834e26,"starting_position":{"x":1317721699.784666,"y":-626376213.8853518,"z":-41573559.25955266},"starting_velocity":{"x":3.608323540191913,"y":8.705880483493228,"z":-0.2953903588682212},"name":"Saturn","model_path":"saturn.glb","diameter":116464.0,"rotation_speed":633.0,"axial_tilt":26.73,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":6.4e19,"starting_position":{"x":1876793591.976653,"y":2256780204.161452,"z":-15821844.53453541},"starting_velocity":{"x":0.5593250277603632,"y":3.223358609129066,"z":3.227082066969737},"name":"Miranda","model_path":"miranda.glb","diameter":471.6,"rotation_speed":2035.40976,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.251e21,"starting_position":{"x":1876695507.52492,"y":2256760167.205151,"z":-16046690.83471954},"starting_velocity":{"x":-8.385308784191833,"y":5.318928951790138,"z":4.453089305595049},"name":"Ariel","model_path":"ariel.glb","diameter":1157.8,"rotation_speed":3629.34576,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.275e21,"starting_position":{"x":1877032097.119599,"y":2256677176.877903,"z":-16115312.10892296},"starting_velocity":{"x":-8.506198828430891,"y":4.275436104814068,"z":-3.265378937492151},"name":"Umbriel","model_path":"umbriel.glb","diameter":1169.4,"rotation_speed":5904.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":3.4e21,"starting_position":{"x":1876446721.049093,"y":2256849468.855134,"z":-15797689.42792165},"starting_velocity":{"x":-4.077764161868127,"y":4.250690343060523,"z":3.508220529443759},"name":"Titania","model_path":"titania.glb","diameter":1576.8,"rotation_speed":12528.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":3.076e21,"starting_position":{"x":1876691132.612216,"y":2256854991.280804,"z":-15382668.94913125},"starting_velocity":{"x":-2.324170074400168,"y":3.526797505106853,"z":1.030057319525953},"name":"Oberon","model_path":"oberon.glb","diameter":1522.8,"rotation_speed":19440.0,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":8.681e25,"starting_position":{"x":1876848145.196212,"y":2256742495.428547,"z":-15933338.78791571},"starting_velocity":{"x":-5.285944969180821,"y":4.037177487005098,"z":0.0832885977451503},"name":"Uranus","model_path":"uranus.glb","diameter":50724.0,"rotation_speed":1034.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[{"children":[],"data":{"mass":2.139e22,"starting_position":{"x":4460435655.53476,"y":-311821079.6191955,"z":-96227400.08927624},"starting_velocity":{"x":0.6549830743821887,"y":8.816651890055235,"z":2.683376921837763},"name":"Triton","model_path":"triton.glb","diameter":2706.8,"rotation_speed":8496.0,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":1.024e26,"starting_position":{"x":4460737814.33013,"y":-311719495.6197202,"z":-96383087.29856476},"starting_velocity":{"x":0.3424898338191547,"y":5.454448402599064,"z":-0.1196973250551823},"name":"Neptune","model_path":"neptune.glb","diameter":49244.0,"rotation_speed":960.0,"axial_tilt":28.32,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.303e22,"starting_position":{"x":2534605027.840262,"y":-4550728311.952005,"z":-246201602.553565},"starting_velocity":{"x":4.90550581768183,"y":1.466573354685091,"z":-1.58125012378935},"name":"Pluto","model_path":"pluto.glb","diameter":2376.6,"rotation_speed":9201.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":220000000000000.0,"starting_position":{"x":-2974525169.762023,"y":4071518952.895051,"z":-1489577717.564979},"starting_velocity":{"x":0.7036787387939378,"y":0.567179895714418,"z":0.09880162683010832},"name":"Halley's Comet","model_path":"deimos.glb","diameter":11.0,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":3.1e21,"starting_position":{"x":-6899004382.898172,"y":-1090297370.986418,"z":3649000392.627125},"starting_velocity":{"x":0.2044745917565618,"y":-3.731030512801199,"z":-0.4904247640299213},"name":"Makemake","model_path":"makemake.glb","diameter":1430.0,"rotation_speed":1350.0,"axial_tilt":28.96,"simulate":true,"light_source":null}},{"children":[],"data":{"mass":1.6466e22,"starting_position":{"x":12804007409.48511,"y":5796599006.941406,"z":-2733004417.387743},"starting_velocity":{"x":-0.7745567938606255,"y":1.50385470985689,"z":1.614258646777714},"name":"Eris","model_path":"eris.glb","diameter":2326.0,"rotation_speed":1554.0,"axial_tilt":0.0,"simulate":true,"light_source":null}}],"data":{"mass":1.9885e30,"starting_position":{"x":-1253558.344523507,"y":-331931.4431501561,"z":31972.046837662},"starting_velocity":{"x":0.006931107133912123,"y":-0.01362000313964326,"z":-0.0000454388831820406},"name":"Sol","model_path":"sun.glb","diameter":1492000.0,"rotation_speed":38880.0,"axial_tilt":7.25,"simulate":true,"light_source":{"intensity":3.75,"range":4436820000000.0,"color":"#C600FF","enabled":true}}}],"starting_time_millis":1697760000000,"title":"Solar System2dd","description":"A scenario wi","scale":1e-7, "timestep": 900} \ No newline at end of file diff --git a/scenarios/voyager_1.png b/scenarios/voyager_1.png new file mode 100644 index 0000000..e1d1a15 Binary files /dev/null and b/scenarios/voyager_1.png differ diff --git a/scenarios/voyager_1.sim b/scenarios/voyager_1.sim new file mode 100644 index 0000000..d967ac6 --- /dev/null +++ b/scenarios/voyager_1.sim @@ -0,0 +1 @@ +{"bodies":[{"children":[{"children":[],"data":{"mass":5.97219e24,"starting_position":{"x":-140968752.6119205,"y":42678857.74469588,"z":-25254.74791200459},"starting_velocity":{"x":-9.120162775175537,"y":-28.61319460879634,"z":-0.001164064214398408},"name":"Earth","model_path":"earth.glb","diameter":12742.0,"rotation_speed":1436.0,"axial_tilt":23.439281,"simulate":true,"horizons_id":399,"light_source":null}},{"children":[],"data":{"mass":721.0,"starting_position":{"x":-478755881.5606613,"y":626054143.9714329,"z":8162617.640802503},"starting_velocity":{"x":-13.59995211599172,"y":7.453842974225971,"z":-0.06438163739849133},"name":"Voyager-1","model_path":"voyager.glb","diameter":0.34,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-31,"light_source":null}},{"children":[{"children":[],"data":{"mass":8.931938e22,"starting_position":{"x":-480132379.6695358,"y":628341089.094857,"z":8166689.579561204},"starting_velocity":{"x":-23.30604398175892,"y":-18.95073373004206,"z":-0.3286829175194121},"name":"Io","model_path":"io.glb","diameter":3643.2,"rotation_speed":2547.36,"axial_tilt":0.0,"simulate":true,"horizons_id":501,"light_source":null}},{"children":[],"data":{"mass":4.799844e22,"starting_position":{"x":-479228508.8604426,"y":628279494.8122885,"z":8173354.739555568},"starting_velocity":{"x":-15.83619738830984,"y":5.3755512407106485,"z":0.7180040615554422},"name":"Europa","model_path":"europa.glb","diameter":1560.8,"rotation_speed":5113.70064,"axial_tilt":0.0,"simulate":true,"horizons_id":502,"light_source":null}},{"children":[],"data":{"mass":1.4819e23,"starting_position":{"x":-479288380.8032896,"y":628940950.8439758,"z":8196875.737661481},"starting_velocity":{"x":-19.79181270480194,"y":-1.655936558187814,"z":0.3543272529809163},"name":"Ganymede","model_path":"ganymede.glb","diameter":5268.2,"rotation_speed":10303.2,"axial_tilt":0.0,"simulate":true,"horizons_id":503,"light_source":null}},{"children":[],"data":{"mass":1.075938e23,"starting_position":{"x":-480685844.2916495,"y":629724828.7996273,"z":8206658.511939555},"starting_velocity":{"x":-17.86463945783917,"y":-10.89807550844258,"z":0.052075036567377435},"name":"Callisto","model_path":"callisto.glb","diameter":4820.6,"rotation_speed":24032.16,"axial_tilt":0.0,"simulate":true,"horizons_id":504,"light_source":null}}],"data":{"mass":1.8981999999999999e27,"starting_position":{"x":-479848384.6135314,"y":628027497.1317629,"z":8159750.788519055},"starting_velocity":{"x":-10.52854951013122,"y":-7.331420678430996,"z":0.2660272900760523},"name":"Jupiter","model_path":"jupiter.glb","diameter":139822.0,"rotation_speed":595.0,"axial_tilt":3.13,"simulate":true,"horizons_id":599,"light_source":null}},{"children":[{"children":[],"data":{"mass":1.3452e23,"starting_position":{"x":-1317155488.735448,"y":456803992.4401622,"z":43802307.2827788},"starting_velocity":{"x":-9.10970895732647,"y":-8.324033972730488,"z":0.4087875904767087},"name":"Titan","model_path":"titan.glb","diameter":5149.46,"rotation_speed":22920.0,"axial_tilt":0.0,"simulate":true,"horizons_id":606,"light_source":null}},{"children":[],"data":{"mass":2.3064854e21,"starting_position":{"x":-1317381464.965859,"y":456177329.2804902,"z":44147862.34416083},"starting_velocity":{"x":-11.96618288883869,"y":-10.30164299046992,"z":1.675951141418822},"name":"Rhea","model_path":"rhea.glb","diameter":763.5,"rotation_speed":6480.0,"axial_tilt":0.0,"simulate":true,"horizons_id":605,"light_source":null}},{"children":[],"data":{"mass":1.8056591e21,"starting_position":{"x":-1318561509.285847,"y":452507022.9275259,"z":45417436.21030155},"starting_velocity":{"x":-0.7035880596626023,"y":-10.34797381487376,"z":-0.001404221072676126},"name":"Iapetus","model_path":"iapetus.glb","diameter":1470.0,"rotation_speed":113760.0,"axial_tilt":0.0,"simulate":true,"horizons_id":608,"light_source":null}},{"children":[],"data":{"mass":1.0954868e21,"starting_position":{"x":-1316974888.586601,"y":455504831.651171,"z":44457903.16273892},"starting_velocity":{"x":2.190650173065378,"y":-2.194720708533485,"z":-3.899770264251245},"name":"Dione","model_path":"dione.glb","diameter":1123.0,"rotation_speed":3941.1576,"axial_tilt":0.0,"simulate":true,"horizons_id":604,"light_source":null}},{"children":[],"data":{"mass":6.174959e20,"starting_position":{"x":-1317564566.3964,"y":455669729.5049866,"z":44434988.86481687},"starting_velocity":{"x":-1.159233797631503,"y":-19.06283686401938,"z":5.226097668691422},"name":"Tethys","model_path":"tethys.glb","diameter":1062.0,"rotation_speed":2718.0,"axial_tilt":0.0,"simulate":true,"horizons_id":603,"light_source":null}},{"children":[],"data":{"mass":3.75094e19,"starting_position":{"x":-1317457651.240214,"y":455690951.4964175,"z":44405049.32898799},"starting_velocity":{"x":-0.9394652495076392,"y":-22.09281941198265,"z":6.401370770951404},"name":"Mimas","model_path":"mimas.glb","diameter":396.0,"rotation_speed":1356.0,"axial_tilt":0.0,"simulate":true,"horizons_id":601,"light_source":null}},{"children":[],"data":{"mass":1.080318e20,"starting_position":{"x":-1317090979.081409,"y":455836517.3459905,"z":44295399.77618125},"starting_velocity":{"x":-11.35457595529069,"y":-0.031213071190596017,"z":-3.726117215904384},"name":"Enceladus","model_path":"enceladus.glb","diameter":504.0,"rotation_speed":1973.11392,"axial_tilt":0.0,"simulate":true,"horizons_id":602,"light_source":null}}],"data":{"mass":5.6834e26,"starting_position":{"x":-1317278822.117749,"y":455713951.9593686,"z":44377832.49869636},"starting_velocity":{"x":-3.677377117144201,"y":-9.15076428503438,"z":0.3062600176749717},"name":"Saturn","model_path":"saturn.glb","diameter":116464.0,"rotation_speed":633.0,"axial_tilt":26.73,"simulate":true,"horizons_id":699,"light_source":null}}],"data":{"mass":1.9885e30,"starting_position":{"x":961232.2255364412,"y":-409638.1359710687,"z":-26920.33308127907},"starting_velocity":{"x":0.01057748426413201,"y":0.01000902911669899,"z":-0.0003291835695185871},"name":"Sol","model_path":"sun.glb","diameter":1392000.0,"rotation_speed":38880.0,"axial_tilt":7.25,"simulate":true,"horizons_id":10,"light_source":{"intensity":3.75e28,"range":4436820000000.0,"color":"#FFFFFF","enabled":true}}}],"starting_time_millis":289353600000,"title":"Voyager 1 Jupiter Flyby","description":"A scenario showcasing the Jupiter flyby from Voyager-1","scale":1e-7,"timestep":20} \ No newline at end of file diff --git a/scenarios/voyager_2.sim b/scenarios/voyager_2.sim new file mode 100644 index 0000000..7171e30 --- /dev/null +++ b/scenarios/voyager_2.sim @@ -0,0 +1 @@ +{"bodies":[{"children":[{"children":[],"data":{"mass":5.97219e24,"starting_position":{"x":-123017023.3575416,"y":-85596108.80631453,"z":-32782.814586889},"starting_velocity":{"x":16.39908895377803,"y":-24.66301551829351,"z":-0.0003312864710665053},"name":"Earth","model_path":"earth.glb","diameter":12742.0,"rotation_speed":1436.0,"axial_tilt":23.439281,"simulate":true,"horizons_id":399,"light_source":null}},{"children":[],"data":{"mass":721.0,"starting_position":{"x":-520175460.4736479,"y":537832296.5246867,"z":14726899.80146521},"starting_velocity":{"x":-10.52305903360361,"y":-0.1513629885977419,"z":-0.5218798700393673},"name":"Voyager-2","model_path":"voyager.glb","diameter":0.34,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":-32,"light_source":null}},{"children":[{"children":[],"data":{"mass":8.931938e22,"starting_position":{"x":-525791844.452992,"y":593007016.4410136,"z":9317436.983311146},"starting_velocity":{"x":7.421044106856044,"y":-6.850639688505155,"z":0.5483975044435838},"name":"Io","model_path":"io.glb","diameter":3643.2,"rotation_speed":2547.36,"axial_tilt":0.0,"simulate":true,"horizons_id":501,"light_source":null}},{"children":[],"data":{"mass":4.799844e22,"starting_position":{"x":-526005624.180619,"y":592775018.6274772,"z":9305549.686412126},"starting_velocity":{"x":3.199999838495593,"y":-11.71027480257327,"z":0.2003906332027068},"name":"Europa","model_path":"europa.glb","diameter":1560.8,"rotation_speed":5113.70064,"axial_tilt":0.0,"simulate":true,"horizons_id":502,"light_source":null}},{"children":[],"data":{"mass":1.4819e23,"starting_position":{"x":-526790743.195125,"y":593880924.6224359,"z":9336343.183975458},"starting_velocity":{"x":-14.53945235749599,"y":-17.91624505654781,"z":-0.12908092916493},"name":"Ganymede","model_path":"ganymede.glb","diameter":5268.2,"rotation_speed":10303.2,"axial_tilt":0.0,"simulate":true,"horizons_id":503,"light_source":null}},{"children":[],"data":{"mass":1.075938e23,"starting_position":{"x":-527573565.0324429,"y":594155736.1148043,"z":9334288.374586374},"starting_velocity":{"x":-13.05821627712898,"y":-15.57321671843886,"z":-0.03876583509016829},"name":"Callisto","model_path":"callisto.glb","diameter":4820.6,"rotation_speed":24032.16,"axial_tilt":0.0,"simulate":true,"horizons_id":504,"light_source":null}}],"data":{"mass":1.8982e27,"starting_position":{"x":-525822455.2841349,"y":593426055.5866941,"z":9331769.455265433},"starting_velocity":{"x":-9.927719700574512,"y":-8.062400973677114,"z":0.2555404822040068},"name":"Jupiter","model_path":"jupiter.glb","diameter":139822.0,"rotation_speed":595.0,"axial_tilt":3.13,"simulate":true,"horizons_id":599,"light_source":null}},{"children":[{"children":[],"data":{"mass":1.3452e23,"starting_position":{"x":-1334393247.276042,"y":414556246.3837333,"z":45764161.22321185},"starting_velocity":{"x":-3.901537028343418,"y":-14.03085723497169,"z":2.820218766424665},"name":"Titan","model_path":"titan.glb","diameter":5149.46,"rotation_speed":22920.0,"axial_tilt":0.0,"simulate":true,"horizons_id":606,"light_source":null}},{"children":[],"data":{"mass":2.3064854e21,"starting_position":{"x":-1333017110.552639,"y":413928133.7330959,"z":45955270.82187763},"starting_velocity":{"x":4.78331860475898,"y":-7.596847551410714,"z":-1.318759039083322},"name":"Rhea","model_path":"rhea.glb","diameter":763.5,"rotation_speed":6480.0,"axial_tilt":0.0,"simulate":true,"horizons_id":605,"light_source":null}},{"children":[],"data":{"mass":1.8056591e21,"starting_position":{"x":-1335452704.36014,"y":417165754.3900307,"z":45517471.76267225},"starting_velocity":{"x":-5.839377134315065,"y":-11.09915125891863,"z":1.241634275494294},"name":"Iapetus","model_path":"iapetus.glb","diameter":1470.0,"rotation_speed":113760.0,"axial_tilt":0.0,"simulate":true,"horizons_id":608,"light_source":null}},{"children":[],"data":{"mass":1.0954868e21,"starting_position":{"x":-1332849851.292933,"y":414175226.1594509,"z":45812220.84763375},"starting_velocity":{"x":2.504696825416715,"y":-2.307151801509334,"z":-3.902817391569108},"name":"Dione","model_path":"dione.glb","diameter":1123.0,"rotation_speed":3941.1576,"axial_tilt":0.0,"simulate":true,"horizons_id":604,"light_source":null}},{"children":[],"data":{"mass":6.174959e20,"starting_position":{"x":-1332897235.893865,"y":414499933.399153,"z":45641424.52998531},"starting_velocity":{"x":-8.88586669428042,"y":-0.1864441533801529,"z":-3.782280902688381},"name":"Tethys","model_path":"tethys.glb","diameter":1062.0,"rotation_speed":2718.0,"axial_tilt":0.0,"simulate":true,"horizons_id":603,"light_source":null}},{"children":[],"data":{"mass":3.75094e19,"starting_position":{"x":-1333199878.576414,"y":414229648.7303354,"z":45813909.78049284},"starting_velocity":{"x":10.70421123792808,"y":-12.90474815196011,"z":1.195122091381888},"name":"Mimas","model_path":"mimas.glb","diameter":396.0,"rotation_speed":1356.0,"axial_tilt":0.0,"simulate":true,"horizons_id":601,"light_source":null}},{"children":[],"data":{"mass":1.080318e20,"starting_position":{"x":-1332930091.180581,"y":414448939.2226105,"z":45676604.21328923},"starting_velocity":{"x":-7.65773756830302,"y":1.433758905976406,"z":-4.883341475373109},"name":"Enceladus","model_path":"enceladus.glb","diameter":504.0,"rotation_speed":1973.11392,"axial_tilt":0.0,"simulate":true,"horizons_id":602,"light_source":null}}],"data":{"mass":5.6834e26,"starting_position":{"x":-1333153148.759407,"y":414385192.0002027,"z":45731626.77868307},"starting_velocity":{"x":-3.387588453634176,"y":-9.244593819144471,"z":0.2958054677835134},"name":"Saturn","model_path":"saturn.glb","diameter":116464.0,"rotation_speed":633.0,"axial_tilt":26.73,"simulate":true,"horizons_id":699,"light_source":null}}],"data":{"mass":1.9885e30,"starting_position":{"x":961232.2255364412,"y":-409638.1359710687,"z":-26920.33308127907},"starting_velocity":{"x":0.01057748426413201,"y":0.01000902911669899,"z":-0.0003291835695185871},"name":"Sol","model_path":"sun.glb","diameter":1392000.0,"rotation_speed":38880.0,"axial_tilt":7.25,"simulate":true,"horizons_id":10,"light_source":{"intensity":3.75e28,"range":4436820000000.0,"color":"#FFFFFF","enabled":true}}},{"children":[],"data":{"mass":8.681e25,"starting_position":{"x":-1829550991.839075,"y":-2112504956.89362,"z":15892639.09186804},"starting_velocity":{"x":5.097207828345995,"y":-4.776726767311473,"z":-0.08383604163230716},"name":"Uranus","model_path":"uranus.glb","diameter":50600.0,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":799,"light_source":null}},{"children":[],"data":{"mass":1.024e26,"starting_position":{"x":-852849431.0302386,"y":-4447980863.225193,"z":111236499.3239064},"starting_velocity":{"x":5.303405608411859,"y":-0.9934298733480662,"z":-0.1018545109924805},"name":"Neptune","model_path":"neptune.glb","diameter":49200.0,"rotation_speed":0.0,"axial_tilt":0.0,"simulate":true,"horizons_id":899,"light_source":null}}],"starting_time_millis":293846400000,"title":"Voyager 2 Flybys","description":"A scenario showcasing the flyboys from Voyager 2","scale":1e-7,"timestep":20} \ No newline at end of file diff --git a/src/constants.rs b/src/constants.rs index 2091ee2..af75512 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,5 +1,5 @@ pub const G: f64 = 6.67430e-11_f64; //gravitational constant -pub const M_TO_UNIT: f64 = 0.0000001; +pub const DEF_M_TO_UNIT: f64 = 0.0000001; pub const M_TO_AU: f32 = 6.684587e-12_f32; pub const HOUR_IN_SECONDS: f32 = 60.0 * 60.0; diff --git a/src/main.rs b/src/main.rs index ea1fb48..88e30a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,28 +1,27 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] use bevy::app::{App, PluginGroup}; +use bevy::asset::io::AssetSourceBuilder; use bevy::diagnostic::FrameTimeDiagnosticsPlugin; -use bevy::prelude::{default, AppExtStates, States, SubStates}; +use bevy::prelude::{default, AppExtStates, AssetApp, States, SubStates}; use bevy::render::settings::{RenderCreation, WgpuSettings}; use bevy::render::RenderPlugin; use bevy::window::{PresentMode, Window, WindowPlugin}; use bevy::DefaultPlugins; use bevy_egui::EguiPlugin; -use bevy_inspector_egui::quick::WorldInspectorPlugin; use bevy_mod_billboard::plugin::BillboardPlugin; - -use serialization::SerializationPlugin; +use reqwest::blocking::Client; use crate::menu::MenuPlugin; use crate::setup::SetupPlugin; -use crate::simulation::components::anise::load_ephemeris; +use crate::simulation::asset::SCENARIO_ASSET_SOURCE; +use crate::simulation::asset::serialization::SerializationPlugin; use crate::simulation::components::editor::EditorPlugin; +use crate::simulation::components::horizons::{get_starting_data, HorizonsApiParameters}; use crate::simulation::SimulationPlugin; mod constants; mod setup; mod menu; -mod serialization; -mod unit; mod simulation; mod utils; @@ -58,6 +57,10 @@ fn set_window_icon( fn main() { App::new() // .add_plugins(DefaultPlugins) + .register_asset_source( + SCENARIO_ASSET_SOURCE, + AssetSourceBuilder::platform_default(SCENARIO_ASSET_SOURCE, None), + ) .add_plugins(DefaultPlugins .set(WindowPlugin { primary_window: Some(Window { diff --git a/src/setup.rs b/src/setup.rs index da5a5e1..e863d1f 100644 --- a/src/setup.rs +++ b/src/setup.rs @@ -1,6 +1,16 @@ +use crate::simulation::asset::serialization::{SerializedBody, SerializedVec, SimulationData}; +use crate::simulation::components::apsis::ApsisBody; +use crate::simulation::components::body::{BodyBundle, BodyChildren, BodyParent, LightSource, Moon, OrbitSettings, Planet, Scale, SceneEntity, SceneHandle, Star}; +use crate::simulation::components::camera::PanOrbitCamera; +use crate::simulation::components::editor::CreateBodyType; +use crate::simulation::components::selection::SelectedEntity; +use crate::simulation::loading::LoadingState; +use crate::simulation::render::skybox::Cubemap; +use crate::simulation::render::star_billboard::StarBillboard; +use crate::simulation::ui::scenario_selection::SelectedScenario; +use crate::simulation::SimState; use bevy::app::{App, Plugin}; use bevy::asset::AssetServer; -use bevy::color::Color::Hsla; use bevy::color::palettes::css::WHITE; use bevy::core::Name; use bevy::core_pipeline::bloom::BloomSettings; @@ -9,23 +19,15 @@ use bevy::ecs::system::EntityCommands; use bevy::hierarchy::BuildChildren; use bevy::math::{DVec3, Vec3}; use bevy::pbr::{PbrBundle, PointLight, PointLightBundle}; -use bevy::prelude::{Assets, Bundle, Camera, Camera3dBundle, ChildBuilder, Color, Commands, default, Entity, Handle, in_state, IntoSystemConfigs, Mesh, OnEnter, PerspectiveProjection, Projection, Res, ResMut, Resource, SceneBundle, SpatialBundle, StandardMaterial, Startup, Transform, Update, Visibility, Circle, Srgba, Hsva, NextState}; -use bevy::render::view::{GpuCulling, NoCpuCulling, RenderLayers}; +use bevy::prelude::{default, in_state, Assets, Camera, Camera3dBundle, ChildBuilder, Circle, Color, Commands, Entity, Handle, Hsva, IntoSystemConfigs, Mesh, NextState, PerspectiveProjection, Projection, Res, ResMut, Resource, SceneBundle, SpatialBundle, Srgba, StandardMaterial, Startup, Transform, Update, Visibility}; +use bevy::render::view::{GpuCulling, NoCpuCulling}; use bevy::scene::Scene; use bevy::text::{JustifyText, TextSection, TextStyle}; +use bevy::time::TimePlugin; use bevy_mod_billboard::{BillboardLockAxisBundle, BillboardTextBundle}; -use crate::simulation::components::apsis::ApsisBody; -use crate::simulation::components::body::{BodyBundle, BodyChildren, BodyParent, LightSource, Moon, OrbitSettings, Planet, SceneEntity, SceneHandle, Star}; -use crate::simulation::components::camera::PanOrbitCamera; -use crate::constants::M_TO_UNIT; -use crate::simulation::loading::LoadingState; -use crate::simulation::components::selection::SelectedEntity; -use crate::serialization::{SerializedBody, SerializedVec, SimulationData}; -use crate::simulation::components::editor::CreateBodyType; -use crate::simulation::SimState; -use crate::simulation::render::skybox::Cubemap; -use crate::simulation::render::star_billboard::StarBillboard; -use crate::simulation::ui::scenario_selection::SelectedScenario; +use crate::simulation::asset::from_scenario_source; +use crate::simulation::components::scale::SimulationScale; +use crate::simulation::units::converter::scale_lumen; pub struct SetupPlugin; @@ -43,7 +45,9 @@ pub struct ScenarioData { pub starting_time_millis: i64, pub title: String, - pub description: String + pub description: String, + pub timestep: i32, + pub scale: f32 } @@ -53,7 +57,9 @@ impl From for ScenarioData { Self { starting_time_millis: value.starting_time_millis, title: value.title, - description: value.description + description: value.description, + timestep: value.timestep, + scale: value.scale } } } @@ -69,6 +75,7 @@ pub fn setup_planets( mut meshes: ResMut>, mut materials: ResMut>, mut sim_state: ResMut>, + scale: Res ) { if selected_scenario.spawned { return; @@ -103,10 +110,10 @@ pub fn setup_planets( parent.spawn(PointLightBundle { point_light: PointLight { color: star_color, - intensity: (source.intensity * M_TO_UNIT.powf(2.)) as f32, + intensity: scale_lumen(source.intensity, &scale), shadows_enabled: true, - range: (source.range * M_TO_UNIT) as f32, //TODO: make this a variable - radius: (entry.data.diameter / 2.0 * M_TO_UNIT) as f32, + range: scale.m_to_unit_32(source.range as f32), //TODO: make this a variable + radius: scale.m_to_unit_32(entry.data.diameter as f32 / 2.0), ..default() }, visibility: if source.enabled { Visibility::Visible } else { Visibility::Hidden }, @@ -118,7 +125,7 @@ pub fn setup_planets( star_color = Srgba::rgb(srgb.red * 30.0, srgb.green * 30.0, srgb.blue * 30.0).into(); //add the star's components - apply_body(BodyBundle::from(entry.clone()), CreateBodyType::Star, &assets, &mut star, &mut meshes, &mut materials, calculate_hue(s_index as f32, stars as f32), star_color); + apply_body(BodyBundle::from(entry.clone()), CreateBodyType::Star, &assets, &mut star, &mut meshes, &mut materials, calculate_hue(s_index as f32, stars as f32), star_color, &scale); //planet count in star system for coloring later let planet_count = entry.children.iter().filter(|p| p.data.simulate).count(); @@ -144,7 +151,7 @@ pub fn setup_planets( let de_planet_entry = *planet_entry; //add the planet's components - apply_body(BodyBundle::from(de_planet_entry.clone()), CreateBodyType::Planet, &assets, &mut planet, &mut meshes, &mut materials,calculate_hue(p_index as f32, planet_count as f32), WHITE.into()); + apply_body(BodyBundle::from(de_planet_entry.clone()), CreateBodyType::Planet, &assets, &mut planet, &mut meshes, &mut materials,calculate_hue(p_index as f32, planet_count as f32), WHITE.into(), &scale); //for the tree-based ui later planets.push(planet_id); @@ -154,7 +161,7 @@ pub fn setup_planets( //collect the moons in a new vector and sort them by the distance to the parent let mut planet_children = de_planet_entry.children.iter().collect::>(); - sort_bodies(&mut planet_children, -serialized_vec_to_vec(de_planet_entry.clone().data.starting_position)); + sort_bodies(&mut planet_children, -DVec3::from(de_planet_entry.clone().data.starting_position)); //iterate through the moons for (m_index, moon_entry) in planet_entry.children.iter().enumerate() { @@ -168,7 +175,7 @@ pub fn setup_planets( moons.push(moon.id()); //add the moon's components - apply_body(BodyBundle::from(moon_entry.clone()), CreateBodyType::Moon, &assets, &mut moon, &mut meshes, &mut materials, calculate_hue(m_index as f32, moon_count as f32), WHITE.into()); + apply_body(BodyBundle::from(moon_entry.clone()), CreateBodyType::Moon, &assets, &mut moon, &mut meshes, &mut materials, calculate_hue(m_index as f32, moon_count as f32), WHITE.into(), &scale); moon.insert(BodyParent(planet_id)); } planet.insert(BodyParent(star_id)); @@ -197,18 +204,12 @@ fn sort_bodies( offset: DVec3, ) { bodies.sort_by(|body1, body2| { - let pos1 = serialized_vec_to_vec(body1.data.starting_position) + offset; - let pos2 = serialized_vec_to_vec(body2.data.starting_position) + offset; + let pos1 = DVec3::from(body1.data.starting_position) +offset; + let pos2 = DVec3::from(body2.data.starting_position) + offset; pos1.length().partial_cmp(&pos2.length()).unwrap() }); } -fn serialized_vec_to_vec( - serialized_vec: SerializedVec -) -> DVec3 { - DVec3::new(serialized_vec.x, serialized_vec.y, serialized_vec.z) -} - pub fn apply_body( bundle: BodyBundle, body_type: CreateBodyType, @@ -217,7 +218,8 @@ pub fn apply_body( meshes: &mut ResMut>, materials: &mut ResMut>, hue: f32, - star_color: Color + star_color: Color, + scale: &SimulationScale ) { let asset_handle: Handle = assets.load(bundle.model_path.clone().0); let color: Color = Hsva::new(hue, 1.0, 0.5, 1.0).into(); @@ -266,6 +268,7 @@ pub fn apply_body( materials, star_color, *id, + &scale, ); } }); @@ -279,9 +282,10 @@ fn spawn_imposter( materials: &mut ResMut>, color: Color, parent_id: Entity, + scale: &SimulationScale ) { parent.spawn(PbrBundle { - mesh: meshes.add(Circle::new(bundle.diameter.num * 3.0 * M_TO_UNIT as f32)), + mesh: meshes.add(Circle::new(scale.m_to_unit_32(bundle.diameter.num * 3.0))), material: materials.add(color), visibility: Visibility::Hidden, ..default() diff --git a/src/simulation/asset/mod.rs b/src/simulation/asset/mod.rs new file mode 100644 index 0000000..b0af105 --- /dev/null +++ b/src/simulation/asset/mod.rs @@ -0,0 +1,13 @@ +use std::path::Path; +use bevy::asset::AssetPath; +use bevy::asset::io::AssetSourceId; + +pub mod serialization; + +pub const SCENARIO_ASSET_SOURCE: &str = "scenarios"; + +pub fn from_scenario_source(path: &str) -> AssetPath { + let path = Path::new(path); + let source = AssetSourceId::from(SCENARIO_ASSET_SOURCE); + AssetPath::from_path(path).with_source(source) +} \ No newline at end of file diff --git a/src/serialization.rs b/src/simulation/asset/serialization.rs similarity index 89% rename from src/serialization.rs rename to src/simulation/asset/serialization.rs index 8fb0a13..d7ed236 100644 --- a/src/serialization.rs +++ b/src/simulation/asset/serialization.rs @@ -1,10 +1,11 @@ -use bevy::asset::io::{AssetSourceBuilder, Reader}; +use bevy::asset::io::file::FileAssetReader; +use bevy::asset::io::{AssetSource, AssetSourceBuilder, AssetSourceId, Reader}; use bevy::asset::AsyncReadExt; use bevy::prelude::{Asset, AssetApp}; use bevy::{ asset::{AssetLoader, LoadContext}, math::DVec3, - prelude::Plugin, reflect::{TypePath}, utils::BoxedFuture, + prelude::Plugin, reflect::TypePath, utils::BoxedFuture, }; use serde::{Deserialize, Serialize}; @@ -14,6 +15,8 @@ pub struct SimulationData { pub starting_time_millis: i64, pub title: String, pub description: String, + pub scale: f32, + pub timestep: i32, } #[derive(Debug, Deserialize, Serialize, TypePath, Clone)] @@ -60,13 +63,14 @@ pub struct SerializedBodyData { pub rotation_speed: f64, pub axial_tilt: f32, pub simulate: bool, + pub horizons_id: Option, pub light_source: Option } #[derive(Debug, Serialize, Deserialize, TypePath, Clone)] pub struct SerializedLightSource { - pub intensity: f64, - pub range: f64, + pub intensity: f32, + pub range: f32, pub color: String, pub enabled: bool } @@ -104,7 +108,6 @@ impl Plugin for SerializationPlugin { fn build(&self, app: &mut bevy::prelude::App) { app - // .register_asset_source("sim", AssetSourceBuilder::default()) .init_asset_loader::() .init_asset::(); } diff --git a/src/simulation/components/anise.rs b/src/simulation/components/anise.rs deleted file mode 100644 index 76fbd66..0000000 --- a/src/simulation/components/anise.rs +++ /dev/null @@ -1,21 +0,0 @@ -use std::str::FromStr; -use anise::constants::frames::{EARTH_MOON_BARYCENTER_J2000, SUN_J2000, VENUS_J2000}; -use anise::prelude::{Almanac, Epoch, SPK}; - -pub fn load_ephemeris( - path: &str, -) { - let spk = SPK::load(path).unwrap(); - let ctx = Almanac::from_spk(spk).unwrap(); - let epoch = Epoch::from_str("2023-10-01 00:00:00.0000 TDB").unwrap(); - - let state = ctx - .translate( - VENUS_J2000, // Target - SUN_J2000, // Observer - epoch, - None, - ) - .unwrap(); - println!("{}", state); -} \ No newline at end of file diff --git a/src/simulation/components/billboard.rs b/src/simulation/components/billboard.rs index afc0a06..681b99a 100644 --- a/src/simulation/components/billboard.rs +++ b/src/simulation/components/billboard.rs @@ -7,7 +7,7 @@ use bevy_mod_billboard::text::BillboardTextBounds; use crate::simulation::components::apsis::ApsisBody; use crate::simulation::components::body::{Diameter, Moon, Planet, Star, BillboardVisible}; use crate::simulation::components::camera::{pan_orbit_camera, PanOrbitCamera}; -use crate::constants::M_TO_UNIT; +use crate::simulation::components::scale::SimulationScale; use crate::simulation::SimState; use crate::simulation::render::star_billboard::STAR_IMPOSTER_DIVIDER; @@ -32,11 +32,12 @@ impl Plugin for BodyBillboardPlugin { #[derive(Resource)] pub struct BillboardSettings { pub show: bool, + pub dynamic_hide: bool, } impl Default for BillboardSettings { fn default() -> Self { - Self { show: true } + Self { show: true, dynamic_hide: true } } } @@ -45,6 +46,7 @@ fn auto_scale_billboards( mut billboards: Query<(&Text, &mut Transform, &mut Visibility), With>, camera: Query<(&PanOrbitCamera, &Transform), (Without, Without, Without, Without)>, settings: Res, + scale: Res ) { if !settings.show { for (_, _, mut visible) in billboards.iter_mut() { @@ -61,14 +63,14 @@ fn auto_scale_billboards( } else if star { radius > STAR_VISIBILITY_THRESHOLD } else { - radius < PLANET_VISIBILITY_THRESHOLD && radius > (diameter.num * 2.0 * M_TO_UNIT as f32) && (apsis.unwrap().perihelion.distance as f64 * M_TO_UNIT * 50.0 > radius as f64) + radius < PLANET_VISIBILITY_THRESHOLD && radius > (scale.m_to_unit_32(diameter.num) * 2.0) && (scale.m_to_unit_32(apsis.unwrap().perihelion.distance) * 50.0 > radius) }; let offset = if star { distance_to_cam } else { - diameter.num * M_TO_UNIT as f32 / distance_to_cam * 0.01 + scale.m_to_unit_32(diameter.num) / distance_to_cam * 0.01 }; - billboard_visible.0 = predicate; + billboard_visible.0 = !settings.dynamic_hide || predicate; billboard( &mut billboards, c_transform, @@ -76,7 +78,7 @@ fn auto_scale_billboards( radius, offset, children, - predicate + !settings.dynamic_hide || predicate ) } } diff --git a/src/simulation/components/body.rs b/src/simulation/components/body.rs index c7ac549..793354e 100644 --- a/src/simulation/components/body.rs +++ b/src/simulation/components/body.rs @@ -1,12 +1,12 @@ -use std::collections::VecDeque; -use bevy::color::Color; +use crate::simulation::asset::serialization::SerializedBody; use bevy::color::palettes::css; +use bevy::color::Color; use bevy::core::Name; use bevy::math::{DVec3, Vec3}; -use bevy::prelude::{Bundle, Component, default, Entity, Handle, Reflect, Scene, Transform, Srgba}; +use bevy::prelude::{default, Bundle, Component, Entity, Handle, Reflect, Scene, Srgba, Transform}; use bevy::render::primitives::Aabb; -use crate::constants::M_TO_UNIT; -use crate::serialization::SerializedBody; +use std::collections::VecDeque; +use crate::simulation::components::horizons::HorizonsId; #[derive(Component, Clone, Default, Reflect, Copy)] pub struct Mass(pub f64); @@ -58,6 +58,7 @@ pub struct OrbitSettings { pub step: f32, pub lines: VecDeque, pub force_direction: DVec3, + pub orbit_line_multiplier: f32, pub hide_lines: bool, pub draw_lines: bool, pub display_force: bool, @@ -73,7 +74,7 @@ pub struct BillboardVisible(pub bool); impl Default for OrbitSettings { fn default() -> Self { - OrbitSettings { color: css::GREEN.into(), lines: VecDeque::with_capacity(3000), force_direction: DVec3::ZERO, draw_lines: false, step: 0.0, period: 0.0, display_force: false, display_velocity: false, arrow_scale: 1, hide_lines: false, } + OrbitSettings { color: css::GREEN.into(), lines: VecDeque::with_capacity(3000), force_direction: DVec3::ZERO, draw_lines: false, step: 0.0, period: 0.0, display_force: false, display_velocity: false, arrow_scale: 1, hide_lines: false, orbit_line_multiplier: 1.0 } } } @@ -128,8 +129,9 @@ pub struct BodyBundle { pub rotation_speed: RotationSpeed, pub axial_tilt: AxialTilt, pub diameter: Diameter, - pub billboard_visible: BillboardVisible - + pub billboard_visible: BillboardVisible, + pub horizons_id: HorizonsId, + } impl From for BodyBundle { @@ -150,6 +152,7 @@ impl From for BodyBundle { ..default() }, rotation_speed: RotationSpeed(value.data.rotation_speed), + horizons_id: HorizonsId(value.data.horizons_id.unwrap_or(-1)), ..default() } } diff --git a/src/simulation/components/diameter.rs b/src/simulation/components/diameter.rs index 462e9dd..09c2c70 100644 --- a/src/simulation/components/diameter.rs +++ b/src/simulation/components/diameter.rs @@ -1,10 +1,10 @@ use bevy::{app::{App, Plugin}, math::Vec3A, prelude::{in_state, Children, GlobalTransform, Handle, IntoSystemConfigs, Mesh, Query, Res, ResMut, Transform, Update, Vec3, With}, render::primitives::{Aabb, Sphere}, scene::{SceneInstance, SceneSpawner}}; use bevy::ecs::query::QueryManyIter; use bevy::prelude::{AssetServer, Entity, Name}; -use crate::constants::M_TO_UNIT; use crate::simulation::SimState; use crate::simulation::components::body::SceneHandle; use crate::simulation::components::body::{Diameter, Scale}; +use crate::simulation::components::scale::SimulationScale; use crate::simulation::loading::LoadingState; pub struct DiameterPlugin; @@ -25,6 +25,7 @@ pub fn apply_real_diameter( spawner: Res, mut loading_state: ResMut, asset_server: Res, + s_scale: Res ) { if !bodies.is_empty() && bodies.iter().all(|(_, _, _, diameter, _, _)| { diameter.applied @@ -48,7 +49,7 @@ pub fn apply_real_diameter( diameter.aabb = Some(aabb); aabb }; - transform.scale = Vec3::splat(diameter.num * M_TO_UNIT as f32 / 1.7) / (Vec3::from(aabb.half_extents)); //not dividing by 1.7 for the diameter makes them to big which doesn't work with satellites very close to their planet + transform.scale = Vec3::splat(s_scale.m_to_unit_32(diameter.num) / 1.7) / (Vec3::from(aabb.half_extents)); //not dividing by 1.7 for the diameter makes them to big which doesn't work with satellites very close to their planet scale.0 = transform.scale.x; diameter.applied = true; loading_state.scaled_bodies_count += 1; diff --git a/src/simulation/components/direction.rs b/src/simulation/components/direction.rs index faba79b..7e9f419 100644 --- a/src/simulation/components/direction.rs +++ b/src/simulation/components/direction.rs @@ -1,9 +1,10 @@ use bevy::{app::{App, Plugin}, prelude::{in_state, Entity, Gizmos, IntoSystemConfigs, Query, Transform, Update, With}}; use bevy::color::palettes::css; -use crate::constants::M_TO_UNIT; +use bevy::prelude::Res; use crate::simulation::SimState; use crate::simulation::components::body::{BodyChildren, Diameter, Moon, OrbitSettings, Planet, Velocity}; use crate::simulation::components::camera::pan_orbit_camera; +use crate::simulation::components::scale::SimulationScale; pub struct DirectionPlugin; @@ -19,10 +20,11 @@ impl Plugin for DirectionPlugin { fn display_force_and_velocity( planet_query: Query<(&Transform, &BodyChildren, &OrbitSettings, &Diameter, &Velocity), With>, moon_query: Query<(Entity, &Transform, &OrbitSettings, &Diameter, &Velocity), With>, - mut gizmos: Gizmos + mut gizmos: Gizmos, + scale: Res ) { for (transform, _, orbit, diameter, velocity) in &planet_query { - let d = diameter.num as f64 * M_TO_UNIT; + let d = scale.m_to_unit(diameter.num as f64); if orbit.display_force { gizmos.arrow(transform.translation, transform.translation + (orbit.force_direction * d * orbit.arrow_scale as f64).as_vec3(), css::BLUE); } @@ -31,7 +33,7 @@ fn display_force_and_velocity( } } for (entity, transform, orbit, diameter, velocity) in &moon_query { - let d = diameter.num as f64 * M_TO_UNIT; + let d = scale.m_to_unit(diameter.num as f64); if orbit.display_force { gizmos.arrow(transform.translation, transform.translation +(orbit.force_direction * d * orbit.arrow_scale as f64).as_vec3(), css::BLUE); } diff --git a/src/simulation/components/editor.rs b/src/simulation/components/editor.rs index 80cd749..413b2c7 100644 --- a/src/simulation/components/editor.rs +++ b/src/simulation/components/editor.rs @@ -4,12 +4,13 @@ use bevy::color::palettes::css::WHITE; use bevy::ecs::observer::TriggerTargets; use bevy::ecs::system::SystemId; use bevy::prelude::{AssetServer, Assets, Bundle, Commands, Entity, FromWorld, IntoSystemConfigs, Local, Mesh, OnEnter, Query, Res, ResMut, Resource, SpatialBundle, StandardMaterial, Transform, Update, Vec3, World}; -use crate::constants::M_TO_UNIT; use crate::setup::apply_body; use crate::simulation::components::body::{BodyBundle, BodyChildren, BodyParent, Moon, Planet, SimPosition}; use crate::simulation::components::diameter::apply_real_diameter; +use crate::simulation::components::horizons::retrieve_starting_data; use crate::simulation::components::rotation::axial_tilt; use crate::simulation::components::save_scenario::save_scenario; +use crate::simulation::components::scale::SimulationScale; use crate::simulation::components::selection::SelectedEntity; use crate::simulation::SimState; use crate::utils::sim_state_type_editor; @@ -23,6 +24,7 @@ impl EditorSystemType { pub const UPDATE_TILT: &'static str = "update_tilt"; pub const CREATE_BODY: &'static str = "create_body"; pub const SAVE_SCENARIO: &'static str = "save_scenario"; + pub const RETRIEVE_DATA: &'static str = "retrieve_data"; } #[derive(Resource)] @@ -71,6 +73,12 @@ impl FromWorld for EditorSystems { world.register_system(save_scenario) ); + + systems.0.insert( + EditorSystemType::RETRIEVE_DATA.into(), + world.register_system(retrieve_starting_data) + ); + systems } } @@ -99,7 +107,8 @@ fn create_empty_body( mut assets: Res, mut meshes: ResMut>, mut materials: ResMut>, - mut index: Local + mut index: Local, + scale: Res ) { let mut entity_commands = commands.spawn(SpatialBundle::default()); apply_body( @@ -110,7 +119,8 @@ fn create_empty_body( &mut meshes, &mut materials, 0.0, - WHITE.into() + WHITE.into(), + &scale ); if create_body_state.body_type != CreateBodyType::Moon { entity_commands.insert(BodyChildren(Vec::new())); @@ -146,7 +156,8 @@ fn selection_listener( pub fn update_body_positions( mut bodies: Query<(Entity, &SimPosition, &mut Transform)>, - selected_entity: Res + selected_entity: Res, + scale: Res ) { let offset = if let Some(entity) = selected_entity.entity { if let Err(_) = bodies.get(entity) { @@ -154,13 +165,12 @@ pub fn update_body_positions( } else { let (_, position, mut transform) = bodies.get_mut(entity).unwrap(); transform.translation = Vec3::ZERO; - (position.0 * M_TO_UNIT).as_vec3() + scale.m_to_unit_dvec(position.0).as_vec3() } } else { Vec3::ZERO }; - println!("Offset: {:?}", offset); for (_, position, mut transform) in bodies.iter_mut() { - transform.translation = (position.0 * M_TO_UNIT).as_vec3() - offset; + transform.translation = scale.m_to_unit_dvec(position.0).as_vec3() - offset; } } diff --git a/src/simulation/components/horizons.rs b/src/simulation/components/horizons.rs new file mode 100644 index 0000000..d2f31b6 --- /dev/null +++ b/src/simulation/components/horizons.rs @@ -0,0 +1,152 @@ +use std::error::Error; +use crate::simulation::asset::serialization::SerializedVec; +use bevy::utils::HashMap; +use reqwest::blocking::Client; +use std::str::FromStr; +use bevy::math::DVec3; +use bevy::prelude::{Component, Plugin, Query, Res, ResMut, Resource}; +use chrono::NaiveDateTime; +use crate::setup::ScenarioData; +use crate::simulation::components::selection::SelectedEntity; +use crate::simulation::ui::editor_body_panel::EditorPanelState; +use crate::simulation::ui::toast::{error_toast, success_toast, ToastContainer}; + +pub struct HorizonsPlugin; + +impl Plugin for HorizonsPlugin { + fn build(&self, app: &mut bevy::prelude::App) { + app + .init_resource::(); + } +} + +#[derive(Resource)] +pub struct HorizonsClient(pub Client); + +impl Default for HorizonsClient { + fn default() -> Self { + Self(Client::new()) + } +} + +#[derive(Component, Clone, Default)] +pub struct HorizonsId(pub i32); + +const HORIZONS_API_URL: &'static str = "https://ssd.jpl.nasa.gov/api/horizons.api?format=text"; + +pub struct HorizonsApiParameters { + + params: HashMap + +} + +impl HorizonsApiParameters { + + pub fn with_defaults() -> Self { + let mut params = HashMap::new(); + params.insert("CENTER".to_string(), "500@0".to_string()); //Solar System Barycenter + params.insert("MAKE_EPHEM".to_string(), "YES".to_string()); + params.insert("EPHEM_TYPE".to_string(), "VECTORS".to_string()); + params.insert("CSV_FORMAT".to_string(), "YES".to_string()); + Self { params } + } + + pub fn with_command(mut self, command: i32) -> Self { + self.params.insert("COMMAND".to_string(), command.to_string()); + self + } + + pub fn with_start_time(mut self, start_time: &str) -> Self { + self.params.insert("START_TIME".to_string(), start_time.to_string()); + self + } + + pub fn with_stop_time(mut self, stop_time: &str) -> Self { + self.params.insert("STOP_TIME".to_string(), stop_time.to_string()); + self + } + + pub fn with_center(mut self, center: i32) -> Self { + self.params.insert("CENTER".to_string(), center.to_string()); + self + } + +} + +pub fn get_starting_data( + parameters: HorizonsApiParameters, + client: Client +) -> Result<(SerializedVec, SerializedVec), Box> { + let mut builder = client.get(HORIZONS_API_URL); + + // Add query parameters to the request + for (key, value) in parameters.params.iter() { + builder = builder.query(&[(&key, &value)]); + } + + // Send the request and handle potential errors + let resp = builder.send()?; + + // Get the response body as text and handle potential errors + let body = resp.text()?; + + // Process the lines of the body and find the data row + let lines = body.lines(); + let mut iter = lines.skip_while(|line| !line.starts_with("$$SOE")); + + // Skip the "$$SOE" line and move to the data line, returning an error if the data line is missing + iter.next(); // Skip the "$$SOE" line + let data_line = iter.next().ok_or("No data row found after $$SOE")?; + + // Split the data row and map each value, handling errors during parsing + let data_row = data_line + .split(", ") + .skip(2) + .map(|d| d.trim()) + .collect::>(); + + if data_row.len() < 6 { + return Err("Data row does not contain enough values".into()); + } + + // Parse the individual values into f64, returning an error if parsing fails + let vec1 = SerializedVec { + x: f64::from_str(data_row[0])?, + y: f64::from_str(data_row[1])?, + z: f64::from_str(data_row[2])?, + }; + let vec2 = SerializedVec { + x: f64::from_str(data_row[3])?, + y: f64::from_str(data_row[4])?, + z: f64::from_str(data_row[5])?, + }; + + Ok((vec1, vec2)) +} + +pub fn retrieve_starting_data( + selected_entity: Res, + bodies: Query<&HorizonsId>, + client: Res, + mut state: ResMut, + scenario: Res, + mut toasts: ResMut +) { + if let Some(entity) = selected_entity.entity { + let starting_date = NaiveDateTime::from_timestamp_millis(scenario.starting_time_millis).unwrap().date(); + let start_date = starting_date.format("%Y-%m-%d").to_string(); + let stop_date = (starting_date + chrono::Duration::days(1)).format("%Y-%m-%d").to_string(); + let id = bodies.get(entity).unwrap(); + let parameters = HorizonsApiParameters::with_defaults() + .with_command(id.0) + .with_start_time(start_date.as_str()) + .with_stop_time(stop_date.as_str()); + if let Ok((pos, vel)) = get_starting_data(parameters, client.0.clone()) { + state.new_position = DVec3::from(pos); + state.new_velocity = DVec3::from(vel); + toasts.0.add(success_toast("Horizons data retrieved")); + } else { + toasts.0.add(error_toast("Failed to retrieve Horizons data. Check the Horizons Id and try again.")); + } + } +} \ No newline at end of file diff --git a/src/simulation/components/mod.rs b/src/simulation/components/mod.rs index 11dc830..78b8c1d 100644 --- a/src/simulation/components/mod.rs +++ b/src/simulation/components/mod.rs @@ -4,11 +4,13 @@ use crate::simulation::components::billboard::BodyBillboardPlugin; use crate::simulation::components::camera::PanOrbitCameraPlugin; use crate::simulation::components::diameter::DiameterPlugin; use crate::simulation::components::direction::DirectionPlugin; +use crate::simulation::components::horizons::HorizonsPlugin; use crate::simulation::components::lock_on::LockOnPlugin; use crate::simulation::components::orbit_lines::OrbitLinePlugin; use crate::simulation::components::physics::PhysicsPlugin; use crate::simulation::components::reset::ResetPlugin; use crate::simulation::components::rotation::RotationPlugin; +use crate::simulation::components::scale::ScalePlugin; use crate::simulation::components::selection::SelectionPlugin; use crate::simulation::components::speed::SpeedPlugin; @@ -26,8 +28,9 @@ pub mod speed; pub mod selection; pub mod reset; pub mod editor; -pub mod anise; +pub mod horizons; mod save_scenario; +pub mod scale; pub struct SimComponentPlugin; @@ -41,12 +44,14 @@ impl Plugin for SimComponentPlugin { .add_plugins(DiameterPlugin) .add_plugins(DirectionPlugin) .add_plugins(LockOnPlugin) + .add_plugins(ScalePlugin) .add_plugins(OrbitLinePlugin) .add_plugins(PhysicsPlugin) .add_plugins(ResetPlugin) .add_plugins(RotationPlugin) .add_plugins(SelectionPlugin) - .add_plugins(SpeedPlugin); + .add_plugins(SpeedPlugin) + .add_plugins(HorizonsPlugin); } } \ No newline at end of file diff --git a/src/simulation/components/orbit_lines.rs b/src/simulation/components/orbit_lines.rs index b995b24..9090842 100644 --- a/src/simulation/components/orbit_lines.rs +++ b/src/simulation/components/orbit_lines.rs @@ -1,9 +1,9 @@ use bevy::{prelude::{in_state, App, Camera, Entity, Gizmos, IntoSystemConfigs, Plugin, PreUpdate, Query, Res, Resource, Transform, Vec3, With, Without}, time::Time}; -use crate::{constants::M_TO_UNIT}; use crate::simulation::components::body::{BillboardVisible, BodyChildren, Diameter, Moon, OrbitSettings, Planet, SimPosition, Star}; use crate::simulation::components::camera::PanOrbitCamera; use crate::simulation::components::physics::{apply_physics, Pause, SubSteps}; +use crate::simulation::components::scale::SimulationScale; use crate::simulation::components::selection::SelectedEntity; use crate::simulation::components::speed::Speed; use crate::simulation::SimState; @@ -51,7 +51,8 @@ fn update_lines( substeps: Res, pause: Res, selected_entity: Res, - ui_state: Res + ui_state: Res, + scale: Res ) { if pause.0 { return; @@ -59,15 +60,15 @@ fn update_lines( let cam = camera.single(); for (entity, mut orbit, pos, _, diameter, billboard_visible) in &mut planet_query { if orbit.draw_lines { - orbit.hide_lines = (cam.radius < diameter.num * M_TO_UNIT as f32 * PLANET_HIDE_MULTIPLIER && entity == selected_entity.entity.unwrap() || !billboard_visible.0) && ui_state.dyn_hide_orbit_lines; + orbit.hide_lines = (cam.radius < scale.m_to_unit_32(diameter.num) * PLANET_HIDE_MULTIPLIER && entity == selected_entity.entity.unwrap() || !billboard_visible.0) && ui_state.dyn_hide_orbit_lines; let speed = speed.0 as f32 * (substeps.0 as f32); let max_step = (orbit.period as f32 / speed) * MULTIPLIER; if orbit.step >= max_step { - orbit.lines.push_back((pos.0 * M_TO_UNIT).as_vec3()); + orbit.lines.push_back(scale.m_to_unit_dvec(pos.0).as_vec3()); // insert_at_nearest_distance(&mut orbit.lines, (pos.0 * M_TO_UNIT).as_vec3()); orbit.step = 0.0; } else { - orbit.step += time.delta_seconds(); + orbit.step += time.delta_seconds() * orbit.orbit_line_multiplier; } } } @@ -76,17 +77,17 @@ fn update_lines( if let Some((_, _, p_pos, _, _, _)) = planet_query.iter().find(|(_, _, _, children, _, _)| { children.0.contains(&entity) }) { - orbit.hide_lines = (cam.radius < diameter.num * M_TO_UNIT as f32 * HIDE_MULTIPLIER && entity == selected_entity.entity.unwrap() || !billboard_visible.0) && ui_state.dyn_hide_orbit_lines; + orbit.hide_lines = (cam.radius < scale.m_to_unit_32(diameter.num) * HIDE_MULTIPLIER && entity == selected_entity.entity.unwrap() || !billboard_visible.0) && ui_state.dyn_hide_orbit_lines; let speed = speed.0 as f32 * (substeps.0 as f32); let max_step = (orbit.period as f32 / speed) * MULTIPLIER; if orbit.step >= max_step { - let raw_p_pos = (p_pos.0 * M_TO_UNIT).as_vec3(); - let raw_pos = (pos.0 * M_TO_UNIT).as_vec3(); + let raw_p_pos = scale.m_to_unit_dvec(p_pos.0).as_vec3(); + let raw_pos = scale.m_to_unit_dvec(pos.0).as_vec3(); orbit.lines.push_back(raw_pos - raw_p_pos); //insert_at_nearest_distance(&mut orbit.lines, raw_pos - raw_p_pos); orbit.step = 0.0; } else { - orbit.step += time.delta_seconds(); + orbit.step += time.delta_seconds() * orbit.orbit_line_multiplier; } } } @@ -97,7 +98,8 @@ fn draw_orbit_line( offset: Res, planet_query: Query<(&OrbitSettings, &SimPosition, &BodyChildren, &Transform), (With, Without, Without)>, moon_query: Query<(Entity, &OrbitSettings, &Transform), (With, Without, Without)>, - mut gizmos: Gizmos + mut gizmos: Gizmos, + scale: Res ) { for (orbit, _, _, transform) in &planet_query { if orbit.draw_lines && !orbit.hide_lines { @@ -109,7 +111,7 @@ fn draw_orbit_line( if let Some((_, p_pos, _, _)) = planet_query.iter().find(|(_, _, children, _)| { children.0.contains(&entity) }) { - let raw_p_pos = (p_pos.0 * M_TO_UNIT).as_vec3(); + let raw_p_pos = scale.m_to_unit_dvec(p_pos.0).as_vec3(); draw_lines(orbit, offset.value + raw_p_pos, &mut gizmos, transform.translation) } } diff --git a/src/simulation/components/physics.rs b/src/simulation/components/physics.rs index 5fb89af..27fa7cc 100644 --- a/src/simulation/components/physics.rs +++ b/src/simulation/components/physics.rs @@ -7,8 +7,9 @@ use bevy::prelude::{Entity, in_state, IntoSystemConfigs, Mut, Query, Res, ResMut use bevy::reflect::List; use crate::simulation::components::body::{Acceleration, Mass, OrbitSettings, SimPosition, Velocity, Star, Planet, BodyChildren}; -use crate::constants::{DEFAULT_SUB_STEPS, G, M_TO_UNIT}; +use crate::constants::{DEFAULT_SUB_STEPS, G}; use crate::simulation::components::orbit_lines::OrbitOffset; +use crate::simulation::components::scale::SimulationScale; use crate::simulation::components::selection::SelectedEntity; use crate::simulation::SimState; use crate::simulation::components::speed::Speed; @@ -78,9 +79,10 @@ pub fn apply_physics( mut orbit_offset: ResMut, sub_steps: Res, mut diagnostics: Diagnostics, + scale: Res, ) { if pause.0 { - change_selection_without_update(&mut query, &selected_entity, &mut orbit_offset); //allows switching bodies while paused + change_selection_without_update(&mut query, &selected_entity, &mut orbit_offset, &scale); //allows switching bodies while paused return; } let count = query.iter().count(); @@ -89,12 +91,12 @@ pub fn apply_physics( let start = Instant::now(); for _ in 0..sub_steps.0 - 1 { update_acceleration(&mut query, count); - update_velocity_and_positions(&mut query, delta, &speed, &selected_entity, &mut orbit_offset, false); + update_velocity_and_positions(&mut query, delta, &speed, &selected_entity, &mut orbit_offset, false, &scale); } #[cfg(not(target_arch = "wasm32"))] let start_step = Instant::now(); update_acceleration(&mut query, count); - update_velocity_and_positions(&mut query, delta, &speed, &selected_entity, &mut orbit_offset, true); + update_velocity_and_positions(&mut query, delta, &speed, &selected_entity, &mut orbit_offset, true, &scale); #[cfg(not(target_arch = "wasm32"))] diagnostics.add_measurement(&NBODY_STEP_TIME, || start_step.elapsed().as_nanos() as f64); #[cfg(not(target_arch = "wasm32"))] @@ -110,7 +112,11 @@ fn update_acceleration( for (entity, mass, mut acc, _, _, sim_pos, _, is_star, is_planet, children) in query.iter_mut() { acc.0 = DVec3::ZERO; for (other_entity, other_mass, ref mut other_acc, other_sim_pos, other_is_star, other_is_planet, other_children) in other_bodies.iter_mut() { - if (is_planet && *other_is_planet) || (is_star && *other_is_planet) || (is_planet && *other_is_star) || (!is_star && !is_planet && (other_children.is_some() && other_children.unwrap().0.contains(&entity)) || *other_is_star) || (!*other_is_star && !*other_is_planet && (children.is_some() && children.unwrap().0.contains(other_entity) || is_star)) { + if (/*is_planet && *other_is_planet) + || (is_star && *other_is_planet) + || (is_planet && *other_is_star) + || (!is_star && !is_planet && (other_children.is_some() && other_children.unwrap().0.contains(&entity)) || *other_is_star) + || (!*other_is_star && !*other_is_planet && (children.is_some() && children.unwrap().0.contains(other_entity) || is_star)*/ true) { let distance = other_sim_pos.0 - sim_pos.0; let r_sq = distance.length_squared(); let force_direction = distance.normalize(); // Calculate the direction vector @@ -128,13 +134,14 @@ fn change_selection_without_update( query: &mut Query<(Entity, &Mass, &mut Acceleration, &mut OrbitSettings, &mut Velocity, &mut SimPosition, &mut Transform, Has, Has, Option<&BodyChildren>)>, selected_entity: &Res, orbit_offset: &mut ResMut, + scale: &SimulationScale, ) { let offset = match selected_entity.entity { //if orbit_offset.enabled is true, we calculate the new position of the selected entity first and then move it to 0,0,0 and add the actual position to all other bodies Some(selected) => { if !orbit_offset.enabled { DVec3::ZERO } else if let Ok((_, _, _, _, _, sim_pos, mut transform, _, _, _)) = query.get_mut(selected) { - let raw_translation = sim_pos.0 * M_TO_UNIT; + let raw_translation = scale.m_to_unit_dvec(sim_pos.0); transform.translation = Vec3::ZERO; //the selected entity will always be at 0,0,0 -raw_translation } else { @@ -154,8 +161,8 @@ fn change_selection_without_update( } } } - let pos_without_offset = sim_pos.0.as_vec3() * M_TO_UNIT as f32; - transform.translation = pos_without_offset + offset.as_vec3(); //apply offset + let pos_without_offset = scale.m_to_unit_dvec(sim_pos.0); + transform.translation = (pos_without_offset + offset).as_vec3(); //apply offset } if orbit_offset.enabled { orbit_offset.value = offset.as_vec3(); @@ -171,6 +178,7 @@ fn update_velocity_and_positions( selected_entity: &Res, orbit_offset: &mut ResMut, last_step: bool, + scale: &SimulationScale, ) { let offset = match selected_entity.entity { //if orbit_offset.enabled is true, we calculate the new position of the selected entity first and then move it to 0,0,0 and add the actual position to all other bodies Some(selected) => { @@ -183,7 +191,7 @@ fn update_velocity_and_positions( acc.0 /= mass.0; //actually apply the force to the body vel.0 += acc.0 * delta_time * speed.0; sim_pos.0 += vel.0 * delta_time * speed.0; //this is the same step as below, but we are doing this first for the offset - let raw_translation = sim_pos.0 * M_TO_UNIT; + let raw_translation = scale.m_to_unit_dvec(sim_pos.0); transform.translation = Vec3::ZERO; //the selected entity will always be at 0,0,0 -raw_translation } else { @@ -207,8 +215,8 @@ fn update_velocity_and_positions( vel.0 += acc.0 * delta_time * speed.0; sim_pos.0 += vel.0 * delta_time * speed.0; if last_step { - let pos_without_offset = sim_pos.0.as_vec3() * M_TO_UNIT as f32; - transform.translation = pos_without_offset + offset.as_vec3(); //apply offset + let pos_without_offset = scale.m_to_unit_dvec(sim_pos.0); + transform.translation = (pos_without_offset + offset).as_vec3(); //apply offset } } if orbit_offset.enabled && last_step { diff --git a/src/simulation/components/reset.rs b/src/simulation/components/reset.rs index ddc637e..a7d633d 100644 --- a/src/simulation/components/reset.rs +++ b/src/simulation/components/reset.rs @@ -1,6 +1,7 @@ -use bevy::prelude::{App, Camera, Commands, DespawnRecursiveExt, Entity, NextState, OnEnter, OnExit, Plugin, Query, ResMut, Vec3, With, Without}; +use bevy::prelude::{App, Camera, Commands, DespawnRecursiveExt, Entity, NextState, OnEnter, OnExit, Plugin, Query, Res, ResMut, Vec3, With, Without}; use crate::{constants::{DEFAULT_SUB_STEPS, DEFAULT_TIMESTEP}}; +use crate::setup::ScenarioData; use crate::simulation::components::body::Mass; use crate::simulation::components::camera::{PanOrbitCamera, DEFAULT_CAM_RADIUS}; use crate::simulation::components::physics::{Pause, SubSteps}; @@ -35,12 +36,13 @@ fn clean_up( mut loading_state: ResMut, mut commands: Commands, mut camera: Query<&mut PanOrbitCamera>, - mut ui_state: ResMut + mut ui_state: ResMut, + scenario_data: Res ) { for entity in m_entities.iter() { commands.entity(entity).despawn_recursive() } - speed.0 = DEFAULT_TIMESTEP; + speed.0 = scenario_data.timestep as f64; pause.0 = false; sim_time.0 = 0.0; selected_entity.entity = None; diff --git a/src/simulation/components/save_scenario.rs b/src/simulation/components/save_scenario.rs index cb1366a..e6e5044 100644 --- a/src/simulation/components/save_scenario.rs +++ b/src/simulation/components/save_scenario.rs @@ -1,5 +1,3 @@ -use crate::constants::M_TO_UNIT; -use crate::serialization::{SerializedBody, SerializedBodyData, SerializedLightSource, SerializedVec, SimulationData}; use crate::setup::ScenarioData; use crate::simulation::components::body::{AxialTilt, BodyChildren, Diameter, LightSource, Mass, ModelPath, RotationSpeed, SimPosition, Star, Velocity}; use crate::simulation::ui::scenario_selection::SelectedScenario; @@ -11,6 +9,11 @@ use bevy::math::DVec3; use bevy::prelude::{default, AssetServer, Assets, Entity, PointLight, Query, Res, ResMut, Visibility}; use std::fs; use egui_toast::{Toast, ToastKind, ToastOptions}; +use crate::simulation::asset::serialization::{SerializedBody, SerializedBodyData, SerializedLightSource, SerializedVec, SimulationData}; +use crate::simulation::components::horizons::HorizonsId; +use crate::simulation::components::scale::SimulationScale; +use crate::simulation::components::speed::Speed; +use crate::simulation::units::converter::unscale_lumen; pub struct SaveScenarioPlugin; @@ -29,9 +32,11 @@ pub struct SystemPanelSet<'w, 's> { selected_scenario: ResMut<'w, SelectedScenario>, bodies_asset: ResMut<'w, Assets>, scenario_data: ResMut<'w, ScenarioData>, - bodies: Query<'w, 's, (Entity, &'static Mass, &'static SimPosition, &'static Velocity, &'static Name, &'static ModelPath, &'static Diameter, &'static RotationSpeed, &'static AxialTilt, Option<&'static BodyChildren>, Option<&'static Star>)>, + bodies: Query<'w, 's, (Entity, &'static Mass, &'static SimPosition, &'static Velocity, &'static Name, &'static ModelPath, &'static Diameter, &'static RotationSpeed, &'static AxialTilt, Option<&'static BodyChildren>, Option<&'static HorizonsId>, Option<&'static Star>)>, lights: Query<'w, 's, (&'static LightSource, &'static PointLight, &'static Visibility)>, - toasts: ResMut<'w, ToastContainer> + toasts: ResMut<'w, ToastContainer>, + scale: Res<'w, SimulationScale>, + speed: Res<'w, Speed> } @@ -46,9 +51,11 @@ pub fn save_scenario( starting_time_millis: scenario_data.starting_time_millis, title: scenario_data.title.clone(), description: scenario_data.description.clone(), + scale: system_panel_set.scale.0, + timestep: system_panel_set.speed.0 as i32 }; let serialized_data = serde_json::to_string(&simulation_data).unwrap(); - fs::write(format!("assets/scenarios/{}", file_path), serialized_data).unwrap(); + fs::write(format!("scenarios/{}", file_path), serialized_data).unwrap(); system_panel_set.toasts.0.add(success_toast("Scenario saved")); } @@ -58,7 +65,7 @@ fn get_file_path<'s>(system_panel_set: &'s SystemPanelSet) -> &'s str { fn collect_bodies(system_panel_set: &SystemPanelSet) -> Vec { let mut bodies = Vec::new(); - system_panel_set.bodies.iter().filter(|(_, _, _, _, _, _, _, _, _, _, star)| star.is_some()).for_each(|(entity, _, _, _, _, _, _, _, _, children, _)| { + system_panel_set.bodies.iter().filter(|(_, _, _, _, _, _, _, _, _, _, _, star)| star.is_some()).for_each(|(entity, _, _, _, _, _, _ ,_, _, children, _, _)| { let mut data = find_body_data(system_panel_set, entity).map(|(data, _)| data).unwrap(); let light_source = find_light_source(system_panel_set, entity); data.light_source = light_source; @@ -73,7 +80,6 @@ fn collect_planets(system_panel_set: &SystemPanelSet, children: BodyChildren) -> for planet_entity in children.0.clone() { if let Some((planet_data, planet_children)) = find_body_data(system_panel_set, planet_entity) { let moons = collect_moons(system_panel_set, planet_children.unwrap().clone()); - println!("{:?}", moons); planets.push(SerializedBody { children: moons, data: planet_data.clone() }); } } @@ -91,9 +97,9 @@ fn collect_moons(system_panel_set: &SystemPanelSet, children: BodyChildren) -> V } fn find_body_data(system_panel_set: &SystemPanelSet, entity: Entity) -> Option<(SerializedBodyData, Option)> { - system_panel_set.bodies.iter().find(|(e, _, _, _, _, _, _, _, _, _, _)| *e == entity) - .map(|(_, m, p, v, n, mp, d, rs, at, child, _)| ( - create_serialized_body_data(m.0, p.0 / 1000.0, v.0 / 1000.0, n.to_string(), mp.cleaned(), d.num as f64 / 1000.0, rs.0, at.num, None), + system_panel_set.bodies.iter().find(|(e, _, _, _, _, _, _, _, _, _, _, _)| *e == entity) + .map(|(_, m, p, v, n, mp, d, rs, at, child, horizon, _)| ( + create_serialized_body_data(m.0, p.0 / 1000.0, v.0 / 1000.0, n.to_string(), mp.cleaned(), d.num as f64 / 1000.0, rs.0, at.num, None, horizon.map(|h| h.0)), child.map(|c| c.clone()) )) } @@ -106,7 +112,8 @@ fn create_serialized_body_data( diameter: f64, rotation_speed: f64, axial_tilt: f32, - light_source: Option + light_source: Option, + horizons_id: Option, ) -> SerializedBodyData { SerializedBodyData { mass, @@ -118,17 +125,18 @@ fn create_serialized_body_data( rotation_speed, axial_tilt, simulate: true, - light_source + light_source, + horizons_id } } fn find_light_source( system_panel_set: &SystemPanelSet, - entity: Entity + entity: Entity, ) -> Option { system_panel_set.lights.iter().find(|(s, _, _)| s.0 == entity).map(|(_, light, visibility)| SerializedLightSource { - intensity: light.intensity as f64 / M_TO_UNIT.powf(2.), - range: light.range as f64 / M_TO_UNIT, + intensity: unscale_lumen(light.intensity, &system_panel_set.scale), + range: system_panel_set.scale.unit_to_m_32(light.range), color: light.color.to_srgba().to_hex(), enabled: visibility == &Visibility::Visible }) diff --git a/src/simulation/components/scale.rs b/src/simulation/components/scale.rs new file mode 100644 index 0000000..83f52c7 --- /dev/null +++ b/src/simulation/components/scale.rs @@ -0,0 +1,69 @@ +use bevy::app::Plugin; +use bevy::math::DVec3; +use bevy::prelude::{Resource, Vec3}; + +pub struct ScalePlugin; + +impl Plugin for ScalePlugin { + + fn build(&self, app: &mut bevy::prelude::App) { + app + .init_resource::(); + } + +} + +#[derive(Resource)] +pub struct SimulationScale(pub f32); + +impl Default for SimulationScale { + + fn default() -> Self { + SimulationScale(0.0000001) + } + +} + +impl SimulationScale { + + pub fn f64(&self) -> f64 { + self.0 as f64 + } + + pub fn squared(&self) -> SimulationScale { + SimulationScale(self.0 * self.0) + } + + pub fn m_to_unit(&self, value: f64) -> f64 { + value * self.0 as f64 + } + + pub fn unit_to_m(&self, value: f64) -> f64 { + value / self.0 as f64 + } + + pub fn m_to_unit_32(&self, value: f32) -> f32 { + value * self.0 + } + + pub fn unit_to_m_32(&self, value: f32) -> f32 { + value / self.0 + } + + pub fn m_to_unit_vec(&self, value: Vec3) -> Vec3 { + value * self.0 + } + + pub fn unit_to_m_vec(&self, value: Vec3) -> Vec3 { + value / self.0 + } + + pub fn m_to_unit_dvec(&self, value: DVec3) -> DVec3 { + value * self.0 as f64 + } + + pub fn unit_to_m_dvec(&self, value: DVec3) -> DVec3 { + value / self.0 as f64 + } + +} \ No newline at end of file diff --git a/src/simulation/components/selection.rs b/src/simulation/components/selection.rs index 6772cc3..2534dd2 100644 --- a/src/simulation/components/selection.rs +++ b/src/simulation/components/selection.rs @@ -3,9 +3,9 @@ use bevy::prelude::{Entity, in_state, IntoSystemConfigs, Query, Res, ResMut, Res use crate::simulation::components::body::{Diameter, Mass, Star}; use crate::simulation::components::camera::{pan_orbit_camera, PanOrbitCamera}; -use crate::constants::M_TO_UNIT; use crate::simulation::components::orbit_lines::OrbitOffset; use crate::simulation::components::physics::apply_physics; +use crate::simulation::components::scale::SimulationScale; use crate::simulation::SimState; const SELECTION_MULTIPLIER: f32 = 3.0; @@ -43,7 +43,8 @@ pub fn apply_camera_to_selection( bodies: Query<(Entity, &Transform, &Diameter, Option<&Star>), With>, mut camera: Query<&mut PanOrbitCamera>, mut selected_entity: ResMut, - orbit_offset: Res + orbit_offset: Res, + scale: ResMut ) { if let Some(entity) = selected_entity.entity { if let Err(_) = bodies.get(entity) { @@ -51,7 +52,7 @@ pub fn apply_camera_to_selection( } else if !selected_entity.changed_focus { let (_, _, diameter, _) = bodies.get(entity).unwrap(); let mut cam = camera.single_mut(); - cam.radius = (diameter.num * SELECTION_MULTIPLIER * M_TO_UNIT as f32); + cam.radius = scale.m_to_unit_32(diameter.num * SELECTION_MULTIPLIER); if orbit_offset.enabled { cam.focus = Vec3::ZERO; } diff --git a/src/simulation/components/speed.rs b/src/simulation/components/speed.rs index b671856..0abcfcc 100644 --- a/src/simulation/components/speed.rs +++ b/src/simulation/components/speed.rs @@ -2,7 +2,7 @@ use bevy::app::{App, Plugin}; use bevy::prelude::Resource; use crate::constants::DEFAULT_TIMESTEP; -use crate::unit::format_seconds; +use crate::simulation::units::text_formatter::format_seconds; pub struct SpeedPlugin; @@ -23,7 +23,7 @@ impl Speed { pub fn format(&self, sub_steps: i32) -> String { let speed_in_seconds = self.0 * (sub_steps as f64); - return format_seconds(speed_in_seconds); + format_seconds(speed_in_seconds) } pub fn small_step_up(&mut self) { diff --git a/src/simulation/mod.rs b/src/simulation/mod.rs index 500255d..66348fa 100644 --- a/src/simulation/mod.rs +++ b/src/simulation/mod.rs @@ -11,6 +11,8 @@ pub mod render; pub mod ui; pub mod components; pub mod loading; +pub mod asset; +pub mod units; #[derive(Clone, Eq, PartialEq, Debug, Default, Hash, Resource)] pub enum SimStateType { diff --git a/src/simulation/render/star_billboard.rs b/src/simulation/render/star_billboard.rs index 438fd12..bee8704 100644 --- a/src/simulation/render/star_billboard.rs +++ b/src/simulation/render/star_billboard.rs @@ -1,10 +1,11 @@ use bevy::app::{App, Plugin, Update}; use bevy::math::Vec3; -use bevy::prelude::{Camera, Children, Component, in_state, IntoSystemConfigs, Parent, Query, Transform, Visibility, With, Without, Entity, Color}; +use bevy::prelude::{Camera, Children, Component, in_state, IntoSystemConfigs, Parent, Query, Transform, Visibility, With, Without, Entity, Color, Res}; use bevy::scene::SceneInstance; - +use crate::constants::DEF_M_TO_UNIT; use crate::simulation::components::body::Star; use crate::simulation::components::camera::pan_orbit_camera; +use crate::simulation::components::scale::SimulationScale; use crate::simulation::SimState; const STAR_IMPOSTER_THRESHOLD: f32 = 4_000.0; @@ -29,20 +30,23 @@ fn change_sun_renderer( mut stars: Query<(&Transform, &Children), (Without, Without)>, mut star_billboards: Query<(&mut Transform, &mut Visibility, &Parent), (With, Without, Without)>, mut scenes: Query<(&SceneInstance, &mut Visibility), (Without, Without)>, + scale: Res ) { let (c_transform, camera) = camera.single(); + let multiplier = scale.0 / DEF_M_TO_UNIT as f32; + let multiplier_sq = multiplier.powi(2); for (transform, children) in &mut stars { let distance = c_transform.translation.distance(transform.translation); for child in children.iter() { if let Ok((_, mut visibility)) = scenes.get_mut(*child) { - if distance > STAR_IMPOSTER_THRESHOLD && camera.hdr { + if distance > STAR_IMPOSTER_THRESHOLD * multiplier && camera.hdr { *visibility = Visibility::Hidden; } else { *visibility = Visibility::Visible; } } if let Ok((_, mut visibility, _)) = star_billboards.get_mut(*child) { - if distance > STAR_IMPOSTER_THRESHOLD && camera.hdr { + if distance > STAR_IMPOSTER_THRESHOLD * multiplier && camera.hdr { *visibility = Visibility::Visible; } else { *visibility = Visibility::Hidden; @@ -55,6 +59,6 @@ fn change_sun_renderer( let (transform, _) = stars.get(**parent).unwrap(); let distance = c_transform.translation.distance(transform.translation); b_transform.look_at(-c_transform.translation, Vec3::Y); - b_transform.scale = Vec3::splat(distance / STAR_IMPOSTER_DIVIDER); + b_transform.scale = Vec3::splat(distance / STAR_IMPOSTER_DIVIDER / multiplier_sq); } } \ No newline at end of file diff --git a/src/simulation/ui/bottom_bar.rs b/src/simulation/ui/bottom_bar.rs index 3fb1a80..50246f7 100644 --- a/src/simulation/ui/bottom_bar.rs +++ b/src/simulation/ui/bottom_bar.rs @@ -1,8 +1,9 @@ -use chrono::{Days, NaiveDateTime}; +use chrono::{Days, Duration, NaiveDateTime}; -pub fn get_date_from_millis(start: i64, millis: f32) -> NaiveDateTime { +pub fn get_date_from_seconds(start: i64, seconds: f32) -> NaiveDateTime { NaiveDateTime::from_timestamp_millis(start) .unwrap() - .checked_add_days(Days::new((((millis * 100.0).round()) / 100.0) as u64)) + .checked_add_signed(Duration::seconds((seconds as f64).round() as i64)) + // .checked_add_days(Days::new((((millis * 100.0).round()) / 100.0) as u64)) .unwrap() } \ No newline at end of file diff --git a/src/simulation/ui/components.rs b/src/simulation/ui/components.rs index 4d99c8a..6d2da80 100644 --- a/src/simulation/ui/components.rs +++ b/src/simulation/ui/components.rs @@ -14,6 +14,6 @@ pub fn vector_field(ui: &mut Ui, name: &str, state: &mut DVec3) { fn coordinate_field(ui: &mut Ui, name: &str, state: &mut f64) { ui.horizontal(|ui| { ui.label(name); - ui.add(egui::DragValue::new(state)); + ui.add(egui::DragValue::new(state).max_decimals(20)); }); } \ No newline at end of file diff --git a/src/simulation/ui/editor_body_panel.rs b/src/simulation/ui/editor_body_panel.rs index f46d453..27d71d0 100644 --- a/src/simulation/ui/editor_body_panel.rs +++ b/src/simulation/ui/editor_body_panel.rs @@ -1,9 +1,7 @@ use bevy::asset::{AssetServer, Assets}; use crate::simulation::components::apsis::ApsisBody; use crate::simulation::components::body::{AxialTilt, BodyChildren, BodyParent, Diameter, LightSource, Mass, ModelPath, OrbitSettings, RotationSpeed, Scale, SceneEntity, SceneHandle, SimPosition, Velocity}; -use crate::constants::{G, M_TO_AU, M_TO_UNIT}; use crate::simulation::components::selection::SelectedEntity; -use crate::unit::{format_length, format_seconds}; use bevy::core::Name; use bevy::math::DVec3; use bevy::pbr::StandardMaterial; @@ -13,10 +11,13 @@ use bevy_egui::{egui, EguiContexts}; use egui_toast::{Toast, ToastKind, ToastOptions}; use crate::setup::spawn_scene; use crate::simulation::components::editor::{EditorSystemType, EditorSystems}; +use crate::simulation::components::horizons::HorizonsId; +use crate::simulation::components::scale::SimulationScale; use crate::simulation::render::star_billboard::StarBillboard; use crate::simulation::ui::components::vector_field; use crate::simulation::ui::toast::{success_toast, ToastContainer}; use crate::simulation::ui::UiState; +use crate::simulation::units::converter::{km_to_m, km_to_m_dvec, km_to_m_f64, m_to_km, m_to_km_dvec, m_to_km_f64, scale_lumen, unscale_lumen}; #[derive(Debug, Default, Clone, Resource)] pub struct EditorPanelState { @@ -30,21 +31,22 @@ pub struct EditorPanelState { pub new_axial_tilt: f32, pub new_model_path: String, pub show_delete_confirm: bool, - pub new_light_settings: Option + pub new_light_settings: Option, + pub horizons_id: i32, } #[derive(Debug, Default, Clone, Copy)] pub struct LightSettings { pub color: Color, - pub intensity: f64, - pub range: f64, + pub intensity: f32, + pub range: f32, pub enabled: bool, } pub fn editor_body_panel( mut egui_context: EguiContexts, selected_entity: Res, - mut query: Query<(Entity, &mut Name, &mut SimPosition, &mut Velocity, &mut Mass, &mut Diameter, &mut RotationSpeed, &mut AxialTilt, &mut ModelPath, &mut SceneHandle), With>, + mut query: Query<(Entity, &mut Name, &mut SimPosition, &mut Velocity, &mut Mass, &mut Diameter, &mut RotationSpeed, &mut AxialTilt, &mut ModelPath, &mut SceneHandle, &mut HorizonsId), With>, scene_query: Query>, mut state: ResMut, mut commands: Commands, @@ -53,20 +55,21 @@ pub fn editor_body_panel( mut light_query: Query<(&mut PointLight, &LightSource, &mut Visibility)>, mut billboards: Query<(&StarBillboard, &mut Handle)>, mut materials: ResMut>, - mut toast_container: ResMut + mut toast_container: ResMut, + scale: Res ) { if egui_context.try_ctx_mut().is_none() { return; } let mut apply = false; if let Some(s_entity) = selected_entity.entity { - if let Ok((entity, mut name, mut pos, mut vel, mut mass, mut diameter, mut rotation_speed, mut tilt, mut model_path, mut scene)) = query.get_mut(s_entity) { + if let Ok((entity, mut name, mut pos, mut vel, mut mass, mut diameter, mut rotation_speed, mut tilt, mut model_path, mut scene, mut horizons_id)) = query.get_mut(s_entity) { let light = light_query.iter_mut().find(|(_, l, _)| l.0 == entity).map(|(a,b,c)| (a,b,c)); let mut billboard_material = billboards.iter_mut().find(|(b, _)| b.0 == entity).map(|(_, m)| m.clone()); if state.entity.is_none() || state.entity.unwrap() != s_entity { - initialize_state(state.as_mut(), s_entity, &name, &pos, &vel, &mass, &diameter, &rotation_speed, &tilt, &model_path, light.as_ref()); + initialize_state(state.as_mut(), s_entity, &name, &pos, &vel, &mass, &diameter, &rotation_speed, &tilt, &model_path, light.as_ref(), &scale, &horizons_id); } - display_body_panel(egui_context.ctx_mut(), state.as_mut(), &mut name, &mut pos, &mut vel, &mut mass, &mut diameter, &mut rotation_speed, &mut tilt, &mut model_path, &mut scene, &mut commands, &systems, &assets, light, scene_query, billboard_material.as_mut(), &mut materials, &mut apply); + display_body_panel(egui_context.ctx_mut(), state.as_mut(), &mut name, &mut pos, &mut vel, &mut mass, &mut diameter, &mut rotation_speed, &mut tilt, &mut model_path, &mut scene, &mut horizons_id, &mut commands, &systems, &assets, light, scene_query, billboard_material.as_mut(), &mut materials, &mut apply, &scale); } } else { state.entity = None; @@ -87,25 +90,28 @@ fn initialize_state( rotation_speed: &RotationSpeed, tilt: &AxialTilt, model_path: &ModelPath, - light: Option<&(Mut, &LightSource, Mut)> + light: Option<&(Mut, &LightSource, Mut)>, + scale: &SimulationScale, + horizons_id: &Mut, ) { *state = EditorPanelState { entity: Some(s_entity), new_name: name.to_string(), - new_position: pos.0 / 1000.0, - new_velocity: vel.0 / 1000.0, + new_position: m_to_km_dvec(pos.0), + new_velocity: m_to_km_dvec(vel.0), new_mass: mass.0, - new_diameter: (diameter.num / 1000.0), + new_diameter: m_to_km(diameter.num), new_rotation_speed: rotation_speed.0, new_axial_tilt: tilt.num, new_model_path: model_path.cleaned(), show_delete_confirm: false, new_light_settings: light.map(|(light, _, visible)| LightSettings { color: (*light).color, - intensity: (*light).intensity as f64 / M_TO_UNIT.powf(2.), + intensity: unscale_lumen((*light).intensity, scale), enabled: **visible == Visibility::Visible, - range: (*light).range as f64 / M_TO_UNIT, - }) + range: scale.unit_to_m_32(light.range), + }), + horizons_id: horizons_id.0, }; } @@ -121,6 +127,7 @@ fn display_body_panel( tilt: &mut AxialTilt, model_path: &mut ModelPath, scene: &mut SceneHandle, + horizons: &mut Mut, commands: &mut Commands, systems: &Res, assets: &Res, @@ -128,7 +135,8 @@ fn display_body_panel( scene_query: Query>, billboard_material: Option<&mut Handle>, materials: &mut ResMut>, - apply: &mut bool + apply: &mut bool, + scale: &SimulationScale ) { egui::SidePanel::right("body_panel") .resizable(true) @@ -139,7 +147,7 @@ fn display_body_panel( ui.heading("Body"); display_body_properties(ui, state); display_light_source(ui, state); - display_bottom_buttons(ui, state, name, pos, vel, mass, diameter, rotation_speed, tilt, model_path, scene, commands, systems, assets, light, scene_query, billboard_material, materials, apply); + display_bottom_buttons(ui, state, name, pos, vel, mass, diameter, rotation_speed, tilt, model_path, scene, horizons, commands, systems, assets, light, scene_query, billboard_material, materials, apply, scale); }); }); } @@ -149,6 +157,10 @@ fn display_body_properties(ui: &mut egui::Ui, state: &mut EditorPanelState) { ui.label("Name"); ui.text_edit_singleline(&mut state.new_name); }); + ui.horizontal(|ui| { + ui.label("Horizons ID"); + ui.add(egui::DragValue::new(&mut state.horizons_id)); + }); ui.horizontal(|ui| { ui.label("Model Path"); ui.text_edit_singleline(&mut state.new_model_path); @@ -216,6 +228,7 @@ fn display_bottom_buttons( tilt: &mut AxialTilt, model_path: &mut ModelPath, scene: &mut SceneHandle, + horizons: &mut Mut, commands: &mut Commands, systems: &Res, assets: &Res, @@ -223,12 +236,13 @@ fn display_bottom_buttons( scene_query: Query>, billboard_material: Option<&mut Handle>, materials: &mut ResMut>, - apply: &mut bool + apply: &mut bool, + scale: &SimulationScale ) { ui.with_layout(Layout::bottom_up(Align::Center), |ui| { ui.horizontal(|ui| { if ui.button("Apply").on_hover_text("Apply changes").clicked() { - apply_changes(state, name, pos, vel, mass, diameter, rotation_speed, tilt, model_path, scene, commands, systems, assets, light, scene_query, billboard_material, materials); + apply_changes(state, name, pos, vel, mass, diameter, rotation_speed, tilt, model_path, scene, horizons, commands, systems, assets, light, scene_query, billboard_material, materials, scale); *apply = true; } if ui.button("Reset").on_hover_text("Reset to original values").clicked() { @@ -250,6 +264,9 @@ fn display_bottom_buttons( } }); ui.separator(); + if ui.button("Fetch Horizons Data").on_hover_text("Fetch data from NASA Horizons").clicked() { + commands.run_system(systems.0[EditorSystemType::RETRIEVE_DATA]); + } }); } @@ -264,25 +281,28 @@ fn apply_changes( tilt: &mut AxialTilt, model_path: &mut ModelPath, scene: &mut SceneHandle, + horizons_id: &mut HorizonsId, commands: &mut Commands, systems: &Res, assets: &Res, light: Option<(Mut, &LightSource, Mut)>, scene_query: Query>, billboard_material: Option<&mut Handle>, - materials: &mut ResMut> + materials: &mut ResMut>, + scale: &SimulationScale ) { name.set(state.new_name.clone()); - pos.0 = state.new_position * 1000.0; - vel.0 = state.new_velocity * 1000.0; + pos.0 = km_to_m_dvec(state.new_position); + vel.0 = km_to_m_dvec(state.new_velocity); mass.0 = state.new_mass; - let new_diameter = state.new_diameter * 1000.0; + let new_diameter = km_to_m(state.new_diameter); diameter.applied = new_diameter == diameter.num; diameter.num = new_diameter; rotation_speed.0 = state.new_rotation_speed; let new_tilt = state.new_axial_tilt; tilt.applied = new_tilt == tilt.num; tilt.num = new_tilt; + *horizons_id = HorizonsId(state.horizons_id); if let Some((mut light, _, mut visible)) = light { light.color = state.new_light_settings.as_ref().unwrap().color; if let Some(material) = billboard_material { @@ -292,8 +312,8 @@ fn apply_changes( let mut material = materials.get_mut(material).unwrap(); material.base_color = new_color; } - light.intensity = (state.new_light_settings.as_ref().unwrap().intensity * M_TO_UNIT.powf(2.)) as f32; - light.range = (state.new_light_settings.as_ref().unwrap().range * M_TO_UNIT) as f32; + light.intensity = scale_lumen(state.new_light_settings.as_ref().unwrap().intensity, scale); + light.range = scale.m_to_unit_32(state.new_light_settings.as_ref().unwrap().range); *visible = if state.new_light_settings.as_ref().unwrap().enabled { Visibility::Visible } else { @@ -305,8 +325,8 @@ fn apply_changes( .insert(PointLightBundle { point_light: PointLight { color: light.color, - intensity: (light.intensity * M_TO_UNIT.powf(2.)) as f32, - range: (light.range * M_TO_UNIT) as f32, + intensity: scale_lumen(light.intensity, scale), + range: scale.m_to_unit_32(light.range), radius: new_diameter / 2.0, ..default() }, diff --git a/src/simulation/ui/editor_bottom_bar.rs b/src/simulation/ui/editor_bottom_bar.rs index 8228360..e744c4f 100644 --- a/src/simulation/ui/editor_bottom_bar.rs +++ b/src/simulation/ui/editor_bottom_bar.rs @@ -11,7 +11,7 @@ use crate::simulation::components::speed::Speed; use crate::simulation::{SimState, SimStateType}; use crate::simulation::components::editor::{EditorSystemType, EditorSystems}; use crate::simulation::ui::{SimTime, UiState}; -use crate::simulation::ui::bottom_bar::get_date_from_millis; +use crate::simulation::ui::bottom_bar::get_date_from_seconds; pub fn editor_bottom_bar( mut sim_time: ResMut, @@ -25,7 +25,7 @@ pub fn editor_bottom_bar( mut commands: Commands ) { let mut window = windows.single_mut(); - let date = get_date_from_millis(scenario_data.starting_time_millis, sim_time.0); + let date = get_date_from_seconds(scenario_data.starting_time_millis, sim_time.0); egui::TopBottomPanel::bottom("time_panel") .resizable(false) .show(egui_context.ctx_mut(), |ui| { diff --git a/src/simulation/ui/metadata.rs b/src/simulation/ui/metadata.rs new file mode 100644 index 0000000..c12f21d --- /dev/null +++ b/src/simulation/ui/metadata.rs @@ -0,0 +1,84 @@ +use bevy::app::{App, Plugin, Update}; +use bevy::log::tracing_subscriber::fmt::format; +use bevy::prelude::{in_state, IntoSystemConfigs, OnEnter, Res, ResMut, Resource}; +use bevy_egui::{egui, EguiContext, EguiContexts}; +use chrono::{NaiveTime, Timelike}; +use egui_extras::DatePickerButton; +use crate::setup::ScenarioData; +use crate::simulation::components::scale::SimulationScale; +use crate::simulation::components::speed::Speed; +use crate::simulation::SimState; +use crate::simulation::ui::bottom_bar::get_date_from_seconds; +use crate::simulation::ui::scenario_selection::{SelectedScenario, SelectionState}; +use crate::simulation::units::text_formatter::format_seconds; +use crate::utils::sim_state_type_editor; + +pub struct MetadataPlugin; + +impl Plugin for MetadataPlugin { + + fn build(&self, app: &mut App) { + app + .init_resource::() + .add_systems(Update, metadata_editor.run_if(sim_state_type_editor)); + } +} + +#[derive(Default, Resource)] +pub struct ShowMetadata(pub bool); + +fn metadata_editor( + mut scenario_data: ResMut, + mut scale: ResMut, + mut show_metadata: ResMut, + mut egui_context: EguiContexts, + mut speed: ResMut, +) { + egui::Window::new("Metadata Editor") + .open(&mut show_metadata.0) + .collapsible(true) + .constrain(true) + .scroll2([true, true]) + .auto_sized() + .show(egui_context.ctx_mut(), |ui| { + ui.horizontal(|ui| { + ui.label("Title"); + ui.text_edit_singleline(&mut scenario_data.title); + }); + ui.horizontal(|ui| { + ui.label("Description"); + ui.text_edit_multiline(&mut scenario_data.description); + }); + let current_date = get_date_from_seconds(scenario_data.starting_time_millis, 0.0); + let mut new_date = current_date.clone().date(); + ui.horizontal(|ui| { + ui.label("Starting Date"); + ui.add(DatePickerButton::new(&mut new_date)); + }); + let mut hour = current_date.time().hour(); + let mut minute = current_date.time().minute(); + let mut second = current_date.time().second(); + ui.horizontal(|ui| { + ui.label("Starting Time"); + ui.add(egui::DragValue::new(&mut hour).range(0..=23)); + ui.label(":"); + ui.add(egui::DragValue::new(&mut minute).range(0..=59)); + ui.label(":"); + ui.add(egui::DragValue::new(&mut second).range(0..=59)); + }); + let changed_date = new_date.and_time(NaiveTime::from_hms_opt(hour, minute, second).unwrap()); + if changed_date != current_date { + scenario_data.starting_time_millis = changed_date.timestamp_millis(); + } + ui.horizontal(|ui| { + ui.label("Default Timestep (in seconds)"); + ui.add(egui::DragValue::new(&mut speed.0)); + ui.label(format!("({}/step)", format_seconds(speed.0))); + }); + ui.horizontal(|ui| { + ui.label("Simulation Scale").on_hover_text("Only applied on simulation start"); + ui.add(egui::DragValue::new(&mut scale.0).min_decimals(20)); + }); + ui.label(format!("(1m = {} units)", 1. / scale.0)); + }); +} \ No newline at end of file diff --git a/src/simulation/ui/mod.rs b/src/simulation/ui/mod.rs index 1ad97ab..a5ddd71 100644 --- a/src/simulation/ui/mod.rs +++ b/src/simulation/ui/mod.rs @@ -1,6 +1,6 @@ mod bottom_bar; pub mod system_panel; -mod editor_body_panel; +pub mod editor_body_panel; pub mod debug_window; pub mod components; pub mod scenario_selection; @@ -8,6 +8,7 @@ mod sim_body_panel; pub mod simulation_bottom_bar; pub mod editor_bottom_bar; pub mod toast; +mod metadata; use bevy::{ core_pipeline::Skybox, @@ -25,7 +26,7 @@ use bevy_inspector_egui::egui::{RichText, TextEdit}; use chrono::{Days, NaiveDateTime}; //use crate::fps::Fps; -use crate::{constants::{DAY_IN_SECONDS, M_TO_AU, M_TO_UNIT}, unit::format_length}; +use crate::constants::{DAY_IN_SECONDS, M_TO_AU}; use crate::simulation::components::billboard::BillboardSettings; use crate::simulation::components::body::BodyParent; use crate::constants::G; @@ -52,11 +53,12 @@ use crate::simulation::components::speed::Speed; use crate::simulation::ui::editor_body_panel::{editor_body_panel, EditorPanelState}; use crate::simulation::ui::debug_window::DebugPlugin; use crate::simulation::ui::editor_bottom_bar::editor_bottom_bar; +use crate::simulation::ui::metadata::MetadataPlugin; use crate::simulation::ui::scenario_selection::ScenarioSelectionPlugin; use crate::simulation::ui::sim_body_panel::sim_body_panel; use crate::simulation::ui::simulation_bottom_bar::simulation_bottom_bar; use crate::simulation::ui::toast::ToastPlugin; -use crate::unit::format_seconds; +//use crate::fps::Fps; use crate::utils::{sim_state_type_editor, sim_state_type_simulation}; #[derive(Resource, Reflect, Default)] @@ -102,6 +104,7 @@ impl Plugin for InterfacePlugin { .add_plugins(DebugPlugin) .add_plugins(ScenarioSelectionPlugin) .add_plugins(ToastPlugin) + .add_plugins(MetadataPlugin) .add_systems( Update, ( diff --git a/src/simulation/ui/scenario_selection.rs b/src/simulation/ui/scenario_selection.rs index 1532939..1c2540c 100644 --- a/src/simulation/ui/scenario_selection.rs +++ b/src/simulation/ui/scenario_selection.rs @@ -1,13 +1,18 @@ use std::fs; +use std::path::Path; use bevy::app::{App, Plugin, Update}; -use bevy::asset::LoadedFolder; +use bevy::asset::io::AssetSourceId; +use bevy::asset::{AssetPath, LoadedFolder}; use bevy::prelude::{in_state, AssetServer, Assets, Commands, Handle, Image, IntoSystemConfigs, Local, NextState, OnEnter, OnExit, Res, ResMut, Resource}; use bevy::utils::HashMap; use bevy_egui::egui::{Align, CentralPanel, Layout, SidePanel, TextureId}; use bevy_egui::{egui, EguiContexts}; use image::load; -use crate::serialization::SimulationData; use crate::simulation::{SimState, SimStateType}; +use crate::simulation::asset::{from_scenario_source, SCENARIO_ASSET_SOURCE}; +use crate::simulation::asset::serialization::SimulationData; +use crate::simulation::components::scale::SimulationScale; +use crate::simulation::components::speed::Speed; use crate::simulation::ui::toast::{error_toast, ToastContainer}; pub struct ScenarioSelectionPlugin; @@ -50,15 +55,13 @@ fn load_scenarios( assets: Res, mut commands: Commands ) { - let handle = assets.load_folder("scenarios"); + let handle = assets.load_folder(from_scenario_source("")); commands.insert_resource(ScenarioFolder(handle)); } fn creation_sidebar( mut egui_context: EguiContexts, mut selection_state: ResMut, - mut sim_state: ResMut>, - mut sim_state_type: ResMut, mut toasts: ResMut ) { if !selection_state.show_creation { @@ -108,7 +111,9 @@ fn creation_sidebar( bodies: Vec::new(), starting_time_millis: 0, title: selection_state.title.clone(), - description: selection_state.description.clone() + description: selection_state.description.clone(), + scale: SimulationScale::default().0, + timestep: Speed::default().0 as i32 }; create_scenario(selection_state.file_name.clone(), selection_state.image_path.clone(), initial_data); selection_state.show_creation = false; @@ -126,7 +131,7 @@ fn validate_input(selection_state: SelectionState) -> Result<(), String> { } else { return Err("Image path cannot be accessed".to_string()); } - if let Ok(e) = fs::exists(format!("assets/scenarios/{}.sim", selection_state.file_name)) { + if let Ok(e) = fs::exists(format!("scenarios/{}.sim", selection_state.file_name)) { if e { return Err("Scenario with file name already exists".to_string()); } @@ -152,7 +157,9 @@ fn show_menu( mut sim_state: ResMut>, mut images: Local>, mut sim_state_type: ResMut, - mut selection_state: ResMut + mut selection_state: ResMut, + mut scale: ResMut, + mut speed: ResMut ) { CentralPanel::default() .show(&egui_context.ctx_mut().clone(), |ui| { @@ -176,7 +183,7 @@ fn show_menu( let image_handle: TextureId = if images.get(file_name).is_some() { images.get(file_name).unwrap().clone() } else { - let handle: Handle = assets.load(format!("scenarios/{}", file_name.replace("sim", "png"))); + let handle: Handle = assets.load(from_scenario_source(file_name.replace("sim", "png").as_str())); let t_id = egui_context.add_image(handle); images.insert(file_name.to_string(), t_id); t_id @@ -213,10 +220,14 @@ fn show_menu( } } if loading_button.clicked() { + *scale = SimulationScale(scenario.scale); + *speed = Speed(scenario.timestep as f64); selected_scenario.handle = typed_handle; sim_state.set(SimState::Loading); *sim_state_type = SimStateType::Simulation; } else if edit_button.clicked() { + *scale = SimulationScale(scenario.scale); + *speed = Speed(scenario.timestep as f64); selected_scenario.handle = typed_handle; sim_state.set(SimState::Loading); *sim_state_type = SimStateType::Editor; @@ -232,8 +243,8 @@ fn show_menu( } fn delete_scenario(file_name: &str) { - fs::remove_file(format!("assets/scenarios/{}", file_name)).unwrap(); - fs::remove_file(format!("assets/scenarios/{}", file_name.replace("sim", "png")).replace("sim", "png")).unwrap(); + fs::remove_file(format!("scenarios/{}", file_name)).unwrap(); + fs::remove_file(format!("scenarios/{}", file_name.replace("sim", "png")).replace("sim", "png")).unwrap(); } fn create_scenario( @@ -241,6 +252,6 @@ fn create_scenario( image_path: String, initial_data: SimulationData ) { - fs::write(format!("assets/scenarios/{}.sim", file_name), serde_json::to_string(&initial_data).unwrap()).unwrap(); - fs::copy(&image_path, format!("assets/scenarios/{}.png", file_name)).unwrap(); + fs::write(format!("scenarios/{}.sim", file_name), serde_json::to_string(&initial_data).unwrap()).unwrap(); + fs::copy(&image_path, format!("scenarios/{}.png", file_name)).unwrap(); } \ No newline at end of file diff --git a/src/simulation/ui/sim_body_panel.rs b/src/simulation/ui/sim_body_panel.rs index ab6e692..e111fff 100644 --- a/src/simulation/ui/sim_body_panel.rs +++ b/src/simulation/ui/sim_body_panel.rs @@ -4,12 +4,13 @@ use bevy::math::Vec3; use bevy::prelude::{Camera, Commands, DespawnRecursiveExt, Entity, Mut, Query, Res, ResMut, Transform, Without}; use bevy_egui::{egui, EguiContexts}; use bevy_egui::egui::{RichText, ScrollArea}; -use crate::constants::{G, M_TO_AU, M_TO_UNIT}; +use crate::constants::{G, M_TO_AU}; use crate::simulation::components::apsis::ApsisBody; use crate::simulation::components::body::{BodyChildren, BodyParent, Diameter, Mass, OrbitSettings, RotationSpeed, Scale, SimPosition, Velocity}; +use crate::simulation::components::scale::SimulationScale; use crate::simulation::components::selection::SelectedEntity; use crate::simulation::ui::UiState; -use crate::unit::{format_length, format_seconds}; +use crate::simulation::units::text_formatter::{format_length, format_seconds}; pub fn sim_body_panel( mut egui_context: EguiContexts, @@ -18,6 +19,7 @@ pub fn sim_body_panel( camera: Query<(&Camera, &Transform), Without>, selected_entity: Res, mut ui_state: ResMut, + s_scale: Res, ) { if !ui_state.visible || egui_context.try_ctx_mut().is_none() { return; @@ -131,8 +133,8 @@ pub fn sim_body_panel( ui.label(RichText::new("Distance to Camera").size(16.0).underline()); let (_, camera_pos) = camera.single(); let c_distance_in_units = camera_pos.translation.distance(transform.translation) as f64; - ui.label(format!("{}", format_length((c_distance_in_units / M_TO_UNIT) as f32))); - ui.label(format!("{:.3} au", c_distance_in_units / M_TO_UNIT * M_TO_AU as f64)); + ui.label(format!("{}", format_length(s_scale.unit_to_m_32(c_distance_in_units as f32)))); + ui.label(format!("{:.3} au", s_scale.unit_to_m(c_distance_in_units) * M_TO_AU as f64)); // Distance to parent if let Some((parent_pos, _, p_name, _)) = parent { @@ -190,6 +192,15 @@ pub fn sim_body_panel( orbit.color = Srgba::rgb(rgb[0], rgb[1], rgb[2]).into(); }); + ui.horizontal(|ui| { + ui.label("Orbit Line Multiplier"); + ui.add( + egui::Slider::new(&mut orbit.orbit_line_multiplier, 0.1..=100.0) + .clamp_to_range(true) + .logarithmic(true), + ); + }); + ui.label( RichText::new("Arrows") .size(16.0) diff --git a/src/simulation/ui/simulation_bottom_bar.rs b/src/simulation/ui/simulation_bottom_bar.rs index 6d55818..53b169a 100644 --- a/src/simulation/ui/simulation_bottom_bar.rs +++ b/src/simulation/ui/simulation_bottom_bar.rs @@ -11,7 +11,7 @@ use crate::simulation::components::physics::{Pause, SubSteps}; use crate::simulation::components::speed::Speed; use crate::simulation::{SimState, SimStateType}; use crate::simulation::ui::{SimTime, StepType, UiState}; -use crate::simulation::ui::bottom_bar::get_date_from_millis; +use crate::simulation::ui::bottom_bar::{get_date_from_seconds}; pub fn simulation_bottom_bar( time: Res