animation corrections

This commit is contained in:
jshipsey 2020-03-08 17:02:25 -04:00
parent 5f8751e2d3
commit bce9d4c24f
6 changed files with 31 additions and 19 deletions

View File

@ -256,7 +256,7 @@ pub fn ability_to_character_state(data: &JoinData, ability_state: AbilityState)
},
AbilityState::TripleAttack { .. } => {
if let Some(tool) = get_tool_data(data) {
CharacterState::TripleAttack {
CharacterState::TripleAttack {
tool,
stage: 1,
stage_time_active: Duration::default(),

View File

@ -16,9 +16,10 @@ impl Animation for AttackAnimation {
skeleton: &Self::Skeleton,
(active_tool_kind, _global_time): Self::Dependency,
anim_time: f64,
_rate: &mut f32,
rate: &mut f32,
skeleton_attr: &SkeletonAttr,
) -> Self::Skeleton {
*rate = 1.0;
let mut next = (*skeleton).clone();
let lab = 1.0;
@ -270,7 +271,7 @@ impl Animation for AttackAnimation {
next.lantern.ori = Quaternion::rotation_x(0.0);
next.lantern.scale = Vec3::one() * 0.0;
next.torso.offset = Vec3::new(0.0, -0.2, 0.1) * skeleton_attr.scaler;
next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler;
next.torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0);
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;

View File

@ -274,6 +274,13 @@ impl Animation for BlockAnimation {
next.torso.ori = Quaternion::rotation_x(0.0);
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
next.l_control.offset = Vec3::new(0.0, 0.0, 0.0);
next.l_control.ori = Quaternion::rotation_x(0.0);
next.l_control.scale = Vec3::one();
next.r_control.offset = Vec3::new(0.0, 0.0, 0.0);
next.r_control.ori = Quaternion::rotation_x(0.0);
next.r_control.scale = Vec3::one();
next
}
}

View File

@ -273,6 +273,13 @@ impl Animation for BlockIdleAnimation {
next.torso.ori = Quaternion::rotation_x(0.0);
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
next.l_control.offset = Vec3::new(0.0, 0.0, 0.0);
next.l_control.ori = Quaternion::rotation_x(0.0);
next.l_control.scale = Vec3::one();
next.r_control.offset = Vec3::new(0.0, 0.0, 0.0);
next.r_control.ori = Quaternion::rotation_x(0.0);
next.r_control.scale = Vec3::one();
next
}
}

View File

@ -12,37 +12,33 @@ impl Animation for WieldAnimation {
fn update_skeleton(
skeleton: &Self::Skeleton,
(active_tool_kind, velocity, _global_time): Self::Dependency,
(active_tool_kind, _velocity, _global_time): Self::Dependency,
anim_time: f64,
rate: &mut f32,
_rate: &mut f32,
skeleton_attr: &SkeletonAttr,
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let speed = Vec2::<f32>::from(velocity).magnitude();
*rate = speed;
let wave_ultra_slow = (anim_time as f32 * 3.0 + PI).sin();
let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos();
let wave = (anim_time as f32 * 1.0).sin();
let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0).sin();
match active_tool_kind {
//TODO: Inventory
Some(ToolKind::Sword(_)) => {
next.l_hand.offset = Vec3::new(0.0, -5.0, -5.0);
next.l_hand.ori = Quaternion::rotation_x(1.27);
next.l_hand.offset = Vec3::new(-0.25, -5.0, -5.0);
next.l_hand.ori = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
next.l_hand.scale = Vec3::one() * 1.04;
next.r_hand.offset = Vec3::new(0.0, -6.0, -8.0);
next.r_hand.ori = Quaternion::rotation_x(1.27);
next.r_hand.offset = Vec3::new(1.25, -5.5, -8.0);
next.r_hand.ori = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3);
next.r_hand.scale = Vec3::one() * 1.05;
next.main.offset = Vec3::new(0.0, 0.0, -6.0);
next.main.ori = Quaternion::rotation_x(-0.3)
next.main.ori = Quaternion::rotation_x(-0.1)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
next.main.scale = Vec3::one();
next.control.offset = Vec3::new(-8.0, 4.0, 6.0);
next.control.offset = Vec3::new(-7.0, 6.0, 6.0);
next.control.ori = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0);
@ -199,8 +195,9 @@ impl Animation for WieldAnimation {
},
_ => {},
}
next.torso.offset = Vec3::new(0.0, 0.3 + wave * -0.08, 0.4) * skeleton_attr.scaler;
next.torso.ori = Quaternion::rotation_x(wave_stop * -0.2);
next.torso.offset = Vec3::new(0.0, 0.0 + wave * -0.08, 0.1) * skeleton_attr.scaler;
next.torso.ori = Quaternion::rotation_x(0.0);
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
next.l_control.offset = Vec3::new(0.0, 0.0, 0.0);

View File

@ -408,8 +408,8 @@ impl FigureMgr {
let target_base = match (
physics.on_ground,
vel.0.magnitude_squared() > 0.001, // Moving
physics.in_fluid, // In water
vel.0.magnitude_squared() > 0.5, // Moving
physics.in_fluid, // In water
) {
// Standing
(true, false, false) => anim::character::StandAnimation::update_skeleton(