kitgit

tirbofish/dropbear · diff

2643d1f · Thribhu K

fix: magna-carta parser fix: reset animation state on animation change so its legs don't look like its snapped fix: collider wireframe finally renders now (fixes #90) fix: kcc contains a CharacterMovementResult now refactor: included a world + entity in all InspectableComponents jarvis, run github actions

Unverified

diff --git a/crates/dropbear-engine/src/animation.rs b/crates/dropbear-engine/src/animation.rs
index a267fe1..b812f40 100644
--- a/crates/dropbear-engine/src/animation.rs
+++ b/crates/dropbear-engine/src/animation.rs
@@ -33,6 +33,9 @@ pub struct AnimationComponent {
 
     #[serde(skip)]
     pub available_animations: Vec<String>,
+
+    #[serde(skip)]
+    pub last_animation_index: Option<usize>,
 }
 
 #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
@@ -72,6 +75,7 @@ impl Default for AnimationComponent {
             bone_buffer: None,
             bind_group: None,
             available_animations: vec![],
+            last_animation_index: None,
         }
     }
 }
@@ -89,6 +93,11 @@ impl AnimationComponent {
             .map(|v| v.name.clone())
             .collect::<Vec<_>>();
 
+        if self.active_animation_index != self.last_animation_index {
+            self.local_pose.clear();
+            self.last_animation_index = self.active_animation_index;
+        }
+
         let Some(anim_idx) = self.active_animation_index else {
             self.reset_to_bind_pose(model);
             return;
diff --git a/crates/eucalyptus-core/src/animation.rs b/crates/eucalyptus-core/src/animation.rs
index b06a9c7..7b7b136 100644
--- a/crates/eucalyptus-core/src/animation.rs
+++ b/crates/eucalyptus-core/src/animation.rs
@@ -66,7 +66,13 @@ impl Component for AnimationComponent {
 }
 
 impl InspectableComponent for AnimationComponent {
-    fn inspect(&mut self, ui: &mut Ui, _graphics: Arc<SharedGraphicsContext>) {
+    fn inspect(
+        &mut self,
+        _world: &World,
+        _entity: Entity,
+        ui: &mut Ui,
+        _graphics: Arc<SharedGraphicsContext>,
+    ) {

Large diffs are not rendered by default. Showing the first 50 of 3151 lines. Show full diff