tirbofish/dropbear · commit
751a9c98a9d3229315f086a1ae4095298f2948fd
fix: light cube rendering
Signature present but could not be verified.
Unverified
@@ -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