From 70afc5a7d871919776a64782e8b93404e6b0defd Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 15 Dec 2024 13:17:43 +0100 Subject: feat!: add raylib rendering --- physics/src/force/drag.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 physics/src/force/drag.rs (limited to 'physics/src/force/drag.rs') diff --git a/physics/src/force/drag.rs b/physics/src/force/drag.rs new file mode 100644 index 0000000..c54dc40 --- /dev/null +++ b/physics/src/force/drag.rs @@ -0,0 +1,15 @@ +use crate::algebra::Scalar; + +use super::Force; + +pub struct Drag { + pub coefficient: Scalar, +} + +impl Force for Drag { + fn apply(&self, particles: &mut Vec) { + for particle in particles { + particle.apply_force(-self.coefficient * particle.velocity); + } + } +} -- cgit v1.2.3