Struct ncollide2d::query::ContactKinematic
source · pub struct ContactKinematic<N: Real> { /* private fields */ }
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§
source§impl<N: Real> ContactKinematic<N>
impl<N: Real> 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_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 set_plane1(&mut self, fid: FeatureId, pt: Point<N>, normal: Unit<Vector<N>>)
pub fn set_plane1(&mut self, fid: FeatureId, pt: Point<N>, normal: Unit<Vector<N>>)
Define as a plane the local approximation of the shape of the first solid.
sourcepub fn set_plane2(&mut self, fid: FeatureId, pt: Point<N>, normal: Unit<Vector<N>>)
pub fn set_plane2(&mut self, fid: FeatureId, pt: Point<N>, normal: Unit<Vector<N>>)
Define as a plane the local approximation of the shape of the second solid.
sourcepub fn set_line1(
&mut self,
fid: FeatureId,
pt: Point<N>,
dir: Unit<Vector<N>>,
normals: PolyhedralCone<N>
)
pub fn set_line1(
&mut self,
fid: FeatureId,
pt: Point<N>,
dir: Unit<Vector<N>>,
normals: PolyhedralCone<N>
)
Define as a line the local approximation of the shape of the second solid.
sourcepub fn set_line2(
&mut self,
fid: FeatureId,
pt: Point<N>,
dir: Unit<Vector<N>>,
normals: PolyhedralCone<N>
)
pub fn set_line2(
&mut self,
fid: FeatureId,
pt: Point<N>,
dir: Unit<Vector<N>>,
normals: PolyhedralCone<N>
)
Define as a line the local approximation of the shape of the second solid.
sourcepub fn set_point1(
&mut self,
fid: FeatureId,
pt: Point<N>,
normals: PolyhedralCone<N>
)
pub fn set_point1(
&mut self,
fid: FeatureId,
pt: Point<N>,
normals: PolyhedralCone<N>
)
Define as a point the local approximation of the shape of the second solid.
sourcepub fn set_point2(
&mut self,
fid: FeatureId,
pt: Point<N>,
normals: PolyhedralCone<N>
)
pub fn set_point2(
&mut self,
fid: FeatureId,
pt: Point<N>,
normals: PolyhedralCone<N>
)
Define as a point the local approximation of the shape of the second solid.
sourcepub fn contact(
&self,
m1: &Isometry<N>,
m2: &Isometry<N>,
default_normal1: &Unit<Vector<N>>
) -> Option<Contact<N>>
pub fn contact(
&self,
m1: &Isometry<N>,
m2: &Isometry<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 contactc
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§
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§
source§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§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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.