Struct AnimationHolder
pub struct AnimationHolder {
pub length: f32,
pub looping: bool,
pub bones: Vec<(String, Vec<AnimationChannel>)>,
}Expand description
An animation as its file gives it, bones by name (vanilla’s AnimationDefinition; NeoForge’s
AnimationHolder): what RenderAssets::animation answers. Bake it against a model with
AnimationHolder::bake before playing it.
Fields§
§length: f32The animation’s length in seconds.
looping: boolWhether it starts over at the end (loop).
bones: Vec<(String, Vec<AnimationChannel>)>Each bone’s channels, by the part’s name, in file order.
Implementations§
§impl AnimationHolder
impl AnimationHolder
pub fn bake(&self, root: &ModelPart) -> KeyframeAnimation
pub fn bake(&self, root: &ModelPart) -> KeyframeAnimation
AnimationDefinition.bake(root): each bone resolved once through the model’s part lookup
(ModelPart.createPartLookup). The name root always selects the actual root; other names
select the first match, visiting each part’s immediate children before their descendants.
Bake once, as a renderer does in its constructor, and keep the result: a bone the model
lacks is logged here and left out.
Trait Implementations§
§impl Clone for AnimationHolder
impl Clone for AnimationHolder
§fn clone(&self) -> AnimationHolder
fn clone(&self) -> AnimationHolder
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 more§impl Debug for AnimationHolder
impl Debug for AnimationHolder
§impl PartialEq for AnimationHolder
impl PartialEq for AnimationHolder
impl StructuralPartialEq for AnimationHolder
Auto Trait Implementations§
impl Freeze for AnimationHolder
impl RefUnwindSafe for AnimationHolder
impl Send for AnimationHolder
impl Sync for AnimationHolder
impl Unpin for AnimationHolder
impl UnsafeUnpin for AnimationHolder
impl UnwindSafe for AnimationHolder
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