Struct PosedParts
#[non_exhaustive]pub struct PosedParts {
pub parts: [Option<PosedPart>; 12],
}Expand description
The humanoid parts of a model, posed this frame: a fixed-size snapshot, nothing allocated.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parts: [Option<PosedPart>; 12]Each of HumanoidPart::ALL at its index there: None for a part the model lacks.
Implementations§
§impl PosedParts
impl PosedParts
pub fn new(
pose: impl Fn(HumanoidPart) -> Option<([f32; 9], bool)>,
) -> Option<PosedParts>
pub fn new( pose: impl Fn(HumanoidPart) -> Option<([f32; 9], bool)>, ) -> Option<PosedParts>
The parts pose gives ModelPart’s nine numbers for (x, y, z, x rot, y rot, z rot, x, y,
z scale) and whether they draw; None when the model lacks a head or a body (not a humanoid
model). A part the model lacks, such as a zombie’s sleeves, is left out.
pub fn get(&self, part: HumanoidPart) -> Option<PosedPart>
pub fn get(&self, part: HumanoidPart) -> Option<PosedPart>
part as posed this frame, if the model has it.
pub fn iter(&self) -> impl Iterator<Item = PosedPart>
pub fn iter(&self) -> impl Iterator<Item = PosedPart>
The parts the model has, in HumanoidPart::ALL’s order.
Trait Implementations§
§impl Clone for PosedParts
impl Clone for PosedParts
§fn clone(&self) -> PosedParts
fn clone(&self) -> PosedParts
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PosedParts
§impl Debug for PosedParts
impl Debug for PosedParts
§impl PartialEq for PosedParts
impl PartialEq for PosedParts
impl StructuralPartialEq for PosedParts
Auto Trait Implementations§
impl Freeze for PosedParts
impl RefUnwindSafe for PosedParts
impl Send for PosedParts
impl Sync for PosedParts
impl Unpin for PosedParts
impl UnsafeUnpin for PosedParts
impl UnwindSafe for PosedParts
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