mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
More arthropod animations
This commit is contained in:
parent
38bbd60fd2
commit
fd3ed89899
@ -597,11 +597,11 @@
|
||||
lateral: ("npc.stag_beetle.male.wing_fr"),
|
||||
),
|
||||
wing_bl: (
|
||||
offset: (-4.0, -1.0, -0.5),
|
||||
offset: (-4.0, -12.0, -0.5),
|
||||
lateral: ("npc.stag_beetle.male.wing_br"),
|
||||
),
|
||||
wing_br: (
|
||||
offset: (-0.0, -1.0, -0.5),
|
||||
offset: (-0.0, -12.0, -0.5),
|
||||
lateral: ("npc.stag_beetle.male.wing_br"),
|
||||
),
|
||||
leg_fl: (
|
||||
@ -655,11 +655,11 @@
|
||||
lateral: ("npc.stag_beetle.male.wing_fr"),
|
||||
),
|
||||
wing_bl: (
|
||||
offset: (-4.0, -1.0, -0.5),
|
||||
offset: (-4.0, -12.0, -0.5),
|
||||
lateral: ("npc.stag_beetle.male.wing_br"),
|
||||
),
|
||||
wing_br: (
|
||||
offset: (-0.0, -1.0, -0.5),
|
||||
offset: (-0.0, -12.0, -0.5),
|
||||
lateral: ("npc.stag_beetle.male.wing_br"),
|
||||
),
|
||||
leg_fl: (
|
||||
|
BIN
assets/voxygen/voxel/npc/horn_beetle/male/wing_br.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/npc/horn_beetle/male/wing_br.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/npc/horn_beetle/male/wing_fr.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/npc/horn_beetle/male/wing_fr.vox
(Stored with Git LFS)
Binary file not shown.
@ -1697,8 +1697,8 @@ impl<'a> AgentData<'a> {
|
||||
controller
|
||||
.actions
|
||||
.push(ControlAction::basic_input(InputKind::Secondary));
|
||||
// Reset timer
|
||||
agent.action_state.timer = 0.0;
|
||||
// Reset timer
|
||||
agent.action_state.timer = 0.0;
|
||||
} else if attack_data.angle < 90.0
|
||||
&& attack_data.dist_sqrd < (1.5 * attack_data.min_attack_dist).powi(2)
|
||||
{
|
||||
@ -1706,7 +1706,8 @@ impl<'a> AgentData<'a> {
|
||||
controller
|
||||
.actions
|
||||
.push(ControlAction::basic_input(InputKind::Primary));
|
||||
} else if thread_rng().gen_bool(0.01) && attack_data.angle < 15.0
|
||||
} else if thread_rng().gen_bool(0.01)
|
||||
&& attack_data.angle < 15.0
|
||||
&& attack_data.dist_sqrd < (6.0 * attack_data.min_attack_dist).powi(2)
|
||||
{
|
||||
controller
|
||||
|
@ -41,49 +41,114 @@ impl Animation for AlphaAnimation {
|
||||
let movement2abs = movement2 * pullback;
|
||||
let movement3abs = movement3 * pullback;
|
||||
|
||||
next.chest.scale = Vec3::one() / s_a.scaler;
|
||||
next.chest.orientation = Quaternion::rotation_x(movement2abs * 0.3)
|
||||
* Quaternion::rotation_z((movement1abs * 4.0 * PI).sin() * 0.02);
|
||||
if s_a.snapper {
|
||||
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(movement1abs * 0.5 + movement2abs * -1.5 + movement3abs * 0.8)
|
||||
* Quaternion::rotation_y(mirror * movement1abs * -0.2 + mirror * movement2abs * 0.2)
|
||||
* Quaternion::rotation_z((movement1abs * 4.0 * PI).sin() * 0.02);
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_x(
|
||||
movement1abs * -0.2 + movement2abs * 0.4 + movement3abs * 0.8,
|
||||
) * Quaternion::rotation_y(
|
||||
movement1abs * -0.1 + movement2abs * 0.2 + movement3abs * 0.2,
|
||||
);
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
|
||||
|
||||
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);
|
||||
next.mandible_l.orientation =
|
||||
Quaternion::rotation_x(movement1abs * 0.5 + movement2abs * -1.5 + movement3abs * 0.8)
|
||||
* Quaternion::rotation_z(movement1abs * 0.5 + movement2abs * -0.6 + movement3abs * 0.8);
|
||||
next.mandible_r.orientation =
|
||||
Quaternion::rotation_x(movement1abs * 0.5 + movement2abs * -1.5 + movement3abs * 0.8)
|
||||
* Quaternion::rotation_z(movement1abs * -0.5 + movement2abs * 0.6 + movement3abs * -0.8);
|
||||
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);
|
||||
next.mandible_l.orientation = Quaternion::rotation_z(
|
||||
movement1abs * 0.7 + movement2abs * -1.0 + movement3abs * 0.8,
|
||||
);
|
||||
next.mandible_r.orientation = Quaternion::rotation_z(
|
||||
movement1abs * -0.7 + movement2abs * 1.0 + movement3abs * -0.8,
|
||||
);
|
||||
|
||||
next.wing_fl.position = Vec3::new(-s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_fr.position = Vec3::new(s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_fl.position = Vec3::new(-s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_fr.position = Vec3::new(s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_fl.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5)
|
||||
* Quaternion::rotation_y(movement1abs * 0.2 + movement2abs * -0.2)
|
||||
* Quaternion::rotation_z(movement1abs * -0.2 + movement2abs * 0.2);
|
||||
next.wing_fr.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.5 + movement2abs * 0.5)
|
||||
* Quaternion::rotation_y(movement1abs * -0.2 + movement2abs * 0.2)
|
||||
* Quaternion::rotation_z(movement1abs * 0.2 + movement2abs * -0.2);
|
||||
|
||||
next.wing_bl.position = Vec3::new(-s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.wing_br.position = Vec3::new(s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.wing_bl.position = Vec3::new(-s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.wing_br.position = Vec3::new(s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.wing_bl.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.3 + movement2abs * 0.3)
|
||||
* Quaternion::rotation_y(movement1abs * 0.2 + movement2abs * -0.2);
|
||||
next.wing_br.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.3 + movement2abs * 0.3)
|
||||
* Quaternion::rotation_y(movement1abs * -0.2 + movement2abs * 0.2);
|
||||
|
||||
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(s_a.leg_ori.0 + movement1abs * 0.4 + movement2abs * -0.4 + movement3abs * 0.8) *
|
||||
Quaternion::rotation_x(movement1abs * 1.0 + movement2abs * -1.8 + movement3abs * 0.8);
|
||||
next.leg_fr.orientation = Quaternion::rotation_z(-s_a.leg_ori.0 + movement1abs * -0.4 + movement2abs * 0.4 + movement3abs * -0.8) *
|
||||
Quaternion::rotation_x(movement1abs * 1.0 + movement2abs * -1.8 + movement3abs * 0.8);
|
||||
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_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.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_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.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_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.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);
|
||||
} else {
|
||||
next.chest.scale = Vec3::one() / s_a.scaler;
|
||||
next.chest.orientation = Quaternion::rotation_x(movement2abs * 0.3)
|
||||
* Quaternion::rotation_z((movement1abs * 4.0 * PI).sin() * 0.02);
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_x(
|
||||
movement1abs * 0.5 + movement2abs * -1.5 + movement3abs * 0.8,
|
||||
) * Quaternion::rotation_y(
|
||||
mirror * movement1abs * -0.2 + mirror * movement2abs * 0.2,
|
||||
) * Quaternion::rotation_z((movement1abs * 4.0 * PI).sin() * 0.02);
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
|
||||
|
||||
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);
|
||||
next.mandible_l.orientation = Quaternion::rotation_x(
|
||||
movement1abs * 0.5 + movement2abs * -1.5 + movement3abs * 0.8,
|
||||
) * Quaternion::rotation_z(
|
||||
movement1abs * 0.5 + movement2abs * -0.6 + movement3abs * 0.8,
|
||||
);
|
||||
next.mandible_r.orientation = Quaternion::rotation_x(
|
||||
movement1abs * 0.5 + movement2abs * -1.5 + movement3abs * 0.8,
|
||||
) * Quaternion::rotation_z(
|
||||
movement1abs * -0.5 + movement2abs * 0.6 + movement3abs * -0.8,
|
||||
);
|
||||
|
||||
next.wing_fl.position = Vec3::new(-s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_fr.position = Vec3::new(s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
|
||||
next.wing_bl.position = Vec3::new(-s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.wing_br.position = Vec3::new(s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
|
||||
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(
|
||||
s_a.leg_ori.0 + movement1abs * 0.4 + movement2abs * -0.4 + movement3abs * 0.8,
|
||||
) * Quaternion::rotation_x(
|
||||
movement1abs * 1.0 + movement2abs * -1.8 + movement3abs * 0.8,
|
||||
);
|
||||
next.leg_fr.orientation = Quaternion::rotation_z(
|
||||
-s_a.leg_ori.0 + movement1abs * -0.4 + movement2abs * 0.4 + movement3abs * -0.8,
|
||||
) * Quaternion::rotation_x(
|
||||
movement1abs * 1.0 + movement2abs * -1.8 + movement3abs * 0.8,
|
||||
);
|
||||
|
||||
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_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_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
|
||||
}
|
||||
}
|
||||
|
@ -64,21 +64,23 @@ impl Animation for DashAnimation {
|
||||
|
||||
next.wing_fl.position = Vec3::new(-s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_fr.position = Vec3::new(s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_fl.orientation = Quaternion::rotation_x(movement1abs * -0.4 + shortalt * 0.2)
|
||||
* Quaternion::rotation_y(movement1abs * -0.5 + movement2abs * -0.7)
|
||||
* Quaternion::rotation_z(movement1abs * 0.2);
|
||||
next.wing_fr.orientation = Quaternion::rotation_x(movement1abs * -0.4 + shortalt * 0.2)
|
||||
* Quaternion::rotation_y(movement1abs * 0.5 + movement2abs * 0.7)
|
||||
* Quaternion::rotation_z(movement1abs * -0.2);
|
||||
next.wing_fl.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.4 + shortalt * 0.2 + movement2abs * -0.6)
|
||||
* Quaternion::rotation_y(movement1abs * -0.5 + movement2abs * -0.1)
|
||||
* Quaternion::rotation_z(movement1abs * -0.2);
|
||||
next.wing_fr.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.4 + shortalt * 0.2 + movement2abs * -0.6)
|
||||
* Quaternion::rotation_y(movement1abs * 0.5 + movement2abs * 0.1)
|
||||
* Quaternion::rotation_z(movement1abs * 0.2);
|
||||
|
||||
next.wing_bl.position = Vec3::new(-s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.wing_br.position = Vec3::new(s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.wing_bl.orientation = Quaternion::rotation_x(movement1abs * -0.2 + shortalt * 0.2)
|
||||
* Quaternion::rotation_y(movement1abs * -0.4 + movement2abs * -0.7)
|
||||
* Quaternion::rotation_z(movement1abs * 0.2);
|
||||
next.wing_br.orientation = Quaternion::rotation_x(movement1abs * -0.2 + shortalt * 0.2)
|
||||
* Quaternion::rotation_y(movement1abs * 0.4 + movement2abs * 0.7)
|
||||
* Quaternion::rotation_z(movement1abs * -0.2);
|
||||
next.wing_bl.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.2 + shortalt * 0.2 + movement2abs * -0.6)
|
||||
* Quaternion::rotation_y(movement1abs * -0.4 + movement2abs * -0.1);
|
||||
next.wing_br.orientation =
|
||||
Quaternion::rotation_x(movement1abs * -0.2 + shortalt * 0.2 + movement2abs * -0.6)
|
||||
* Quaternion::rotation_y(movement1abs * 0.4 + movement2abs * 0.1);
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -21,7 +21,9 @@ impl Animation for IdleAnimation {
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
next.chest.scale = Vec3::one();
|
||||
next.chest.scale = Vec3::one() / s_a.scaler;
|
||||
next.wing_bl.scale = Vec3::one() * 0.98;
|
||||
next.wing_br.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
|
||||
|
@ -22,6 +22,8 @@ impl Animation for JumpAnimation {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
next.chest.scale = Vec3::one() / s_a.scaler;
|
||||
next.wing_bl.scale = Vec3::one() * 0.98;
|
||||
next.wing_br.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
|
||||
|
@ -128,6 +128,7 @@ pub struct SkeletonAttr {
|
||||
leg_b: (f32, f32, f32),
|
||||
scaler: f32,
|
||||
leg_ori: (f32, f32, f32, f32),
|
||||
snapper: bool,
|
||||
}
|
||||
|
||||
impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr {
|
||||
@ -155,6 +156,7 @@ impl Default for SkeletonAttr {
|
||||
leg_b: (0.0, 0.0, 0.0),
|
||||
scaler: 0.0,
|
||||
leg_ori: (0.0, 0.0, 0.0, 0.0),
|
||||
snapper: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -206,7 +208,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Tarantula, _) => (3.0, 0.0, -4.0),
|
||||
(Blackwidow, _) => (3.0, 0.0, -4.0),
|
||||
(Antlion, _) => (3.0, 0.0, -4.0),
|
||||
(Hornbeetle, _) => (-0.5, 5.0, 3.0),
|
||||
(Hornbeetle, _) => (5.5, 5.0, 3.0),
|
||||
(Leafbeetle, _) => (0.5, 5.0, 3.0),
|
||||
(Stagbeetle, _) => (0.5, 6.0, 4.5),
|
||||
(Weevil, _) => (0.5, 5.0, 3.0),
|
||||
@ -219,9 +221,9 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Tarantula, _) => (3.0, 0.0, -4.0),
|
||||
(Blackwidow, _) => (3.0, 0.0, -4.0),
|
||||
(Antlion, _) => (3.0, 0.0, -4.0),
|
||||
(Hornbeetle, _) => (0.0, 6.0, 2.0),
|
||||
(Hornbeetle, _) => (4.0, 6.0, 2.0),
|
||||
(Leafbeetle, _) => (0.5, 4.0, 2.0),
|
||||
(Stagbeetle, _) => (0.5, -5.0, 3.0),
|
||||
(Stagbeetle, _) => (0.5, 6.0, 3.0),
|
||||
(Weevil, _) => (0.5, 4.0, 1.5),
|
||||
(Cavespider, _) => (3.0, 0.0, -4.0),
|
||||
(Moltencrawler, _) => (3.0, 0.0, -4.0),
|
||||
@ -298,6 +300,12 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Antlion, _) => (0.7, -0.3, -0.4, 0.4),
|
||||
(_, _) => (0.1, -0.3, 0.0, 0.4),
|
||||
},
|
||||
// Whether or not it used its mandibles for attacks
|
||||
snapper: match (body.species, body.body_type) {
|
||||
(Stagbeetle, _) => true,
|
||||
(Antlion, _) => true,
|
||||
(_, _) => false,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,40 +25,21 @@ impl Animation for RunAnimation {
|
||||
*rate = 1.0;
|
||||
|
||||
let speednorm = speed / 13.0;
|
||||
//let canceler = (speed / 24.0).powf(0.6);
|
||||
//let speednorm = (speed / 13.0).powf(0.25);
|
||||
|
||||
let mixed_vel = (acc_vel + anim_time * 6.0) * 0.8; //sets run frequency using speed, with anim_time setting a floor
|
||||
|
||||
//let speedmult = 1.0;
|
||||
//let lab: f32 = 0.6; //6
|
||||
//create a mix between a sine and a square wave
|
||||
//(controllable with ratio variable)
|
||||
let ratio = 0.1;
|
||||
let wave1 = (mixed_vel).sin();
|
||||
let wave2 = (mixed_vel - PI / 2.0).sin();
|
||||
let wave3 = (mixed_vel + PI / 2.0).sin();
|
||||
let wave4 = (mixed_vel + PI).sin();
|
||||
let foot1 = wave1.abs().powf(ratio) * wave1.signum();
|
||||
let foot2 = wave2.abs().powf(ratio) * wave2.signum();
|
||||
let foot3 = wave3.abs().powf(ratio) * wave3.signum();
|
||||
let foot4 = wave4.abs().powf(ratio) * wave4.signum();
|
||||
|
||||
//let short = ((1.0
|
||||
// / (0.72
|
||||
// + 0.28 * ((mixed_vel * 1.0 * lab * speedmult + PI * -0.15 -
|
||||
// 0.5).sin()).powi(2)))
|
||||
//.sqrt())
|
||||
//
|
||||
// * ((mixed_vel * 1.0 * lab * speedmult + PI * -0.15 - 0.5).sin())
|
||||
// * speednorm;
|
||||
|
||||
//
|
||||
//let shortalt = (mixed_vel * 1.0 * lab * speedmult + PI * 3.0 / 8.0 -
|
||||
// 0.5).sin() * speednorm;
|
||||
|
||||
//let ori: Vec2<f32> = Vec2::from(orientation);
|
||||
//let last_ori = Vec2::from(last_ori);
|
||||
//let tilt = if ::vek::Vec2::new(ori, last_ori)
|
||||
// .map(|o| o.magnitude_squared())
|
||||
// .map(|m| m > 0.001 && m.is_finite())
|
||||
// .reduce_and()
|
||||
// && ori.angle_between(last_ori).is_finite()
|
||||
//{
|
||||
// ori.angle_between(last_ori).min(0.2)
|
||||
// * last_ori.determine_side(Vec2::zero(), ori).signum()
|
||||
//} else {
|
||||
// 0.0
|
||||
//}
|
||||
//} * 1.3;
|
||||
let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude()) * speednorm;
|
||||
|
||||
next.chest.scale = Vec3::one() / s_a.scaler;
|
||||
@ -85,37 +66,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(s_a.leg_ori.0 + (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(-s_a.leg_ori.0 - (mixed_vel + PI / 2.0).sin() * 0.4);
|
||||
next.leg_fl.orientation = Quaternion::rotation_x(foot4.max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(s_a.leg_ori.0 + foot2 * 0.4);
|
||||
next.leg_fr.orientation = Quaternion::rotation_x(foot1.max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-s_a.leg_ori.0 - foot3 * 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.2)
|
||||
* Quaternion::rotation_y((mixed_vel).sin().max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(s_a.leg_ori.1 + (mixed_vel + PI / 2.0).sin() * 0.2);
|
||||
next.leg_fcr.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.2)
|
||||
* Quaternion::rotation_y((mixed_vel).sin().min(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-s_a.leg_ori.1 - (mixed_vel + PI * 1.5).sin() * 0.2);
|
||||
next.leg_fcl.orientation = Quaternion::rotation_x(foot4 * 0.2)
|
||||
* Quaternion::rotation_y(foot1.max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(s_a.leg_ori.1 + foot3 * 0.2);
|
||||
next.leg_fcr.orientation = Quaternion::rotation_x(foot1 * 0.2)
|
||||
* Quaternion::rotation_y(foot1.min(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-s_a.leg_ori.1 - foot2 * 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.2)
|
||||
* Quaternion::rotation_y((mixed_vel + PI).sin().max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(s_a.leg_ori.2 + (mixed_vel + PI * 1.5).sin() * 0.3);
|
||||
next.leg_bcr.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.2)
|
||||
* Quaternion::rotation_y((mixed_vel + PI).sin().min(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-s_a.leg_ori.2 - (mixed_vel + PI / 2.0).sin() * 0.3);
|
||||
next.leg_bcl.orientation = Quaternion::rotation_x(foot4 * 0.2)
|
||||
* Quaternion::rotation_y(foot4.max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(s_a.leg_ori.2 + foot2 * 0.3);
|
||||
next.leg_bcr.orientation = Quaternion::rotation_x(foot1 * 0.2)
|
||||
* Quaternion::rotation_y(foot4.min(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-s_a.leg_ori.2 - foot3 * 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.2)
|
||||
* Quaternion::rotation_y((mixed_vel).sin().max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(s_a.leg_ori.3 + (mixed_vel + PI / 2.0).sin() * 0.2);
|
||||
next.leg_br.orientation = Quaternion::rotation_x((mixed_vel).sin() * 0.2)
|
||||
* Quaternion::rotation_y((mixed_vel).sin().min(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-s_a.leg_ori.3 - (mixed_vel + PI * 1.5).sin() * 0.2);
|
||||
next.leg_bl.orientation = Quaternion::rotation_x(foot4 * 0.2)
|
||||
* Quaternion::rotation_y(foot1.max(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(s_a.leg_ori.3 + foot3 * 0.2);
|
||||
next.leg_br.orientation = Quaternion::rotation_x(foot1 * 0.2)
|
||||
* Quaternion::rotation_y(foot1.min(0.0) * 0.7)
|
||||
* Quaternion::rotation_z(-s_a.leg_ori.3 - foot2 * 0.2);
|
||||
|
||||
next
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user