corrected villager empty weapon issue

This commit is contained in:
jshipsey 2020-04-19 02:09:58 -04:00 committed by Joshua Barretto
parent a89b28e117
commit 729912d33b
6 changed files with 48 additions and 49 deletions

View File

@ -25,11 +25,11 @@
lateral: ("npc.giant.male.leg_r"),
),
foot_l: (
offset: (-3.0, -5.5, -10.5),
offset: (-3.0, -5.5, -2.5),
lateral: ("npc.giant.male.foot_l"),
),
foot_r: (
offset: (-3.0, -5.5, -10.5),
offset: (-3.0, -5.5, -2.5),
lateral: ("npc.giant.male.foot_r"),
)
),
@ -59,11 +59,11 @@
lateral: ("npc.giant.female.leg_r"),
),
foot_l: (
offset: (-3.0, -5.5, -10.5),
offset: (-3.0, -5.5, -2.5),
lateral: ("npc.giant.female.foot_l"),
),
foot_r: (
offset: (-3.0, -5.5, -10.5),
offset: (-3.0, -5.5, -2.5),
lateral: ("npc.giant.female.foot_r"),
)
),

View File

@ -55,4 +55,8 @@
vox_spec: ("weapon.debug_wand", (-1.5, -9.5, -4.0)),
color: None
),
Empty: (
vox_spec: ("armor.empty", (-3.0, -3.5, 1.0)),
color: None
),
})

View File

