mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
starting to wire in new wield setup for bipedlarge
This commit is contained in:
parent
e6eeef4524
commit
14ec1b9f5f
@ -25,14 +25,14 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-5.0, -5.5, -5.0),
|
||||
offset: (-5.0, -5.5, -4.0),
|
||||
central: ("weapon.hammer.2hhammer_ogre"),
|
||||
)
|
||||
),
|
||||
(Ogre, Female): (
|
||||
head: (
|
||||
offset: (-9.0, -5.5, -6.0),
|
||||
central: ("npc.ogre.female..head"),
|
||||
central: ("npc.ogre.female.head"),
|
||||
),
|
||||
torso_upper: (
|
||||
offset: (-6.0, -5.0, -6.0),
|
||||
@ -55,7 +55,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-2.5, -5.5, -5.0),
|
||||
offset: (-2.5, -5.5, -4.0),
|
||||
central: ("weapon.staff.firestaff_ogre"),
|
||||
)
|
||||
),
|
||||
@ -205,7 +205,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-5.0, -6.5, -4.0),
|
||||
offset: (-4.0, -6.0, -4.0),
|
||||
central: ("weapon.hammer.2hhammer_troll"),
|
||||
)
|
||||
),
|
||||
@ -235,7 +235,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-5.0, -6.5, -4.0),
|
||||
offset: (-4.0, -6.0, -4.0),
|
||||
central: ("weapon.hammer.2hhammer_troll"),
|
||||
)
|
||||
),
|
||||
@ -265,7 +265,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-5.0, -6.5, -4.0),
|
||||
offset: (-1.5, -9.0, -4.0),
|
||||
central: ("weapon.sword.greatsword_2h_dullahan"),
|
||||
)
|
||||
),
|
||||
@ -295,7 +295,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-5.0, -6.5, -4.0),
|
||||
offset: (-1.5, -9.0, -4.0),
|
||||
central: ("weapon.sword.greatsword_2h_dullahan"),
|
||||
)
|
||||
),
|
||||
@ -325,7 +325,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-1.5, -9.0, -10.0),
|
||||
offset: (0.0, 0.0, 0.0),
|
||||
central: ("armor.empty"),
|
||||
)
|
||||
),
|
||||
@ -355,7 +355,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-1.5, -9.0, -10.0),
|
||||
offset: (0.0, 0.0, 0.0),
|
||||
central: ("armor.empty"),
|
||||
)
|
||||
),
|
||||
@ -385,7 +385,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-3.5, -3.0, -5.0),
|
||||
offset: (-3.0, -3.0, -4.0),
|
||||
central: ("weapon.staff.firestaff_saurok"),
|
||||
)
|
||||
),
|
||||
@ -415,7 +415,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-3.5, -3.0, -5.0),
|
||||
offset: (-3.0, -3.0, -4.0),
|
||||
central: ("weapon.staff.firestaff_saurok"),
|
||||
)
|
||||
),
|
||||
@ -445,7 +445,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-1.5, -3.0, -5.0),
|
||||
offset: (-1.5, -4.0, -4.0),
|
||||
central: ("weapon.sword.long_2h_saurok"),
|
||||
)
|
||||
),
|
||||
@ -475,7 +475,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-1.5, -3.0, -5.0),
|
||||
offset: (-1.5, -4.0, -4.0),
|
||||
central: ("weapon.sword.long_2h_saurok"),
|
||||
)
|
||||
),
|
||||
@ -505,7 +505,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-2.5, -4.0, -7.0),
|
||||
offset: (-1.5, -4.0, -16.5),
|
||||
central: ("weapon.bow.longbow_saurok"),
|
||||
)
|
||||
),
|
||||
@ -535,7 +535,7 @@
|
||||
central: ("armor.empty"),
|
||||
),
|
||||
main: (
|
||||
offset: (-2.5, -4.0, -7.0),
|
||||
offset: (-1.5, -4.0, -16.5),
|
||||
central: ("weapon.bow.longbow_saurok"),
|
||||
)
|
||||
),
|
||||
|
BIN
assets/voxygen/voxel/weapon/hammer/2hhammer_troll.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/weapon/hammer/2hhammer_troll.vox
(Stored with Git LFS)
Binary file not shown.
74
voxygen/src/anim/src/biped_large/equip.rs
Normal file
74
voxygen/src/anim/src/biped_large/equip.rs
Normal file
@ -0,0 +1,74 @@
|
||||
use super::{
|
||||
super::{vek::*, Animation},
|
||||
BipedLargeSkeleton, SkeletonAttr,
|
||||
};
|
||||
use common::comp::item::{Hands, ToolKind};
|
||||
use std::f32::consts::PI;
|
||||
|
||||
pub struct EquipAnimation;
|
||||
|
||||
impl Animation for EquipAnimation {
|
||||
type Dependency = (Option<ToolKind>, Option<ToolKind>, f32, f64);
|
||||
type Skeleton = BipedLargeSkeleton;
|
||||
|
||||
#[cfg(feature = "use-dyn-lib")]
|
||||
const UPDATE_FN: &'static [u8] = b"biped_large_equip\0";
|
||||
|
||||
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_equip")]
|
||||
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
|
||||
fn update_skeleton_inner(
|
||||
skeleton: &Self::Skeleton,
|
||||
(active_tool_kind, second_tool_kind, velocity, _global_time): Self::Dependency,
|
||||
anim_time: f64,
|
||||
rate: &mut f32,
|
||||
_s_a: &SkeletonAttr,
|
||||
) -> Self::Skeleton {
|
||||
*rate = 1.0;
|
||||
let mut next = (*skeleton).clone();
|
||||
let lab = 1.0;
|
||||
|
||||
let equip_slow = 1.0 + (anim_time as f32 * 12.0 + PI).cos();
|
||||
let equip_slowa = 1.0 + (anim_time as f32 * 12.0 + PI / 4.0).cos();
|
||||
next.hand_l.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(-2.3)
|
||||
* Quaternion::rotation_z(-1.57);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(-2.3)
|
||||
* Quaternion::rotation_z(1.57);
|
||||
next.control.position = Vec3::new(equip_slowa * -1.5, 0.0, equip_slow * 1.5);
|
||||
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
next.hand_l.position = Vec3::new(-8.0, -5.0, 17.0);
|
||||
next.hand_r.position = Vec3::new(-6.0, -4.5, 14.0);
|
||||
},
|
||||
Some(ToolKind::Axe(_)) => {
|
||||
next.hand_l.position = Vec3::new(-7.0, -5.0, 17.0);
|
||||
next.hand_r.position = Vec3::new(-5.0, -4.5, 14.0);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
next.hand_l.position = Vec3::new(-5.0, -5.0, 13.0);
|
||||
next.hand_r.position = Vec3::new(-3.0, -4.5, 10.0);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
|
||||
next.hand_l.position = Vec3::new(-3.0, -5.0, 8.0);
|
||||
next.hand_r.position = Vec3::new(-1.75, -4.5, 5.0);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
next.hand_l.position = Vec3::new(-3.0, -5.0, 9.0);
|
||||
next.hand_r.position = Vec3::new(-1.75, -4.5, 7.0);
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
||||
next.second.scale = match (
|
||||
active_tool_kind.map(|tk| tk.hands()),
|
||||
second_tool_kind.map(|tk| tk.hands()),
|
||||
) {
|
||||
(Some(Hands::OneHand), Some(Hands::OneHand)) => Vec3::one(),
|
||||
(_, _) => Vec3::zero(),
|
||||
};
|
||||
|
||||
next
|
||||
}
|
||||
}
|
@ -63,12 +63,12 @@ impl Animation for IdleAnimation {
|
||||
next.head.scale = Vec3::one() * 1.02 + breathe * 0.4;
|
||||
|
||||
next.upper_torso.position =
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + torso * 0.5);
|
||||
Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + torso * -0.5);
|
||||
next.upper_torso.orientation = Quaternion::rotation_x(-breathe);
|
||||
next.upper_torso.scale = Vec3::one() - breathe * 0.4;
|
||||
|
||||
next.lower_torso.position =
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + torso * 0.15);
|
||||
Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + torso * 0.5);
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(breathe);
|
||||
next.lower_torso.scale = Vec3::one() * 1.02 + breathe * 0.4;
|
||||
@ -109,9 +109,9 @@ impl Animation for IdleAnimation {
|
||||
next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + torso * 0.2);
|
||||
next.leg_r.scale = Vec3::one() * 1.02;
|
||||
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2 + torso * -0.6);
|
||||
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2);
|
||||
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2 + torso * -0.6);
|
||||
next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2);
|
||||
|
||||
next.torso.position = Vec3::new(0.0, 0.0, 0.0) / 8.0;
|
||||
next.torso.scale = Vec3::one() / 8.0;
|
||||
|
@ -12,13 +12,14 @@ pub mod shoot;
|
||||
pub mod spin;
|
||||
pub mod spinmelee;
|
||||
pub mod wield;
|
||||
pub mod equip;
|
||||
|
||||
// Reexports
|
||||
pub use self::{
|
||||
alpha::AlphaAnimation, beam::BeamAnimation, beta::BetaAnimation, charge::ChargeAnimation,
|
||||
dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapAnimation,
|
||||
run::RunAnimation, shockwave::ShockwaveAnimation, shoot::ShootAnimation, spin::SpinAnimation,
|
||||
spinmelee::SpinMeleeAnimation, wield::WieldAnimation,
|
||||
spinmelee::SpinMeleeAnimation, wield::WieldAnimation, equip::EquipAnimation,
|
||||
};
|
||||
|
||||
use super::{make_bone, vek::*, FigureBoneData, Skeleton};
|
||||
@ -119,6 +120,21 @@ pub struct SkeletonAttr {
|
||||
hand: (f32, f32, f32),
|
||||
leg: (f32, f32, f32),
|
||||
foot: (f32, f32, f32),
|
||||
shl: (f32, f32, f32, f32, f32, f32),
|
||||
shr: (f32, f32, f32, f32, f32, f32),
|
||||
sc: (f32, f32, f32, f32, f32, f32),
|
||||
hhl: (f32, f32, f32, f32, f32, f32),
|
||||
hhr: (f32, f32, f32, f32, f32, f32),
|
||||
hc: (f32, f32, f32, f32, f32, f32),
|
||||
sthl: (f32, f32, f32, f32, f32, f32),
|
||||
sthr: (f32, f32, f32, f32, f32, f32),
|
||||
stc: (f32, f32, f32, f32, f32, f32),
|
||||
ahl: (f32, f32, f32, f32, f32, f32),
|
||||
ahr: (f32, f32, f32, f32, f32, f32),
|
||||
ac: (f32, f32, f32, f32, f32, f32),
|
||||
bhl: (f32, f32, f32, f32, f32, f32),
|
||||
bhr: (f32, f32, f32, f32, f32, f32),
|
||||
bc: (f32, f32, f32, f32, f32, f32),
|
||||
beast: bool,
|
||||
}
|
||||
|
||||
@ -145,6 +161,21 @@ 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),
|
||||
shl: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
shr: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
sc: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
hhl: (0.0, 0.0, 10.0, 0.0, 0.0, 0.0),
|
||||
hhr: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
hc: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
sthl: (0.0, 0.0, 10.0, 0.0, 0.0, 0.0),
|
||||
sthr: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
stc: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
ahl: (0.0, 0.0, 10.0, 0.0, 0.0, 0.0),
|
||||
ahr: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
ac: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
bhl: (0.0, 0.0, 10.0, 0.0, 0.0, 0.0),
|
||||
bhr: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
bc: (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
|
||||
beast: false,
|
||||
}
|
||||
}
|
||||
@ -182,7 +213,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Ogre, Female) => (0.0, 28.0),
|
||||
(Cyclops, _) => (-2.0, 27.0),
|
||||
(Wendigo, _) => (-1.0, 29.0),
|
||||
(Troll, _) => (-1.0, 27.5),
|
||||
(Troll, _) => (-1.0, 26.5),
|
||||
(Dullahan, _) => (0.0, 29.0),
|
||||
(Werewolf, _) => (3.0, 26.0),
|
||||
(Occultsaurok, _) => (3.0, 23.0),
|
||||
@ -260,6 +291,75 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
||||
(Mightysaurok, _) => (3.5, 2.0, -12.0),
|
||||
(Slysaurok, _) => (3.5, 2.0, -12.0),
|
||||
},
|
||||
shl: match (body.species, body.body_type) {
|
||||
(Dullahan, _) => (-4.75, -11.0, 8.5, 1.47, -0.2, 0.0),
|
||||
(Mightysaurok, _) => (-4.75, -11.0, 8.5, 1.47, -0.2, 0.0),
|
||||
(_, _) => (-4.75, -1.0, 2.5, 1.47, -0.2, 0.0),
|
||||
},
|
||||
shr: match (body.species, body.body_type) {
|
||||
(Dullahan, _) => (5.75, -11.5, 4.5, 1.47, 0.3, 0.0),
|
||||
(Mightysaurok, _) => (-4.75, -11.0, 8.5, 1.47, -0.2, 0.0),
|
||||
(_, _) => (3.75, -1.5, -0.5, 1.47, 0.3, 0.0),
|
||||
},
|
||||
sc: match (body.species, body.body_type) {
|
||||
(Dullahan, _) => (-7.0, 17.0, -16.0, -0.1, 0.0, 0.0),
|
||||
(Mightysaurok, _) => (-4.75, -11.0, 8.5, 1.47, -0.2, 0.0),
|
||||
(_, _) => (-7.0, 7.0, -10.0, -0.1, 0.0, 0.0),
|
||||
},
|
||||
hhl: match (body.species, body.body_type) {
|
||||
(Ogre, Male) => (-6.0, -10.0, 17.0, 1.57, -0.57, 0.0),
|
||||
(Cyclops, _) => (-6.0, -10.0, 17.0, 1.57, -0.57, 0.0),
|
||||
(Troll, _) => (-6.0, -10.0, 17.0, 1.57, -0.57, 0.0),
|
||||
(_, _) => (-6.0, -10.0, 17.0, 1.57, -0.57, 0.0),
|
||||
},
|
||||
hhr: match (body.species, body.body_type) {
|
||||
(Ogre, Male) => (-6.0, -10.0, 0.0, 1.57, -0.57, 0.0),
|
||||
(Cyclops, _) => (-6.0, -10.0, 0.0, 1.57, -0.57, 0.0),
|
||||
(Troll, _) => (-6.0, -10.0, 0.0, 1.57, -0.57, 0.0),
|
||||
(_, _) => (-6.0, -10.0, 0.0, 1.57, -0.57, 0.0),
|
||||
},
|
||||
hc: match (body.species, body.body_type) {
|
||||
(Ogre, Male) => (8.5, 6.0, -12.0, -0.57, -1.57, 1.0),
|
||||
(Cyclops, _) => (8.5, 6.0, -12.0, -0.57, -1.57, 1.0),
|
||||
(Troll, _) => (8.5, 6.0, -12.0, -0.57, -1.57, 1.0),
|
||||
(_, _) => (8.5, 6.0, -12.0, -0.57, -1.57, 1.0),
|
||||
},
|
||||
sthl: match (body.species, body.body_type) {
|
||||
(Ogre, Female) => (11.0, 5.0, -4.0, 1.27, 0.0, 0.0),
|
||||
(Occultsaurok, _) => (11.0, 5.0, -4.0, 1.27, 0.0, 0.0),
|
||||
(_, _) => (11.0, 5.0, -4.0, 1.27, 0.0, 0.0),
|
||||
},
|
||||
sthr: match (body.species, body.body_type) {
|
||||
(Ogre, Female) => (17.0, 7.5, 2.0, 1.57, 0.8, 0.0),
|
||||
(Occultsaurok, _) => (17.0, 7.5, 2.0, 1.57, 0.8, 0.0),
|
||||
(_, _) => (17.0, 7.5, 2.0, 1.57, 0.8, 0.0),
|
||||
},
|
||||
stc: match (body.species, body.body_type) {
|
||||
(Ogre, Female) => (-18.0, 1.0, -2.0, -0.3, 0.15, 0.0),
|
||||
(Occultsaurok, _) => (-18.0, 1.0, -2.0, -0.3, 0.15, 0.0),
|
||||
(_, _) => (-18.0, 1.0, -2.0, -0.3, 0.15, 0.0),
|
||||
},
|
||||
ahl: match (body.species, body.body_type) {
|
||||
(_, _) => (-0.5, -1.0, 7.0, 1.87, 0.0, 0.0),
|
||||
},
|
||||
ahr: match (body.species, body.body_type) {
|
||||
(_, _) => (0.0, -1.0, 1.0, 4.34, 0.2, 0.0),
|
||||
},
|
||||
ac: match (body.species, body.body_type) {
|
||||
(_, _) => (-8.0, 11.0, 3.0, 2.0, 0.0, 3.14),
|
||||
},
|
||||
bhl: match (body.species, body.body_type) {
|
||||
(Slysaurok, _) => (3.0, 2.5, 0.0, 1.2, -0.6, -0.3),
|
||||
(_, _) => (3.0, 2.5, 0.0, 1.2, -0.6, -0.3),
|
||||
},
|
||||
bhr: match (body.species, body.body_type) {
|
||||
(Slysaurok, _) => (3.0, 2.5, 0.0, 1.2, -0.6, -0.3),
|
||||
(_, _) => (5.9, 5.5, -5.0, 1.2, -0.6, -0.3),
|
||||
},
|
||||
bc: match (body.species, body.body_type) {
|
||||
(Slysaurok, _) => (3.0, 2.5, 0.0, 1.2, -0.6, -0.3),
|
||||
(_, _) => (-7.0, 3.0, -8.0, 0.0, 0.0, 0.0),
|
||||
},
|
||||
beast: matches!((body.species, body.body_type), (Werewolf, _)),
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,21 @@ impl Animation for WieldAnimation {
|
||||
* 0.25,
|
||||
);
|
||||
|
||||
let breathe = if s_a.beast {
|
||||
// Controls for the beast breathing
|
||||
let intensity = 0.04;
|
||||
let lenght = 1.5;
|
||||
let chop = 0.2;
|
||||
let chop_freq = 60.0;
|
||||
intensity * (lenght * anim_time as f32).sin()
|
||||
+ 0.05
|
||||
* chop
|
||||
* (anim_time as f32 * chop_freq).sin()
|
||||
* (anim_time as f32 * lenght).cos()
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
||||
let foothoril = (((1.0)
|
||||
/ (0.4
|
||||
+ (0.6)
|
||||
@ -120,9 +135,7 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_z(test * 0.02);
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(-1.57)
|
||||
* Quaternion::rotation_z(1.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.0);
|
||||
|
||||
if velocity > 0.5 {
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1) * 1.02;
|
||||
@ -137,8 +150,6 @@ impl Animation for WieldAnimation {
|
||||
next.lower_torso.orientation =
|
||||
Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14);
|
||||
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05);
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x)
|
||||
* Quaternion::rotation_x(0.0);
|
||||
@ -169,18 +180,18 @@ impl Animation for WieldAnimation {
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6);
|
||||
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1);
|
||||
next.upper_torso.position = Vec3::new(0.0, s_a.upper_torso.0, s_a.upper_torso.1 + torso * -0.5);
|
||||
next.upper_torso.orientation =
|
||||
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
||||
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1);
|
||||
next.lower_torso.position = Vec3::new(0.0, s_a.lower_torso.0, s_a.lower_torso.1 + torso * 0.5);
|
||||
next.lower_torso.orientation =
|
||||
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, s_a.jaw.0 - slower * 0.12, s_a.jaw.1 + slow * 0.2);
|
||||
next.jaw.orientation = Quaternion::rotation_x(slow * 0.05);
|
||||
next.jaw.orientation = Quaternion::rotation_x(-0.1 + breathe * 2.0);
|
||||
|
||||
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
|
||||
next.tail.orientation = Quaternion::rotation_z(0.0 + slow * 0.2 + tailmove.x)
|
||||
@ -201,32 +212,30 @@ impl Animation for WieldAnimation {
|
||||
}
|
||||
match active_tool_kind {
|
||||
Some(ToolKind::Sword(_)) => {
|
||||
next.hand_l.position = Vec3::new(-4.75, -1.0, 2.5);
|
||||
next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2);
|
||||
next.hand_r.position = Vec3::new(3.75, -1.5, -0.5);
|
||||
Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.shr.0, s_a.shr.1, s_a.shr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3);
|
||||
next.main.position = Vec3::new(3.0, 6.0, -5.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.1);
|
||||
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.0);
|
||||
|
||||
next.control.position = Vec3::new(-7.0, 7.0, -10.0);
|
||||
next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2);
|
||||
next.control.orientation = Quaternion::rotation_x(u_slow * 0.15)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
},
|
||||
Some(ToolKind::Bow(_)) => {
|
||||
next.hand_l.position = Vec3::new(3.0, 2.5, 0.0);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(1.20)
|
||||
* Quaternion::rotation_y(-0.6)
|
||||
* Quaternion::rotation_z(-0.3);
|
||||
next.hand_r.position = Vec3::new(5.9, 5.5, -5.0);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(1.20)
|
||||
* Quaternion::rotation_y(-0.6)
|
||||
* Quaternion::rotation_z(-0.3);
|
||||
next.main.position = Vec3::new(8.0, 8.0, -13.0);
|
||||
next.main.orientation = Quaternion::rotation_x(-0.3)
|
||||
* Quaternion::rotation_y(0.3)
|
||||
* Quaternion::rotation_z(-0.6);
|
||||
next.hand_l.position = Vec3::new(s_a.bhl.0, s_a.bhl.1, s_a.bhl.2);
|
||||
next.hand_l.orientation = Quaternion::rotation_x(s_a.bhl.3)
|
||||
* Quaternion::rotation_y(s_a.bhl.4)
|
||||
* Quaternion::rotation_z(s_a.bhl.5);
|
||||
next.hand_r.position = Vec3::new(s_a.bhr.0, s_a.bhr.1, s_a.bhr.2);
|
||||
next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3)
|
||||
* Quaternion::rotation_y(s_a.bhr.4)
|
||||
* Quaternion::rotation_z(s_a.bhr.5);
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.0);
|
||||
|
||||
next.hold.position = Vec3::new(1.2, -1.0, -14.2);
|
||||
next.hold.orientation = Quaternion::rotation_x(-1.7)
|
||||
@ -234,50 +243,50 @@ impl Animation for WieldAnimation {
|
||||
* Quaternion::rotation_z(-0.1);
|
||||
next.hold.scale = Vec3::one() * 1.0;
|
||||
|
||||
next.control.position = Vec3::new(-7.0, 3.0, -8.0);
|
||||
next.control.position = Vec3::new(s_a.bc.0, s_a.bc.1, s_a.bc.2);
|
||||
next.control.orientation = Quaternion::rotation_x(u_slow * 0.2)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.1);
|
||||
},
|
||||
Some(ToolKind::Hammer(_)) => {
|
||||
next.hand_l.position =
|
||||
Vec3::new(-s_a.hand.0 - 7.0, s_a.hand.1 - 7.0, s_a.hand.2 + 10.0);
|
||||
Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
Quaternion::rotation_x(s_a.hhl.3)
|
||||
* Quaternion::rotation_y(s_a.hhl.4)
|
||||
* Quaternion::rotation_z(s_a.hhl.5);
|
||||
|
||||
next.hand_r.position =
|
||||
Vec3::new(s_a.hand.0 - 7.0, s_a.hand.1 - 7.0, s_a.hand.2 + 10.0);
|
||||
Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
|
||||
Quaternion::rotation_x(s_a.hhr.3)
|
||||
* Quaternion::rotation_y(s_a.hhr.4)
|
||||
* Quaternion::rotation_z(s_a.hhr.5);
|
||||
|
||||
next.control.position = Vec3::new(7.0, 9.0, -10.0);
|
||||
next.control.orientation = Quaternion::rotation_x(test * 0.02)
|
||||
* Quaternion::rotation_y(test * 0.02)
|
||||
* Quaternion::rotation_z(test * 0.02);
|
||||
next.control.position = Vec3::new(s_a.hc.0, s_a.hc.1, s_a.hc.2);
|
||||
next.control.orientation = Quaternion::rotation_x(s_a.hc.3 + test * 0.02)
|
||||
* Quaternion::rotation_y(s_a.hc.4 + test * 0.02)
|
||||
* Quaternion::rotation_z(s_a.hc.5 + test * 0.02);
|
||||
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_y(-1.57)
|
||||
* Quaternion::rotation_z(1.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.0);
|
||||
},
|
||||
Some(ToolKind::Staff(_)) => {
|
||||
next.hand_l.position = Vec3::new(11.0, 5.0, -4.0);
|
||||
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
|
||||
next.hand_l.orientation =
|
||||
Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);
|
||||
next.hand_r.position = Vec3::new(17.0, 7.5, 2.0);
|
||||
Quaternion::rotation_x(s_a.sthl.3) * Quaternion::rotation_y(s_a.sthl.4);
|
||||
next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
|
||||
next.hand_r.orientation =
|
||||
Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.8);
|
||||
Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
|
||||
|
||||
next.shoulder_r.position =
|
||||
Vec3::new(s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
next.shoulder_r.orientation =
|
||||
Quaternion::rotation_z(0.4) * Quaternion::rotation_x(1.0);
|
||||
|
||||
next.main.position = Vec3::new(10.0, 12.5, 13.2);
|
||||
next.main.orientation = Quaternion::rotation_y(PI);
|
||||
next.main.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.0);
|
||||
|
||||
next.control.position = Vec3::new(-18.0, 1.0, -2.0);
|
||||
next.control.position = Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2);
|
||||
next.control.orientation = Quaternion::rotation_x(-0.3 + u_slow * 0.1)
|
||||
* Quaternion::rotation_y(0.15)
|
||||
* Quaternion::rotation_z(u_slowalt * 0.08);
|
||||
@ -314,10 +323,8 @@ impl Animation for WieldAnimation {
|
||||
|
||||
next.second.orientation = Quaternion::rotation_x(PI);
|
||||
|
||||
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.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.0);
|
||||
|
||||
next.shoulder_l.position =
|
||||
Vec3::new(-s_a.shoulder.0, s_a.shoulder.1, s_a.shoulder.2);
|
||||
@ -369,11 +376,8 @@ impl Animation for WieldAnimation {
|
||||
next.control.position = Vec3::new(0.0, 0.0, 0.0);
|
||||
next.control.orientation = Quaternion::rotation_z(0.0);
|
||||
|
||||
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(0.0, 0.0, 0.0);
|
||||
next.main.orientation = Quaternion::rotation_y(0.0);
|
||||
|
||||
next.shoulder_l.position = Vec3::new(
|
||||
-s_a.shoulder.0,
|
||||
|
@ -2214,8 +2214,8 @@ impl FigureMgr {
|
||||
|
||||
let target_base = match (
|
||||
physics.on_ground,
|
||||
vel.0.magnitude_squared() > 0.15, // Moving
|
||||
physics.in_fluid.is_some(), // In water
|
||||
vel.0.magnitude_squared() > MOVING_THRESHOLD_SQR, // Moving
|
||||
physics.in_fluid.is_some(), // In water
|
||||
) {
|
||||
// Standing
|
||||
(true, false, false) => anim::biped_large::IdleAnimation::update_skeleton(
|
||||
@ -2250,6 +2250,15 @@ impl FigureMgr {
|
||||
),
|
||||
};
|
||||
let target_bones = match &character {
|
||||
CharacterState::Equipping { .. } => {
|
||||
anim::biped_large::EquipAnimation::update_skeleton(
|
||||
&target_base,
|
||||
(active_tool_kind, second_tool_kind, vel.0.magnitude(), time),
|
||||
state.state_time,
|
||||
&mut state_animation_rate,
|
||||
skeleton_attr,
|
||||
)
|
||||
},
|
||||
CharacterState::Wielding { .. } => {
|
||||
anim::biped_large::WieldAnimation::update_skeleton(
|
||||
&target_base,
|
||||
|
Loading…
Reference in New Issue
Block a user