mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Initial bipedlarge beast walk animation
This commit is contained in:
parent
204fa50de9
commit
f4a068c422
@ -309,7 +309,7 @@
|
||||
center: ("npc.werewolf.male.torso_upper"),
|
||||
),
|
||||
torso_lower: (
|
||||
offset: (-6.0, -5.5, -4.0),
|
||||
offset: (-6.0, -5.5, -8.0),
|
||||
center: ("npc.werewolf.male.torso_lower"),
|
||||
),
|
||||
jaw: (
|
||||
@ -339,7 +339,7 @@
|
||||
center: ("npc.werewolf.male.torso_upper"),
|
||||
),
|
||||
torso_lower: (
|
||||
offset: (-6.0, -5.5, -4.0),
|
||||
offset: (-6.0, -5.5, -8.0),
|
||||
center: ("npc.werewolf.male.torso_lower"),
|
||||
),
|
||||
jaw: (
|
||||
|
BIN
assets/voxygen/voxel/npc/werewolf/male/head.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/npc/werewolf/male/head.vox
(Stored with Git LFS)
Binary file not shown.
@ -54,30 +54,37 @@ impl Animation for IdleAnimation {
|
||||
* 0.125,
|
||||
);
|
||||
|
||||
// Controls for the beast breathing
|
||||
let intensity = 0.04;
|
||||
let lenght = 1.0;
|
||||
let chop = 0.2;
|
||||
let chop_freq = 40.0;
|
||||
|
||||
let breathing = intensity * (lenght * anim_time as f32).sin() + 0.05 * chop * (anim_time as f32 * chop_freq).sin() * (anim_time as f32 * lenght).cos();
|
||||
|
||||
next.head.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.head.0,
|
||||
skeleton_attr.head.1 + torso * 0.2,
|
||||
) * 1.02;
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6 + breathing);
|
||||
next.head.scale = Vec3::one() * 1.02 + breathing * 0.4;
|
||||
|
||||
next.upper_torso.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.upper_torso.0,
|
||||
skeleton_attr.upper_torso.1 + torso * 0.5,
|
||||
);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(0.0);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(- breathing);
|
||||
next.upper_torso.scale = Vec3::one() - breathing * 0.4;
|
||||
|
||||
next.lower_torso.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.lower_torso.0,
|
||||
skeleton_attr.lower_torso.1 + torso * 0.15,
|
||||
);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02;
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathing);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02 + breathing * 0.4;
|
||||
|
||||
next.jaw.position = Vec3::new(
|
||||
0.0,
|
||||
@ -111,16 +118,16 @@ impl Animation for IdleAnimation {
|
||||
skeleton_attr.shoulder.1,
|
||||
skeleton_attr.shoulder.2,
|
||||
);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
next.shoulder_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathing);
|
||||
next.shoulder_l.scale = Vec3::one() + breathing;
|
||||
|
||||
next.shoulder_r.position = Vec3::new(
|
||||
skeleton_attr.shoulder.0,
|
||||
skeleton_attr.shoulder.1,
|
||||
skeleton_attr.shoulder.2,
|
||||
);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
next.shoulder_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathing);
|
||||
next.shoulder_r.scale = Vec3::one() + breathing;
|
||||
|
||||
next.hand_l.position = Vec3::new(
|
||||
-skeleton_attr.hand.0,
|
||||
|
@ -89,6 +89,7 @@ pub struct SkeletonAttr {
|
||||
hand: (f32, f32, f32),
|
||||
leg: (f32, f32, f32),
|
||||
foot: (f32, f32, f32),
|
||||
beast: bool,
|
||||
}
|
||||
|
||||
impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr {
|
||||
@ -114,6 +115,7 @@ impl Default for SkeletonAttr {
|
||||
hand: (0.0, 0.0, 0.0),
|
||||
leg: (0.0, 0.0, 0.0),
|
||||
foot: (0.0, 0.0, 0.0),
|
||||
beast: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -146,7 +148,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Wendigo, _) => (-1.0, 29.0),
|
||||
(Troll, _) => (-1.0, 27.5),
|
||||
(Dullahan, _) => (0.0, 29.0),
|
||||
(Werewolf, _) => (3.0, 30.5),
|
||||
(Werewolf, _) => (3.0, 26.5),
|
||||
},
|
||||
lower_torso: match (body.species, body.body_type) {
|
||||
(Ogre, Male) => (1.0, -7.0),
|
||||
@ -155,7 +157,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Wendigo, _) => (-1.5, -6.0),
|
||||
(Troll, _) => (1.0, -10.5),
|
||||
(Dullahan, _) => (0.0, -6.5),
|
||||
(Werewolf, _) => (1.0, -14.5),
|
||||
(Werewolf, _) => (1.0, -10.0),
|
||||
},
|
||||
tail: match (body.species, body.body_type) {
|
||||
(Ogre, _) => (0.0, 0.0),
|
||||
@ -163,7 +165,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Wendigo, _) => (0.0, 0.0),
|
||||
(Troll, _) => (0.0, 0.0),
|
||||
(Dullahan, _) => (0.0, 0.0),
|
||||
(Werewolf, _) => (-5.5, 2.0),
|
||||
(Werewolf, _) => (-5.5, -2.0),
|
||||
},
|
||||
shoulder: match (body.species, body.body_type) {
|
||||
(Ogre, Male) => (12.0, 0.5, 0.0),
|
||||
@ -201,6 +203,10 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Dullahan, _) => (4.0, 2.5, 8.0),
|
||||
(Werewolf, _) => (5.5, 6.5, 6.0),
|
||||
},
|
||||
beast: match (body.species, body.body_type) {
|
||||
(Werewolf, _) => (true),
|
||||
_ => (false),
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,6 +48,13 @@ impl Animation for RunAnimation {
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin());
|
||||
|
||||
let footrotr2 = (((5.0)
|
||||
/ (2.5
|
||||
+ (2.5)
|
||||
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).cos()).powf(2.0 as f32)))
|
||||
.sqrt())
|
||||
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).cos());
|
||||
|
||||
let footrotr = (((5.0)
|
||||
/ (1.0
|
||||
+ (4.0)
|
||||
@ -59,129 +66,250 @@ impl Animation for RunAnimation {
|
||||
|
||||
let shortalt = (anim_time as f32 * lab as f32 * 16.0 + PI / 2.0).sin();
|
||||
|
||||
next.head.position = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02;
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(short * -0.18) * Quaternion::rotation_x(-0.05);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
if skeleton_attr.beast {
|
||||
next.head.position = Vec3::new(0.0, skeleton_attr.head.0 - 3.0, skeleton_attr.head.1 + 4.0) * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z(short * -0.18) * Quaternion::rotation_x(0.45);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.upper_torso.0,
|
||||
skeleton_attr.upper_torso.1 + shortalt * -1.5,
|
||||
);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(short * 0.18);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
next.upper_torso.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.upper_torso.0,
|
||||
skeleton_attr.upper_torso.1 + shortalt * -1.5,
|
||||
);
|
||||
next.upper_torso.orientation = Quaternion::rotation_x(-0.45) * Quaternion::rotation_z(short * 0.18);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
|
||||
next.lower_torso.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.lower_torso.0,
|
||||
skeleton_attr.lower_torso.1,
|
||||
);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02;
|
||||
next.lower_torso.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.lower_torso.0,
|
||||
skeleton_attr.lower_torso.1,
|
||||
);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(0.0);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
next.jaw.position = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(0.0);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
|
||||
next.tail.orientation =
|
||||
Quaternion::rotation_x(shortalt * 0.3);
|
||||
next.tail.scale = Vec3::one();
|
||||
next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
|
||||
next.tail.orientation =
|
||||
Quaternion::rotation_x(shortalt * 0.05 + 0.45);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0);
|
||||
next.second.scale = Vec3::one() * 0.0;
|
||||
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0);
|
||||
next.second.scale = Vec3::one() * 0.0;
|
||||
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.control.orientation = Quaternion::rotation_z(0.0);
|
||||
next.control.scale = Vec3::one();
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.control.orientation = Quaternion::rotation_z(0.0);
|
||||
next.control.scale = Vec3::one();
|
||||
|
||||
next.main.position = Vec3::new(-5.0, -7.0, 7.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
|
||||
next.main.scale = Vec3::one() * 1.02;
|
||||
next.main.position = Vec3::new(-5.0, -7.0, 7.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
|
||||
next.main.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.shoulder_l.position = Vec3::new(
|
||||
-skeleton_attr.shoulder.0,
|
||||
skeleton_attr.shoulder.1 + foothoril * -3.0,
|
||||
skeleton_attr.shoulder.2,
|
||||
);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_x(footrotl * -0.36)
|
||||
* Quaternion::rotation_y(0.1)
|
||||
* Quaternion::rotation_z(footrotl * 0.3);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
next.shoulder_l.position = Vec3::new(
|
||||
-skeleton_attr.shoulder.0,
|
||||
skeleton_attr.shoulder.1 + foothoril * -3.0,
|
||||
skeleton_attr.shoulder.2,
|
||||
);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_x(footrotl * -0.36 + 0.45)
|
||||
* Quaternion::rotation_y(0.1)
|
||||
* Quaternion::rotation_z(footrotl * 0.3);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position = Vec3::new(
|
||||
skeleton_attr.shoulder.0,
|
||||
skeleton_attr.shoulder.1 + foothorir * -3.0,
|
||||
skeleton_attr.shoulder.2,
|
||||
);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_x(footrotr * -0.36)
|
||||
* Quaternion::rotation_y(-0.1)
|
||||
* Quaternion::rotation_z(footrotr * -0.3);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
next.shoulder_r.position = Vec3::new(
|
||||
skeleton_attr.shoulder.0,
|
||||
skeleton_attr.shoulder.1 + foothorir * -3.0,
|
||||
skeleton_attr.shoulder.2,
|
||||
);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_x(footrotr * -0.36 + 0.45)
|
||||
* Quaternion::rotation_y(-0.1)
|
||||
* Quaternion::rotation_z(footrotr * -0.3);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.hand_l.position = Vec3::new(
|
||||
-1.0 + -skeleton_attr.hand.0,
|
||||
skeleton_attr.hand.1 + foothoril * -4.0,
|
||||
skeleton_attr.hand.2 + foothoril * 1.0,
|
||||
);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.15 + (handhoril * -1.2).max(-0.3))
|
||||
* Quaternion::rotation_y(handhoril * -0.1);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
next.hand_l.position = Vec3::new(
|
||||
-1.0 + -skeleton_attr.hand.0,
|
||||
skeleton_attr.hand.1 + foothoril * -4.0 + 2.0,
|
||||
skeleton_attr.hand.2 + foothoril * 0.5 + 2.0,
|
||||
);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.15 + (handhoril * -1.2).max(-0.3) + 0.45)
|
||||
* Quaternion::rotation_y(handhoril * 0.1);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position = Vec3::new(
|
||||
1.0 + skeleton_attr.hand.0,
|
||||
skeleton_attr.hand.1 + foothorir * -4.0,
|
||||
skeleton_attr.hand.2 + foothorir * 1.0,
|
||||
);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.15 + (handhorir * -1.2).max(-0.3))
|
||||
* Quaternion::rotation_y(handhorir * 0.1);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
next.hand_r.position = Vec3::new(
|
||||
1.0 + skeleton_attr.hand.0,
|
||||
skeleton_attr.hand.1 + foothorir * -4.0 + 2.0,
|
||||
skeleton_attr.hand.2 + foothorir * 0.5 + 2.0,
|
||||
);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.15 + (handhorir * -1.2).max(-0.3) + 0.45)
|
||||
* Quaternion::rotation_y(handhorir * -0.1);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_l.position = Vec3::new(
|
||||
-skeleton_attr.leg.0,
|
||||
skeleton_attr.leg.1,
|
||||
skeleton_attr.leg.2,
|
||||
) * 0.98;
|
||||
next.leg_l.orientation =
|
||||
Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothoril * 0.3);
|
||||
next.leg_l.scale = Vec3::one() * 0.98;
|
||||
next.leg_l.position = Vec3::new(
|
||||
-skeleton_attr.leg.0,
|
||||
skeleton_attr.leg.1,
|
||||
skeleton_attr.leg.2,
|
||||
) * 0.98;
|
||||
next.leg_l.orientation =
|
||||
Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothoril * 0.5 - 0.25);
|
||||
next.leg_l.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.leg_r.position = Vec3::new(
|
||||
skeleton_attr.leg.0,
|
||||
skeleton_attr.leg.1,
|
||||
skeleton_attr.leg.2,
|
||||
) * 0.98;
|
||||
next.leg_r.position = Vec3::new(
|
||||
skeleton_attr.leg.0,
|
||||
skeleton_attr.leg.1,
|
||||
skeleton_attr.leg.2,
|
||||
) * 0.98;
|
||||
next.leg_r.orientation =
|
||||
Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothorir * 0.5 - 0.25);
|
||||
next.leg_r.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.leg_r.orientation =
|
||||
Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothorir * 0.3);
|
||||
next.leg_r.scale = Vec3::one() * 0.98;
|
||||
next.foot_l.position = Vec3::new(
|
||||
-skeleton_attr.foot.0,
|
||||
4.0 + skeleton_attr.foot.1 + foothoril * 4.5 - 10.0,
|
||||
skeleton_attr.foot.2 + ((footvertl * 5.0).max(0.0)),
|
||||
) / 8.0;
|
||||
next.foot_l.orientation =
|
||||
Quaternion::rotation_x(-0.5 + footrotl * 0.85);
|
||||
next.foot_l.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.foot_l.position = Vec3::new(
|
||||
-skeleton_attr.foot.0,
|
||||
4.0 + skeleton_attr.foot.1 + foothoril * 8.5,
|
||||
skeleton_attr.foot.2 + ((footvertl * 6.5).max(0.0)),
|
||||
) / 8.0;
|
||||
next.foot_l.orientation =
|
||||
Quaternion::rotation_x(-0.5 + footrotl * 0.85) * Quaternion::rotation_y(0.0);
|
||||
next.foot_l.scale = Vec3::one() / 8.0;
|
||||
next.foot_r.position = Vec3::new(
|
||||
skeleton_attr.foot.0,
|
||||
4.0 + skeleton_attr.foot.1 + foothorir * 4.5 - 10.0,
|
||||
skeleton_attr.foot.2 + ((footvertr * 5.0).max(0.0)),
|
||||
) / 8.0;
|
||||
next.foot_r.orientation =
|
||||
Quaternion::rotation_x(-0.5 + footrotr2 * 0.85);
|
||||
next.foot_r.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
skeleton_attr.foot.0,
|
||||
4.0 + skeleton_attr.foot.1 + foothorir * 8.5,
|
||||
skeleton_attr.foot.2 + ((footvertr * 6.5).max(0.0)),
|
||||
) / 8.0;
|
||||
next.foot_r.orientation =
|
||||
Quaternion::rotation_x(-0.5 + footrotr * 0.85) * Quaternion::rotation_y(0.0);
|
||||
next.foot_r.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25);
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25);
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
} else {
|
||||
next.head.position = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02;
|
||||
next.head.orientation = Quaternion::rotation_z(short * -0.18) * Quaternion::rotation_x(-0.05);
|
||||
next.head.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.upper_torso.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.upper_torso.0,
|
||||
skeleton_attr.upper_torso.1 + shortalt * -1.5,
|
||||
);
|
||||
next.upper_torso.orientation = Quaternion::rotation_z(short * 0.18);
|
||||
next.upper_torso.scale = Vec3::one();
|
||||
|
||||
next.lower_torso.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.lower_torso.0,
|
||||
skeleton_attr.lower_torso.1,
|
||||
);
|
||||
next.lower_torso.orientation = Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1);
|
||||
next.jaw.orientation = Quaternion::rotation_x(0.0);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
|
||||
next.tail.orientation =
|
||||
Quaternion::rotation_x(shortalt * 0.3);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.second.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.second.orientation =
|
||||
Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0);
|
||||
next.second.scale = Vec3::one() * 0.0;
|
||||
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.control.orientation = Quaternion::rotation_z(0.0);
|
||||
next.control.scale = Vec3::one();
|
||||
|
||||
next.main.position = Vec3::new(-5.0, -7.0, 7.0);
|
||||
next.main.orientation =
|
||||
Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
|
||||
next.main.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.shoulder_l.position = Vec3::new(
|
||||
-skeleton_attr.shoulder.0,
|
||||
skeleton_attr.shoulder.1 + foothoril * -3.0,
|
||||
skeleton_attr.shoulder.2,
|
||||
);
|
||||
next.shoulder_l.orientation = Quaternion::rotation_x(footrotl * -0.36)
|
||||
* Quaternion::rotation_y(0.1)
|
||||
* Quaternion::rotation_z(footrotl * 0.3);
|
||||
next.shoulder_l.scale = Vec3::one();
|
||||
|
||||
next.shoulder_r.position = Vec3::new(
|
||||
skeleton_attr.shoulder.0,
|
||||
skeleton_attr.shoulder.1 + foothorir * -3.0,
|
||||
skeleton_attr.shoulder.2,
|
||||
);
|
||||
next.shoulder_r.orientation = Quaternion::rotation_x(footrotr * -0.36)
|
||||
* Quaternion::rotation_y(-0.1)
|
||||
* Quaternion::rotation_z(footrotr * -0.3);
|
||||
next.shoulder_r.scale = Vec3::one();
|
||||
|
||||
next.hand_l.position = Vec3::new(
|
||||
-1.0 + -skeleton_attr.hand.0,
|
||||
skeleton_attr.hand.1 + foothoril * -4.0,
|
||||
skeleton_attr.hand.2 + foothoril * 1.0,
|
||||
);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.15 + (handhoril * -1.2).max(-0.3))
|
||||
* Quaternion::rotation_y(handhoril * -0.1);
|
||||
next.hand_l.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.hand_r.position = Vec3::new(
|
||||
1.0 + skeleton_attr.hand.0,
|
||||
skeleton_attr.hand.1 + foothorir * -4.0,
|
||||
skeleton_attr.hand.2 + foothorir * 1.0,
|
||||
);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.15 + (handhorir * -1.2).max(-0.3))
|
||||
* Quaternion::rotation_y(handhorir * 0.1);
|
||||
next.hand_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.leg_l.position = Vec3::new(
|
||||
-skeleton_attr.leg.0,
|
||||
skeleton_attr.leg.1,
|
||||
skeleton_attr.leg.2,
|
||||
) * 0.98;
|
||||
next.leg_l.orientation =
|
||||
Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothoril * 0.3);
|
||||
next.leg_l.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.leg_r.position = Vec3::new(
|
||||
skeleton_attr.leg.0,
|
||||
skeleton_attr.leg.1,
|
||||
skeleton_attr.leg.2,
|
||||
) * 0.98;
|
||||
|
||||
next.leg_r.orientation =
|
||||
Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothorir * 0.3);
|
||||
next.leg_r.scale = Vec3::one() * 0.98;
|
||||
|
||||
next.foot_l.position = Vec3::new(
|
||||
-skeleton_attr.foot.0,
|
||||
4.0 + skeleton_attr.foot.1 + foothoril * 8.5,
|
||||
skeleton_attr.foot.2 + ((footvertl * 6.5).max(0.0)),
|
||||
) / 8.0;
|
||||
next.foot_l.orientation =
|
||||
Quaternion::rotation_x(-0.5 + footrotl * 0.85) * Quaternion::rotation_y(0.0);
|
||||
next.foot_l.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.foot_r.position = Vec3::new(
|
||||
skeleton_attr.foot.0,
|
||||
4.0 + skeleton_attr.foot.1 + foothorir * 8.5,
|
||||
skeleton_attr.foot.2 + ((footvertr * 6.5).max(0.0)),
|
||||
) / 8.0;
|
||||
next.foot_r.orientation =
|
||||
Quaternion::rotation_x(-0.5 + footrotr * 0.85) * Quaternion::rotation_y(0.0);
|
||||
next.foot_r.scale = Vec3::one() / 8.0;
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
|
||||
next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25);
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
}
|
||||
next
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,22 @@ impl Animation for WieldAnimation {
|
||||
let breathe = (anim_time as f32 + 1.5 * PI).sin();
|
||||
let test = (anim_time as f32 + 36.0 * PI).sin();
|
||||
|
||||
let slower = (anim_time as f32 * 1.0 + PI).sin();
|
||||
let slow = (anim_time as f32 * 3.5 + PI).sin();
|
||||
|
||||
let tailmove = Vec2::new(
|
||||
((global_time + anim_time) as f32 / 2.0)
|
||||
.floor()
|
||||
.mul(7331.0)
|
||||
.sin()
|
||||
* 0.25,
|
||||
((global_time + anim_time) as f32 / 2.0)
|
||||
.floor()
|
||||
.mul(1337.0)
|
||||
.sin()
|
||||
* 0.125,
|
||||
);
|
||||
|
||||
let look = Vec2::new(
|
||||
((global_time + anim_time) as f32 / 8.0)
|
||||
.floor()
|
||||
@ -126,12 +142,17 @@ impl Animation for WieldAnimation {
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1 * 0.0);
|
||||
next.jaw.orientation = Quaternion::rotation_z(0.0);
|
||||
next.jaw.scale = Vec3::one();
|
||||
|
||||
next.jaw.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.jaw.0 - slower * 0.12,
|
||||
skeleton_attr.jaw.1 + slow * 0.2,
|
||||
);
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_z(0.0);
|
||||
next.tail.orientation =
|
||||
Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) * Quaternion::rotation_x(0.0);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.shoulder_l.position = Vec3::new(
|
||||
@ -214,6 +235,19 @@ impl Animation for WieldAnimation {
|
||||
Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.jaw.position = Vec3::new(
|
||||
0.0,
|
||||
skeleton_attr.jaw.0 - slower * 0.12,
|
||||
skeleton_attr.jaw.1 + slow * 0.2,
|
||||
);
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05);
|
||||
next.jaw.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.tail.position = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1);
|
||||
next.tail.orientation =
|
||||
Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x) * Quaternion::rotation_x(0.0);
|
||||
next.tail.scale = Vec3::one();
|
||||
|
||||
next.shoulder_l.position = Vec3::new(
|
||||
-skeleton_attr.shoulder.0,
|
||||
skeleton_attr.shoulder.1 + foothoril * -1.0,
|
||||
|
Loading…
Reference in New Issue
Block a user