@ -36,10 +36,10 @@ impl Animation for IdleAnimation {
next.head.offset = Vec3::new(
0.0,
skeleton_attr.head.0,
skeleton_attr.head.1 + torso * 0.6,
) / 8.0;
skeleton_attr.head.1 + torso * 0.2,
) * 1.02;
next.head.ori = Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6);
next.head.scale = Vec3::one() / 8.0;
next.head.scale = Vec3::one() * 1.02;
next.upper_torso.offset = Vec3::new(
0.0,
@ -52,7 +52,7 @@ impl Animation for IdleAnimation {
next.lower_torso.offset = Vec3::new(
0.0,
skeleton_attr.lower_torso.0,
skeleton_attr.lower_torso.1 + torso * 0.35,
skeleton_attr.lower_torso.1 + torso * 0.15,
);
next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.lower_torso.scale = Vec3::one() * 1.02;
@ -79,7 +79,7 @@ impl Animation for IdleAnimation {
skeleton_attr.hand.2 + torso * 0.6,
);
next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.hand_l.scale = Vec3::one();
next.hand_l.scale = Vec3::one() * 1.02;
next.hand_r.offset = Vec3::new(
skeleton_attr.hand.0,
@ -87,23 +87,23 @@ impl Animation for IdleAnimation {
skeleton_attr.hand.2 + torso * 0.6,
);
next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.hand_r.scale = Vec3::one();
next.hand_r.scale = Vec3::one() * 1.02;
next.leg_l.offset = Vec3::new(
-skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2 + torso * 0.2,
) / 8.0;
) * 1.02;
next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.leg_l.scale = Vec3::one() / 8.0;
next.leg_l.scale = Vec3::one() * 1.02;
next.leg_r.offset = Vec3::new(
skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2 + torso * 0.2,
) / 8.0;
) * 1.02;
next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.leg_r.scale = Vec3::one() / 8.0;
next.leg_r.scale = Vec3::one() * 1.02;
next.foot_l.offset = Vec3::new(
-skeleton_attr.foot.0,

View File

@ -56,23 +56,19 @@ impl Skeleton for BipedLargeSkeleton {
let torso_mat = self.torso.compute_base_matrix();
[
FigureBoneData::new(torso_mat * self.head.compute_base_matrix()),
FigureBoneData::new(torso_mat * upper_torso_mat * self.head.compute_base_matrix()),
FigureBoneData::new(torso_mat * upper_torso_mat),
FigureBoneData::new(
torso_mat * upper_torso_mat * self.lower_torso.compute_base_matrix(),
),
FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_l_mat),
FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_r_mat),
FigureBoneData::new(
torso_mat * upper_torso_mat * shoulder_l_mat * self.hand_l.compute_base_matrix(),
),
FigureBoneData::new(
torso_mat * upper_torso_mat * shoulder_r_mat * self.hand_r.compute_base_matrix(),
),
FigureBoneData::new(torso_mat * leg_l_mat),
FigureBoneData::new(torso_mat * leg_r_mat),
FigureBoneData::new(torso_mat * self.foot_l.compute_base_matrix()),
FigureBoneData::new(torso_mat * self.foot_r.compute_base_matrix()),
FigureBoneData::new(torso_mat * upper_torso_mat * self.hand_l.compute_base_matrix()),
FigureBoneData::new(torso_mat * upper_torso_mat * self.hand_r.compute_base_matrix()),
FigureBoneData::new(torso_mat * upper_torso_mat * leg_l_mat),
FigureBoneData::new(torso_mat * upper_torso_mat * leg_r_mat),
FigureBoneData::new(self.foot_l.compute_base_matrix()),
FigureBoneData::new(self.foot_r.compute_base_matrix()),
FigureBoneData::default(),
FigureBoneData::default(),
FigureBoneData::default(),
@ -137,10 +133,10 @@ impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr {
use comp::biped_large::Species::*;
Self {
head: match (body.species, body.body_type) {
(Giant, _) => (0.0, 28.5),
(Giant, _) => (0.0, 10.0),
},
upper_torso: match (body.species, body.body_type) {
(Giant, _) => (0.0, 18.5),
(Giant, _) => (0.0, 20.0),
},
lower_torso: match (body.species, body.body_type) {
(Giant, _) => (1.0, -9.5),
@ -149,13 +145,13 @@ impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr {
(Giant, _) => (6.0, 0.5, 2.5),
},
hand: match (body.species, body.body_type) {
(Giant, _) => (3.5, -1.0, 3.0),
(Giant, _) => (8.5, -1.0, 4.0),
},
leg: match (body.species, body.body_type) {
(Giant, _) => (3.5, 0.0, 14.0),
(Giant, _) => (3.5, 0.0, -5.0),
},
foot: match (body.species, body.body_type) {
(Giant, _) => (4.0, 0.5, 11.0),
(Giant, _) => (4.0, 0.5, 2.5),
},
}
}

View File

@ -17,7 +17,7 @@ impl Animation for RunAnimation {
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let lab = 14.0;
let lab = 1.0;
let legl = (anim_time as f32 * lab as f32).sin();
let legr = (anim_time as f32 * lab as f32 + PI).sin();
@ -30,9 +30,9 @@ impl Animation for RunAnimation {
let footvertr = (anim_time as f32 * lab as f32 + PI * 0.4).sin().max(0.0);
next.head.offset =
Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + belt * 1.0) / 8.0;
Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + belt * 1.0) * 1.02;
next.head.ori = Quaternion::rotation_z(belt * 0.1) * Quaternion::rotation_x(0.3);
next.head.scale = Vec3::one() / 8.0;
next.head.scale = Vec3::one() * 1.02;
next.upper_torso.offset = Vec3::new(
0.0,
@ -72,7 +72,7 @@ impl Animation for RunAnimation {
skeleton_attr.hand.2,
);
next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 + legr * 0.5);
next.hand_l.scale = Vec3::one();
next.hand_l.scale = Vec3::one() * 1.02;
next.hand_r.offset = Vec3::new(
skeleton_attr.hand.0,
@ -80,42 +80,42 @@ impl Animation for RunAnimation {
skeleton_attr.hand.2,
);
next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 - legr * 0.5);
next.hand_r.scale = Vec3::one();
next.hand_r.scale = Vec3::one() * 1.02;
next.leg_l.offset = Vec3::new(
-skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2 + belt * 0.4,
) / 8.0;
skeleton_attr.leg.2 + legl * 0.4,
) * 1.02;
next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-legl * 0.3);
next.leg_l.scale = Vec3::one() / 8.0;
next.leg_l.scale = Vec3::one() * 1.02;
next.leg_r.offset = Vec3::new(
skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2 + belt * 0.4,
) / 8.0;
skeleton_attr.leg.2 + legr * 0.4,
) * 1.02;
next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-legr * 0.3);
next.leg_r.scale = Vec3::one() / 8.0;
next.leg_r.scale = Vec3::one() * 1.02;
next.foot_l.offset = Vec3::new(
-skeleton_attr.foot.0,
skeleton_attr.foot.1 - foothoril * 4.5 - 0.5,
skeleton_attr.foot.2 + footvertl * 6.0,
skeleton_attr.foot.1 + foothoril * -4.0,
skeleton_attr.foot.2 + footvertl * 3.0,
) / 8.0;
next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 - legl * 0.5);
next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.foot_l.scale = Vec3::one() / 8.0 * 0.98;
next.foot_r.offset = Vec3::new(
skeleton_attr.foot.0,
skeleton_attr.foot.1 - foothorir * 4.5 - 0.5,
skeleton_attr.foot.2 + footvertr * 6.0,
skeleton_attr.foot.1 + foothorir * -4.0,
skeleton_attr.foot.2 + footvertr * 3.0,
) / 8.0;
next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 - legr * 0.5);
next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.foot_r.scale = Vec3::one() / 8.0 * 0.98;
next.torso.offset = Vec3::new(0.0, 0.0, 0.0);
next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.3);
next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2);
next.torso.scale = Vec3::one();
next
}

View File

@ -24,7 +24,6 @@ impl Animation for RunAnimation {
let walkintensity = if speed > 5.0 { 1.0 } else { 0.7 };
let walk = if speed > 5.0 { 1.0 } else { 0.5 };
let lower = if speed > 5.0 { 0.0 } else { 2.0 };
let walk = if speed > 5.0 { 1.0 } else { 0.5 };
let snapfoot = if speed > 5.0 { 1.1 } else { 2.0 };
let lab = 1.0;
let long = (((5.0)