Skeleton rework with rough offsets

This commit is contained in:
Snowram 2020-07-25 01:30:08 +02:00 committed by jshipsey
parent 830fa3e9e0
commit a0da059676
11 changed files with 141 additions and 140 deletions

View File

@ -8,7 +8,7 @@ edition = "2018"
name = "voxygen_anim"
# Uncomment to use animation hot reloading
# Note: this breaks `cargo test`
# crate-type = ["lib", "cdylib"]
crate-type = ["lib", "cdylib"]
[features]
use-dyn-lib = ["libloading", "notify", "lazy_static", "tracing", "find_folder"]

View File

@ -37,10 +37,10 @@ impl Animation for IdleAnimation {
.sin()
* 0.25,
);
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) / 18.0;
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1);
next.head.ori = Quaternion::rotation_z(rat_head_look.x)
* Quaternion::rotation_x(rat_head_look.y + wave * 0.03);
next.head.scale = Vec3::one() / 18.0;
next.head.scale = Vec3::one();
next.chest.offset = Vec3::new(
0.0,
@ -50,18 +50,18 @@ impl Animation for IdleAnimation {
next.chest.ori = Quaternion::rotation_y(wave_slow * 0.06);
next.chest.scale = Vec3::one() / 18.0;
next.feet_f.offset = Vec3::new(0.0, skeleton_attr.feet_f.0, skeleton_attr.feet_f.1) / 18.0;
next.feet_f.offset = Vec3::new(0.0, skeleton_attr.feet_f.0, skeleton_attr.feet_f.1 + 3.0);
next.feet_f.ori = Quaternion::rotation_z(0.0);
next.feet_f.scale = Vec3::one() / 18.0;
next.feet_f.scale = Vec3::one();
next.feet_b.offset = Vec3::new(0.0, skeleton_attr.feet_b.0, skeleton_attr.feet_b.1) / 18.0;
next.feet_b.offset = Vec3::new(0.0, skeleton_attr.feet_b.0, skeleton_attr.feet_b.1 + 3.0);
next.feet_b.ori = Quaternion::rotation_x(0.0);
next.feet_b.scale = Vec3::one() / 18.0;
next.feet_b.scale = Vec3::one();
next.tail.offset =
Vec3::new(0.0, skeleton_attr.tail.0 + wave * 0.2, skeleton_attr.tail.1) / 18.0;
Vec3::new(0.0, skeleton_attr.tail.0 + wave * 0.2, skeleton_attr.tail.1);
next.tail.ori = Quaternion::rotation_y(wave_slow * 0.05);
next.tail.scale = Vec3::one() / 18.0;
next.tail.scale = Vec3::one();
next
}

View File

@ -21,25 +21,25 @@ impl Animation for JumpAnimation {
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) / 18.0;
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1);
next.head.ori = Quaternion::rotation_z(0.8) * Quaternion::rotation_x(0.5);
next.head.scale = Vec3::one() / 18.0;
next.head.scale = Vec3::one();
next.chest.offset = Vec3::new(0.0, skeleton_attr.chest.0, skeleton_attr.chest.1) / 18.0;
next.chest.ori = Quaternion::rotation_y(0.0);
next.chest.scale = Vec3::one() / 18.0;
next.feet_f.offset = Vec3::new(0.0, skeleton_attr.feet_f.0, skeleton_attr.feet_f.1) / 18.0;
next.feet_f.offset = Vec3::new(0.0, skeleton_attr.feet_f.0, skeleton_attr.feet_f.1);
next.feet_f.ori = Quaternion::rotation_z(0.0);
next.feet_f.scale = Vec3::one() / 18.0;
next.feet_f.scale = Vec3::one();
next.feet_b.offset = Vec3::new(0.0, skeleton_attr.feet_b.0, skeleton_attr.feet_b.1) / 18.0;
next.feet_b.offset = Vec3::new(0.0, skeleton_attr.feet_b.0, skeleton_attr.feet_b.1);
next.feet_b.ori = Quaternion::rotation_x(0.0);
next.feet_b.scale = Vec3::one() / 18.0;
next.feet_b.scale = Vec3::one();
next.tail.offset = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1) / 18.0;
next.tail.offset = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
next.tail.ori = Quaternion::rotation_y(0.0);
next.tail.scale = Vec3::one() / 18.0;
next.tail.scale = Vec3::one();
next
}

View File

