Struct ncollide2d::query::ContactKinematic
source · [−]Expand description
Local contact kinematic of a pair of solids around two given points.
This is used to update the localization of contact points between two solids from one frame to another. To achieve this, the local shape of the solids around the given points are approximated by either dilated lines (unbounded cylinders), planes, dilated points (spheres).
Implementations
sourceimpl<N: RealField + Copy> ContactKinematic<N>
impl<N: RealField + Copy> ContactKinematic<N>
sourcepub fn new() -> Self
pub fn new() -> Self
Initializes an empty contact kinematic.
All the contact kinematic information must be filled using methods
prefixed by set_
.
sourcepub fn transform1(&mut self, m: &Isometry<N>)
pub fn transform1(&mut self, m: &Isometry<N>)
Applies the given transformation to the first set of contact information.
sourcepub fn transform2(&mut self, m: &Isometry<N>)
pub fn transform2(&mut self, m: &Isometry<N>)
Applies the given transformation to the second set of contact information.
sourcepub fn local1(&self) -> Point<N>
pub fn local1(&self) -> Point<N>
The tracked point in local space of the first solid.
This may not correspond to the contact point in the local space of the first since it does not takes the dilation into account.
sourcepub fn local2(&self) -> Point<N>
pub fn local2(&self) -> Point<N>
The tracked point in local space of the second solid.
This may not correspond to the contact point in the local space of the second solid since it does not takes the dilation into account.
sourcepub fn feature1(&self) -> FeatureId
pub fn feature1(&self) -> FeatureId
The shape-dependent identifier of the feature of the first solid on which lies the contact point.
sourcepub fn feature2(&self) -> FeatureId
pub fn feature2(&self) -> FeatureId
The shape-dependent identifier of the feature of the second solid on which lies the contact point.
sourcepub fn set_feature1(&mut self, f: FeatureId)
pub fn set_feature1(&mut self, f: FeatureId)
Sets the shape-dependent identifier of the feature of the first solid on which lies the contact point.
sourcepub fn set_feature2(&mut self, f: FeatureId)
pub fn set_feature2(&mut self, f: FeatureId)
Sets the shape-dependent identifier of the feature of the second solid on which lies the contact point.
sourcepub fn set_dilation1(&mut self, margin: N)
pub fn set_dilation1(&mut self, margin: N)
Sets the dilation of the first solid.
sourcepub fn set_dilation2(&mut self, margin: N)
pub fn set_dilation2(&mut self, margin: N)
Sets the dilation of the second solid.
sourcepub fn approx1(&self) -> &LocalShapeApproximation<N>
pub fn approx1(&self) -> &LocalShapeApproximation<N>
The local approximation of the first shape.
sourcepub fn approx2(&self) -> &LocalShapeApproximation<N>
pub fn approx2(&self) -> &LocalShapeApproximation<N>
The local approximation of the first shape.
sourcepub fn approx1_mut(&mut self) -> &mut LocalShapeApproximation<N>
pub fn approx1_mut(&mut self) -> &mut LocalShapeApproximation<N>
The local approximation of the first shape.
sourcepub fn approx2_mut(&mut self) -> &mut LocalShapeApproximation<N>
pub fn approx2_mut(&mut self) -> &mut LocalShapeApproximation<N>
The local approximation of the second shape.
sourcepub fn set_approx1(
&mut self,
feature: FeatureId,
point: Point<N>,
geom: NeighborhoodGeometry<N>
)
pub fn set_approx1(
&mut self,
feature: FeatureId,
point: Point<N>,
geom: NeighborhoodGeometry<N>
)
Sets the local approximation of the first shape.
sourcepub fn set_approx2(
&mut self,
feature: FeatureId,
point: Point<N>,
geom: NeighborhoodGeometry<N>
)
pub fn set_approx2(
&mut self,
feature: FeatureId,
point: Point<N>,
geom: NeighborhoodGeometry<N>
)
Sets the local approximation of the second shape.
sourcepub fn contact(
&self,
m1: &Isometry<N>,
s1: &dyn Shape<N>,
deformations1: Option<&[N]>,
m2: &Isometry<N>,
s2: &dyn Shape<N>,
deformations2: Option<&[N]>,
default_normal1: &Unit<Vector<N>>
) -> Option<Contact<N>>
pub fn contact(
&self,
m1: &Isometry<N>,
s1: &dyn Shape<N>,
deformations1: Option<&[N]>,
m2: &Isometry<N>,
s2: &dyn Shape<N>,
deformations2: Option<&[N]>,
default_normal1: &Unit<Vector<N>>
) -> Option<Contact<N>>
Computes the updated contact points with the new positions of the solids.
The vector default_normal1
is the normal of the resulting contact
in the rare case where the contact normal cannot be determined by the update.
Typically, this should be set to the latest contact normal known.
Trait Implementations
sourceimpl<N: Clone + RealField + Copy> Clone for ContactKinematic<N>
impl<N: Clone + RealField + Copy> Clone for ContactKinematic<N>
sourcefn clone(&self) -> ContactKinematic<N>
fn clone(&self) -> ContactKinematic<N>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<N: Copy + RealField + Copy> Copy for ContactKinematic<N>
Auto Trait Implementations
impl<N> RefUnwindSafe for ContactKinematic<N> where
N: RefUnwindSafe,
impl<N> Send for ContactKinematic<N>
impl<N> Sync for ContactKinematic<N>
impl<N> Unpin for ContactKinematic<N> where
N: Unpin,
impl<N> UnwindSafe for ContactKinematic<N> where
N: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedAs for T
impl<T> CheckedAs for T
sourcefn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst> where
T: CheckedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dst where
Src: CheckedCast<Dst>,
sourcefn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
sourceimpl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert 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
. Read more
sourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
sourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
sourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> DowncastSync for T where
T: Any + Send + Sync,
impl<T> DowncastSync for T where
T: Any + Send + Sync,
sourceimpl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Src where
Dst: LosslessTryFrom<Src>,
sourcefn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
sourceimpl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Src where
Dst: LossyFrom<Src>,
sourcefn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
sourceimpl<T> OverflowingAs for T
impl<T> OverflowingAs for T
sourcefn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool) where
T: OverflowingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dst where
Src: OverflowingCast<Dst>,
sourcefn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
OverflowingCasts the value.
sourceimpl<T> SaturatingAs for T
impl<T> SaturatingAs for T
sourcefn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dst where
T: SaturatingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dst where
Src: SaturatingCast<Dst>,
sourcefn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
sourceimpl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
sourcefn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
sourcefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
sourcefn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
sourcefn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
sourcefn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dst where
T: UnwrappedCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dst where
Src: UnwrappedCast<Dst>,
sourcefn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
UnwrappedCasts the value.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WrappingAs for T
impl<T> WrappingAs for T
sourcefn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dst where
T: WrappingCast<Dst>,
Casts the value.
sourceimpl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dst where
Src: WrappingCast<Dst>,
sourcefn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
WrappingCasts the value.