tirbofish/dropbear · commit
f4471a782884cbe562b5f7af4e9e7489b19299f5
refactor: main shader, bind groups and textures.
jarvis, run github actions
Signature present but could not be verified.
Unverified
@@ -86,10 +86,12 @@ impl AnimationComponent { self.available_animations = model.animations.iter().map(|v| v.name.clone()).collect::<Vec<_>>(); let Some(anim_idx) = self.active_animation_index else { + self.reset_to_bind_pose(model); return; }; if anim_idx >= model.animations.len() { + self.reset_to_bind_pose(model); return; } @@ -108,6 +110,7 @@ impl AnimationComponent { self.speed = settings.speed; self.looping = settings.looping; self.is_playing = settings.is_playing; + self.reset_to_bind_pose(model); return; } let animation = &model.animations[anim_idx]; @@ -129,6 +132,11 @@ impl AnimationComponent { self.looping = settings.looping; self.is_playing = settings.is_playing; + if !settings.is_playing { + self.reset_to_bind_pose(model); + return; + } + for channel in &animation.channels { let count = channel.times.len(); if count == 0 { continue; } @@ -275,6 +283,11 @@ impl AnimationComponent { self.update_matrices(model); } + fn reset_to_bind_pose(&mut self, model: &Model) { + self.local_pose.clear(); + self.update_matrices(model); + } + fn apply_single_keyframe( channel: &crate::model::AnimationChannel, index: usize,
Large diffs are not rendered by default. Showing the first 50 of 1592 lines. Show full diff