@ -40,13 +40,14 @@ impl Skeleton for CritterSkeleton {
#[cfg_attr(feature = "be-dyn-lib", export_name = "critter_compute_mats")]
fn compute_matrices_inner(&self) -> ([FigureBoneData; 16], Vec3<f32>) {
let chest_mat = self.chest.compute_base_matrix();
(
[
FigureBoneData::new(self.head.compute_base_matrix()),
FigureBoneData::new(self.chest.compute_base_matrix()),
FigureBoneData::new(self.feet_f.compute_base_matrix()),
FigureBoneData::new(self.feet_b.compute_base_matrix()),
FigureBoneData::new(self.tail.compute_base_matrix()),
FigureBoneData::new(chest_mat * self.head.compute_base_matrix()),
FigureBoneData::new(chest_mat),
FigureBoneData::new(chest_mat * self.feet_f.compute_base_matrix()),
FigureBoneData::new(chest_mat * self.feet_b.compute_base_matrix()),
FigureBoneData::new(chest_mat * self.tail.compute_base_matrix()),
FigureBoneData::default(),
FigureBoneData::default(),
FigureBoneData::default(),
@ -109,12 +110,12 @@ impl<'a> From<&'a comp::critter::Body> for CritterAttr {
use comp::critter::Species::*;
Self {
head: match (body.species, body.body_type) {
(Rat, _) => (6.5, 7.0),
(Axolotl, _) => (5.0, 5.0),
(Gecko, _) => (5.0, 4.0),
(Turtle, _) => (8.0, 7.0),
(Squirrel, _) => (5.0, 4.0),
(Fungome, _) => (4.0, 4.0),
(Rat, _) => (6.5, 3.0),
(Axolotl, _) => (5.0, 1.0),
(Gecko, _) => (5.0, 0.0),
(Turtle, _) => (8.0, 3.0),
(Squirrel, _) => (5.0, 0.0),
(Fungome, _) => (4.0, 0.0),
},
chest: match (body.species, body.body_type) {
(Rat, _) => (0.0, 6.0),
@ -125,28 +126,28 @@ impl<'a> From<&'a comp::critter::Body> for CritterAttr {
(Fungome, _) => (0.0, 5.0),
},
feet_f: match (body.species, body.body_type) {
(Rat, _) => (2.0, 0.5),
(Axolotl, _) => (2.0, 0.5),
(Gecko, _) => (1.0, 0.5),
(Turtle, _) => (3.0, 0.5),
(Squirrel, _) => (1.0, 0.5),
(Fungome, _) => (1.0, 0.5),
(Rat, _) => (2.0, -5.0),
(Axolotl, _) => (2.0, -5.0),
(Gecko, _) => (1.0, -2.0),
(Turtle, _) => (3.0, -5.0),
(Squirrel, _) => (1.0, -2.0),
(Fungome, _) => (1.0, -4.0),
},
feet_b: match (body.species, body.body_type) {
(Rat, _) => (-2.0, 0.5),
(Axolotl, _) => (-2.0, 0.5),
(Gecko, _) => (-2.0, 0.5),
(Turtle, _) => (-2.0, 0.5),
(Squirrel, _) => (-1.0, 0.5),
(Fungome, _) => (-2.0, 0.5),
(Rat, _) => (-2.0, -5.0),
(Axolotl, _) => (-2.0, -5.0),
(Gecko, _) => (-2.0, -2.0),
(Turtle, _) => (-2.0, -5.0),
(Squirrel, _) => (-1.0, -2.0),
(Fungome, _) => (-2.0, -4.0),
},
tail: match (body.species, body.body_type) {
(Rat, _) => (-8.0, 3.0),
(Axolotl, _) => (-7.0, 3.0),
(Gecko, _) => (-7.0, 2.0),
(Turtle, _) => (-6.0, 4.0),
(Squirrel, _) => (-3.0, 4.0),
(Fungome, _) => (-6.0, 3.0),
(Rat, _) => (-8.0, -1.0),
(Axolotl, _) => (-7.0, -1.0),
(Gecko, _) => (-6.5, -2.0),
(Turtle, _) => (-6.0, 0.0),
(Squirrel, _) => (-3.0, 0.0),
(Fungome, _) => (-6.0, -1.0),
},
}
}

View File

@ -26,9 +26,9 @@ impl Animation for RunAnimation {
let wave_cos = (anim_time as f32 * 13.0).sin();
let wave_slow = (anim_time as f32 * 6.5 + PI).sin();
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) / 18.0;
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1);
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + wave * 0.03);
next.head.scale = Vec3::one() / 18.0;
next.head.scale = Vec3::one();
next.chest.offset = Vec3::new(
0.0,
@ -38,18 +38,18 @@ impl Animation for RunAnimation {
next.chest.ori = Quaternion::rotation_y(wave_slow * 0.3);
next.chest.scale = Vec3::one() / 18.0;
next.feet_f.offset = Vec3::new(0.0, skeleton_attr.feet_f.0, skeleton_attr.feet_f.1) / 18.0;
next.feet_f.offset = Vec3::new(0.0, skeleton_attr.feet_f.0, skeleton_attr.feet_f.1);
next.feet_f.ori = Quaternion::rotation_x(wave * 1.0);
next.feet_f.scale = Vec3::one() / 18.0;
next.feet_f.scale = Vec3::one();
next.feet_b.offset = Vec3::new(0.0, skeleton_attr.feet_b.0, skeleton_attr.feet_b.1) / 18.0;
next.feet_b.offset = Vec3::new(0.0, skeleton_attr.feet_b.0, skeleton_attr.feet_b.1);
next.feet_b.ori = Quaternion::rotation_x(wave_cos * 1.0);
next.feet_b.scale = Vec3::one() / 18.0;
next.feet_b.scale = Vec3::one();
next.tail.offset =
Vec3::new(0.0, skeleton_attr.tail.0 + wave * 1.0, skeleton_attr.tail.1) / 18.0;
Vec3::new(0.0, skeleton_attr.tail.0 + wave * 1.0, skeleton_attr.tail.1);
next.tail.ori = Quaternion::rotation_y(wave_slow * 0.08);
next.tail.scale = Vec3::one() / 18.0;
next.tail.scale = Vec3::one();
next
}

View File

@ -102,7 +102,7 @@ impl Animation for IdleAnimation {
next.wing_out_l.offset = Vec3::new(
-skeleton_attr.wing_out.0,
skeleton_attr.wing_out.1,
skeleton_attr.wing_out.2 - 1.4,
skeleton_attr.wing_out.2,
);
next.wing_out_l.ori = Quaternion::rotation_y(-2.0);
next.wing_out_l.scale = Vec3::one();
@ -110,7 +110,7 @@ impl Animation for IdleAnimation {
next.wing_out_r.offset = Vec3::new(
skeleton_attr.wing_out.0,
skeleton_attr.wing_out.1,
skeleton_attr.wing_out.2 - 1.4,
skeleton_attr.wing_out.2,
);
next.wing_out_r.ori = Quaternion::rotation_y(2.0);
next.wing_out_r.scale = Vec3::one();

View File

@ -77,10 +77,10 @@ impl Skeleton for DragonSkeleton {
FigureBoneData::new(
chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix(),
),
FigureBoneData::new(self.foot_fl.compute_base_matrix()),
FigureBoneData::new(self.foot_fr.compute_base_matrix()),
FigureBoneData::new(self.foot_bl.compute_base_matrix()),
FigureBoneData::new(self.foot_br.compute_base_matrix()),
FigureBoneData::new(chest_front_mat * self.foot_fl.compute_base_matrix()),
FigureBoneData::new(chest_front_mat * self.foot_fr.compute_base_matrix()),
FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix() * self.foot_bl.compute_base_matrix()),
FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix() * self.foot_br.compute_base_matrix()),
FigureBoneData::default(),
],
Vec3::default(),
@ -165,7 +165,7 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr {
(Reddragon, _) => (6.5, -5.0),
},
chest_front: match (body.species, body.body_type) {
(Reddragon, _) => (0.0, 14.0),
(Reddragon, _) => (0.0, 15.0),
},
chest_rear: match (body.species, body.body_type) {
(Reddragon, _) => (-12.5, 0.0),
@ -183,10 +183,10 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr {
(Reddragon, _) => (23.0, 0.5, 4.0),
},
feet_f: match (body.species, body.body_type) {
(Reddragon, _) => (6.0, 0.0, 1.5),
(Reddragon, _) => (6.0, 1.0, -13.0),
},
feet_b: match (body.species, body.body_type) {
(Reddragon, _) => (6.0, -15.0, 3.0),
(Reddragon, _) => (6.0, -2.0, -10.5),
},
height: match (body.species, body.body_type) {
(Reddragon, _) => (1.0),

View File

@ -40,10 +40,10 @@ impl Animation for IdleAnimation {
);
next.head.offset =
Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + slow * 0.2) / 11.0;
Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + slow * 0.2);
next.head.ori = Quaternion::rotation_z(head_look.x)
* Quaternion::rotation_x(head_look.y + slow_alt * 0.03);
next.head.scale = Vec3::one() / 10.5;
next.head.scale = Vec3::one();
next.chest.offset = Vec3::new(
slow * 0.05,
@ -57,33 +57,33 @@ impl Animation for IdleAnimation {
-skeleton_attr.feet_f.0,
skeleton_attr.feet_f.1,
skeleton_attr.feet_f.2,
) / 11.0;
);
next.leg_fl.ori = Quaternion::rotation_x(slow * 0.08);
next.leg_fl.scale = Vec3::one() / 11.0;
next.leg_fl.scale = Vec3::one();
next.leg_fr.offset = Vec3::new(
skeleton_attr.feet_f.0,
skeleton_attr.feet_f.1,
skeleton_attr.feet_f.2,
) / 11.0;
);
next.leg_fr.ori = Quaternion::rotation_x(slow_alt * 0.08);
next.leg_fr.scale = Vec3::one() / 11.0;
next.leg_fr.scale = Vec3::one();
next.leg_bl.offset = Vec3::new(
-skeleton_attr.feet_b.0,
skeleton_attr.feet_b.1,
skeleton_attr.feet_b.2,
) / 11.0;
);
next.leg_bl.ori = Quaternion::rotation_x(slow_alt * 0.08);
next.leg_bl.scale = Vec3::one() / 11.0;
next.leg_bl.scale = Vec3::one();
next.leg_br.offset = Vec3::new(
skeleton_attr.feet_b.0,
skeleton_attr.feet_b.1,
skeleton_attr.feet_b.2,
) / 11.0;
);
next.leg_br.ori = Quaternion::rotation_x(slow * 0.08);
next.leg_br.scale = Vec3::one() / 11.0;
next.leg_br.scale = Vec3::one();
next.tail.offset = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
next.tail.ori = Quaternion::rotation_z(slow * 0.4);

View File

@ -20,9 +20,9 @@ impl Animation for JumpAnimation {
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) / 11.0;
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1);
next.head.ori = Quaternion::rotation_z(-0.8) * Quaternion::rotation_x(0.5);
next.head.scale = Vec3::one() / 10.5;
next.head.scale = Vec3::one();
next.chest.offset = Vec3::new(0.0, skeleton_attr.chest.0, skeleton_attr.chest.1) / 11.0;
next.chest.ori = Quaternion::rotation_y(0.0);
@ -32,33 +32,33 @@ impl Animation for JumpAnimation {
-skeleton_attr.feet_f.0,
skeleton_attr.feet_f.1,
skeleton_attr.feet_f.2,
) / 11.0;
);
next.leg_fl.ori = Quaternion::rotation_x(0.0);
next.leg_fl.scale = Vec3::one() / 11.0;
next.leg_fl.scale = Vec3::one();
next.leg_fr.offset = Vec3::new(
skeleton_attr.feet_f.0,
skeleton_attr.feet_f.1,
skeleton_attr.feet_f.2,
) / 11.0;
);
next.leg_fr.ori = Quaternion::rotation_x(0.0);
next.leg_fr.scale = Vec3::one() / 11.0;
next.leg_fr.scale = Vec3::one();
next.leg_bl.offset = Vec3::new(
-skeleton_attr.feet_b.0,
skeleton_attr.feet_b.1,
skeleton_attr.feet_b.2,
) / 11.0;
);
next.leg_bl.ori = Quaternion::rotation_x(0.0);
next.leg_bl.scale = Vec3::one() / 11.0;
next.leg_bl.scale = Vec3::one();
next.leg_br.offset = Vec3::new(
skeleton_attr.feet_b.0,
skeleton_attr.feet_b.1,
skeleton_attr.feet_b.2,
) / 11.0;
);
next.leg_br.ori = Quaternion::rotation_x(0.0);
next.leg_br.scale = Vec3::one() / 11.0;
next.leg_br.scale = Vec3::one();
next.tail.offset = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
next.tail.ori = Quaternion::rotation_x(-0.3);

