pub struct PrimitiveMut<'a>(/* private fields */);Expand description
One primitive of a Mesh, edited in place: it reads as a Primitive and changes field by field (its streams,
indices, topology and material), but never as a whole, so a primitive can’t be replaced by another or swapped
with one, and the list keeps its count and order. Per-primitive components describe the primitive in its place;
a pass that rebuilds the list uses crate::World::rebuild_primitives or crate::World::edit_mesh, which
carry them along.
No slice to swap, sort or reverse:
ⓘ
let mut mesh = primase_core::Mesh::default();
mesh.primitives_mut().swap(0, 1);and no primitive replaced by another:
ⓘ
let mut mesh = primase_core::Mesh::default();
let other = mesh.primitives()[0].clone();
*mesh.primitive_mut(0).unwrap() = other;Implementations§
Source§impl PrimitiveMut<'_>
impl PrimitiveMut<'_>
pub fn topology_mut(&mut self) -> &mut Topology
pub fn streams_mut(&mut self) -> &mut BTreeMap<Semantic, Stream>
pub fn indices_mut(&mut self) -> &mut Option<Vec<u32>>
pub fn material_mut(&mut self) -> &mut Option<Entity>
Sourcepub fn fields(&mut self) -> PrimitiveFields<'_>
pub fn fields(&mut self) -> PrimitiveFields<'_>
Every field at once, for an edit that changes several (indices against the streams, say).
Trait Implementations§
Source§impl<'a> Debug for PrimitiveMut<'a>
impl<'a> Debug for PrimitiveMut<'a>
Auto Trait Implementations§
impl<'a> !UnwindSafe for PrimitiveMut<'a>
impl<'a> Forget for PrimitiveMut<'a>
impl<'a> Freeze for PrimitiveMut<'a>
impl<'a> RefUnwindSafe for PrimitiveMut<'a>
impl<'a> Send for PrimitiveMut<'a>
impl<'a> Sync for PrimitiveMut<'a>
impl<'a> Unpin for PrimitiveMut<'a>
impl<'a> UnsafeUnpin for PrimitiveMut<'a>
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