From 6f598681fb7eb4f745db7fc7cf903efc809d5f75 Mon Sep 17 00:00:00 2001 From: timokoesters Date: Fri, 2 Aug 2019 22:50:19 +0200 Subject: [PATCH] Fix combat animations for non humanoids --- voxygen/src/scene/figure.rs | 48 +++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index a43774169b..c9ce0fdcb4 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -767,24 +767,30 @@ impl FigureMgr { }; let target_skeleton = match animation_info.animation { - comp::Animation::Run => anim::quadruped::RunAnimation::update_skeleton( - state.skeleton_mut(), - (vel.0.magnitude(), time), - animation_info.time, - skeleton_attr, - ), - comp::Animation::Idle => anim::quadruped::IdleAnimation::update_skeleton( - state.skeleton_mut(), - time, - animation_info.time, - skeleton_attr, - ), - comp::Animation::Jump => anim::quadruped::JumpAnimation::update_skeleton( - state.skeleton_mut(), - (vel.0.magnitude(), time), - animation_info.time, - skeleton_attr, - ), + comp::Animation::Run | comp::Animation::Crun => { + anim::quadruped::RunAnimation::update_skeleton( + state.skeleton_mut(), + (vel.0.magnitude(), time), + animation_info.time, + skeleton_attr, + ) + } + comp::Animation::Idle | comp::Animation::Cidle => { + anim::quadruped::IdleAnimation::update_skeleton( + state.skeleton_mut(), + time, + animation_info.time, + skeleton_attr, + ) + } + comp::Animation::Jump | comp::Animation::Cjump => { + anim::quadruped::JumpAnimation::update_skeleton( + state.skeleton_mut(), + (vel.0.magnitude(), time), + animation_info.time, + skeleton_attr, + ) + } // TODO! _ => state.skeleton_mut().clone(), @@ -807,7 +813,7 @@ impl FigureMgr { }; let target_skeleton = match animation_info.animation { - comp::Animation::Run => { + comp::Animation::Run | comp::Animation::Crun => { anim::quadrupedmedium::RunAnimation::update_skeleton( state.skeleton_mut(), (vel.0.magnitude(), time), @@ -815,7 +821,7 @@ impl FigureMgr { skeleton_attr, ) } - comp::Animation::Idle => { + comp::Animation::Idle | comp::Animation::Cidle => { anim::quadrupedmedium::IdleAnimation::update_skeleton( state.skeleton_mut(), time, @@ -823,7 +829,7 @@ impl FigureMgr { skeleton_attr, ) } - comp::Animation::Jump => { + comp::Animation::Jump | comp::Animation::Cjump => { anim::quadrupedmedium::JumpAnimation::update_skeleton( state.skeleton_mut(), (vel.0.magnitude(), time),