summaryrefslogtreecommitdiff
path: root/src/particle_system.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/particle_system.rs')
-rw-r--r--src/particle_system.rs47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/particle_system.rs b/src/particle_system.rs
deleted file mode 100644
index a3d7a4b..0000000
--- a/src/particle_system.rs
+++ /dev/null
@@ -1,47 +0,0 @@
-use nalgebra::{Point as PointBase, SVector};
-
-use crate::{constraint::Constraint, force::Force};
-
-pub const N: usize = 2;
-pub type Scalar = f64;
-
-pub type Vector = SVector<Scalar, N>;
-pub type Point = PointBase<Scalar, N>;
-
-#[derive(Debug)]
-pub struct Particle {
- pub mass: Scalar,
- pub position: Point,
- pub velocity: Vector,
-
- /// Force accumulator
- pub force: Vector,
-}
-
-impl Particle {
- pub fn new(position: Point, mass: Scalar) -> Self {
- Self {
- mass,
- position,
- velocity: Vector::zeros(),
- force: Vector::zeros(),
- }
- }
-
- pub fn apply_force(&mut self, force: Vector) {
- self.force += force;
- }
- pub fn reset_force(&mut self) {
- self.force = Vector::zeros()
- }
-}
-
-// #[derive(Debug)]
-pub struct ParticleSystem {
- pub particles: Vec<Particle>,
- pub constraints: Vec<Box<dyn Constraint>>,
- pub forces: Vec<Box<dyn Force>>,
-
- /// Simulation clock
- pub t: Scalar,
-}