use super::*;
#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
pub struct Keyframe3D {
#[get(type(copy))]
pub(crate) time_secs: f32,
#[get(type(copy))]
pub(crate) transform: Transform3D,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct SkeletonJoint3D {
pub(crate) name: String,
#[get(skip)]
pub(crate) parent: Option<usize>,
#[get(type(copy))]
pub(crate) rest_transform: Transform3D,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct JointTrack3D {
#[get(type(copy))]
pub(crate) joint_index: usize,
pub(crate) keyframes: Vec<Keyframe3D>,
}
#[derive(Clone, Data, Debug, PartialEq)]
pub struct AnimationClip3D {
pub(crate) name: String,
#[get(type(copy))]
pub(crate) duration_secs: f32,
#[get(type(copy))]
pub(crate) looping: bool,
pub(crate) tracks: Vec<JointTrack3D>,
}
#[derive(Clone, Copy, Data, Debug, New, PartialEq)]
pub struct SkinWeight3D {
#[get(type(copy))]
pub(crate) joint_indices: [u16; 4],
#[get(type(copy))]
pub(crate) weights: [f32; 4],
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct SkeletonRig3D {
pub(crate) joints: Vec<SkeletonJoint3D>,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct Skin3D {
pub(crate) name: String,
pub(crate) joints: Vec<u32>,
#[get(type(copy))]
pub(crate) skeleton_root: Option<u32>,
pub(crate) inverse_bind_matrices: Vec<Mat4>,
#[get(type(copy))]
pub(crate) skinning_mode: SkinningMode,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct SkinPaletteScratch3D {
pub(crate) skin_matrices: Vec<Mat4>,
pub(crate) skin_normal_matrices: Vec<[Vec3; 3]>,
pub(crate) skin_dual_quats: Vec<DualQuat>,
pub(crate) morphed_vertices: Vec<Vertex3D>,
pub(crate) skinned_vertices: Vec<Vertex3D>,
}
#[derive(Clone, Copy, Data, Debug, PartialEq)]
pub struct NlaLayer3D {
#[get(type(copy))]
pub(crate) clip_index: usize,
#[get(type(copy))]
pub(crate) weight: f32,
#[get(type(copy))]
pub(crate) blend_mode: NlaBlendMode,
#[get(type(copy))]
pub(crate) repeat_mode: NlaRepeatMode,
#[get(type(copy))]
pub(crate) time_secs: f32,
#[get(type(copy))]
pub(crate) time_scale: f32,
#[get(type(copy))]
pub(crate) fade_elapsed_secs: f32,
#[get(type(copy))]
pub(crate) fade_duration_secs: f32,
#[get(type(copy))]
pub(crate) fade_start_weight: f32,
#[get(type(copy))]
pub(crate) fade_target_weight: f32,
#[get(type(copy))]
pub(crate) joint_mask: u64,
#[get(type(copy))]
pub(crate) enabled: bool,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct AnimationPoseScratch3D {
pub(crate) node_translations: Vec<Vec3>,
pub(crate) node_rotations: Vec<Quat>,
pub(crate) node_scales: Vec<Vec3>,
pub(crate) node_touched_translation: Vec<bool>,
pub(crate) node_touched_rotation: Vec<bool>,
pub(crate) node_touched_scale: Vec<bool>,
pub(crate) morph_weights: Vec<f32>,
pub(crate) morph_touched: Vec<bool>,
pub(crate) sampler_values: Vec<f32>,
}
#[derive(Clone, Data, Debug, Default, PartialEq)]
pub struct AnimationMixer3D {
pub(crate) clips: Vec<ImportedAnimationClip3D>,
pub(crate) layers: Vec<NlaLayer3D>,
pub(crate) pose_scratch: AnimationPoseScratch3D,
pub(crate) rest_translations: Vec<Vec3>,
pub(crate) rest_rotations: Vec<Quat>,
pub(crate) rest_scales: Vec<Vec3>,
pub(crate) rest_morph_weights: Vec<f32>,
}