summaryrefslogtreecommitdiff
path: root/src/constraint
diff options
context:
space:
mode:
Diffstat (limited to 'src/constraint')
-rw-r--r--src/constraint/slider.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/constraint/slider.rs b/src/constraint/slider.rs
index ceea4ea..9f7973b 100644
--- a/src/constraint/slider.rs
+++ b/src/constraint/slider.rs
@@ -3,7 +3,7 @@ use std::usize;
use nalgebra::{DVector, RowDVector};
use crate::{
- algebra::line::Line,
+ algebra::subspace::Line,
particle_system::{Scalar, N},
ParticleSystem, Point, Vector,
};
@@ -23,7 +23,7 @@ impl ParticleSystem {
let point = self.particles[particle_id].position;
self.constraints.push(Box::new(SliderConstraint {
particle_id,
- line: Line::new(point, direction),
+ line: Line::new(point, [direction]),
jacobian: RowDVector::zeros(self.particles.len() * N),
}));
}
@@ -37,7 +37,7 @@ impl Constraint for SliderConstraint {
fn c(&self, q: &DVector<Scalar>) -> Scalar {
let position = q.fixed_rows::<N>(self.particle_id * N);
let point = Point::from_coordinates(position.into());
- self.line.distance_to_point(point)
+ self.line.distance(point)
}
fn set_jacobian(&mut self, jacobian: RowDVector<Scalar>) {