forked from Brickworks/yahs
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from philiplinden/bevy
Rewrite with Bevy
- Loading branch information
Showing
45 changed files
with
2,888 additions
and
2,102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,49 +2,101 @@ | |
name = "yahs" | ||
description = "Yet Another HAB Simulator" | ||
authors = ["Philip Linden <[email protected]>"] | ||
version = "0.2.0" | ||
version = "0.4.0" | ||
edition = "2021" | ||
readme = "README.md" | ||
license-file = "LICENSE" | ||
|
||
[features] | ||
default = ["gui"] | ||
gui = [ | ||
"egui", | ||
"egui_extras", | ||
"egui_plot", | ||
"eframe", | ||
"emath", | ||
"rfd", | ||
default = [ | ||
# Default to a native dev build. | ||
"dev_native", | ||
] | ||
dev = [ | ||
# Improve compile times for dev builds by linking Bevy as a dynamic | ||
# library. | ||
"bevy/dynamic_linking", | ||
"bevy/bevy_dev_tools", | ||
] | ||
dev_native = [ | ||
"dev", | ||
# Enable system information plugin for native dev builds. | ||
"bevy/sysinfo_plugin", | ||
"iyes_perf_ui/sysinfo", | ||
] | ||
config-files = ["ron", "bevy_common_assets", "serde"] | ||
inspect = ["bevy-inspector-egui", "bevy_panorbit_camera/bevy_egui"] | ||
|
||
[dependencies] | ||
pretty_env_logger = "0.5.0" | ||
libm = "0.2.1" | ||
toml = "0.8.10" | ||
clap = { version = "4.1", default-features = false, features = [ | ||
"derive", | ||
"std", | ||
"help", | ||
"usage", | ||
"error-context", | ||
"suggestions", | ||
] } | ||
csv = "1.2.1" | ||
serde = { version = "1.0.196", features = ["derive"] } | ||
log = { version = "0.4.20", features = ["release_max_level_debug"] } | ||
egui = { version = "0.26.2", features = ["log", "serde"], optional = true } | ||
egui_plot = { version = "0.26.2", features = ["serde"], optional = true } | ||
eframe = { version = "0.26.2", features = ["persistence"], optional = true } | ||
emath = { version = "0.26.2", optional = true } | ||
egui_extras = { version = "0.26.2", features = [ | ||
"chrono", | ||
"datepicker", | ||
"file", | ||
], optional = true } | ||
rfd = { version = "0.14.0", optional = true } | ||
ultraviolet = { version = "0.9.2", features = ["serde"] } | ||
# core dependencies | ||
bevy = "0.14.2" | ||
bevy-trait-query = "0.6.0" | ||
# physics dependencies | ||
avian3d = { version = "0.1.2", features = ["debug-plugin"] } | ||
# ui dependencies | ||
bevy_panorbit_camera = { version = "0.20.0" } | ||
bevy-inspector-egui = { version = "0.27.0", features = ["highlight_changes"], optional = true } | ||
iyes_perf_ui = "0.3.0" | ||
# file io dependencies | ||
bevy_common_assets = { version = "0.11.0", features = ["ron"], optional = true } | ||
ron = { version = "0.8.1", optional = true } | ||
serde = { version = "1.0", features = ["derive"], optional = true } | ||
parry3d = { version = "0.17.2", features = ["parallel"] } | ||
|
||
[[bin]] | ||
name = "yahs" | ||
path = "src/main.rs" | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Some Bevy optimizations | ||
# ----------------------------------------------------------------------------- | ||
|
||
# Idiomatic Bevy code often triggers these lints, and the CI workflow treats | ||
# them as errors. In some cases they may still signal poor code quality however, | ||
# so consider commenting out these lines. | ||
[lints.clippy] | ||
# Bevy supplies arguments to systems via dependency injection, so it's | ||
# natural for systems to request more than 7 arguments -- which triggers | ||
# this lint. | ||
too_many_arguments = "allow" | ||
# Queries that access many components may trigger this lint. | ||
type_complexity = "allow" | ||
|
||
|
||
# Compile with Performance Optimizations: | ||
# https://bevyengine.org/learn/quick-start/getting-started/setup/#compile-with-performance-optimizations | ||
|
||
# Enable a small amount of optimization in the dev profile. | ||
[profile.dev] | ||
opt-level = 1 | ||
|
||
# Enable a large amount of optimization in the dev profile for dependencies. | ||
[profile.dev.package."*"] | ||
opt-level = 3 | ||
|
||
# The default profile is optimized for Wasm builds because that's what [Trunk | ||
# reads](https://github.com/trunk-rs/trunk/issues/605). Optimize for size in the | ||
# wasm-release profile to reduce load times and bandwidth usage on web. | ||
[profile.release] | ||
# Compile the entire crate as one unit. Slows compile times, marginal | ||
# improvements. | ||
codegen-units = 1 | ||
# Do a second optimization pass over the entire program, including | ||
# dependencies. Slows compile times, marginal improvements. | ||
lto = "thin" | ||
# Optimize with size in mind (also try "z", sometimes it is better). | ||
# Slightly slows compile times, great improvements to file size and runtime | ||
# performance. | ||
opt-level = "s" | ||
# Strip all debugging information from the binary to slightly reduce file | ||
# size. | ||
strip = "debuginfo" | ||
|
||
# Override some settings for native builds. | ||
[profile.release-native] | ||
# Default to release profile values. | ||
inherits = "release" | ||
# Optimize with performance in mind. | ||
opt-level = 3 | ||
# Keep debug information in the binary. | ||
strip = "none" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,12 @@ | ||
# yet another HAB simulator | ||
|
||
A high altitude balloon flight simulator based on [tkschuler/EarthSHAB](https://github.com/tkschuler/EarthSHAB) and [brickworks/mfc-apps](https://github.com/Brickworks/mfc-apps), built on Rust. | ||
A high altitude balloon flight simulator based on | ||
[tkschuler/EarthSHAB](https://github.com/tkschuler/EarthSHAB) and | ||
[brickworks/mfc-apps](https://github.com/Brickworks/mfc-apps), built on Rust. | ||
|
||
## Installation | ||
|
||
```sh | ||
cargo install --git https://github.com/Brickworks/yahs.git --features gui | ||
yahs --help | ||
``` | ||
|
||
## Usage (CLI) | ||
Set the simulation configuration in `config/default.toml` | ||
|
||
Then use the `start` command to start a flight simulation. Use the `RUST_LOG` | ||
environment variable to specify the log level to report. | ||
|
||
```sh | ||
yahs start | ||
``` | ||
|
||
## Usage (GUI) | ||
|
||
```sh | ||
yahs gui | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
( | ||
gases: [ | ||
// Species of gas with a known molar mass (kg/mol) | ||
( | ||
name: "Air", | ||
abbreviation: "Air", | ||
molar_mass: 0.02897, | ||
), | ||
( | ||
name: "Helium", | ||
abbreviation: "He", | ||
molar_mass: 0.0040026, | ||
), | ||
( | ||
name: "Hydrogen", | ||
abbreviation: "H2", | ||
molar_mass: 0.00201594, | ||
), | ||
( | ||
name: "Nitrogen", | ||
abbreviation: "N2", | ||
molar_mass: 0.0280134, | ||
), | ||
( | ||
name: "Oxygen", | ||
abbreviation: "O2", | ||
molar_mass: 0.0319988, | ||
), | ||
( | ||
name: "Argon", | ||
abbreviation: "Ar", | ||
molar_mass: 0.039948, | ||
), | ||
( | ||
name: "Carbon Dioxide", | ||
abbreviation: "CO2", | ||
molar_mass: 0.04400995, | ||
), | ||
( | ||
name: "Neon", | ||
abbreviation: "Ne", | ||
molar_mass: 0.020183, | ||
), | ||
( | ||
name: "Krypton", | ||
abbreviation: "Kr", | ||
molar_mass: 0.08380, | ||
), | ||
( | ||
name: "Xenon", | ||
abbreviation: "Xe", | ||
molar_mass: 0.13130, | ||
), | ||
( | ||
name: "Methane", | ||
abbreviation: "CH4", | ||
molar_mass: 0.01604303, | ||
), | ||
], | ||
// Properties, attributes and functions related to the material properties. | ||
// Source: https://www.matweb.com/ | ||
materials: [ | ||
( | ||
name: "Nothing", | ||
max_temperature: 1e30, | ||
density: 0.0, | ||
emissivity: 1.0, | ||
absorptivity: 0.0, | ||
thermal_conductivity: 1e30, | ||
specific_heat: 0.0, | ||
poissons_ratio: 0.5, | ||
elasticity: 1e30, | ||
max_strain: 1e30, | ||
max_stress: 1e30, | ||
), | ||
( | ||
name: "Rubber", | ||
max_temperature: 385.0, | ||
density: 1000.0, | ||
emissivity: 0.86, | ||
absorptivity: 0.86, | ||
thermal_conductivity: 0.25, | ||
specific_heat: 1490.0, | ||
poissons_ratio: 0.5, | ||
elasticity: 4000000.0, | ||
max_strain: 8.0, | ||
max_stress: 25000000.0, | ||
), | ||
( | ||
name: "LowDensityPolyethylene", | ||
max_temperature: 348.0, | ||
density: 919.0, | ||
emissivity: 0.94, | ||
absorptivity: 0.94, | ||
thermal_conductivity: 0.3175, | ||
specific_heat: 2600.0, | ||
poissons_ratio: 0.5, | ||
elasticity: 300_000_000.0, | ||
max_strain: 6.25, | ||
max_stress: 10_000_000.0, | ||
), | ||
] | ||
) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.