veloren_voxygen_anim/item/
idle.rs

1use super::{
2    super::{Animation, vek::*},
3    ItemSkeleton, SkeletonAttr,
4};
5
6pub struct IdleAnimation;
7
8impl Animation for IdleAnimation {
9    type Dependency<'a> = f32;
10    type Skeleton = ItemSkeleton;
11
12    #[cfg(feature = "use-dyn-lib")]
13    const UPDATE_FN: &'static [u8] = b"item_idle\0";
14
15    #[cfg_attr(feature = "be-dyn-lib", unsafe(export_name = "item_idle"))]
16    fn update_skeleton_inner(
17        skeleton: &Self::Skeleton,
18        _: Self::Dependency<'_>,
19        _anim_time: f32,
20        _rate: &mut f32,
21        s_a: &SkeletonAttr,
22    ) -> Self::Skeleton {
23        let mut next = (*skeleton).clone();
24
25        next.bone0.position = Vec3::new(s_a.bone0.0, s_a.bone0.1, s_a.bone0.2);
26        next.bone0.orientation.rotate_x(s_a.bone0.3);
27
28        next
29    }
30}