1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton};

pub type Body = ();

#[derive(Clone, Default)]
pub struct FixtureSkeleton;

pub struct SkeletonAttr;

impl<'a, Factor> Lerp<Factor> for &'a FixtureSkeleton {
    type Output = FixtureSkeleton;

    fn lerp_unclamped(_from: Self, _to: Self, _factor: Factor) -> Self::Output { FixtureSkeleton }

    fn lerp_unclamped_precise(_from: Self, _to: Self, _factor: Factor) -> Self::Output {
        FixtureSkeleton
    }
}

impl Skeleton for FixtureSkeleton {
    type Attr = SkeletonAttr;
    type Body = Body;

    const BONE_COUNT: usize = 1;
    #[cfg(feature = "use-dyn-lib")]
    const COMPUTE_FN: &'static [u8] = b"fixture_compute_mats\0";

    #[cfg_attr(feature = "be-dyn-lib", export_name = "fixture_compute_mats")]

    fn compute_matrices_inner(
        &self,
        base_mat: Mat4<f32>,
        buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
        (): Self::Body,
    ) -> Offsets {
        buf[0] = make_bone(base_mat);
        Offsets::default()
    }
}

impl Default for SkeletonAttr {
    fn default() -> Self { Self }
}

impl<'a> From<&'a Body> for SkeletonAttr {
    fn from(_body: &'a Body) -> Self { Self }
}