pub struct UnilateralConstraint<N: RealField + Copy, Id> {
pub impulse: N,
pub r: N,
pub rhs: N,
pub impulse_id: Id,
pub assembly_id1: usize,
pub assembly_id2: usize,
pub j_id1: usize,
pub j_id2: usize,
pub wj_id1: usize,
pub wj_id2: usize,
pub ndofs1: usize,
pub ndofs2: usize,
}
Expand description
A unilateral (inequality) consraint.
Fields§
§impulse: N
The impulse applied by this constraint.
r: N
The scaling parameter of the SOR-prox method.
rhs: N
The target velocity change this constraint must apply.
impulse_id: Id
The index of the impulse used for its storage in an impuse cache.
assembly_id1: usize
The assembly index of the first body.
assembly_id2: usize
The assembly index of the second body.
j_id1: usize
Index of the first entry of the jacobian of the constraint affecting the first body.
j_id2: usize
Index of the first entry of the constraint jacobian multiplied by the inverse mass of the second body.
wj_id1: usize
Index of the first entry of the constraint jacobian multiplied by the inverse mass of the first body.
wj_id2: usize
Index of the first entry of the constraint jacobian multiplied by the inverse mass of the second body.
ndofs1: usize
Number of degree of freedom of the first body.
ndofs2: usize
Number of degree of freedom of the second body.
Implementations§
Source§impl<N: RealField + Copy, Id> UnilateralConstraint<N, Id>
impl<N: RealField + Copy, Id> UnilateralConstraint<N, Id>
Sourcepub fn new(
geom: ConstraintGeometry<N>,
assembly_id1: usize,
assembly_id2: usize,
rhs: N,
impulse: N,
impulse_id: Id,
) -> Self
pub fn new( geom: ConstraintGeometry<N>, assembly_id1: usize, assembly_id2: usize, rhs: N, impulse: N, impulse_id: Id, ) -> Self
Create a new unilateral constraint.
Auto Trait Implementations§
impl<N, Id> Freeze for UnilateralConstraint<N, Id>
impl<N, Id> RefUnwindSafe for UnilateralConstraint<N, Id>where
N: RefUnwindSafe,
Id: RefUnwindSafe,
impl<N, Id> Send for UnilateralConstraint<N, Id>where
Id: Send,
impl<N, Id> Sync for UnilateralConstraint<N, Id>where
Id: Sync,
impl<N, Id> Unpin for UnilateralConstraint<N, Id>
impl<N, Id> UnwindSafe for UnilateralConstraint<N, Id>where
N: UnwindSafe,
Id: UnwindSafe,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.