View File

@ -37,12 +37,12 @@ impl Skeleton for QuadrupedSmallSkeleton {
let chest_mat = self.chest.compute_base_matrix();
(
[
FigureBoneData::new(self.head.compute_base_matrix()),
FigureBoneData::new(chest_mat * self.head.compute_base_matrix()),
FigureBoneData::new(chest_mat),
FigureBoneData::new(self.leg_fl.compute_base_matrix()),
FigureBoneData::new(self.leg_fr.compute_base_matrix()),
FigureBoneData::new(self.leg_bl.compute_base_matrix()),
FigureBoneData::new(self.leg_br.compute_base_matrix()),
FigureBoneData::new(chest_mat * self.leg_fl.compute_base_matrix()),
FigureBoneData::new(chest_mat * self.leg_fr.compute_base_matrix()),
FigureBoneData::new(chest_mat * self.leg_bl.compute_base_matrix()),
FigureBoneData::new(chest_mat * self.leg_br.compute_base_matrix()),
FigureBoneData::new(chest_mat * self.tail.compute_base_matrix()),
FigureBoneData::default(),
FigureBoneData::default(),
@ -104,25 +104,25 @@ impl<'a> From<&'a comp::quadruped_small::Body> for SkeletonAttr {
use comp::quadruped_small::Species::*;
Self {
head: match (body.species, body.body_type) {
(Pig, _) => (6.0, 7.0),
(Fox, _) => (8.0, 8.0),
(Sheep, _) => (8.0, 8.0),
(Boar, _) => (13.0, 8.0),
(Jackalope, _) => (6.0, 9.0),
(Skunk, _) => (7.0, 9.0),
(Cat, _) => (7.0, 8.0),
(Batfox, _) => (8.0, 9.0),
(Raccoon, _) => (9.0, 7.0),
(Quokka, _) => (10.0, 10.0),
(Dodarock, _) => (8.0, 9.0),
(Holladon, _) => (8.0, 8.0),
(Hyena, _) => (7.5, 13.0),
(Pig, _) => (5.0, 2.0),
(Fox, _) => (7.0, 3.0),
(Sheep, _) => (9.0, 3.0),
(Boar, _) => (12.0, 3.0),
(Jackalope, _) => (5.0, 4.0),
(Skunk, _) => (6.0, 4.0),
(Cat, _) => (6.0, 3.0),
(Batfox, _) => (7.0, 4.0),
(Raccoon, _) => (8.0, 2.0),
(Quokka, _) => (9.0, 5.0),
(Dodarock, _) => (7.0, 4.0),
(Holladon, _) => (7.0, 3.0),
(Hyena, _) => (7.5, 2.0),
},
chest: match (body.species, body.body_type) {
(Pig, _) => (0.0, 8.0),
(Fox, _) => (1.0, 5.0),
(Pig, _) => (0.0, 7.0),
(Fox, _) => (0.0, 5.0),
(Sheep, _) => (-1.0, 6.0),
(Boar, _) => (0.0, 7.0),
(Boar, _) => (0.0, 8.5),
(Jackalope, _) => (-2.0, 6.0),
(Skunk, _) => (0.0, 6.0),
(Cat, _) => (0.0, 6.0),
@ -134,34 +134,34 @@ impl<'a> From<&'a comp::quadruped_small::Body> for SkeletonAttr {
(Hyena, _) => (-2.0, 9.0),
},
feet_f: match (body.species, body.body_type) {
(Pig, _) => (3.0, 5.0, 2.0),
(Fox, _) => (3.0, 5.0, 3.0),
(Sheep, _) => (3.0, 3.0, 3.0),
(Boar, _) => (3.0, 5.0, 3.0),
(Jackalope, _) => (3.0, 5.0, 4.0),
(Skunk, _) => (3.0, 3.0, 4.0),
(Cat, _) => (3.0, 5.0, 3.0),
(Batfox, _) => (2.5, 5.0, 3.0),
(Raccoon, _) => (3.0, 5.0, 3.0),
(Quokka, _) => (3.0, 5.0, 3.0),
(Dodarock, _) => (3.5, 5.0, 4.0),
(Holladon, _) => (3.0, 5.0, 4.0),
(Hyena, _) => (2.5, 5.0, 6.0),
(Pig, _) => (3.5, 3.0, -5.5),
(Fox, _) => (2.5, 3.0, -2.0),
(Sheep, _) => (3.5, 2.0, -2.5),
(Boar, _) => (3.5, 4.0, -4.5),
(Jackalope, _) => (2.0, 4.0, -2.0),
(Skunk, _) => (2.0, 2.0, -2.0),
(Cat, _) => (2.0, 4.0, -3.0),
(Batfox, _) => (1.5, 4.0, -3.0),
(Raccoon, _) => (2.0, 4.0, -3.0),
(Quokka, _) => (2.0, 4.0, -3.0),
(Dodarock, _) => (2.5, 4.0, -2.0),
(Holladon, _) => (2.0, 4.0, -2.0),
(Hyena, _) => (2.5, 4.0, -4.0),
},
feet_b: match (body.species, body.body_type) {
(Pig, _) => (3.0, -2.0, 2.0),
(Fox, _) => (2.5, -2.0, 3.0),
(Sheep, _) => (3.0, -4.0, 3.0),
(Boar, _) => (3.0, -3.0, 5.0),
(Jackalope, _) => (3.0, -2.0, 4.0),
(Skunk, _) => (3.0, -4.0, 4.0),
(Cat, _) => (2.0, -2.0, 3.0),
(Batfox, _) => (2.5, -2.0, 3.0),
(Raccoon, _) => (3.0, -2.0, 3.0),
(Quokka, _) => (3.0, -4.0, 3.0),
(Dodarock, _) => (4.5, -3.0, 4.0),
(Holladon, _) => (4.0, -4.0, 3.0),
(Hyena, _) => (2.5, -7.0, 6.0),
(Pig, _) => (2.0, -2.0, -5.5),
(Fox, _) => (1.5, -2.0, -1.0),
(Sheep, _) => (3.5, -4.0, -2.5),
(Boar, _) => (2.0, -3.0, -2.5),
(Jackalope, _) => (2.0, -2.0, 0.0),
(Skunk, _) => (1.0, -4.0, -2.5),
(Cat, _) => (1.5, -2.0, -3.0),
(Batfox, _) => (2.0, -2.0, -2.5),
(Raccoon, _) => (2.5, -2.0, -3.5),
(Quokka, _) => (2.5, -4.0, -3.5),
(Dodarock, _) => (2.0, -3.0, -5.5),
(Holladon, _) => (3.5, -2.0, -3.5),
(Hyena, _) => (3.0, -5.0, -4.5),
},
tail: match (body.species, body.body_type) {
(Pig, _) => (-4.0, 3.0),

View File

@ -28,10 +28,10 @@ impl Animation for RunAnimation {
let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude()).max(-0.7);
next.head.offset =
Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + slow * 1.5) / 11.0;
Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + slow * 1.5);
next.head.ori =
Quaternion::rotation_x(0.2 + slow * 0.05) * Quaternion::rotation_y(slow_alt * 0.03);
next.head.scale = Vec3::one() / 10.5;
next.head.scale = Vec3::one();
next.chest.offset = Vec3::new(
0.0,
@ -45,33 +45,33 @@ impl Animation for RunAnimation {
-skeleton_attr.feet_f.0,
skeleton_attr.feet_f.1 + fast * 0.8,
skeleton_attr.feet_f.2 + fast_alt * 1.5,
) / 11.0;
);
next.leg_fl.ori = Quaternion::rotation_x(fast * 0.3);
next.leg_fl.scale = Vec3::one() / 11.0;
next.leg_fl.scale = Vec3::one();
next.leg_fr.offset = Vec3::new(
skeleton_attr.feet_f.0,
skeleton_attr.feet_f.1 + fast_alt * -0.8,
skeleton_attr.feet_f.2 + fast * 1.5,
) / 11.0;
);
next.leg_fr.ori = Quaternion::rotation_x(fast_alt * -0.3);
next.leg_fr.scale = Vec3::one() / 11.0;
next.leg_fr.scale = Vec3::one();
next.leg_bl.offset = Vec3::new(
-skeleton_attr.feet_b.0,
skeleton_attr.feet_b.1 + fast_alt * -0.8,
skeleton_attr.feet_b.2 + fast * 1.5,
) / 11.0;
);
next.leg_bl.ori = Quaternion::rotation_x(fast_alt * -0.3);
next.leg_bl.scale = Vec3::one() / 11.0;
next.leg_bl.scale = Vec3::one();
next.leg_br.offset = Vec3::new(
skeleton_attr.feet_b.0,
skeleton_attr.feet_b.1 + fast * 0.8,
skeleton_attr.feet_b.2 + fast_alt * 1.5,
) / 11.0;
);
next.leg_br.ori = Quaternion::rotation_x(fast * 0.3);
next.leg_br.scale = Vec3::one() / 11.0;
next.leg_br.scale = Vec3::one();
next.tail.offset = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
next.tail.ori = Quaternion::rotation_z(0.0);