pub struct SoftCollisionMesh { /* private fields */ }Expand description
A mesh a soft body collides through: a polyline (2D) or triangle mesh (3D) whose vertices follow the body’s particles, and the collider holding it. A skinned mesh carries thin features the coarse cells cannot: its vertices are barycentric combinations of the particles.
Implementations§
Source§impl SoftCollisionMesh
impl SoftCollisionMesh
Sourcepub fn id(&self) -> SoftMeshId
pub fn id(&self) -> SoftMeshId
Where this mesh lives in its soft body.
Sourcepub fn collider(&self) -> ColliderHandle
pub fn collider(&self) -> ColliderHandle
The collider holding this mesh’s shape (invalid for a mesh that is only drawn).
Sourcepub fn collision_enabled(&self) -> bool
pub fn collision_enabled(&self) -> bool
Whether this mesh collides (false: it is only drawn).
Sourcepub fn indices(&self) -> &[[u32; 3]]
pub fn indices(&self) -> &[[u32; 3]]
The mesh’s elements: segments in 2D, triangles in 3D, or segments in 3D for a wire
(u32::MAX fills the unused slot then; see Self::element).
Sourcepub fn element(&self, i: usize) -> &[u32]
pub fn element(&self, i: usize) -> &[u32]
The vertices of the i-th element: two for a segment, DIM for a facet.
Sourcepub fn arity(&self) -> usize
pub fn arity(&self) -> usize
How many vertices this mesh’s elements have: 2 for a wire (a rope in 3D, and every
mesh in 2D), DIM for a surface.
Sourcepub fn is_wire(&self) -> bool
pub fn is_wire(&self) -> bool
Whether this mesh is a wire (segments in 3D): a curve, with no inside and no facets.
Sourcepub fn binding(&self) -> &SoftMeshMapping
pub fn binding(&self) -> &SoftMeshMapping
How this mesh’s vertices follow the computational mesh.
Sourcepub fn is_skinned(&self) -> bool
pub fn is_skinned(&self) -> bool
Whether this mesh rides the body’s cells rather than its particles.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Whether this mesh is closed (every segment vertex / triangle edge shared by exactly two elements).
Sourcepub fn is_oriented(&self) -> bool
pub fn is_oriented(&self) -> bool
Whether this mesh’s collider shape carries parry’s ORIENTED flag, as of the last step.
Sourcepub fn is_solid(&self) -> bool
pub fn is_solid(&self) -> bool
Whether this mesh encloses solid matter: closed and oriented. Its contacts with other bodies are then oriented outward and nothing is held inside it; otherwise it is two-sided.
Sourcepub fn self_contacts_enabled(&self) -> bool
pub fn self_contacts_enabled(&self) -> bool
Whether this mesh collides with itself.
Sourcepub fn vertex_count(&self) -> usize
pub fn vertex_count(&self) -> usize
The number of vertices of this mesh.
Sourcepub fn vertices(&self) -> &[Vector] ⓘ
pub fn vertices(&self) -> &[Vector] ⓘ
The cached world-space vertices of a skinned mesh (empty for a direct mesh, whose
vertices are its particles: see Self::vertex_positions).
Sourcepub fn vertex_positions<'a>(
&'a self,
body: &'a SoftBody,
) -> impl ExactSizeIterator<Item = Vector> + 'a
pub fn vertex_positions<'a>( &'a self, body: &'a SoftBody, ) -> impl ExactSizeIterator<Item = Vector> + 'a
The world-space position of every vertex of this mesh.
Sourcepub fn vertex(&self, body: &SoftBody, i: usize) -> Vector
pub fn vertex(&self, body: &SoftBody, i: usize) -> Vector
The world position of the i-th vertex.
Sourcepub fn vertex_velocity(&self, body: &SoftBody, i: usize) -> Vector
pub fn vertex_velocity(&self, body: &SoftBody, i: usize) -> Vector
The world velocity of the i-th vertex: a skinned vertex moves with the cell holding it.
Source§impl SoftCollisionMesh
impl SoftCollisionMesh
Sourcepub fn topology_version(&self) -> u32
pub fn topology_version(&self) -> u32
A counter bumped whenever this mesh’s topology changes: a renderer keying its mesh on it rebuilds only what changed.
Trait Implementations§
Source§impl Clone for SoftCollisionMesh
impl Clone for SoftCollisionMesh
Source§fn clone(&self) -> SoftCollisionMesh
fn clone(&self) -> SoftCollisionMesh
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SoftCollisionMesh
impl RefUnwindSafe for SoftCollisionMesh
impl Send for SoftCollisionMesh
impl Sync for SoftCollisionMesh
impl Unpin for SoftCollisionMesh
impl UnsafeUnpin for SoftCollisionMesh
impl UnwindSafe for SoftCollisionMesh
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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 moreimpl<T> MaybeSync for T
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§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.