mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Arthropod run
This commit is contained in:
parent
fa549eece7
commit
2871fa83bc
@ -25,7 +25,7 @@ impl Animation for AlphaAnimation {
|
||||
|
||||
let (movement1base, movement2base, movement3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time.powi(2), 0.0, 0.0),
|
||||
Some(StageSection::Swing) => (1.0, anim_time.powi(4), 0.0),
|
||||
Some(StageSection::Action) => (1.0, anim_time.powi(4), 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
|
@ -39,23 +39,23 @@ impl Animation for IdleAnimation {
|
||||
|
||||
next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
//next.leg_fl.orientation = Quaternion::rotation_z(0.1);
|
||||
//next.leg_fr.orientation = Quaternion::rotation_z(-0.1);
|
||||
next.leg_fl.orientation = Quaternion::rotation_z(0.1);
|
||||
next.leg_fr.orientation = Quaternion::rotation_z(-0.1);
|
||||
|
||||
next.leg_fcl.position = Vec3::new(-s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2);
|
||||
next.leg_fcr.position = Vec3::new(s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2);
|
||||
//next.leg_fcl.orientation = Quaternion::rotation_z(-0.3);
|
||||
//next.leg_fcr.orientation = Quaternion::rotation_z(0.3);
|
||||
next.leg_fcl.orientation = Quaternion::rotation_z(-0.3);
|
||||
next.leg_fcr.orientation = Quaternion::rotation_z(0.3);
|
||||
|
||||
next.leg_bcl.position = Vec3::new(-s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2);
|
||||
next.leg_bcr.position = Vec3::new(s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2);
|
||||
//next.leg_bcl.orientation = Quaternion::rotation_z(0.0);
|
||||
//next.leg_bcr.orientation = Quaternion::rotation_z(0.0);
|
||||
next.leg_bcl.orientation = Quaternion::rotation_z(0.0);
|
||||
next.leg_bcr.orientation = Quaternion::rotation_z(0.0);
|
||||
|
||||
next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
//next.leg_bl.orientation = Quaternion::rotation_z(0.4);
|
||||
//next.leg_br.orientation = Quaternion::rotation_z(-0.4);
|
||||
next.leg_bl.orientation = Quaternion::rotation_z(0.4);
|
||||
next.leg_br.orientation = Quaternion::rotation_z(-0.4);
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ impl Animation for RunAnimation {
|
||||
|
||||
//let speednorm = speed / 13.0;
|
||||
let speednorm = (speed / 13.0).powf(0.25);
|
||||
let mixed_vel = acc_vel + anim_time * 6.0; //sets run frequency using speed, with anim_time setting a floor
|
||||
let mixed_vel = (acc_vel + anim_time * 6.0) * 0.6; //sets run frequency using speed, with anim_time setting a floor
|
||||
|
||||
let speedmult = 1.0;
|
||||
let lab: f32 = 0.6; //6
|
||||
@ -65,8 +65,13 @@ impl Animation for RunAnimation {
|
||||
next.chest.scale = Vec3::one() / s_a.scaler;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.1)
|
||||
* Quaternion::rotation_y((mixed_vel).sin().min(0.0) * 0.1)
|
||||
* Quaternion::rotation_z((mixed_vel + PI * 1.5).sin() * 0.1);
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
|
||||
next.chest.orientation = Quaternion::rotation_x((mixed_vel).sin().max(0.0) * 0.06)
|
||||
* Quaternion::rotation_z((mixed_vel + PI / 2.0).sin() * 0.06);
|
||||
|
||||
next.mandible_l.position = Vec3::new(-s_a.mandible.0, s_a.mandible.1, s_a.mandible.2);
|
||||
next.mandible_r.position = Vec3::new(s_a.mandible.0, s_a.mandible.1, s_a.mandible.2);
|
||||
@ -79,15 +84,37 @@ impl Animation for RunAnimation {
|
||||
|
||||
next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fl.orientation = Quaternion::rotation_x((mixed_vel + PI).sin().max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(0.1 + (mixed_vel - PI / 2.0).sin() * 0.4);
|
||||
next.leg_fr.orientation = Quaternion::rotation_x((mixed_vel).sin().max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-0.1 - (mixed_vel + PI / 2.0).sin() * 0.4);
|
||||
|
||||
next.leg_fcl.position = Vec3::new(-s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2);
|
||||
next.leg_fcr.position = Vec3::new(s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2);
|
||||
next.leg_fcl.orientation = Quaternion::rotation_x((mixed_vel + PI).sin() * 0.4)
|
||||
* Quaternion::rotation_y((mixed_vel).sin().max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-0.3 + (mixed_vel + PI / 2.0).sin() * 0.2);
|
||||
next.leg_fcr.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.4)
|
||||
* Quaternion::rotation_y((mixed_vel).sin().min(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(0.3 - (mixed_vel + PI * 1.5).sin() * 0.2);
|
||||
|
||||
next.leg_bcl.position = Vec3::new(-s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2);
|
||||
next.leg_bcr.position = Vec3::new(s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2);
|
||||
next.leg_bcl.orientation = Quaternion::rotation_x((mixed_vel + PI).sin() * 0.4)
|
||||
* Quaternion::rotation_y((mixed_vel + PI).sin().max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z((mixed_vel + PI * 1.5).sin() * 0.3);
|
||||
next.leg_bcr.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.4)
|
||||
* Quaternion::rotation_y((mixed_vel + PI).sin().min(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-(mixed_vel + PI / 2.0).sin() * 0.3);
|
||||
|
||||
next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
next.leg_bl.orientation = Quaternion::rotation_x((mixed_vel + PI).sin() * 0.4)
|
||||
* Quaternion::rotation_y((mixed_vel).sin().max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(0.4 + (mixed_vel + PI / 2.0).sin() * 0.2);
|
||||
next.leg_br.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.4)
|
||||
* Quaternion::rotation_y((mixed_vel).sin().min(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-0.4 - (mixed_vel + PI * 1.5).sin() * 0.2);
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -3536,7 +3536,7 @@ impl FigureMgr {
|
||||
StageSection::Buildup => {
|
||||
stage_time / stage.base_buildup_duration.as_secs_f32()
|
||||
},
|
||||
StageSection::Swing => {
|
||||
StageSection::Action => {
|
||||
stage_time / stage.base_swing_duration.as_secs_f32()
|
||||
},
|
||||
StageSection::Recover => {
|
||||
|
Loading…
Reference in New Issue
Block a user