veloren_voxygen_anim/
fixture.rs1use super::{FigureBoneData, 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 type ComputedSkeleton = ();
24
25 const BONE_COUNT: usize = 1;
26 #[cfg(feature = "use-dyn-lib")]
27 const COMPUTE_FN: &'static [u8] = b"fixture_compute_mats\0";
28
29 #[cfg_attr(feature = "be-dyn-lib", unsafe(export_name = "fixture_compute_mats"))]
30 fn compute_matrices_inner(
31 &self,
32 base_mat: Mat4<f32>,
33 buf: &mut [FigureBoneData; super::MAX_BONE_COUNT],
34 (): Self::Body,
35 ) -> Self::ComputedSkeleton {
36 buf[0] = make_bone(base_mat);
37 }
38}
39
40impl Default for SkeletonAttr {
41 fn default() -> Self { Self }
42}
43
44impl<'a> From<&'a Body> for SkeletonAttr {
45 fn from(_body: &'a Body) -> Self { Self }
46}