kitgit

tirbofish/dropbear · diff

751a9c9 · Thribhu K

fix: light cube rendering

Unverified

diff --git a/crates/dropbear-engine/src/animation.rs b/crates/dropbear-engine/src/animation.rs
index 05e9851..6acbbe7 100644
--- a/crates/dropbear-engine/src/animation.rs
+++ b/crates/dropbear-engine/src/animation.rs
@@ -3,7 +3,7 @@ use std::sync::Arc;
 use glam::Mat4;
 use wgpu::util::DeviceExt;
 use crate::graphics::SharedGraphicsContext;
-use crate::model::{AnimationInterpolation, ChannelValues, Model, NodeTransform};
+use crate::model::{Animation, AnimationInterpolation, ChannelValues, Model, NodeTransform};
 
 #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
 pub struct AnimationComponent {
@@ -18,6 +18,9 @@ pub struct AnimationComponent {
     #[serde(default)]
     pub is_playing: bool,
 
+    #[serde(default)]
+    pub animation_settings: HashMap<usize, AnimationSettings>,
+
     #[serde(skip)]
     pub local_pose: HashMap<usize, NodeTransform>,
     #[serde(skip)]
@@ -27,6 +30,32 @@ pub struct AnimationComponent {
     pub bone_buffer: Option<wgpu::Buffer>,
     #[serde(skip)]
     pub bind_group: Option<wgpu::BindGroup>,
+
+    #[serde(skip)]
+    pub available_animations: Vec<String>,
+}
+
+#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
+pub struct AnimationSettings {
+    #[serde(default)]
+    pub time: f32,
+    #[serde(default)]
+    pub speed: f32,
+    #[serde(default)]
+    pub looping: bool,
+    #[serde(default)]
+    pub is_playing: bool,
+}
+
+impl Default for AnimationSettings {
+    fn default() -> Self {
+        Self {
+            time: 0.0,
+            speed: 1.0,
+            looping: true,

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