pub struct GpuConstraintSolver {
pub pairs: Vec<BroadphasePairGpu>,
pub manifolds: Vec<ContactManifoldGpu>,
}Expand description
Iterative sequential-impulse constraint solver for rigid body contacts.
Fields§
§pairs: Vec<BroadphasePairGpu>Broadphase candidate pairs.
manifolds: Vec<ContactManifoldGpu>Contact manifolds, aligned with pairs.
Implementations§
Source§impl GpuConstraintSolver
impl GpuConstraintSolver
Sourcepub fn add_manifold(
&mut self,
pair: BroadphasePairGpu,
manifold: ContactManifoldGpu,
)
pub fn add_manifold( &mut self, pair: BroadphasePairGpu, manifold: ContactManifoldGpu, )
Add a manifold (and its corresponding broadphase pair) to the solver.
Sourcepub fn solve_sequential_impulse(
&self,
bodies: &mut [GpuRigidBody],
dt: f32,
iterations: usize,
)
pub fn solve_sequential_impulse( &self, bodies: &mut [GpuRigidBody], dt: f32, iterations: usize, )
Solve all contact constraints via sequential impulses.
Iterates iterations times over every contact point and applies a
non-penetration impulse. A restitution coefficient of 0.3 is used.
Trait Implementations§
Source§impl Clone for GpuConstraintSolver
impl Clone for GpuConstraintSolver
Source§fn clone(&self) -> GpuConstraintSolver
fn clone(&self) -> GpuConstraintSolver
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GpuConstraintSolver
impl Debug for GpuConstraintSolver
Source§impl Default for GpuConstraintSolver
impl Default for GpuConstraintSolver
Source§fn default() -> GpuConstraintSolver
fn default() -> GpuConstraintSolver
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GpuConstraintSolver
impl RefUnwindSafe for GpuConstraintSolver
impl Send for GpuConstraintSolver
impl Sync for GpuConstraintSolver
impl Unpin for GpuConstraintSolver
impl UnsafeUnpin for GpuConstraintSolver
impl UnwindSafe for GpuConstraintSolver
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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