veloren_voxygen_anim/object/
idle.rs

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