veloren_voxygen_anim/
fixture.rs1use super::{FigureBoneData, Offsets, Skeleton, make_bone, vek::*};
2
3pub type Body = ();
4
5#[derive(Clone, Default)]
6pub struct FixtureSkeleton;
7
8pub struct SkeletonAttr;
9
10impl<Factor> Lerp<Factor> for &FixtureSkeleton {
11 type Output = FixtureSkeleton;
12
13 fn lerp_unclamped(_from: Self, _to: Self, _factor: Factor) -> Self::Output { FixtureSkeleton }
14
15 fn lerp_unclamped_precise(_from: Self, _to: Self, _factor: Factor) -> Self::Output {
16 FixtureSkeleton
17 }
18}
19
20impl Skeleton for FixtureSkeleton {
21 type Attr = SkeletonAttr;
22 type Body = Body;
23
24 const BONE_COUNT: usize = 1;
25 #[cfg(feature = "use-dyn-lib")]
26 const COMPUTE_FN: &'static [u8] = b"fixture_compute_mats\0";
27
28 #[cfg_attr(feature = "be-dyn-lib", export_name = "fixture_compute_mats")]
29
30 fn compute_matrices_inner(
31 &self,
32 base_mat: Mat4<f32>,
33 buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
34 (): Self::Body,
35 ) -> Offsets {
36 buf[0] = make_bone(base_mat);
37 Offsets::default()
38 }
39}
40
41impl Default for SkeletonAttr {
42 fn default() -> Self { Self }
43}
44
45impl<'a> From<&'a Body> for SkeletonAttr {
46 fn from(_body: &'a Body) -> Self { Self }
47}