mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
remove 0.8, add snow's mixed_vel idea for other bodies
This commit is contained in:
parent
f1a991fa09
commit
9d82b20891
@ -1,8 +1,8 @@
|
||||
Shockwave(
|
||||
energy_cost: 0,
|
||||
buildup_duration: 1.5,
|
||||
swing_duration: 0.15,
|
||||
recover_duration: 1.8,
|
||||
buildup_duration: 0.6,
|
||||
swing_duration: 0.12,
|
||||
recover_duration: 1.2,
|
||||
damage: 500,
|
||||
poise_damage: 50,
|
||||
knockback: (strength: 40.0, direction: TowardsUp),
|
||||
|
@ -54,12 +54,9 @@ impl Body {
|
||||
pub fn mass(&self) -> Mass { Mass((self.hull_vol() + self.balloon_vol()) * self.density().0) }
|
||||
}
|
||||
|
||||
/// Terrain is 11.0 scale relative to small-scale voxels, and all figures get
|
||||
/// multiplied by 0.8 in rendering. For now, have a constant in `comp::Scale`
|
||||
/// that compensates for both of these, but there might be a more elegant way
|
||||
/// (e.g. using `Scale(0.8)` for everything else and not having a magic number
|
||||
/// in figure rendering, and multiplying terrain models by 11.0 in animation).
|
||||
pub const AIRSHIP_SCALE: f32 = 11.0 / 0.8;
|
||||
/// Terrain is 11.0 scale relative to small-scale voxels,
|
||||
/// airship scale is multiplied by 11 to reach terrain scale.
|
||||
pub const AIRSHIP_SCALE: f32 = 11.0;
|
||||
|
||||
/// Duplicate of some of the things defined in `voxygen::scene::figure::load` to
|
||||
/// avoid having to refactor all of that to `common` for using voxels as
|
||||
|
@ -356,23 +356,23 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Redoni, _) => (5.0, 5.0, -12.5),
|
||||
},
|
||||
scaler: match (body.species, body.body_type) {
|
||||
(Ogre, Male) => 1.4,
|
||||
(Ogre, Female) => 1.4,
|
||||
(Cyclops, _) => 1.6,
|
||||
(Wendigo, _) => 1.2,
|
||||
(Troll, _) => 1.3,
|
||||
(Dullahan, _) => 1.4,
|
||||
(Werewolf, _) => 1.2,
|
||||
(Occultsaurok, _) => 1.2,
|
||||
(Mightysaurok, _) => 1.2,
|
||||
(Slysaurok, _) => 1.2,
|
||||
(Ogre, Male) => 1.12,
|
||||
(Ogre, Female) => 1.12,
|
||||
(Cyclops, _) => 1.28,
|
||||
(Wendigo, _) => 1.1,
|
||||
(Troll, _) => 1.1,
|
||||
(Dullahan, _) => 1.12,
|
||||
(Werewolf, _) => 1.0,
|
||||
(Occultsaurok, _) => 1.0,
|
||||
(Mightysaurok, _) => 1.0,
|
||||
(Slysaurok, _) => 1.0,
|
||||
(Mindflayer, _) => 1.5,
|
||||
(Minotaur, _) => 2.0,
|
||||
(Tidalwarrior, _) => 2.0,
|
||||
(Yeti, _) => 1.5,
|
||||
(Harvester, _) => 1.5,
|
||||
(Blueoni, _) => 1.5,
|
||||
(Redoni, _) => 1.5,
|
||||
(Minotaur, _) => 1.7,
|
||||
(Tidalwarrior, _) => 1.7,
|
||||
(Yeti, _) => 1.2,
|
||||
(Harvester, _) => 1.2,
|
||||
(Blueoni, _) => 1.2,
|
||||
(Redoni, _) => 1.2,
|
||||
},
|
||||
tempo: match (body.species, body.body_type) {
|
||||
(Ogre, Male) => 0.9,
|
||||
|
@ -201,17 +201,17 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Husk, _) => (0.0, 0.0, 8.0),
|
||||
},
|
||||
scaler: match (body.species, body.body_type) {
|
||||
(Gnome, _) => 1.0,
|
||||
(Sahagin, _) => 1.3,
|
||||
(Adlet, _) => 1.2,
|
||||
(Gnarling, _) => 1.0,
|
||||
(Mandragora, _) => 1.0,
|
||||
(Kappa, _) => 1.0,
|
||||
(Cactid, _) => 1.0,
|
||||
(Gnoll, _) => 1.0,
|
||||
(Haniwa, _) => 1.4,
|
||||
(Myrmidon, _) => 1.5,
|
||||
(Husk, _) => 1.4,
|
||||
(Gnome, _) => 0.8,
|
||||
(Sahagin, _) => 1.05,
|
||||
(Adlet, _) => 1.0,
|
||||
(Gnarling, _) => 0.8,
|
||||
(Mandragora, _) => 0.8,
|
||||
(Kappa, _) => 0.8,
|
||||
(Cactid, _) => 0.8,
|
||||
(Gnoll, _) => 0.8,
|
||||
(Haniwa, _) => 1.12,
|
||||
(Myrmidon, _) => 1.24,
|
||||
(Husk, _) => 1.12,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -216,18 +216,18 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
Self {
|
||||
scaler: match (body.species, body.body_type) {
|
||||
// TODO : Derive scale from body proportions
|
||||
(Orc, Male) => 1.14,
|
||||
(Orc, Female) => 1.02,
|
||||
(Human, Male) => 1.02,
|
||||
(Human, Female) => 0.96,
|
||||
(Elf, Male) => 1.02,
|
||||
(Elf, Female) => 0.96,
|
||||
(Dwarf, Male) => 0.84,
|
||||
(Dwarf, Female) => 0.78,
|
||||
(Undead, Male) => 0.96,
|
||||
(Undead, Female) => 0.9,
|
||||
(Danari, Male) => 0.70,
|
||||
(Danari, Female) => 0.70,
|
||||
(Orc, Male) => 0.91,
|
||||
(Orc, Female) => 0.81,
|
||||
(Human, Male) => 0.81,
|
||||
(Human, Female) => 0.76,
|
||||
(Elf, Male) => 0.82,
|
||||
(Elf, Female) => 0.76,
|
||||
(Dwarf, Male) => 0.67,
|
||||
(Dwarf, Female) => 0.62,
|
||||
(Undead, Male) => 0.78,
|
||||
(Undead, Female) => 0.72,
|
||||
(Danari, Male) => 0.56,
|
||||
(Danari, Female) => 0.56,
|
||||
},
|
||||
head_scale: match (body.species, body.body_type) {
|
||||
(Orc, Male) => 0.9,
|
||||
|
@ -161,7 +161,7 @@ impl Animation for RunAnimation {
|
||||
next.foot_l.position = Vec3::new(
|
||||
-s_a.foot.0 + footstrafel * sideabs * 3.0 + tilt * -2.0,
|
||||
s_a.foot.1
|
||||
+ (1.0 - sideabs) * (-1.5 * speednorm + foothoril * -10.5 * speednorm)
|
||||
+ (1.0 - sideabs) * (-0.5 * speednorm + foothoril * -7.5 * speednorm)
|
||||
+ (direction * 5.0).max(0.0),
|
||||
s_a.foot.2
|
||||
+ (1.0 - sideabs) * (2.0 * speednorm + ((footvertl * -2.1 * speednorm).max(-1.0)))
|
||||
@ -176,7 +176,7 @@ impl Animation for RunAnimation {
|
||||
next.foot_r.position = Vec3::new(
|
||||
s_a.foot.0 + footstrafer * sideabs * 3.0 + tilt * -2.0,
|
||||
s_a.foot.1
|
||||
+ (1.0 - sideabs) * (-1.5 * speednorm + foothorir * -10.5 * speednorm)
|
||||
+ (1.0 - sideabs) * (-0.5 * speednorm + foothorir * -7.5 * speednorm)
|
||||
+ (direction * 5.0).max(0.0),
|
||||
s_a.foot.2
|
||||
+ (1.0 - sideabs) * (2.0 * speednorm + ((footvertr * -2.1 * speednorm).max(-1.0)))
|
||||
|
@ -140,7 +140,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
shoulder: match (body.species, body.body_type) {
|
||||
(StoneGolem, _) => (8.0, -1.5, 4.0),
|
||||
(Treant, _) => (8.0, 4.5, -3.0),
|
||||
(ClayGolem, _) => (8.0, 4.5, 3.0),
|
||||
(ClayGolem, _) => (8.0, 2.0, 3.0),
|
||||
},
|
||||
hand: match (body.species, body.body_type) {
|
||||
(StoneGolem, _) => (12.5, -1.0, -7.0),
|
||||
@ -158,9 +158,9 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(ClayGolem, _) => (3.5, -1.0, -8.5),
|
||||
},
|
||||
scaler: match (body.species, body.body_type) {
|
||||
(StoneGolem, _) => 1.8,
|
||||
(Treant, _) => 1.8,
|
||||
(ClayGolem, _) => 1.8,
|
||||
(StoneGolem, _) => 1.5,
|
||||
(Treant, _) => 1.5,
|
||||
(ClayGolem, _) => 1.5,
|
||||
},
|
||||
tempo: match (body.species, body.body_type) {
|
||||
(StoneGolem, _) => 1.0,
|
||||
|
@ -18,38 +18,39 @@ impl Animation for RunAnimation {
|
||||
fn update_skeleton_inner(
|
||||
skeleton: &Self::Skeleton,
|
||||
(velocity, orientation, last_ori, _global_time, acc_vel): Self::Dependency,
|
||||
_anim_time: f32,
|
||||
anim_time: f32,
|
||||
_rate: &mut f32,
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
let speed = Vec2::<f32>::from(velocity).magnitude();
|
||||
let mixed_vel = acc_vel + anim_time * 2.0;
|
||||
|
||||
let lab: f32 = 0.45 * s_a.tempo;
|
||||
let speednorm = (speed / 7.0).powf(0.6);
|
||||
let foothoril = ((1.0 / (0.4 + (0.6) * ((acc_vel * 2.0 * lab + PI * 1.4).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * 2.0 * lab + PI * 1.4).sin())
|
||||
* speednorm;
|
||||
let foothorir = ((1.0 / (0.4 + (0.6) * ((acc_vel * 2.0 * lab + PI * 0.4).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * 2.0 * lab + PI * 0.4).sin())
|
||||
* speednorm;
|
||||
let footvertl = (acc_vel * 2.0 * lab).sin() * speednorm;
|
||||
let footvertr = (acc_vel * 2.0 * lab + PI).sin() * speednorm;
|
||||
let foothoril =
|
||||
((1.0 / (0.4 + (0.6) * ((mixed_vel * 2.0 * lab + PI * 1.4).sin()).powi(2))).sqrt())
|
||||
* ((mixed_vel * 2.0 * lab + PI * 1.4).sin())
|
||||
* speednorm;
|
||||
let foothorir =
|
||||
((1.0 / (0.4 + (0.6) * ((mixed_vel * 2.0 * lab + PI * 0.4).sin()).powi(2))).sqrt())
|
||||
* ((mixed_vel * 2.0 * lab + PI * 0.4).sin())
|
||||
* speednorm;
|
||||
let footvertl = (mixed_vel * 2.0 * lab).sin() * speednorm;
|
||||
let footvertr = (mixed_vel * 2.0 * lab + PI).sin() * speednorm;
|
||||
|
||||
let footrotl = ((1.0 / (0.5 + (0.5) * ((acc_vel * 2.0 * lab + PI * 1.4).sin()).powi(2)))
|
||||
let footrotl = ((1.0 / (0.5 + (0.5) * ((mixed_vel * 2.0 * lab + PI * 1.4).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * 2.0 * lab + PI * 1.4).sin())
|
||||
* ((mixed_vel * 2.0 * lab + PI * 1.4).sin())
|
||||
* speednorm;
|
||||
|
||||
let footrotr = ((1.0 / (0.2 + (0.8) * ((acc_vel * 2.0 * lab + PI * 0.4).sin()).powi(2)))
|
||||
let footrotr = ((1.0 / (0.2 + (0.8) * ((mixed_vel * 2.0 * lab + PI * 0.4).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * 2.0 * lab + PI * 0.4).sin())
|
||||
* ((mixed_vel * 2.0 * lab + PI * 0.4).sin())
|
||||
* speednorm;
|
||||
|
||||
let short = (acc_vel * lab * 2.0).sin() * speednorm;
|
||||
let shortalt = (acc_vel * lab * 2.0 + PI / 2.0).sin() * speednorm;
|
||||
let short = (mixed_vel * lab * 2.0).sin() * speednorm;
|
||||
let shortalt = (mixed_vel * lab * 2.0 + PI / 2.0).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)
|
||||
|
@ -258,18 +258,18 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
_ => (0.0, 1.0),
|
||||
},
|
||||
scaler: match (body.species, body.body_type) {
|
||||
(Crocodile, _) => (1.3),
|
||||
(Alligator, _) => (1.4),
|
||||
(Salamander, _) => (1.4),
|
||||
(Monitor, _) => (1.1),
|
||||
(Asp, _) => (1.4),
|
||||
(Rocksnapper, _) => (1.4),
|
||||
(Hakulaq, _) => (1.3),
|
||||
(Pangolin, _) => (1.3),
|
||||
(Maneater, _) => (1.4),
|
||||
(Lavadrake, _) => (1.4),
|
||||
(Basilisk, _) => (1.6),
|
||||
_ => (1.0),
|
||||
(Crocodile, _) => (1.05),
|
||||
(Alligator, _) => (1.12),
|
||||
(Salamander, _) => (1.12),
|
||||
(Monitor, _) => (0.9),
|
||||
(Asp, _) => (1.12),
|
||||
(Rocksnapper, _) => (1.12),
|
||||
(Hakulaq, _) => (1.05),
|
||||
(Pangolin, _) => (1.05),
|
||||
(Maneater, _) => (1.12),
|
||||
(Lavadrake, _) => (1.12),
|
||||
(Basilisk, _) => (1.3),
|
||||
_ => (0.9),
|
||||
},
|
||||
tempo: match (body.species, body.body_type) {
|
||||
(Crocodile, _) => (0.7),
|
||||
|
@ -17,7 +17,7 @@ impl Animation for RunAnimation {
|
||||
fn update_skeleton_inner(
|
||||
skeleton: &Self::Skeleton,
|
||||
(velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency,
|
||||
_anim_time: f32,
|
||||
anim_time: f32,
|
||||
_rate: &mut f32,
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
@ -25,39 +25,40 @@ impl Animation for RunAnimation {
|
||||
let speed = (Vec2::<f32>::from(velocity).magnitude()).min(15.0);
|
||||
|
||||
let speednorm = (speed / 15.0).powf(0.25);
|
||||
let mixed_vel = acc_vel + anim_time * 6.0;
|
||||
|
||||
let lab: f32 = 0.8 * s_a.tempo;
|
||||
let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude()).max(-0.7) * speednorm;
|
||||
|
||||
let short = ((1.0 / (0.72 + 0.28 * ((acc_vel * lab + PI * 0.25).sin()).powi(2))).sqrt())
|
||||
* ((acc_vel * lab + PI * 0.25).sin())
|
||||
let short = ((1.0 / (0.72 + 0.28 * ((mixed_vel * lab + PI * 0.25).sin()).powi(2))).sqrt())
|
||||
* ((mixed_vel * lab + PI * 0.25).sin())
|
||||
* speednorm;
|
||||
let shortalt = (acc_vel * lab + PI * 0.25).sin();
|
||||
let shortalt = (mixed_vel * lab + PI * 0.25).sin();
|
||||
|
||||
let foothoril = ((1.0 / (0.4 + (0.6) * ((acc_vel * lab + PI * 1.45).sin()).powi(2)))
|
||||
let foothoril = ((1.0 / (0.4 + (0.6) * ((mixed_vel * lab + PI * 1.45).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * lab + PI * 1.45).sin())
|
||||
* ((mixed_vel * lab + PI * 1.45).sin())
|
||||
* speednorm;
|
||||
let footvertl = (acc_vel * lab + PI * 0.0).sin() * speednorm;
|
||||
let footvertl = (mixed_vel * lab + PI * 0.0).sin() * speednorm;
|
||||
|
||||
let foothorir = ((1.0 / (0.4 + (0.6) * ((acc_vel * lab + PI * 0.45).sin()).powi(2)))
|
||||
let foothorir = ((1.0 / (0.4 + (0.6) * ((mixed_vel * lab + PI * 0.45).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * lab + PI * 0.45).sin())
|
||||
* ((mixed_vel * lab + PI * 0.45).sin())
|
||||
* speednorm;
|
||||
let footvertr = (acc_vel * lab + PI).sin() * speednorm;
|
||||
let footvertr = (mixed_vel * lab + PI).sin() * speednorm;
|
||||
|
||||
//back feet
|
||||
let foothorilb = ((1.0 / (0.4 + (0.6) * ((acc_vel * lab + PI * 1.05).sin()).powi(2)))
|
||||
let foothorilb = ((1.0 / (0.4 + (0.6) * ((mixed_vel * lab + PI * 1.05).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * lab + PI * 1.05).sin())
|
||||
* ((mixed_vel * lab + PI * 1.05).sin())
|
||||
* speednorm;
|
||||
let footvertlb = (acc_vel * lab + PI * (-0.4)).sin() * speednorm;
|
||||
let footvertlb = (mixed_vel * lab + PI * (-0.4)).sin() * speednorm;
|
||||
|
||||
let foothorirb = ((1.0 / (0.4 + (0.6) * ((acc_vel * lab + PI * 0.05).sin()).powi(2)))
|
||||
let foothorirb = ((1.0 / (0.4 + (0.6) * ((mixed_vel * lab + PI * 0.05).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * lab + PI * 0.05).sin())
|
||||
* ((mixed_vel * lab + PI * 0.05).sin())
|
||||
* speednorm;
|
||||
let footvertrb = (acc_vel * lab + PI * 0.6).sin() * speednorm;
|
||||
let footvertrb = (mixed_vel * lab + PI * 0.6).sin() * speednorm;
|
||||
|
||||
let ori: Vec2<f32> = Vec2::from(orientation);
|
||||
let last_ori = Vec2::from(last_ori);
|
||||
|
@ -509,29 +509,29 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Snowleopard, _) => (0.5, 0.5, -5.5),
|
||||
},
|
||||
scaler: match (body.species, body.body_type) {
|
||||
(Grolgar, _) => (1.3),
|
||||
(Saber, _) => (1.1),
|
||||
(Tuskram, _) => (1.2),
|
||||
(Lion, _) => (1.3),
|
||||
(Tarasque, _) => (1.3),
|
||||
(Tiger, _) => (1.2),
|
||||
(Catoblepas, _) => (1.3),
|
||||
(Roshwalr, _) => (1.3),
|
||||
(Barghest, _) => (1.5),
|
||||
(Antelope, _) => (1.2),
|
||||
(Kelpie, _) => (1.35),
|
||||
(Donkey, _) => (1.2),
|
||||
(Horse, _) => (1.42),
|
||||
(Zebra, _) => (1.3),
|
||||
(Cattle, _) => (1.5),
|
||||
(Highland, _) => (1.6),
|
||||
(Bear, _) => (1.7),
|
||||
(Yak, _) => (1.7),
|
||||
(Camel, _) => (1.42),
|
||||
(Dreadhorn, _) => (2.0),
|
||||
(Moose, _) => (1.2),
|
||||
(Snowleopard, _) => (1.2),
|
||||
_ => (1.0),
|
||||
(Grolgar, _) => (1.05),
|
||||
(Saber, _) => (0.9),
|
||||
(Tuskram, _) => (0.95),
|
||||
(Lion, _) => (1.05),
|
||||
(Tarasque, _) => (1.05),
|
||||
(Tiger, _) => (0.95),
|
||||
(Catoblepas, _) => (1.05),
|
||||
(Roshwalr, _) => (1.05),
|
||||
(Barghest, _) => (1.2),
|
||||
(Antelope, _) => (0.95),
|
||||
(Kelpie, _) => (1.1),
|
||||
(Donkey, _) => (0.95),
|
||||
(Horse, _) => (1.2),
|
||||
(Zebra, _) => (1.05),
|
||||
(Cattle, _) => (1.25),
|
||||
(Highland, _) => (1.32),
|
||||
(Bear, _) => (1.4),
|
||||
(Yak, _) => (1.4),
|
||||
(Camel, _) => (1.15),
|
||||
(Dreadhorn, _) => (1.6),
|
||||
(Moose, _) => (0.95),
|
||||
(Snowleopard, _) => (0.95),
|
||||
_ => (0.9),
|
||||
},
|
||||
startangle: match (body.species, body.body_type) {
|
||||
//changes the default angle of front feet
|
||||
|
@ -30,15 +30,17 @@ impl Animation for RunAnimation {
|
||||
let amplitude3 = (speed / 24.0).powf(0.6);
|
||||
let speedmult = s_a.tempo;
|
||||
let canceler = (speed / 24.0).powf(0.6);
|
||||
let mixed_vel = acc_vel + anim_time * 2.5;
|
||||
|
||||
let short = ((1.0
|
||||
/ (0.72
|
||||
+ 0.28 * ((acc_vel * (1.0) * lab * speedmult + PI * -0.15 - 0.5).sin()).powi(2)))
|
||||
+ 0.28
|
||||
* ((mixed_vel * (1.0) * lab * speedmult + PI * -0.15 - 0.5).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * (1.0) * lab * speedmult + PI * -0.15 - 0.5).sin());
|
||||
* ((mixed_vel * (1.0) * lab * speedmult + PI * -0.15 - 0.5).sin());
|
||||
|
||||
//
|
||||
let shortalt = (acc_vel * (1.0) * lab * speedmult + PI * 3.0 / 8.0 - 0.5).sin();
|
||||
let shortalt = (mixed_vel * (1.0) * lab * speedmult + PI * 3.0 / 8.0 - 0.5).sin();
|
||||
let look = Vec2::new(
|
||||
(global_time / 2.0 + anim_time / 2.0)
|
||||
.floor()
|
||||
@ -59,17 +61,17 @@ impl Animation for RunAnimation {
|
||||
let shift4 = speedadjust - PI * 3.0 / 4.0 + speedadjust * PI / 2.0;
|
||||
|
||||
//FL
|
||||
let foot1a = (acc_vel * (1.0) * lab * speedmult + 0.0 + canceler * 0.05 + shift1).sin(); //1.5
|
||||
let foot1b = (acc_vel * (1.0) * lab * speedmult + 1.1 + canceler * 0.05 + shift1).sin(); //1.9
|
||||
let foot1a = (mixed_vel * (1.0) * lab * speedmult + 0.0 + canceler * 0.05 + shift1).sin(); //1.5
|
||||
let foot1b = (mixed_vel * (1.0) * lab * speedmult + 1.1 + canceler * 0.05 + shift1).sin(); //1.9
|
||||
//FR
|
||||
let foot2a = (acc_vel * (1.0) * lab * speedmult + shift2).sin(); //1.0
|
||||
let foot2b = (acc_vel * (1.0) * lab * speedmult + 1.1 + shift2).sin(); //1.0
|
||||
let foot2a = (mixed_vel * (1.0) * lab * speedmult + shift2).sin(); //1.0
|
||||
let foot2b = (mixed_vel * (1.0) * lab * speedmult + 1.1 + shift2).sin(); //1.0
|
||||
//BL
|
||||
let foot3a = (acc_vel * (1.0) * lab * speedmult + shift3).sin(); //0.0
|
||||
let foot3b = (acc_vel * (1.0) * lab * speedmult + 1.57 + shift3).sin(); //0.4
|
||||
let foot3a = (mixed_vel * (1.0) * lab * speedmult + shift3).sin(); //0.0
|
||||
let foot3b = (mixed_vel * (1.0) * lab * speedmult + 1.57 + shift3).sin(); //0.4
|
||||
//BR
|
||||
let foot4a = (acc_vel * (1.0) * lab * speedmult + 0.0 + canceler * 0.05 + shift4).sin(); //0.3
|
||||
let foot4b = (acc_vel * (1.0) * lab * speedmult + 1.57 + canceler * 0.05 + shift4).sin(); //0.7
|
||||
let foot4a = (mixed_vel * (1.0) * lab * speedmult + 0.0 + canceler * 0.05 + shift4).sin(); //0.3
|
||||
let foot4b = (mixed_vel * (1.0) * lab * speedmult + 1.57 + canceler * 0.05 + shift4).sin(); //0.7
|
||||
//
|
||||
let ori: Vec2<f32> = Vec2::from(orientation);
|
||||
let last_ori = Vec2::from(last_ori);
|
||||
@ -100,7 +102,7 @@ impl Animation for RunAnimation {
|
||||
next.ears.scale = Vec3::one() * 1.02;
|
||||
|
||||
//Gallop
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + shortalt * -0.5);
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + shortalt * -0.2);
|
||||
next.head.orientation = Quaternion::rotation_x(
|
||||
look.y * 0.3 / ((canceler).max(0.5)) + amplitude * short * 0.05 - 0.1,
|
||||
) * Quaternion::rotation_z(
|
||||
@ -151,20 +153,18 @@ impl Animation for RunAnimation {
|
||||
s_a.leg_f.1 + amplitude3 * foot1b * -1.6,
|
||||
s_a.leg_f.2 + amplitude3 * foot1a * 2.3,
|
||||
);
|
||||
next.leg_fl.orientation =
|
||||
Quaternion::rotation_x(0.2 * canceler + amplitude3 * foot1a * 0.85)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
next.leg_fl.orientation = Quaternion::rotation_x(0.2 * canceler + amplitude3 * foot1a)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
|
||||
next.leg_fr.position = Vec3::new(
|
||||
s_a.leg_f.0,
|
||||
s_a.leg_f.1 + amplitude3 * foot2b * -1.6,
|
||||
s_a.leg_f.2 + amplitude3 * foot2a * 2.3,
|
||||
);
|
||||
next.leg_fr.orientation =
|
||||
Quaternion::rotation_x(0.2 * canceler + amplitude3 * foot2a * 0.85)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
next.leg_fr.orientation = Quaternion::rotation_x(0.2 * canceler + amplitude3 * foot2a)
|
||||
* Quaternion::rotation_z(tilt * -0.5)
|
||||
* Quaternion::rotation_y(tilt * 1.5);
|
||||
|
||||
next.leg_bl.position = Vec3::new(
|
||||
-s_a.leg_b.0,
|
||||
@ -192,7 +192,7 @@ impl Animation for RunAnimation {
|
||||
s_a.feet_f.2 + (foot1a * 2.0).max(-1.0) * amplitude2 + 1.0 * canceler,
|
||||
);
|
||||
next.foot_fl.orientation =
|
||||
Quaternion::rotation_x(s_a.startangle * canceler + amplitude2 * foot1b * -0.7)
|
||||
Quaternion::rotation_x(s_a.startangle * canceler + amplitude2 * foot1b * -0.85)
|
||||
* Quaternion::rotation_y(tilt * -1.0);
|
||||
|
||||
next.foot_fr.position = Vec3::new(
|
||||
@ -201,7 +201,7 @@ impl Animation for RunAnimation {
|
||||
s_a.feet_f.2 + (foot2a * 2.0).max(-1.0) * amplitude2 + 1.0 * canceler,
|
||||
);
|
||||
next.foot_fr.orientation =
|
||||
Quaternion::rotation_x(s_a.startangle * canceler + amplitude2 * foot2b * -0.7)
|
||||
Quaternion::rotation_x(s_a.startangle * canceler + amplitude2 * foot2b * -0.85)
|
||||
* Quaternion::rotation_y(tilt * -1.0);
|
||||
|
||||
next.foot_bl.position = Vec3::new(
|
||||
|
@ -255,26 +255,26 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Goat, _) => (-7.0, 0.0),
|
||||
},
|
||||
scaler: match (body.species, body.body_type) {
|
||||
(Pig, _) => (0.9),
|
||||
(Fox, _) => (0.9),
|
||||
(Boar, _) => (1.1),
|
||||
(Jackalope, _) => (0.8),
|
||||
(Skunk, _) => (0.9),
|
||||
(Cat, _) => (0.8),
|
||||
(Batfox, _) => (1.1),
|
||||
(Dodarock, _) => (1.2),
|
||||
(Holladon, _) => (1.4),
|
||||
(Rabbit, _) => (0.7),
|
||||
(Frog, _) => (0.7),
|
||||
(Rat, _) => (0.65),
|
||||
(Axolotl, _) => (0.65),
|
||||
(Gecko, _) => (0.7),
|
||||
(Turtle, _) => (0.9),
|
||||
(Squirrel, _) => (0.6),
|
||||
(Fungome, _) => (0.9),
|
||||
(Porcupine, _) => (0.8),
|
||||
(Hare, _) => (0.8),
|
||||
_ => (1.0),
|
||||
(Pig, _) => (0.72),
|
||||
(Fox, _) => (0.72),
|
||||
(Boar, _) => (0.95),
|
||||
(Jackalope, _) => (0.67),
|
||||
(Skunk, _) => (0.72),
|
||||
(Cat, _) => (0.67),
|
||||
(Batfox, _) => (0.9),
|
||||
(Dodarock, _) => (0.95),
|
||||
(Holladon, _) => (1.12),
|
||||
(Rabbit, _) => (0.56),
|
||||
(Frog, _) => (0.56),
|
||||
(Rat, _) => (0.5),
|
||||
(Axolotl, _) => (0.5),
|
||||
(Gecko, _) => (0.56),
|
||||
(Turtle, _) => (0.67),
|
||||
(Squirrel, _) => (0.4),
|
||||
(Fungome, _) => (0.72),
|
||||
(Porcupine, _) => (0.65),
|
||||
(Hare, _) => (0.65),
|
||||
_ => (0.8),
|
||||
},
|
||||
tempo: match (body.species, body.body_type) {
|
||||
(Boar, _) => (1.1),
|
||||
|
@ -223,14 +223,14 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Ntouka, _) => (1.5, -1.0, -2.5),
|
||||
},
|
||||
scaler: match (body.species, body.body_type) {
|
||||
(Archaeos, _) => (3.0),
|
||||
(Odonto, _) => (3.0),
|
||||
(Sandraptor, _) => (8.0),
|
||||
(Snowraptor, _) => (8.0),
|
||||
(Woodraptor, _) => (8.0),
|
||||
(Sunlizard, _) => (8.0),
|
||||
(Yale, _) => (7.0),
|
||||
(Ntouka, _) => (3.0),
|
||||
(Archaeos, _) => (3.75),
|
||||
(Odonto, _) => (3.75),
|
||||
(Sandraptor, _) => (10.0),
|
||||
(Snowraptor, _) => (10.0),
|
||||
(Woodraptor, _) => (10.0),
|
||||
(Sunlizard, _) => (10.0),
|
||||
(Yale, _) => (8.75),
|
||||
(Ntouka, _) => (3.75),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ impl Animation for RunAnimation {
|
||||
fn update_skeleton_inner(
|
||||
skeleton: &Self::Skeleton,
|
||||
(velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency,
|
||||
_anim_time: f32,
|
||||
anim_time: f32,
|
||||
rate: &mut f32,
|
||||
s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
@ -26,26 +26,27 @@ 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;
|
||||
|
||||
let speedmult = 1.0;
|
||||
let lab: f32 = 0.6; //6
|
||||
|
||||
let short = ((1.0
|
||||
/ (0.72
|
||||
+ 0.28 * ((acc_vel * 1.0 * lab * speedmult + PI * -0.15 - 0.5).sin()).powi(2)))
|
||||
+ 0.28 * ((mixed_vel * 1.0 * lab * speedmult + PI * -0.15 - 0.5).sin()).powi(2)))
|
||||
.sqrt())
|
||||
* ((acc_vel * 1.0 * lab * speedmult + PI * -0.15 - 0.5).sin())
|
||||
* ((mixed_vel * 1.0 * lab * speedmult + PI * -0.15 - 0.5).sin())
|
||||
* speednorm;
|
||||
|
||||
//
|
||||
let shortalt = (acc_vel * 1.0 * lab * speedmult + PI * 3.0 / 8.0 - 0.5).sin() * speednorm;
|
||||
let shortalt = (mixed_vel * 1.0 * lab * speedmult + PI * 3.0 / 8.0 - 0.5).sin() * speednorm;
|
||||
|
||||
//FL
|
||||
let foot1a = (acc_vel * 1.0 * lab * speedmult + 0.0 + PI).sin() * speednorm; //1.5
|
||||
let foot1b = (acc_vel * 1.0 * lab * speedmult + 1.57 + PI).sin() * speednorm; //1.9
|
||||
let foot1a = (mixed_vel * 1.0 * lab * speedmult + 0.0 + PI).sin() * speednorm; //1.5
|
||||
let foot1b = (mixed_vel * 1.0 * lab * speedmult + 1.57 + PI).sin() * speednorm; //1.9
|
||||
//FR
|
||||
let foot2a = (acc_vel * 1.0 * lab * speedmult).sin() * speednorm; //1.2
|
||||
let foot2b = (acc_vel * 1.0 * lab * speedmult + 1.57).sin() * speednorm; //1.6
|
||||
let foot2a = (mixed_vel * 1.0 * lab * speedmult).sin() * speednorm; //1.2
|
||||
let foot2b = (mixed_vel * 1.0 * lab * speedmult + 1.57).sin() * speednorm; //1.6
|
||||
let ori: Vec2<f32> = Vec2::from(orientation);
|
||||
let last_ori = Vec2::from(last_ori);
|
||||
let tilt = if ::vek::Vec2::new(ori, last_ori)
|
||||
|
@ -5101,8 +5101,7 @@ impl<S: Skeleton> FigureState<S> {
|
||||
self.state_time += dt * state_animation_rate;
|
||||
|
||||
let mat = {
|
||||
anim::vek::Mat4::from(ori)
|
||||
* anim::vek::Mat4::scaling_3d(anim::vek::Vec3::from(0.8 * scale))
|
||||
anim::vek::Mat4::from(ori) * anim::vek::Mat4::scaling_3d(anim::vek::Vec3::from(scale))
|
||||
};
|
||||
|
||||
let atlas_offs = model.allocation.rectangle.min;
|
||||
|
Loading…
Reference in New Issue
Block a user