From 36711e888551c710cb16c2f3b9ac2bfd9385353f Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sun, 17 Jan 2021 14:38:29 -0500 Subject: [PATCH] wielding --- .../voxel/biped_small_central_manifest.ron | 48 ---------- .../voxel/biped_small_lateral_manifest.ron | 48 +++++----- .../voxel/biped_small_weapon_manifest.ron | 74 +++++++++++++++ .../voxygen/voxel/npc/basilisk/male/chest.vox | Bin 10876 -> 10876 bytes .../voxel/npc/basilisk/male/head_lower.vox | Bin 7428 -> 7576 bytes .../voxel/npc/basilisk/male/tail_front.vox | Bin 4416 -> 4564 bytes .../voxel/npc/sunlizard/male/chest_back.vox | Bin 2020 -> 2316 bytes voxygen/anim/src/biped_small/idle.rs | 1 - voxygen/anim/src/biped_small/mod.rs | 47 ++++++---- voxygen/anim/src/biped_small/run.rs | 15 ++-- voxygen/anim/src/biped_small/wield.rs | 85 ++++++++++++++++++ voxygen/src/scene/figure/load.rs | 50 +++++++---- voxygen/src/scene/figure/mod.rs | 34 ++++--- 13 files changed, 277 insertions(+), 125 deletions(-) create mode 100644 assets/voxygen/voxel/biped_small_weapon_manifest.ron create mode 100644 voxygen/anim/src/biped_small/wield.rs diff --git a/assets/voxygen/voxel/biped_small_central_manifest.ron b/assets/voxygen/voxel/biped_small_central_manifest.ron index 53bb7fdf2e..ee77358b9e 100644 --- a/assets/voxygen/voxel/biped_small_central_manifest.ron +++ b/assets/voxygen/voxel/biped_small_central_manifest.ron @@ -16,10 +16,6 @@ offset: (-0.5, -5.0, -2.5), central: ("armor.empty"), ), - main: ( - offset: (-1.5, -7.5, -5.0), - central: ("armor.empty"), - ), ), (Gnome, Female): ( head: ( @@ -38,10 +34,6 @@ offset: (-0.5, -5.0, -2.5), central: ("armor.empty"), ), - main: ( - offset: (-1.5, -7.5, -5.0), - central: ("armor.empty"), - ), ), (Sahagin, Male): ( head: ( @@ -60,10 +52,6 @@ offset: (-1.5, -13.0, -5.0), central: ("npc.sahagin.male.tail"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.sahagin"), - ), ), (Sahagin, Female): ( head: ( @@ -82,10 +70,6 @@ offset: (-1.5, -13.0, -5.0), central: ("npc.sahagin.male.tail"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.sahagin"), - ), ), (Adlet, Male): ( head: ( @@ -104,10 +88,6 @@ offset: (-1.0, -5.0, -1.0), central: ("npc.adlet.male.tail"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.adlet"), - ), ), (Adlet, Female): ( head: ( @@ -126,10 +106,6 @@ offset: (-1.0, -5.0, -1.0), central: ("npc.adlet.male.tail"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.adlet"), - ), ), (Gnarling, Male): ( head: ( @@ -148,10 +124,6 @@ offset: (-1.5, -13.0, -3.0), central: ("npc.gnarling.male.tail"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.adlet"), - ), ), (Gnarling, Female): ( head: ( @@ -170,10 +142,6 @@ offset: (-1.5, -13.0, -3.0), central: ("npc.gnarling.male.tail"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.adlet"), - ), ), (Mandragora, Male): ( head: ( @@ -192,10 +160,6 @@ offset: (0.0, 0.0, 0.0), central: ("armor.empty"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.adlet"), - ), ), (Mandragora, Female): ( head: ( @@ -214,10 +178,6 @@ offset: (0.0, 0.0, 0.0), central: ("armor.empty"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.adlet"), - ), ), (Kappa, Male): ( head: ( @@ -236,10 +196,6 @@ offset: (-2.5, -10.0, -5.0), central: ("npc.kappa.male.tail"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.adlet"), - ), ), (Kappa, Female): ( head: ( @@ -258,9 +214,5 @@ offset: (-2.5, -10.0, -5.0), central: ("npc.kappa.male.tail"), ), - main: ( - offset: (-0.5, -7.5, -5.0), - central: ("weapon.spear.adlet"), - ), ), }) diff --git a/assets/voxygen/voxel/biped_small_lateral_manifest.ron b/assets/voxygen/voxel/biped_small_lateral_manifest.ron index ae965ffae0..a891e4fdf2 100644 --- a/assets/voxygen/voxel/biped_small_lateral_manifest.ron +++ b/assets/voxygen/voxel/biped_small_lateral_manifest.ron @@ -1,11 +1,11 @@ ({ (Gnome, Male): ( hand_l: ( - offset: (-2.0, -2.0, -5.0), + offset: (-4.0, -2.0, -5.0), lateral: ("npc.gnome.male.hand_l"), ), hand_r: ( - offset: (-2.0, -2.0, -5.0), + offset: (0.0, -2.0, -5.0), lateral: ("npc.gnome.male.hand_r"), ), foot_l: ( @@ -19,11 +19,11 @@ ), (Gnome, Female): ( hand_l: ( - offset: (-2.0, -2.0, -5.0), + offset: (-4.0, -2.0, -5.0), lateral: ("npc.gnome.male.hand_l"), ), hand_r: ( - offset: (-2.0, -2.0, -5.0), + offset: (0.0, -2.0, -5.0), lateral: ("npc.gnome.male.hand_r"), ), foot_l: ( @@ -37,11 +37,11 @@ ), (Sahagin, Male): ( hand_l: ( - offset: (0.0, -4.0, -11.0), + offset: (-7.0, -4.0, -13.0), lateral: ("npc.sahagin.male.hand_l"), ), hand_r: ( - offset: (0.0, -4.0, -11.0), + offset: (0.0, -4.0, -13.0), lateral: ("npc.sahagin.male.hand_r"), ), foot_l: ( @@ -55,11 +55,11 @@ ), (Sahagin, Female): ( hand_l: ( - offset: (0.0, -4.0, -11.0), + offset: (-7.0, -4.0, -13.0), lateral: ("npc.sahagin.male.hand_l"), ), hand_r: ( - offset: (-7.0, -4.0, -11.0), + offset: (0.0, -4.0, -13.0), lateral: ("npc.sahagin.male.hand_r"), ), foot_l: ( @@ -73,11 +73,11 @@ ), (Adlet, Male): ( hand_l: ( - offset: (-2.0, -2.0, -6.0), + offset: (-4.0, -2.0, -7.0), lateral: ("npc.adlet.male.hand_l"), ), hand_r: ( - offset: (-2.0, -2.0, -6.0), + offset: (0.0, -2.0, -7.0), lateral: ("npc.adlet.male.hand_r"), ), foot_l: ( @@ -91,11 +91,11 @@ ), (Adlet, Female): ( hand_l: ( - offset: (-2.0, -2.0, -6.0), + offset: (-4.0, -2.0, -7.0), lateral: ("npc.adlet.male.hand_l"), ), hand_r: ( - offset: (-2.0, -2.0, -6.0), + offset: (0.0, -2.0, -7.0), lateral: ("npc.adlet.male.hand_r"), ), foot_l: ( @@ -109,11 +109,11 @@ ), (Gnarling, Male): ( hand_l: ( - offset: (-1.5, -1.5, -7.0), + offset: (-3.0, -1.5, -7.0), lateral: ("npc.gnarling.male.hand_l"), ), hand_r: ( - offset: (-1.5, -1.5, -7.0), + offset: (0.0, -1.5, -7.0), lateral: ("npc.gnarling.male.hand_r"), ), foot_l: ( @@ -127,11 +127,11 @@ ), (Gnarling, Female): ( hand_l: ( - offset: (-1.5, -1.5, -7.0), + offset: (-3.0, -1.5, -7.0), lateral: ("npc.gnarling.male.hand_l"), ), hand_r: ( - offset: (-1.5, -1.5, -7.0), + offset: (0.0, -1.5, -7.0), lateral: ("npc.gnarling.male.hand_r"), ), foot_l: ( @@ -145,11 +145,11 @@ ), (Mandragora, Male): ( hand_l: ( - offset: (-2.0, -1.5, -7.0), + offset: (-4.0, -1.5, -7.0), lateral: ("npc.mandragora.male.hand_l"), ), hand_r: ( - offset: (-2.0, -1.5, -7.0), + offset: (0.0, -1.5, -7.0), lateral: ("npc.mandragora.male.hand_r"), ), foot_l: ( @@ -163,11 +163,11 @@ ), (Mandragora, Female): ( hand_l: ( - offset: (-2.0, -1.5, -7.0), + offset: (-4.0, -1.5, -7.0), lateral: ("npc.mandragora.male.hand_l"), ), hand_r: ( - offset: (-2.0, -1.5, -7.0), + offset: (0.0, -1.5, -7.0), lateral: ("npc.mandragora.male.hand_r"), ), foot_l: ( @@ -181,11 +181,11 @@ ), (Kappa, Male): ( hand_l: ( - offset: (-3.0, -4.0, -10.0), + offset: (-6.0, -4.0, -12.0), lateral: ("npc.kappa.male.hand_l"), ), hand_r: ( - offset: (-3.0, -4.0, -10.0), + offset: (0.0, -4.0, -12.0), lateral: ("npc.kappa.male.hand_r"), ), foot_l: ( @@ -199,11 +199,11 @@ ), (Kappa, Female): ( hand_l: ( - offset: (-3.0, -4.0, -10.0), + offset: (-6.0, -4.0, -12.0), lateral: ("npc.kappa.male.hand_l"), ), hand_r: ( - offset: (-3.0, -4.0, -10.0), + offset: (0.0, -4.0, -12.0), lateral: ("npc.kappa.male.hand_r"), ), foot_l: ( diff --git a/assets/voxygen/voxel/biped_small_weapon_manifest.ron b/assets/voxygen/voxel/biped_small_weapon_manifest.ron new file mode 100644 index 0000000000..06850173f8 --- /dev/null +++ b/assets/voxygen/voxel/biped_small_weapon_manifest.ron @@ -0,0 +1,74 @@ +({ + (Gnome, Male): ( + main: ( + offset: (-1.5, -3.0, -5.0), + weapon: ("weapon.spear.sahagin"), + ), + ), + (Gnome, Female): ( + main: ( + offset: (-1.5, -3.0, -5.0), + weapon: ("weapon.spear.sahagin"), + ), + ), + (Sahagin, Male): ( + main: ( + offset: (-1.5, -3.0, -5.0), + weapon: ("weapon.spear.sahagin"), + ), + ), + (Sahagin, Female): ( + main: ( + offset: (-1.5, -3.0, -5.0), + weapon: ("weapon.spear.sahagin"), + ), + ), + (Adlet, Male): ( + main: ( + offset: (-0.5, -3.0, -5.0), + weapon: ("weapon.spear.adlet"), + ), + ), + (Adlet, Female): ( + main: ( + offset: (-0.5, -3.0, -5.0), + weapon: ("weapon.spear.adlet"), + ), + ), + (Gnarling, Male): ( + main: ( + offset: (-0.5, -3.0, -5.0), + weapon: ("weapon.spear.adlet"), + ), + ), + (Gnarling, Female): ( + main: ( + offset: (-0.5, -3.0, -5.0), + weapon: ("weapon.spear.adlet"), + ), + ), + (Mandragora, Male): ( + main: ( + offset: (-0.5, -3.0, -5.0), + weapon: ("weapon.spear.adlet"), + ), + ), + (Mandragora, Female): ( + main: ( + offset: (-0.5, -3.0, -5.0), + weapon: ("weapon.spear.adlet"), + ), + ), + (Kappa, Male): ( + main: ( + offset: (-0.5, -3.0, -5.0), + weapon: ("weapon.spear.adlet"), + ), + ), + (Kappa, Female): ( + main: ( + offset: (-0.5, -3.0, -5.0), + weapon: ("weapon.spear.adlet"), + ), + ), +}) diff --git a/assets/voxygen/voxel/npc/basilisk/male/chest.vox b/assets/voxygen/voxel/npc/basilisk/male/chest.vox index 3d930ce6f31624d6f8026a9e8f9428e6d22259f4..47687b176b0db4efe13de2ee97ad4f72329d0bf1 100644 GIT binary patch delta 71 zcmewp@+V}2HzRKhD+5y`8xXSt@#Y9de@0FqmpO`^fjM&X2By=Df>EptEI=WaXm%jY T!N3x;xrarWi4iEvc19ThP}2|g delta 71 zcmewp@+V}2HzRK(D+5z78xXTIFa>UoVDx9?jACP8j$&tEj^4b1=`^DtPz4K6h$WgG Wh&dQoA~*N2C^IoeZQj6kMi~H1Ll5Er diff --git a/assets/voxygen/voxel/npc/basilisk/male/head_lower.vox b/assets/voxygen/voxel/npc/basilisk/male/head_lower.vox index ce8f95361ec8a4852ffbcd7519b966f0e56b10bb..fa519da302254a5a5beb46c978c493a9ae4fded8 100644 GIT binary patch delta 894 zcmW-ezi!k(5XSADnVs3S&*75G-9-YCBE>xb6oCc`ib%GT`y&+pd5APfbZJr}Buj{g zph5QnJOm|09)Nag$lmGSus76~SPkeCl;pdEr(;gbz9|6$Cx4 zhr4idt}rUDH*swMri;>SSq58H3Wmq<^2ipY0yFAkK<^^n-Flc1mUSl5h)5g7H(opv zF6)S38UE;@F^=AK9x7uJb&aX(12o2YZ8py4n7Pi}alQW?Khb1JR$99_$~BA1=@Iq!ggxtQ@{gS1-)YN~2gAWu;28 zHc7St8Yss}rE7&oNjK(`t!c6|4%d4-Hh&+Po50*hPIn#{3+i!2vQrSy(?frpbECkR zTVvlvrp_~AJ)uviv1`V$GxdQTdN_L2%7R+jz#cu{MtINCWz6?|hLnY5gc=pKg5Xm4bQ2vn9%~gCArv8$qt=goXmHXSP$yk*m^pAc zC!`{zBBUau!jCgTC_*TBffx9Ixe`7|*wLZJofGvQbtKm*Q5Ue*g9vYglLO(PxD&#i SP_p)vt|L%vVzd9d%=kZ~qjJgs delta 744 zcmWmAzi!k(5C(AH&dkot+UIb|CFe+yNRi??8Ylt{6cmwcC*&d&|9JtrG)Qzblqf>7 zgm?%VbT5#HprptHP~;8Zi>05wU3)w`_K#OzUY@=`zdrt+Wm)s)tVLuGM_INx>)#fS z8(a(6fn&Jt`m?(V3tZ2Bo&K9yV(y%I+`bNLdXgx-E3LdFExJfyGkucZWGvHp{8%|| zSekc+B7NlZ-f6a({=^eDnq6*LA7;x$+~rpG5uFu`xu4AIBjY$k;a(vT^$~>;=_KQH z;}^$k8qnByaJrY@H-Aj<4A zArsOfo+)bZx3{)y@w2g?D;14{QC=IR#_X_GKdeRf>KtO+s}lrU)g=V2ni7h*s+kwH z(gN=<8f7F{*llAvXcNS=Lay5ANKmg@hv-$4y!y~68ak*|je}WLn_{o~t%K@8?T~cY pL`b@i+;3RQivk!;O`o=0F2@3>T=w&F*>Sno7eFwF?bpMC{{!%hV{ZTe diff --git a/assets/voxygen/voxel/npc/basilisk/male/tail_front.vox b/assets/voxygen/voxel/npc/basilisk/male/tail_front.vox index 775c741267bfd38584d08affa21d520a89dd4825..ed1c161219c52114386ce587cad33636f1ae5295 100644 GIT binary patch literal 4564 zcmaKvZLD2omB*jAwVr3copaiIdrMm=wW4sV5jr@fT9{Ozj+NfF_XUT2&XI`2D2>B_ zWJ0vL(P*8C#URj>mzmKZDq|)n0%;o^GlQrMLt+dXA|^_R^OA|*$b6X0r&;qmkQn0! zZt}~2t@Yn)?dRFg-lypYj@+>00q5M(dk!8(-1j#)w|a1Vpq(ZBRWO9};D&yD@ZOGq zzdw!6#mX(G%B={*ni!;ZtFduw2?S#6R#Qv8<(iJTBSzzZctDKC;@1)ggvzhP%CDx% zPX$%-P*ba^)qWzxTKnbD__YWL1QbHcbuHI{5G#bvFUO7=DyX7i;FlF*4$BE7hm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*Aq#G8X+J#cFn?P@`qcCx}UZnV#>0^jp3^9uj8S?)5Ho9u04=6TJ9>ozp dMB0G3Rzn3f#I!M@nKn|KEzC@z7=Gks`~?*-Z8HD> diff --git a/voxygen/anim/src/biped_small/idle.rs b/voxygen/anim/src/biped_small/idle.rs index 6dad997260..72348a531b 100644 --- a/voxygen/anim/src/biped_small/idle.rs +++ b/voxygen/anim/src/biped_small/idle.rs @@ -2,7 +2,6 @@ use super::{ super::{vek::*, Animation}, BipedSmallSkeleton, SkeletonAttr, }; -use std::{f32::consts::PI, ops::Mul}; pub struct IdleAnimation; diff --git a/voxygen/anim/src/biped_small/mod.rs b/voxygen/anim/src/biped_small/mod.rs index f43aafdeca..c8bf4bdd1a 100644 --- a/voxygen/anim/src/biped_small/mod.rs +++ b/voxygen/anim/src/biped_small/mod.rs @@ -1,8 +1,9 @@ pub mod idle; pub mod run; +pub mod wield; // Reexports -pub use self::{idle::IdleAnimation, run::RunAnimation}; +pub use self::{idle::IdleAnimation, run::RunAnimation, wield::WieldAnimation}; use super::{make_bone, vek::*, FigureBoneData, Skeleton}; use common::comp::{self}; @@ -20,6 +21,10 @@ skeleton_impls!(struct BipedSmallSkeleton { + hand_r, + foot_l, + foot_r, + control, + control_l, + control_r, + }); impl Skeleton for BipedSmallSkeleton { @@ -38,15 +43,17 @@ impl Skeleton for BipedSmallSkeleton { ) -> Vec3 { let chest_mat = base_mat * Mat4::::from(self.chest); let shorts_mat = chest_mat * Mat4::::from(self.shorts); - + let control_mat = chest_mat * Mat4::::from(self.control); + let control_l_mat = Mat4::::from(self.control_l); + let control_r_mat = Mat4::::from(self.control_r); *(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [ make_bone(chest_mat * Mat4::::from(self.head)), make_bone(chest_mat), make_bone(shorts_mat), make_bone(shorts_mat * Mat4::::from(self.tail)), - make_bone(chest_mat * Mat4::::from(self.main)), - make_bone(chest_mat * Mat4::::from(self.hand_l)), - make_bone(chest_mat * Mat4::::from(self.hand_r)), + make_bone(control_mat * Mat4::::from(self.main)), + make_bone(control_mat * control_l_mat * Mat4::::from(self.hand_l)), + make_bone(control_mat * control_r_mat * Mat4::::from(self.hand_r)), make_bone(base_mat * Mat4::::from(self.foot_l)), make_bone(base_mat * Mat4::::from(self.foot_r)), ]; @@ -61,6 +68,7 @@ pub struct SkeletonAttr { tail: (f32, f32), hand: (f32, f32, f32), foot: (f32, f32, f32), + grip: (f32, f32, f32), } impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { @@ -83,6 +91,7 @@ impl Default for SkeletonAttr { tail: (0.0, 0.0), hand: (0.0, 0.0, 0.0), foot: (0.0, 0.0, 0.0), + grip: (0.0, 0.0, 0.0), } } } @@ -104,7 +113,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Sahagin, _) => (0.0, 15.0), (Adlet, _) => (0.0, 11.0), (Gnarling, _) => (0.0, 7.5), - (Mandragora, _) => (0.0, 8.5), + (Mandragora, _) => (0.0, 10.5), (Kappa, _) => (0.0, 14.5), }, shorts: match (body.species, body.body_type) { @@ -112,7 +121,7 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Sahagin, _) => (0.5, -7.0), (Adlet, _) => (0.0, -3.0), (Gnarling, _) => (0.0, -3.0), - (Mandragora, _) => (0.0, -3.0), + (Mandragora, _) => (0.0, -6.5), (Kappa, _) => (0.0, -3.0), }, tail: match (body.species, body.body_type) { @@ -120,16 +129,16 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Sahagin, _) => (-2.5, -2.0), (Adlet, _) => (-4.5, -2.0), (Gnarling, _) => (-2.0, 1.5), - (Mandragora, _) => (0.0, 0.0), - (Kappa, _) => (0.0, -3.0), + (Mandragora, _) => (0.0, -1.0), + (Kappa, _) => (0.0, -4.0), }, hand: match (body.species, body.body_type) { - (Gnome, _) => (6.0, 0.5, -1.0), - (Sahagin, _) => (9.5, 3.5, -2.0), - (Adlet, _) => (6.0, -0.5, 0.0), - (Gnarling, _) => (5.0, 0.0, 1.5), - (Mandragora, _) => (6.0, -0.5, -2.5), - (Kappa, _) => (7.5, 3.5, -2.0), + (Gnome, _) => (4.0, 0.5, -1.0), + (Sahagin, _) => (3.5, 3.5, -2.0), + (Adlet, _) => (4.5, -0.5, 2.0), + (Gnarling, _) => (4.0, 0.0, 1.5), + (Mandragora, _) => (4.0, -0.5, -2.5), + (Kappa, _) => (4.0, 3.5, -0.5), }, foot: match (body.species, body.body_type) { (Gnome, _) => (3.0, 0.0, 4.0), @@ -139,6 +148,14 @@ impl<'a> From<&'a Body> for SkeletonAttr { (Mandragora, _) => (3.0, 0.0, 4.0), (Kappa, _) => (3.0, 3.0, 9.0), }, + grip: match (body.species, body.body_type) { + (Gnome, _) => (0.0, 0.0, 5.0), + (Sahagin, _) => (1.0, 0.0, 13.0), + (Adlet, _) => (0.0, 0.0, 7.0), + (Gnarling, _) => (0.0, 0.0, 7.0), + (Mandragora, _) => (0.0, 0.0, 7.0), + (Kappa, _) => (0.75, 1.0, 12.0), + }, } } } diff --git a/voxygen/anim/src/biped_small/run.rs b/voxygen/anim/src/biped_small/run.rs index 3426dcb806..bf35df919e 100644 --- a/voxygen/anim/src/biped_small/run.rs +++ b/voxygen/anim/src/biped_small/run.rs @@ -19,7 +19,7 @@ impl Animation for RunAnimation { fn update_skeleton_inner( skeleton: &Self::Skeleton, - (velocity, orientation, last_ori, global_time, avg_vel, acc_vel): Self::Dependency, + (velocity, orientation, last_ori, global_time, _avg_vel, acc_vel): Self::Dependency, anim_time: f64, rate: &mut f32, s_a: &SkeletonAttr, @@ -27,7 +27,6 @@ impl Animation for RunAnimation { let mut next = (*skeleton).clone(); let speed = Vec2::::from(velocity).magnitude(); *rate = 1.0; - let impact = (avg_vel.z).max(-8.0); let speednorm = speed / 9.4; let lab = 1.0; @@ -105,9 +104,7 @@ impl Animation for RunAnimation { ) / 13.0; next.chest.orientation = Quaternion::rotation_z(short * 0.06 + tilt * -0.6) * Quaternion::rotation_y(tilt * 1.6) - * Quaternion::rotation_x( - impact * 0.06 + shortalter * 0.035 + speednorm * -0.4 + (tilt.abs()), - ); + * Quaternion::rotation_x(shortalter * 0.035 + speednorm * -0.4 + (tilt.abs())); next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1); next.shorts.orientation = Quaternion::rotation_x(0.1 * speednorm) @@ -136,10 +133,10 @@ 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.0 * speednorm + footrotl * -4.5 * speednorm) + + (1.0 - sideabs) * (-1.0 * speednorm + footrotl * -1.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))) + + (1.0 - sideabs) * (2.0 * speednorm + ((footvertl * -1.1 * speednorm).max(-1.0))) + side * ((footvertsl * 1.5).max(-1.0)), ) / 13.0; next.foot_l.orientation = Quaternion::rotation_x( @@ -151,10 +148,10 @@ 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.0 * speednorm + footrotr * -4.5 * speednorm) + + (1.0 - sideabs) * (-1.0 * speednorm + footrotr * -1.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))) + + (1.0 - sideabs) * (2.0 * speednorm + ((footvertr * -1.1 * speednorm).max(-1.0))) + side * ((footvertsr * -1.5).max(-1.0)), ) / 13.0; next.foot_r.orientation = Quaternion::rotation_x( diff --git a/voxygen/anim/src/biped_small/wield.rs b/voxygen/anim/src/biped_small/wield.rs new file mode 100644 index 0000000000..eaeed43738 --- /dev/null +++ b/voxygen/anim/src/biped_small/wield.rs @@ -0,0 +1,85 @@ +use super::{ + super::{vek::*, Animation}, + BipedSmallSkeleton, SkeletonAttr, +}; +use std::f32::consts::PI; + +pub struct WieldAnimation; + +type WieldAnimationDependency = (Vec3, Vec3, Vec3, f64, Vec3, f32); + +impl Animation for WieldAnimation { + type Dependency = WieldAnimationDependency; + type Skeleton = BipedSmallSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"biped_small_wield\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "biped_small_wield")] + + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (velocity, _orientation, _last_ori, _global_time, _avg_vel, acc_vel): Self::Dependency, + anim_time: f64, + _rate: &mut f32, + s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + let speed = Vec2::::from(velocity).magnitude(); + + let fastacc = (acc_vel * 2.0).sin(); + let fast = (anim_time as f32 * 10.0).sin(); + let fastalt = (anim_time as f32 * 10.0 + PI / 2.0).sin(); + let slow = (anim_time as f32 * 2.0).sin(); + + let speednorm = speed / 9.4; + let speednormcancel = 1.0 - speednorm; + + next.foot_l.scale = Vec3::one() / 13.0; + next.foot_r.scale = Vec3::one() / 13.0; + + next.chest.scale = Vec3::one() / 13.0; + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + fast * -0.1 * speednormcancel); + next.head.orientation = Quaternion::rotation_x(0.45 * speednorm) + * Quaternion::rotation_y(fast * 0.15 * speednormcancel); + next.chest.position = Vec3::new( + 0.0, + s_a.chest.0, + s_a.chest.1 + fastalt * 0.4 * speednormcancel + speednormcancel * -0.5, + ) / 13.0; + + next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1); + //next.main.position = Vec3::new(0.0, s_a.hand.2*-1.0, 0.0); + + next.main.position = Vec3::new(0.0, 0.0, 0.0); + + next.hand_l.position = Vec3::new(s_a.grip.0 * 4.0, 0.0, s_a.grip.2); + next.hand_r.position = Vec3::new(-s_a.grip.0 * 4.0, 0.0, s_a.grip.2); + + next.hand_l.orientation = Quaternion::rotation_x(0.0); + next.hand_r.orientation = Quaternion::rotation_x(0.0); + + next.control_l.position = Vec3::new(1.0 - s_a.grip.0 * 2.0, 2.0, -2.0); + next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 2.0, 2.0); + + next.control.position = Vec3::new( + -3.0, + s_a.grip.2, + -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0 + fastacc * 1.5 + fastalt * 0.5 * speednormcancel, + ); + + next.control_l.orientation = + Quaternion::rotation_x(PI / 1.5 + slow * 0.1) * Quaternion::rotation_y(-0.3); + next.control_r.orientation = + Quaternion::rotation_x(PI / 1.5 + slow * 0.1 + s_a.grip.0 * 0.2) + * Quaternion::rotation_y(0.5 + slow * 0.0 + s_a.grip.0 * 0.2); + + next.control.orientation = Quaternion::rotation_x(-1.35 + 0.5 * speednorm); + + next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1); + next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel) + * Quaternion::rotation_z(fast * 0.15 * speednormcancel); + + next + } +} diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 412d1475e8..8483653367 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -2478,7 +2478,6 @@ struct SidedBSCentralVoxSpec { chest: BipedSmallCentralSubSpec, shorts: BipedSmallCentralSubSpec, tail: BipedSmallCentralSubSpec, - main: BipedSmallCentralSubSpec, } #[derive(Deserialize)] struct BipedSmallCentralSubSpec { @@ -2500,11 +2499,24 @@ struct BipedSmallLateralSubSpec { lateral: VoxSimple, } +#[derive(Deserialize)] +struct BipedSmallWeaponSpec(HashMap<(BSSpecies, BSBodyType), SidedBSWeaponVoxSpec>); +#[derive(Deserialize)] +struct SidedBSWeaponVoxSpec { + main: BipedSmallWeaponSubSpec, +} +#[derive(Deserialize)] +struct BipedSmallWeaponSubSpec { + offset: [f32; 3], // Should be relative to initial origin + weapon: VoxSimple, +} + make_vox_spec!( biped_small::Body, struct BipedSmallSpec { central: BipedSmallCentralSpec = "voxygen.voxel.biped_small_central_manifest", lateral: BipedSmallLateralSpec = "voxygen.voxel.biped_small_lateral_manifest", + weapon: BipedSmallWeaponSpec = "voxygen.voxel.biped_small_weapon_manifest", }, |FigureKey { body, .. }, spec| { [ @@ -2524,7 +2536,7 @@ make_vox_spec!( body.species, body.body_type, )), - Some(spec.central.read().0.mesh_main( + Some(spec.weapon.read().0.mesh_main( body.species, body.body_type, )), @@ -2619,22 +2631,6 @@ impl BipedSmallCentralSpec { (central, Vec3::from(spec.tail.offset)) } - - fn mesh_main(&self, species: BSSpecies, body_type: BSBodyType) -> BoneMeshes { - let spec = match self.0.get(&(species, body_type)) { - Some(spec) => spec, - None => { - error!( - "No main specification exists for the combination of {:?} and {:?}", - species, body_type - ); - return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); - }, - }; - let central = graceful_load_segment(&spec.main.central.0); - - (central, Vec3::from(spec.main.offset)) - } } impl BipedSmallLateralSpec { @@ -2702,6 +2698,24 @@ impl BipedSmallLateralSpec { (lateral, Vec3::from(spec.foot_r.offset)) } } +impl BipedSmallWeaponSpec { + fn mesh_main(&self, species: BSSpecies, body_type: BSBodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No main specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let weapon = graceful_load_segment(&spec.main.weapon.0); + + (weapon, Vec3::from(spec.main.offset)) + } +} + //// #[derive(Deserialize)] diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index a9d645ae5f..8669f3b3ac 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -2624,23 +2624,37 @@ impl FigureMgr { &mut state_animation_rate, skeleton_attr, ), - _ => anim::biped_small::RunAnimation::update_skeleton( + _ => anim::biped_small::IdleAnimation::update_skeleton( &BipedSmallSkeleton::default(), - ( - vel.0, - ori, - state.last_ori, - time, - state.avg_vel, - state.acc_vel, - ), + (vel.0, ori, state.last_ori, time, state.avg_vel), state.state_time, &mut state_animation_rate, skeleton_attr, ), }; - state.skeleton = anim::vek::Lerp::lerp(&state.skeleton, &target_base, dt_lerp); + let target_bones = match &character { + CharacterState::Wielding { .. } => { + anim::biped_small::WieldAnimation::update_skeleton( + &target_base, + ( + vel.0, + ori, + state.last_ori, + time, + state.avg_vel, + state.acc_vel, + ), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ) + }, + // TODO! + _ => target_base, + }; + + state.skeleton = anim::vek::Lerp::lerp(&state.skeleton, &target_bones, dt_lerp); state.update( renderer, pos.0,