pub struct AnimationManagerBuilder;Expand description
Builder for creating AnimationManager from M2Model data
Implementations§
Source§impl AnimationManagerBuilder
impl AnimationManagerBuilder
Sourcepub fn from_model(model: &M2Model, data: &[u8]) -> Result<AnimationManager>
pub fn from_model(model: &M2Model, data: &[u8]) -> Result<AnimationManager>
Create an AnimationManager from M2Model data
This resolves all bone animation tracks from the raw M2 data and creates a fully functional animation manager ready for playback.
§Arguments
model- The parsed M2 modeldata- The raw M2 file bytes (needed to resolve animation data offsets)
§Returns
An AnimationManager ready for animation playback, or an error if resolution fails
§Example
ⓘ
use wow_m2::{M2Model, animation::AnimationManagerBuilder};
let data = std::fs::read("model.m2")?;
let model = M2Model::parse(&mut std::io::Cursor::new(&data))?;
let manager = AnimationManagerBuilder::from_model(&model, &data)?;
// Update animation each frame
manager.update(delta_time_ms);
let translation = manager.get_bone_translation(0);Auto Trait Implementations§
impl Freeze for AnimationManagerBuilder
impl RefUnwindSafe for AnimationManagerBuilder
impl Send for AnimationManagerBuilder
impl Sync for AnimationManagerBuilder
impl Unpin for AnimationManagerBuilder
impl UnwindSafe for AnimationManagerBuilder
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
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>
Converts
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>
Converts
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 more