pub struct ConstraintSolverKernel;Expand description
Projected Gauss-Seidel (PGS) constraint solver kernel.
Iteratively solves positional constraints using position-based dynamics (PBD) style updates.
Implementations§
Source§impl ConstraintSolverKernel
impl ConstraintSolverKernel
Sourcepub fn solve_distance_constraints(
positions: &mut [[f64; 3]],
inv_masses: &[f64],
constraints: &[DistanceConstraint],
dt: f64,
)
pub fn solve_distance_constraints( positions: &mut [[f64; 3]], inv_masses: &[f64], constraints: &[DistanceConstraint], dt: f64, )
Solve distance constraints for one iteration.
Updates positions in-place to satisfy the constraints.
inv_masses[i] is the inverse mass of body i.
Auto Trait Implementations§
impl Freeze for ConstraintSolverKernel
impl RefUnwindSafe for ConstraintSolverKernel
impl Send for ConstraintSolverKernel
impl Sync for ConstraintSolverKernel
impl Unpin for ConstraintSolverKernel
impl UnsafeUnpin for ConstraintSolverKernel
impl UnwindSafe for ConstraintSolverKernel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more