Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 1 addition & 71 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Notable changes to this project will be documented in this file.

## [unreleased]
## [0.3.0](https://github.com/philiplinden/buoy/compare/v0.2.0..v0.3.0) - 2025-07-28

### 🧪 Experimental

Expand All @@ -18,74 +18,4 @@ Notable changes to this project will be documented in this file.

- Remove big_space options (#39) ([`b03eff2`](https://github.com/philiplinden/buoy/commit/b03eff2fb9175f28a235db4cfe9b6da1b0aeb828))

## [0.2.0](https://github.com/philiplinden/buoy/compare/v0.1.0..v0.2.0) - 2025-06-27

### 🚀 Features

- Mesh tools and a simple scene (#37) ([`d9d7bc2`](https://github.com/philiplinden/buoy/commit/d9d7bc29ad77b49017b29eb6dc673a638bddac7a))
- Add egui side panel (#35) ([`1c5dff4`](https://github.com/philiplinden/buoy/commit/1c5dff46f16cf93c01641ddbb4625dc69aabc544))

### ♻️ Refactor

- Merge buoy-common with buoy-runtime (#38) ([`9e8fd7e`](https://github.com/philiplinden/buoy/commit/9e8fd7e4f29aae8f5b18840d4225965704e0b581))
- Run headless by default (#36) ([`012f179`](https://github.com/philiplinden/buoy/commit/012f179b78804c3cd393d2d4d304e9e55befb2f9))
- Buoy-core -> buoy-physics, add buoy-common, grid space is optional (#34) ([`a8e770e`](https://github.com/philiplinden/buoy/commit/a8e770e58c88a950f74c46a53fc069474c044607))
- Remove python experiments (#33) ([`089042b`](https://github.com/philiplinden/buoy/commit/089042b574e39ba263ec528affa14a5448073341))

### 🐛 Bug Fixes

- Disable mesh utils for now and focus on headless ([`db8ac1f`](https://github.com/philiplinden/buoy/commit/db8ac1f90a3a683c5d5f7902302ff1f66faa871a))

### ⚙️ Repository

- Refresh the changelog on pushes to main ([`26a2e6a`](https://github.com/philiplinden/buoy/commit/26a2e6a3f26df28b7d622901302cc12f579b98dc))
- Package the bevy-ui binary for releases ([`064e94c`](https://github.com/philiplinden/buoy/commit/064e94cd37ee1a161564b2b5c04f80533033742d))
- Include unreleased changes in log ([`c9fa447`](https://github.com/philiplinden/buoy/commit/c9fa4478d781a42c0e25d37669a5157b390f4195))

## [0.1.0] - 2025-03-02

### 📚 Documentation

- Update readme ([`5685be7`](https://github.com/philiplinden/buoy/commit/5685be7df46da343be3b831e7e5c15e024227a1c))
- More resources ([`696266b`](https://github.com/philiplinden/buoy/commit/696266b175e90f3e36d5de8494ef2f7977d41b43))

### ♻️ Refactor

- Disallow dead code in most places, add placeholders for payload ([`edb98d3`](https://github.com/philiplinden/buoy/commit/edb98d3a6aff3c3633de027930e3406e3fdd3bb0))

### 🎨 UI & Styling

- Improved plots ([`6d1bba1`](https://github.com/philiplinden/buoy/commit/6d1bba1862d9be682693fe6932148195a8db3ea7))
- Switch to egui, add plots (#15) ([`bdc6113`](https://github.com/philiplinden/buoy/commit/bdc6113a3d77993f56df5796358879371002e8f9))
- Deconflict debug text and console screen space ([`837a626`](https://github.com/philiplinden/buoy/commit/837a626c0a4781d22150d1fe3ea12e71519d5729))
- Add gizmos, flatten app module (#3) ([`119dade`](https://github.com/philiplinden/buoy/commit/119dade9ffb889d48ddcccb3381958bff7eae594))
- Add a gas monitor ([`3de7b41`](https://github.com/philiplinden/buoy/commit/3de7b4167d26622d516bd4cf9a11c5c584d724b0))
- Some debug ui practice ([`c80aa64`](https://github.com/philiplinden/buoy/commit/c80aa64d2bbd4cc2c1932889863bada2f8a1d0c2))
- Sim state monitoring, play/pause ([`88ce33b`](https://github.com/philiplinden/buoy/commit/88ce33b46f65d1e592057e51128b995d65eb34eb))
- Drop egui, add iyes_perf_ui ([`8cf8096`](https://github.com/philiplinden/buoy/commit/8cf8096625dd3ea4cfe98125a4f8d1d148eb5fbb))

### 🐛 Bug Fixes

- Fix up physics states ([`b311fe4`](https://github.com/philiplinden/buoy/commit/b311fe4d9e38f67e2c4fa5ee20b268da6797afe1))

### 🧪 Experimental

- Scaffold things in python for prototyping (#25) ([`45f8e98`](https://github.com/philiplinden/buoy/commit/45f8e98b571bff0a2bf8aac607f6745b0cc2743c))
- Smooth out artifacts ([`11ee325`](https://github.com/philiplinden/buoy/commit/11ee325c5d2f418f33b6db4e483ed94fb9f58709))
- Experimenting with plots and big space ([`8a57fb7`](https://github.com/philiplinden/buoy/commit/8a57fb7f7f6ce7151209f9f8f577bf3d248b7277))
- Experimenting with meshes and modules ([`2d75f55`](https://github.com/philiplinden/buoy/commit/2d75f5528cecac68c87851a3f5e1a4388741c1e1))
- Forces are stable! (#14) ([`5e0dbef`](https://github.com/philiplinden/buoy/commit/5e0dbefea4e4adf7eda26d73c3f7f9eb711020ad))

### ⚙️ Repository

- Yet another reorg - more submodules ([`2ac04de`](https://github.com/philiplinden/buoy/commit/2ac04de27df4b41f1223042e15e2c5a817b1bcb3))
- Skip deploys ([`2db5450`](https://github.com/philiplinden/buoy/commit/2db5450b77d736bbd545dab3b71a3681782d62f9))
- I guess docs need sound? ([`eb141a6`](https://github.com/philiplinden/buoy/commit/eb141a6a446042670815ea3cfb9a5598b7f5e036))
- Replace cache step with the one from leafwing ([`99642d9`](https://github.com/philiplinden/buoy/commit/99642d9cd84ff8eda7d29904e2fc7c22c3fd8f08))
- Add bevy deps ([`56ed0f3`](https://github.com/philiplinden/buoy/commit/56ed0f3d6c41e6f2b114d4cacfda22bd3e0f2a0a))


## New Contributors ❤️

* @philiplinden made their first contribution
<!-- generated by git-cliff -->
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
resolver = "2" # Important for Bevy
members = [
"crates/buoy-physics",
"crates/buoy-ui",
# "crates/buoy-ui",
"crates/buoy-runtime",
]

Expand Down Expand Up @@ -36,7 +36,6 @@ avian3d = { version = "0.3.1", default-features = false, features = [
# "collider-from-mesh",
] }
uom = "0.37.0"
bevy_common_assets = { version = "0.13", features = ["ron"] }
serde = { version = "1.0", features = ["derive"] }

[workspace.metadata.bevy_cli]
Expand Down
20 changes: 5 additions & 15 deletions crates/buoy-physics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
[package]
name = "buoy-physics"
version = "0.3.0"
description = "Physics for buoyancy simulation"
version = "0.4.0"
description = "Physics for buoyancy simulation (no bevy dependency)"
edition = { workspace = true }
authors = { workspace = true }
license = { workspace = true }

[dependencies]
bevy = { workspace = true }
avian3d = { workspace = true }
uom = { workspace = true }
serde = { workspace = true }
glam = "0.30.5"
log = "0.4.27"

[features]
default = [
"dev",
]
dev = [
"bevy/dynamic_linking",
"bevy/bevy_debug_stepping",
"avian3d/bevy_diagnostic",
]


# [package.metadata.mutually_exclusive_features]
default = []
9 changes: 2 additions & 7 deletions crates/buoy-physics/src/atmosphere.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,20 @@
//! - https://www.translatorscafe.com/unit-converter/en-US/calculator/altitude
//! - https://www.grc.nasa.gov/WWW/K-12/airplane/atmosmet.html

use avian3d::prelude::{Position, RigidBody};
use bevy::prelude::*;
use uom::si::{
f32::*,
thermodynamic_temperature::{degree_celsius, kelvin},
pressure::kilopascal,
};
use glam::Vec3;
use log::error;

use crate::{
ideal_gas::{ideal_gas_density, GasSpecies},
constants::{STANDARD_TEMPERATURE, STANDARD_PRESSURE},
};

pub(crate) fn plugin(app: &mut App) {
app.insert_resource(Atmosphere);
}

/// US Standard Atmosphere, 1976
#[derive(Resource)]
pub struct Atmosphere;

impl Atmosphere {
Expand Down
50 changes: 50 additions & 0 deletions crates/buoy-physics/src/force.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
use glam::Vec3;
use uom::si::{
acceleration::meter_per_second_squared, area::square_meter, f32::*, length::meter,
mass::kilogram, mass_density::kilogram_per_cubic_meter, ratio::ratio, volume::cubic_meter,
velocity::meter_per_second,
};

use crate::constants::{EARTH_RADIUS_M, STANDARD_GRAVITY};

/// Force (N) due to drag as a solid body moves through a fluid.
pub fn drag(
velocity: Vec3,
ambient_density: MassDensity,
drag_area: Area,
drag_coefficient: f32,
) -> Vec3 {
let velocity_magnitude: f32 = velocity.length();
if velocity_magnitude < f32::EPSILON {
return Vec3::ZERO;
}

-0.5 * drag_coefficient
* ambient_density.get::<kilogram_per_cubic_meter>()
* drag_area.get::<square_meter>()
* velocity_magnitude * velocity_magnitude
* velocity / velocity_magnitude
}

/// Upward force (N) vector due to atmosphere displaced by the given gas volume.
/// The direction of this force is always world-space up (it opposes gravity).
pub fn buoyancy(
gravity_acceleration: Acceleration,
displaced_volume: Volume,
ambient_density: MassDensity,
) -> Vec3 {
Vec3::Y
* (displaced_volume.get::<cubic_meter>()
* ambient_density.get::<kilogram_per_cubic_meter>()
* gravity_acceleration.get::<meter_per_second_squared>())
}

/// Fraction of standard gravity at an altitude (m) above mean sea level.
pub fn local_gravity(altitude: Length) -> Acceleration {
*EARTH_RADIUS_M / (*EARTH_RADIUS_M + altitude) * *STANDARD_GRAVITY
}

#[allow(dead_code)]
pub fn weight(mass: uom::si::f32::Mass, gravity: Acceleration) -> Vec3 {
Vec3::NEG_Y * mass.get::<kilogram>() * gravity.get::<meter_per_second_squared>()
}
92 changes: 0 additions & 92 deletions crates/buoy-physics/src/forces.rs

This file was deleted.

Loading