From 28cde31bbb47bd67af4cc3c1086bc9a9478bb417 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sat, 24 Oct 2020 14:54:36 -0400 Subject: [PATCH] setup for staff, more anim conversions --- assets/voxygen/item_image_manifest.ron | 14 +-- .../voxel/weapon/sceptre/ore-nature.vox | 2 +- .../voxel/weapon/sceptre/wood-nature.vox | 2 +- .../voxel/weapon/sceptre/wood-simple.vox | 2 +- .../voxel/weapon/staff/firestaff_amethyst.vox | 4 +- .../voxel/weapon/staff/firestaff_bone.vox | 4 +- .../voxel/weapon/staff/firestaff_cultist.vox | 2 +- .../voxel/weapon/staff/firestaff_ogre.vox | 2 +- .../voxel/weapon/staff/firestaff_saurok.vox | 2 +- .../voxel/weapon/staff/firestaff_starter.vox | 2 +- .../voxel/weapon/staff/wood-simple.vox | 2 +- common/src/comp/inventory/item/tool.rs | 4 +- voxygen/src/anim/src/character/alpha.rs | 62 +--------- voxygen/src/anim/src/character/beta.rs | 50 +++----- voxygen/src/anim/src/character/charge.rs | 27 +++-- voxygen/src/anim/src/character/chargeswing.rs | 112 ++++++++--------- voxygen/src/anim/src/character/climb.rs | 47 -------- voxygen/src/anim/src/character/dance.rs | 2 - voxygen/src/anim/src/character/equip.rs | 113 +++--------------- voxygen/src/anim/src/character/glidewield.rs | 36 ------ voxygen/src/anim/src/character/gliding.rs | 21 ---- voxygen/src/anim/src/character/jump.rs | 4 + voxygen/src/anim/src/character/mod.rs | 15 +++ voxygen/src/anim/src/character/roll.rs | 38 ------ voxygen/src/anim/src/character/run.rs | 7 +- voxygen/src/anim/src/character/shoot.rs | 26 ++-- voxygen/src/anim/src/character/spin.rs | 45 +++---- voxygen/src/anim/src/character/stand.rs | 4 + voxygen/src/anim/src/character/swim.rs | 4 + voxygen/src/anim/src/character/swimwield.rs | 2 - voxygen/src/anim/src/character/wield.rs | 36 +++--- voxygen/src/anim/src/fish_medium/idle.rs | 5 - voxygen/src/anim/src/fish_medium/jump.rs | 5 - voxygen/src/anim/src/fish_medium/run.rs | 5 - 34 files changed, 206 insertions(+), 502 deletions(-) diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 06677412cc..b7c0aa25ce 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -491,32 +491,32 @@ // Staffs Tool(Staff("BasicStaff")): VoxTrans( "voxel.weapon.staff.firestaff_starter", - (1.0, 0.0, 0.0), (-310., 90.0, 0.0), 1.2, + (1.0, 0.0, 0.0), (-130., 90.0, 0.0), 1.2, ), Tool(Staff("BoneStaff")): VoxTrans( "voxel.weapon.staff.firestaff_bone", - (1.0, 0.0, 0.0), (-310., 90.0, 0.0), 1.2, + (1.0, 0.0, 0.0), (-130., 90.0, 0.0), 1.2, ), Tool(Staff("AmethystStaff")): VoxTrans( "voxel.weapon.staff.firestaff_amethyst", - (1.0, 0.0, 0.0), (-310., 90.0, 0.0), 1.2, + (1.0, 0.0, 0.0), (-130., 90.0, 0.0), 1.2, ), Tool(Staff("CultistStaff")): VoxTrans( "voxel.weapon.staff.firestaff_cultist", - (1.0, 0.0, 0.0), (-310., 90.0, 0.0), 1.2, + (1.0, 0.0, 0.0), (-130., 90.0, 0.0), 1.2, ), // Healing staff Tool(Sceptre("Sceptre")): VoxTrans( "voxel.weapon.sceptre.wood-nature", - (1.0, -1.0, 0.0), (-310., 90.0, 0.0), 1.2, + (1.0, -1.0, 0.0), (-130., 90.0, 0.0), 1.2, ), Tool(Sceptre("StarterSceptre")): VoxTrans( "voxel.weapon.sceptre.wood-simple", - (0.0, -0.0, 0.0), (-310., 90.0, 0.0), 1.25, + (0.0, -0.0, 0.0), (-130., 90.0, 0.0), 1.25, ), Tool(Sceptre("SceptreVelorite")): VoxTrans( "voxel.weapon.sceptre.ore-nature", - (1.0, -1.0, 0.0), (-310., 90.0, 0.0), 1.15, + (1.0, -1.0, 0.0), (-130., 90.0, 0.0), 1.15, ), // Shields Tool(Shield("BasicShield")): VoxTrans( diff --git a/assets/voxygen/voxel/weapon/sceptre/ore-nature.vox b/assets/voxygen/voxel/weapon/sceptre/ore-nature.vox index 772fee747a..da5e0c3fbe 100644 --- a/assets/voxygen/voxel/weapon/sceptre/ore-nature.vox +++ b/assets/voxygen/voxel/weapon/sceptre/ore-nature.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5f6949d842517a5fb70205f613c239ca3a9e32744cda67e5d4d9e16af8a99638 +oid sha256:8b96a76d1a3423d8d91a9f987932e632f83ea914e87f44e95791bcbcc38e0f16 size 1680 diff --git a/assets/voxygen/voxel/weapon/sceptre/wood-nature.vox b/assets/voxygen/voxel/weapon/sceptre/wood-nature.vox index cfb29487b3..e69a774d6c 100644 --- a/assets/voxygen/voxel/weapon/sceptre/wood-nature.vox +++ b/assets/voxygen/voxel/weapon/sceptre/wood-nature.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7d170f609ca3ec724429acdefb3c076f334265a9bed58d644bfb4e202e91ca94 +oid sha256:c6a1bf23334b4190cf55a48652c9ff3884a1d6ee2056f94bb1567e1b31ae81e2 size 1448 diff --git a/assets/voxygen/voxel/weapon/sceptre/wood-simple.vox b/assets/voxygen/voxel/weapon/sceptre/wood-simple.vox index dab2e37a70..f91eb4e919 100644 --- a/assets/voxygen/voxel/weapon/sceptre/wood-simple.vox +++ b/assets/voxygen/voxel/weapon/sceptre/wood-simple.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1909f46000f552884b96f2b218629cb0d3d7a7dd60c74e39fb373ff96dd11b7a +oid sha256:aa5235aec6d75a53ba81a711867e26c31cb1b95f9c4fa396647a22f7ab26ba87 size 1376 diff --git a/assets/voxygen/voxel/weapon/staff/firestaff_amethyst.vox b/assets/voxygen/voxel/weapon/staff/firestaff_amethyst.vox index b35b431f38..79ebeed4ef 100644 --- a/assets/voxygen/voxel/weapon/staff/firestaff_amethyst.vox +++ b/assets/voxygen/voxel/weapon/staff/firestaff_amethyst.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cefd61e370671c019a81b822c05b111474f7506f79e4ba89e2c0396210ebfa25 -size 27535 +oid sha256:5b5a77d834b2f4817a2764198f4053af3c473f3b760b52eb7f842e58ab7e6651 +size 1380 diff --git a/assets/voxygen/voxel/weapon/staff/firestaff_bone.vox b/assets/voxygen/voxel/weapon/staff/firestaff_bone.vox index cc95d94c9d..a4c7c637a5 100644 --- a/assets/voxygen/voxel/weapon/staff/firestaff_bone.vox +++ b/assets/voxygen/voxel/weapon/staff/firestaff_bone.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8a008037e3968e259841e2cb943ccdef822345364d00a6e3b10ceaf5e80a43ed -size 27451 +oid sha256:7dd2da60ea3f14dc738a7c80ff748e69bb98feade3f5e5efccd2f7fdf5d24d67 +size 1296 diff --git a/assets/voxygen/voxel/weapon/staff/firestaff_cultist.vox b/assets/voxygen/voxel/weapon/staff/firestaff_cultist.vox index 2c27ee0143..56d3de6a0c 100644 --- a/assets/voxygen/voxel/weapon/staff/firestaff_cultist.vox +++ b/assets/voxygen/voxel/weapon/staff/firestaff_cultist.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:39641c0dc427c30ac328101e3cbf7074e133d004a57ef964810b71d43779ddb8 +oid sha256:8d45183e514f725203b055037f539c944e4862900885433b31a4c0a9870ba5c6 size 1464 diff --git a/assets/voxygen/voxel/weapon/staff/firestaff_ogre.vox b/assets/voxygen/voxel/weapon/staff/firestaff_ogre.vox index 9720db64e2..20337015cc 100644 --- a/assets/voxygen/voxel/weapon/staff/firestaff_ogre.vox +++ b/assets/voxygen/voxel/weapon/staff/firestaff_ogre.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1a7e0f7afd15aae9d17febd8d04873a35bac6aac7ffa8cdb19a8836779bb55db +oid sha256:ae78b481491fa24dfa9ada77861a2094985f59288e88b8e47513ffb20cafff40 size 2040 diff --git a/assets/voxygen/voxel/weapon/staff/firestaff_saurok.vox b/assets/voxygen/voxel/weapon/staff/firestaff_saurok.vox index 12f8b3693e..b27250ae2b 100644 --- a/assets/voxygen/voxel/weapon/staff/firestaff_saurok.vox +++ b/assets/voxygen/voxel/weapon/staff/firestaff_saurok.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:949263aa4188847a4859d324db734638283bcfdf42e1db720f1444b5fbd76bde +oid sha256:521e8a46b305caa26c32a8905be9daba4fd4dcca085de27b2f7bb84a38d9b4ff size 1508 diff --git a/assets/voxygen/voxel/weapon/staff/firestaff_starter.vox b/assets/voxygen/voxel/weapon/staff/firestaff_starter.vox index 5ea4ad7a88..862afa389b 100644 --- a/assets/voxygen/voxel/weapon/staff/firestaff_starter.vox +++ b/assets/voxygen/voxel/weapon/staff/firestaff_starter.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6dc6d05c1067f2af69684f5120815684f8dadc6af0ad75b2e36d7fd3739c9a7e +oid sha256:2f5c033588bc902b1e7e2e5fd6e20d1b39cf7bdd8ca60172bb834d674cad47cc size 1464 diff --git a/assets/voxygen/voxel/weapon/staff/wood-simple.vox b/assets/voxygen/voxel/weapon/staff/wood-simple.vox index 88047f09b1..5d17bb63e6 100644 --- a/assets/voxygen/voxel/weapon/staff/wood-simple.vox +++ b/assets/voxygen/voxel/weapon/staff/wood-simple.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3df078fd1320d72e06702ef16cf0ff9ce03c4f644f04c2ec52215e922ac96282 +oid sha256:ebc6f06fdb8cc53dd82bcfde95b307eb61a18220efdb506463f4cc4b73f3d586 size 1448 diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index a097d49d9e..7f8b5499d8 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -267,8 +267,8 @@ impl Tool { range: 3.5, max_angle: 30.0, charge_duration: Duration::from_millis(1200), - swing_duration: Duration::from_millis(400), - recover_duration: Duration::from_millis(100), + swing_duration: Duration::from_millis(200), + recover_duration: Duration::from_millis(300), }, LeapMelee { energy_cost: 700, diff --git a/voxygen/src/anim/src/character/alpha.rs b/voxygen/src/anim/src/character/alpha.rs index 44ff6d7f5b..5ec8f3fd6b 100644 --- a/voxygen/src/anim/src/character/alpha.rs +++ b/voxygen/src/anim/src/character/alpha.rs @@ -38,9 +38,9 @@ impl Animation for AlphaAnimation { let lab = 1.0; let (movement1, movement2, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0), + Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), + Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powf(4.0)), _ => (0.0, 0.0, 0.0), }; @@ -56,10 +56,6 @@ impl Animation for AlphaAnimation { / (0.4 + 4.6 * ((anim_time as f32 * lab as f32 * 9.0).sin()).powf(2.0 as f32))) .sqrt()) * ((anim_time as f32 * lab as f32 * 9.0).sin()); - let quick = (((5.0) - / (0.4 + 4.6 * ((anim_time as f32 * lab as f32 * 18.0).sin()).powf(2.0 as f32))) - .sqrt()) - * ((anim_time as f32 * lab as f32 * 18.0).sin()); let axe = (((1.0) / (0.05 + 0.95 * ((anim_time as f32 * lab as f32 * 8.0).sin()).powf(2.0 as f32))) .sqrt()) @@ -74,7 +70,6 @@ impl Animation for AlphaAnimation { * ((anim_time as f32 * lab as f32 * 4.0).sin()); match active_tool_kind { - //TODO: Inventory Some(ToolKind::Sword(_)) => { next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.orientation = Quaternion::rotation_x(0.0); @@ -101,67 +96,16 @@ impl Animation for AlphaAnimation { movement1 * 1.5 + (movement2 * 1.75).sin() * -3.0 + movement3 * 0.5, ); - next.head.position = Vec3::new(0.0, s_a.head.0 + 0.0, s_a.head.1); + next.head.position = Vec3::new(0.0 + movement2 * 2.0, s_a.head.0, s_a.head.1); next.head.orientation = Quaternion::rotation_z( movement1 * -0.9 + (movement2 * 1.75).sin() * 2.5 + movement3 * -0.5, ); }, Some(ToolKind::Dagger(_)) => { - next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); - next.head.orientation = Quaternion::rotation_z(slow * -0.25) - * Quaternion::rotation_x(0.0 + slow * 0.15) - * Quaternion::rotation_y(slow * -0.15); - - next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); - next.chest.orientation = Quaternion::rotation_z(slow * 0.4) - * Quaternion::rotation_x(0.0 + slow * -0.2) - * Quaternion::rotation_y(slow * 0.2); - - next.belt.position = Vec3::new(0.0, s_a.belt.0, s_a.belt.1); - next.belt.orientation = next.chest.orientation * -0.3; - - next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1); - next.shorts.orientation = next.chest.orientation * -0.45; - - next.hand_l.position = Vec3::new(0.0, 0.0, 0.0); - next.hand_l.orientation = Quaternion::rotation_x(0.0); - - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_x(0.0); - next.control_l.position = Vec3::new(-10.0 + push * 5.0, 6.0 + push * 5.0, 2.0); next.control_l.orientation = Quaternion::rotation_x(-1.4 + slow * 0.4) * Quaternion::rotation_y(slow * -1.3) * Quaternion::rotation_z(1.4 + slow * -0.5); - - next.hand_r.position = Vec3::new(0.0, 0.0, 0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0); - next.hand_r.scale = Vec3::one() * 1.04; - - next.second.position = Vec3::new(0.0, 0.0, 0.0); - next.second.orientation = Quaternion::rotation_x(0.0); - - next.control_r.position = Vec3::new(8.0, 0.0, 0.0); - next.control_r.orientation = Quaternion::rotation_x(0.0); - - next.foot_l.position = - Vec3::new(-s_a.foot.0, slow * -3.0 + quick * 3.0 - 4.0, s_a.foot.2); - next.foot_l.orientation = Quaternion::rotation_x(slow * 0.6) - * Quaternion::rotation_y((slow * -0.2).max(0.0)); - - next.foot_r.position = - Vec3::new(s_a.foot.0, slow * 3.0 + quick * -3.0 + 5.0, s_a.foot.2); - next.foot_r.orientation = Quaternion::rotation_x(slow * -0.6) - * Quaternion::rotation_y((slow * 0.2).min(0.0)); - - next.lantern.orientation = - Quaternion::rotation_x(slow * -0.7 + 0.4) * Quaternion::rotation_y(slow * 0.4); - - next.torso.position = Vec3::new(0.0, 0.0, 0.1) * s_a.scaler; - next.torso.orientation = Quaternion::rotation_z(0.0) - * Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0); - next.torso.scale = Vec3::one() / 11.0 * s_a.scaler; }, Some(ToolKind::Axe(_)) => { next.head.position = Vec3::new(0.0, 0.0 + s_a.head.0, s_a.head.1); diff --git a/voxygen/src/anim/src/character/beta.rs b/voxygen/src/anim/src/character/beta.rs index 54308d30ae..7ae0dae5cb 100644 --- a/voxygen/src/anim/src/character/beta.rs +++ b/voxygen/src/anim/src/character/beta.rs @@ -34,9 +34,9 @@ impl Animation for BetaAnimation { let mut next = (*skeleton).clone(); let (movement1, movement2, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0), - Some(StageSection::Cast) => (1.0, anim_time as f32, 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), + Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), + Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powf(4.0)), _ => (0.0, 0.0, 0.0), }; @@ -53,41 +53,29 @@ impl Animation for BetaAnimation { Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4); next.control.position = Vec3::new( - s_a.sc.0 - + movement1 * -5.0 - + (movement2 as f32 * 2.5).sin() * 30.0 - + movement3 * -5.0, - s_a.sc.1 - (movement1 as f32 * 8.0).sin() * 0.8 - + movement1 * 2.0 - + movement3 * 2.0, - s_a.sc.2 - (movement1 as f32 * 8.0).sin() * 0.4, + s_a.sc.0 + (-1.4 + movement1 * -3.0 + movement2 * -2.0) * (1.0 - movement3), + s_a.sc.1 + (-1.4 + movement1 * 3.0 + movement2 * 3.0) * (1.0 - movement3), + s_a.sc.2 + (-1.9 + movement1 * 2.5 * (1.0 - movement3)), ); - next.control.orientation = Quaternion::rotation_x(-1.57 + s_a.sc.3) - * Quaternion::rotation_y( - s_a.sc.4 + movement1 * 1.5 + (movement2 as f32 * 2.5).sin() * 0.5, - ) - * Quaternion::rotation_z(1.0 + s_a.sc.5 + (movement2 as f32 * 2.5).sin() * 1.0); - next.chest.orientation = Quaternion::rotation_y(-0.1) + next.control.orientation = + Quaternion::rotation_x(s_a.sc.3 + (-1.7) * (1.0 - movement3)) + * Quaternion::rotation_y( + s_a.sc.4 + + (0.4 + movement1 * 1.5 + movement2 * -2.5) * (1.0 - movement3), + ) + * Quaternion::rotation_z( + s_a.sc.5 + (1.67 + movement2 * 1.57) * (1.0 - movement3), + ); + next.chest.orientation = Quaternion::rotation_x(0.15) + * Quaternion::rotation_y((-0.1) * (1.0 - movement3)) * Quaternion::rotation_z( - 0.4 + movement1 * 1.5 - + (movement2 as f32 * 2.5).sin() * -0.5 - + movement3 * 1.0, - ); - next.head.orientation = Quaternion::rotation_y(0.1) - * Quaternion::rotation_z( - -0.1 + movement1 * -1.1 + (movement2 as f32 * 2.5).sin() * -0.5, + (0.4 + movement1 * 1.5 + movement2 * -2.5) * (1.0 - movement3), ); + next.head.orientation = Quaternion::rotation_z((-0.4) * (1.0 - movement3)); }, _ => {}, } - next.glider.position = Vec3::new(0.0, 0.0, 10.0); - next.glider.scale = Vec3::one() * 0.0; - - next.lantern.orientation = Quaternion::rotation_x(0.4); - next.lantern.scale = Vec3::one() * 0.65; - next.hold.scale = Vec3::one() * 0.0; - next.second.scale = match ( active_tool_kind.map(|tk| tk.hands()), second_tool_kind.map(|tk| tk.hands()), diff --git a/voxygen/src/anim/src/character/charge.rs b/voxygen/src/anim/src/character/charge.rs index b97b55aa85..394bc38678 100644 --- a/voxygen/src/anim/src/character/charge.rs +++ b/voxygen/src/anim/src/character/charge.rs @@ -94,23 +94,24 @@ impl Animation for ChargeAnimation { match active_tool_kind { //TODO: Inventory Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => { - next.hand_l.position = Vec3::new(11.0, 5.0, -4.0); - next.hand_l.orientation = Quaternion::rotation_x(1.27); - next.hand_r.position = Vec3::new(12.0, 5.5, 2.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(s_a.sthl.3); + + 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.2); - next.main.position = Vec3::new(12.0, 8.5, 13.2); - next.main.orientation = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(3.14) - * Quaternion::rotation_z(0.0); + Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.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 + quick * 3.5 * (1.0 / (stopa + 0.1)), - 0.0 + quicka * 3.5 * (1.0 / (stopa + 0.1)), - 8.0 - stop * 3.0, + s_a.stc.0 + quick * 3.5 * (1.0 / (stopa + 0.1)), + s_a.stc.1, + s_a.stc.2 - stop * 3.0, ); - next.control.orientation = - Quaternion::rotation_x(stop * -0.2) * Quaternion::rotation_z(stop * 0.2); + next.control.orientation = Quaternion::rotation_x(s_a.stc.3 + stop * -0.2) + * Quaternion::rotation_y(s_a.stc.4) + * Quaternion::rotation_z(s_a.stc.5 + stop * 0.2); }, Some(ToolKind::Bow(_)) => { next.hand_l.position = Vec3::new(1.0, -2.0 + stop * -1.0, 0.0); diff --git a/voxygen/src/anim/src/character/chargeswing.rs b/voxygen/src/anim/src/character/chargeswing.rs index b35fe26bc4..dd9e3b6a56 100644 --- a/voxygen/src/anim/src/character/chargeswing.rs +++ b/voxygen/src/anim/src/character/chargeswing.rs @@ -44,7 +44,6 @@ impl Animation for ChargeswingAnimation { // end spin stuff let movement = anim_time as f32 * 1.0; - let fire = (anim_time as f32 * 18.0 * lab as f32).sin(); let foothoril = (anim_time as f32 * 8.0 * lab as f32 + PI * 1.45).sin(); let foothorir = (anim_time as f32 * 8.0 * lab as f32 + PI * (0.45)).sin(); @@ -64,53 +63,60 @@ impl Animation for ChargeswingAnimation { * ((anim_time as f32 * 8.0 * lab as f32 + PI * 0.4).sin()).powf(2.0 as f32))) .sqrt()) * ((anim_time as f32 * 8.0 * lab as f32 + PI * 0.4).sin()); - if let Some(ToolKind::Hammer(_)) = active_tool_kind { - next.hand_l.position = Vec3::new(-12.0, 0.0, 0.0); - next.hand_l.orientation = Quaternion::rotation_x(-0.0) * Quaternion::rotation_y(0.0); - next.hand_r.position = Vec3::new(2.0, 0.0, 0.0); - next.hand_r.orientation = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); - next.main.position = Vec3::new(0.0, 0.0, 0.0); - next.main.orientation = Quaternion::rotation_y(-1.57) * Quaternion::rotation_z(1.57); - next.control.position = Vec3::new(6.0, 7.0, 1.0); - next.control.orientation = Quaternion::rotation_x(0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); + let (movement1, movement2, movement3, tension) = match stage_section { + Some(StageSection::Charge) => ( + (anim_time as f32).min(1.0), + 0.0, + 0.0, + (anim_time as f32 * 18.0 * lab as f32).sin(), + ), + Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powf(4.0), 0.0), + _ => (0.0, 0.0, 0.0, 0.0), + }; + if let Some(ToolKind::Hammer(_)) = active_tool_kind { + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_x(0.0); + next.hand_l.position = Vec3::new( + s_a.hhl.0, + s_a.hhl.1, + s_a.hhl.2 + (movement2 * -8.0) * (1.0 - movement3), + ); + next.hand_l.orientation = + Quaternion::rotation_x(s_a.hhl.3) * Quaternion::rotation_y(s_a.hhl.4); + next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2); + next.hand_r.orientation = + Quaternion::rotation_x(s_a.hhr.3) * Quaternion::rotation_y(s_a.hhr.4); + + next.control.position = Vec3::new( + s_a.hc.0 + (movement1 * -2.0 + movement2 * -3.0) * (1.0 - movement3), + s_a.hc.1 + (movement1 * 2.0 + movement2 * 3.0) * (1.0 - movement3), + s_a.hc.2 + (movement1 * 2.0 + movement2 * 4.0) * (1.0 - movement3), + ); + next.control.orientation = Quaternion::rotation_x(s_a.hc.3+(movement2*4.0)*(1.0-movement3)) + * Quaternion::rotation_y(s_a.hc.4+(tension*0.08+movement1 * 0.7+movement2*-3.5)*(1.0-movement3))//+fire * 0.1 + * Quaternion::rotation_z(s_a.hc.5+(movement1 * 0.2+movement2*-0.5)*(1.0-movement3)); + next.chest.orientation = Quaternion::rotation_z( + short * 0.04 + (movement1 * 2.0 + movement2 * -2.5) * (1.0 - movement3), + ); + next.belt.orientation = + Quaternion::rotation_z(short * 0.08 + (movement1 * -1.0) * (1.0 - movement3)); + next.shorts.orientation = + Quaternion::rotation_z(short * 0.15 + (movement1 * -1.0) * (1.0 - movement3)); + next.head.position = Vec3::new( + 0.0 + (movement1 * -1.0 + movement2 * 2.0) * (1.0 - movement3), + s_a.head.0 + (movement1 * 1.0) * (1.0 - movement3), + s_a.head.1, + ); + next.head.orientation = + Quaternion::rotation_z((movement1 * -1.5 + movement2 * 2.2) * (1.0 - movement3)); + next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); if let Some(stage_section) = stage_section { match stage_section { StageSection::Charge => { - next.control.position = Vec3::new( - 6.0 + (movement * -4.0).max(-8.0), - 7.0 + (movement * 2.0).min(2.0), - 1.0, - ); - next.control.orientation = Quaternion::rotation_x(0.3) - * Quaternion::rotation_y( - 0.0 + (movement * 0.7).min(0.7) - + fire * 0.1 * (anim_time as f32).min(2.0), - ) - * Quaternion::rotation_z(0.0 + (movement * 0.2).min(0.5)); - next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); - next.chest.orientation = - Quaternion::rotation_z((movement * 2.0).min(PI / 2.0)); - next.belt.orientation = - Quaternion::rotation_z((short * 0.08 + movement * -1.0).max(-PI / 5.0)); - next.shorts.orientation = - Quaternion::rotation_z((short * 0.15 + movement * -1.0).max(-PI / 4.0)); - - next.head.position = Vec3::new( - 0.0, - s_a.head.0 - 2.0 + (movement * 2.0).min(2.0), - s_a.head.1, - ); - - next.head.orientation = - Quaternion::rotation_z((movement * -1.8).max(PI / -2.0)); - next.belt.orientation = Quaternion::rotation_z(short * 0.05); - - next.shorts.orientation = Quaternion::rotation_z(short * 0.15); - if speed > 0.5 { + /*if speed > 0.5 { next.foot_l.position = Vec3::new( -s_a.foot.0, s_a.foot.1 + foothoril * -2.5 - 3.5, @@ -143,25 +149,7 @@ impl Animation for ChargeswingAnimation { next.foot_r.orientation = Quaternion::rotation_x(0.2) * Quaternion::rotation_z(0.5); }; - }, - - StageSection::Swing => { - next.chest.orientation = Quaternion::rotation_z(-0.5); - next.control.position = Vec3::new(6.0, 7.0, 1.0 + 3.0); - next.control.orientation = Quaternion::rotation_x(PI / 2.0) - * Quaternion::rotation_y(-1.6) - * Quaternion::rotation_z(0.3 - movement * 2.5); - next.head.orientation = Quaternion::rotation_z(0.8); - next.hand_l.position = Vec3::new(-3.0, 0.0, 0.0); - }, - StageSection::Recover => { - next.chest.orientation = Quaternion::rotation_z(-0.5 + movement * 0.5); - next.control.position = Vec3::new(6.0, 7.0, 1.0 + 3.0 + movement * -3.0); - next.control.orientation = Quaternion::rotation_x(PI / 2.0) - * Quaternion::rotation_y(-1.6 + movement * 1.6) - * Quaternion::rotation_z(-2.2 + movement * 2.2); - next.head.orientation = Quaternion::rotation_z(0.8 + movement * -0.8); - next.hand_l.position = Vec3::new(-3.0 + movement * -9.0, 0.0, 0.0); + */ }, _ => {}, } diff --git a/voxygen/src/anim/src/character/climb.rs b/voxygen/src/anim/src/character/climb.rs index d64a24b0fd..828a5489e3 100644 --- a/voxygen/src/anim/src/character/climb.rs +++ b/voxygen/src/anim/src/character/climb.rs @@ -97,40 +97,6 @@ impl Animation for ClimbAnimation { ); next.hand_r.orientation = Quaternion::rotation_x(2.2 - quicka * 0.5); - match active_tool_kind { - Some(ToolKind::Dagger(_)) => { - next.main.position = Vec3::new(-4.0, -5.0, 7.0); - next.main.orientation = - Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI); - }, - Some(ToolKind::Shield(_)) => { - next.main.position = Vec3::new(-0.0, -5.0, 3.0); - next.main.orientation = - Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); - }, - _ => { - next.main.position = Vec3::new(-7.0, -5.0, 15.0); - next.main.orientation = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - }, - } - match second_tool_kind { - Some(ToolKind::Dagger(_)) => { - next.second.position = Vec3::new(4.0, -6.0, 7.0); - next.second.orientation = - Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); - }, - Some(ToolKind::Shield(_)) => { - next.second.position = Vec3::new(0.0, -4.0, 3.0); - next.second.orientation = - Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI); - }, - _ => { - next.second.position = Vec3::new(-7.0, -5.0, 15.0); - next.second.orientation = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - }, - } next.foot_l.position = Vec3::new(-s_a.foot.0, 5.0 + s_a.foot.1, s_a.foot.2 + quick * 2.5); next.foot_l.orientation = Quaternion::rotation_x(0.2 - quicka * 0.5); @@ -143,16 +109,6 @@ impl Animation for ClimbAnimation { next.shoulder_r.orientation = Quaternion::rotation_x(smooth * 0.15); - next.glider.position = Vec3::new(0.0, 0.0, 10.0); - next.glider.scale = Vec3::one() * 0.0; - - next.main.position = Vec3::new(-7.0, -5.0, 18.0); - next.main.orientation = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + smootha * 0.25); - - next.second.position = Vec3::new(0.0, 0.0, 0.0); - next.second.orientation = Quaternion::rotation_y(0.0); - next.lantern.orientation = Quaternion::rotation_x(smooth * -0.3) * Quaternion::rotation_y(smooth * -0.3); @@ -211,9 +167,6 @@ impl Animation for ClimbAnimation { next.glider.position = Vec3::new(0.0, 0.0, 10.0); next.glider.scale = Vec3::one() * 0.0; - next.main.position = Vec3::new(-7.0, -5.0, 18.0); - next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - next.torso.position = Vec3::new(0.0, -0.2, 0.4) * s_a.scaler; }; diff --git a/voxygen/src/anim/src/character/dance.rs b/voxygen/src/anim/src/character/dance.rs index 8b17dd085d..ec63d74e00 100644 --- a/voxygen/src/anim/src/character/dance.rs +++ b/voxygen/src/anim/src/character/dance.rs @@ -168,8 +168,6 @@ impl Animation for DanceAnimation { next.control.position = Vec3::new(0.0, 0.0, 0.0); next.control.orientation = Quaternion::rotation_x(0.0); - - next.second.scale = match ( active_tool_kind.map(|tk| tk.hands()), second_tool_kind.map(|tk| tk.hands()), diff --git a/voxygen/src/anim/src/character/equip.rs b/voxygen/src/anim/src/character/equip.rs index efe71f4328..ab254de95e 100644 --- a/voxygen/src/anim/src/character/equip.rs +++ b/voxygen/src/anim/src/character/equip.rs @@ -21,122 +21,45 @@ impl Animation for EquipAnimation { (active_tool_kind, second_tool_kind, velocity, _global_time): Self::Dependency, anim_time: f64, rate: &mut f32, - s_a: &SkeletonAttr, + _s_a: &SkeletonAttr, ) -> Self::Skeleton { *rate = 1.0; let mut next = (*skeleton).clone(); let lab = 1.0; - let short = (((5.0) - / (1.5 + 3.5 * ((anim_time as f32 * lab as f32 * 16.0).sin()).powf(2.0 as f32))) - .sqrt()) - * ((anim_time as f32 * lab as f32 * 16.0).sin()); - 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(-0.75, -1.0, -2.5); - next.hand_l.orientation = - Quaternion::rotation_x(1.57) * Quaternion::rotation_y(-0.2); - next.hand_r.position = Vec3::new(0.75, -1.5, -5.5); - next.hand_r.orientation = - Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.3); - next.main.position = Vec3::new(0.0, 0.0, -6.0); - next.main.orientation = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.control.position = - Vec3::new(-3.0 + equip_slowa * -1.5, -5.0, 12.0 + equip_slow * 1.5); - next.control.orientation = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); + 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(-4.0, 3.0, 6.0); - next.hand_l.orientation = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_z(3.14 - 0.3) - * Quaternion::rotation_y(-0.8); - next.hand_r.position = Vec3::new(-2.5, 9.0, 4.0); - next.hand_r.orientation = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_z(3.14 - 0.3) - * Quaternion::rotation_y(-0.8); - next.main.position = Vec3::new(-6.0, 10.0, -1.0); - next.main.orientation = Quaternion::rotation_x(1.27) - * Quaternion::rotation_y(-0.3) - * Quaternion::rotation_z(-0.8); - - next.control.position = Vec3::new(0.0, 0.0, 0.0); - next.control.orientation = - Quaternion::rotation_x(0.2) * Quaternion::rotation_y(-0.3); + 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(-7.0, 5.5, 3.5); - next.hand_l.orientation = - Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.32); - next.hand_r.position = Vec3::new(8.0, 7.75, 0.0); - next.hand_r.orientation = - Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.22); - next.main.position = Vec3::new(6.0, 7.0, 0.0); - next.main.orientation = - Quaternion::rotation_y(-1.35) * Quaternion::rotation_z(1.57); - - next.control.position = - Vec3::new(-3.0 + equip_slowa * -1.5, -12.0, 12.0 + equip_slow * 1.5); - next.control.orientation = - Quaternion::rotation_x(0.0) * Quaternion::rotation_y(1.35 + 2.5); + 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(0.0, 0.0, -4.0); - next.hand_l.orientation = - Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0); - next.hand_r.position = Vec3::new(0.0, 0.0, 2.0); - next.hand_r.orientation = - Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2); - next.main.position = Vec3::new(0.0, 0.0, 13.2); - next.main.orientation = Quaternion::rotation_y(3.14); - - next.control.position = Vec3::new(-4.0, 7.0, 4.0); - next.control.orientation = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.15) - * Quaternion::rotation_z(0.0); + 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(2.0, 1.5, 0.0); - next.hand_l.orientation = Quaternion::rotation_x(1.20) - * Quaternion::rotation_y(-0.6) - * Quaternion::rotation_z(-0.3); - next.hand_l.scale = Vec3::one() * 1.04; - next.hand_r.position = Vec3::new(5.9, 4.5, -5.0); - next.hand_r.orientation = Quaternion::rotation_x(1.20) - * Quaternion::rotation_y(-0.6) - * Quaternion::rotation_z(-0.3); - next.hand_r.scale = Vec3::one() * 1.04; - next.main.position = Vec3::new(3.0, 2.0, -13.0); - next.main.orientation = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.3) - * Quaternion::rotation_z(-0.6); - - next.control.position = Vec3::new(-7.0, 6.0, 6.0); - next.control.orientation = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); + 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.hold.scale = Vec3::one() * 0.0; - - if velocity > 0.5 { - next.torso.orientation = Quaternion::rotation_x(-0.2); - } else { - next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 + short * 0.2); - - next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2); - next.foot_l.orientation = Quaternion::rotation_x(0.0); - - next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2); - next.foot_r.orientation = Quaternion::rotation_x(0.0); - } next.second.scale = match ( active_tool_kind.map(|tk| tk.hands()), diff --git a/voxygen/src/anim/src/character/glidewield.rs b/voxygen/src/anim/src/character/glidewield.rs index f27ba0a94e..81d8876c32 100644 --- a/voxygen/src/anim/src/character/glidewield.rs +++ b/voxygen/src/anim/src/character/glidewield.rs @@ -77,42 +77,6 @@ impl Animation for GlideWieldAnimation { next.glider.orientation = Quaternion::rotation_x(0.35); next.glider.position = Vec3::new(0.0, -9.0, 17.0); next.glider.scale = Vec3::one() * 1.0; - - match active_tool_kind { - Some(ToolKind::Dagger(_)) => { - next.main.position = Vec3::new(-4.0, -5.0, 7.0); - next.main.orientation = - Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI); - }, - Some(ToolKind::Shield(_)) => { - next.main.position = Vec3::new(-0.0, -5.0, 3.0); - next.main.orientation = - Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); - }, - _ => { - next.main.position = Vec3::new(-7.0, -5.0, 15.0); - next.main.orientation = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - }, - } - - match second_tool_kind { - Some(ToolKind::Dagger(_)) => { - next.second.position = Vec3::new(4.0, -6.0, 7.0); - next.second.orientation = - Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); - }, - Some(ToolKind::Shield(_)) => { - next.second.position = Vec3::new(0.0, -4.0, 3.0); - next.second.orientation = - Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI); - }, - _ => { - next.second.position = Vec3::new(-7.0, -5.0, 15.0); - next.second.orientation = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - }, - } } next.second.scale = match ( diff --git a/voxygen/src/anim/src/character/gliding.rs b/voxygen/src/anim/src/character/gliding.rs index 2b1ca1b02e..38efa414dc 100644 --- a/voxygen/src/anim/src/character/gliding.rs +++ b/voxygen/src/anim/src/character/gliding.rs @@ -76,17 +76,13 @@ impl Animation for GlidingAnimation { anim_time as f32 }; - next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.orientation = Quaternion::rotation_x(0.35 - slow * 0.10 + head_look.y) * Quaternion::rotation_z(head_look.x + slowa * 0.15); - next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); next.chest.orientation = Quaternion::rotation_z(slowa * 0.02); - next.belt.position = Vec3::new(0.0, 0.0, -2.0); next.belt.orientation = Quaternion::rotation_z(slowa * 0.1 + tilt * tiltcancel * 12.0); - next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1); next.shorts.orientation = Quaternion::rotation_z(slowa * 0.12 + tilt * tiltcancel * 16.0); next.hand_l.position = Vec3::new(-9.5, -3.0, 10.0); @@ -118,23 +114,6 @@ impl Animation for GlidingAnimation { Quaternion::rotation_x(0.8) * Quaternion::rotation_y(slowa * 0.04); next.glider.scale = Vec3::one(); - match active_tool_kind { - Some(ToolKind::Dagger(_)) => { - next.main.position = Vec3::new(-4.0, -5.0, 7.0); - next.main.orientation = - Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI); - }, - Some(ToolKind::Shield(_)) => { - next.main.position = Vec3::new(-0.0, -5.0, 3.0); - next.main.orientation = - Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); - }, - _ => { - next.main.position = Vec3::new(-7.0, -5.0, 15.0); - next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - }, - } - next.torso.position = Vec3::new(0.0, -4.0, 10.0) / 11.0 * s_a.scaler; next.torso.orientation = Quaternion::rotation_x(-0.06 * speed.max(12.0) + slow * 0.04) * Quaternion::rotation_y(tilt * tiltcancel * 32.0); diff --git a/voxygen/src/anim/src/character/jump.rs b/voxygen/src/anim/src/character/jump.rs index f2494d61ac..c49c62008b 100644 --- a/voxygen/src/anim/src/character/jump.rs +++ b/voxygen/src/anim/src/character/jump.rs @@ -136,6 +136,10 @@ impl Animation for JumpAnimation { next.main.orientation = Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); }, + Some(ToolKind::Staff(_)) => { + next.main.position = Vec3::new(2.0, -5.0, -1.0); + next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57); + }, _ => { next.main.position = Vec3::new(-7.0, -5.0, 15.0); next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); diff --git a/voxygen/src/anim/src/character/mod.rs b/voxygen/src/anim/src/character/mod.rs index dc340c0849..5d7015a681 100644 --- a/voxygen/src/anim/src/character/mod.rs +++ b/voxygen/src/anim/src/character/mod.rs @@ -136,6 +136,9 @@ pub struct SkeletonAttr { 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), } impl Default for SkeletonAttr { @@ -158,6 +161,9 @@ impl Default for SkeletonAttr { 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), } } } @@ -249,6 +255,15 @@ impl<'a> From<&'a Body> for SkeletonAttr { hc: match (body.species, body.body_type) { (_, _) => (6.0, 7.0, 1.0, -0.3, -1.57, 0.5), }, + sthl: match (body.species, body.body_type) { + (_, _) => (0.0, 0.0, 1.0, 1.27, 0.0, 0.0), + }, + sthr: match (body.species, body.body_type) { + (_, _) => (0.0, 0.0, 7.0, 1.57, 0.2, 0.0), + }, + stc: match (body.species, body.body_type) { + (_, _) => (-5.0, 5.0, -1.0, -0.3, 0.15, 0.0), + }, } } } diff --git a/voxygen/src/anim/src/character/roll.rs b/voxygen/src/anim/src/character/roll.rs index c067ecefb4..4029f9abfa 100644 --- a/voxygen/src/anim/src/character/roll.rs +++ b/voxygen/src/anim/src/character/roll.rs @@ -75,46 +75,8 @@ impl Animation for RollAnimation { next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1 + 5.5, s_a.foot.2 - 5.0); next.foot_r.orientation = Quaternion::rotation_x(0.9); - next.glider.position = Vec3::new(0.0, 0.0, 10.0); - - match active_tool_kind { - Some(ToolKind::Dagger(_)) => { - next.main.position = Vec3::new(-4.0, -5.0, 7.0); - next.main.orientation = - Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(1.5 * PI); - }, - Some(ToolKind::Shield(_)) => { - next.main.position = Vec3::new(-0.0, -5.0, 3.0); - next.main.orientation = - Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); - }, - _ => { - next.main.position = Vec3::new(-7.0, -5.0, 15.0); - next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - }, - } - - match second_tool_kind { - Some(ToolKind::Dagger(_)) => { - next.second.position = Vec3::new(4.0, -6.0, 7.0); - next.second.orientation = - Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); - }, - Some(ToolKind::Shield(_)) => { - next.second.position = Vec3::new(0.0, -4.0, 3.0); - next.second.orientation = - Quaternion::rotation_y(-0.25 * PI) * Quaternion::rotation_z(1.5 * PI); - }, - _ => { - next.second.position = Vec3::new(-7.0, -5.0, 15.0); - next.second.orientation = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - }, - } - next.lantern.orientation = Quaternion::rotation_x(0.1) * Quaternion::rotation_y(0.1); next.lantern.scale = Vec3::one() * 0.65; - next.hold.scale = Vec3::one() * 0.0; next.torso.position = Vec3::new(0.0, 0.0, 8.0) / 11.0 * s_a.scaler; next.torso.orientation = diff --git a/voxygen/src/anim/src/character/run.rs b/voxygen/src/anim/src/character/run.rs index 7a294f0252..60d962a76d 100644 --- a/voxygen/src/anim/src/character/run.rs +++ b/voxygen/src/anim/src/character/run.rs @@ -197,9 +197,14 @@ impl Animation for RunAnimation { next.main.orientation = Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); }, + Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => { + next.main.position = Vec3::new(2.0, -5.0, -1.0); + next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57); + }, _ => { next.main.position = Vec3::new(-7.0, -5.0, 15.0); - next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); + next.main.orientation = + Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + shorte * -0.2); }, } diff --git a/voxygen/src/anim/src/character/shoot.rs b/voxygen/src/anim/src/character/shoot.rs index 5b91f768c5..72345ea941 100644 --- a/voxygen/src/anim/src/character/shoot.rs +++ b/voxygen/src/anim/src/character/shoot.rs @@ -56,20 +56,22 @@ impl Animation for ShootAnimation { next.shorts.orientation = next.chest.orientation * -0.08; match active_tool_kind { - //TODO: Inventory Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => { - next.hand_l.position = Vec3::new(11.0, 5.0, -4.0); - next.hand_l.orientation = - Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0); - next.hand_r.position = Vec3::new(12.0, 5.5, 2.0); - next.hand_r.orientation = - Quaternion::rotation_x(1.57) * Quaternion::rotation_y(0.2); - next.main.position = Vec3::new(12.0, 8.5, 13.2); - next.main.orientation = Quaternion::rotation_y(3.14); + 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(s_a.sthl.3); - next.control.position = Vec3::new(-7.0, 6.0, 6.0 - exp * 5.0); - next.control.orientation = - Quaternion::rotation_x(exp * 1.3) * Quaternion::rotation_z(exp * 1.5); + 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(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.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(s_a.stc.0, s_a.stc.1 + exp * 5.0, s_a.stc.2 - exp * 5.0); + next.control.orientation = Quaternion::rotation_x(s_a.stc.3 + exp * 0.4) + * Quaternion::rotation_y(s_a.stc.4) + * Quaternion::rotation_z(s_a.stc.5 + exp * 1.5); }, Some(ToolKind::Bow(_)) => { next.hand_l.position = diff --git a/voxygen/src/anim/src/character/spin.rs b/voxygen/src/anim/src/character/spin.rs index dbbd6e7932..e4cf7fb82b 100644 --- a/voxygen/src/anim/src/character/spin.rs +++ b/voxygen/src/anim/src/character/spin.rs @@ -39,9 +39,9 @@ impl Animation for SpinAnimation { let lab = 1.0; let (movement1, movement2, movement3) = match stage_section { - Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0), - Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), - Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), + Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), + Some(StageSection::Swing) => (1.0, (anim_time as f32).powf(1.8), 0.0), + Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powf(4.0)), _ => (0.0, 0.0, 0.0), }; @@ -55,8 +55,6 @@ impl Animation for SpinAnimation { let spin = (anim_time as f32 * 2.8 * lab as f32).sin(); let spinhalf = (anim_time as f32 * 1.4 * lab as f32).sin(); - fn slow(x: f32) -> f32 { (x * 8.0).sin() } - next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); if let Some(ToolKind::Sword(_)) = active_tool_kind { @@ -71,32 +69,21 @@ impl Animation for SpinAnimation { Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4); next.control.position = Vec3::new( - s_a.sc.0 + movement1 * 2.0 + movement2 * -8.0 + movement3 * -7.0, - s_a.sc.1 - + 8.0 - + slow(movement1) * 0.6 - + slow(movement2) * 3.0 - + slow(movement3) * -0.8 - + movement3 * -10.0, - s_a.sc.2 - + 1.0 - + slow(movement1) * 0.6 - + slow(movement2) * 3.5 - + movement2 * 3.0 - + slow(movement3) * -0.4 - + movement3 * -4.0, + s_a.sc.0 + movement1 * 2.0 + movement2 * -4.0 + movement3 * -7.0, + s_a.sc.1 + 8.0 + movement1 * 0.6 + movement3 * -10.0, + s_a.sc.2 + 1.0 + movement1 * 0.6 + movement2 * 1.5 + movement3 * -4.0, ); - next.control.orientation = Quaternion::rotation_x( - -0.5 + s_a.sc.4 + movement1 * -1.57 + movement2 * -0.6 + slow(movement2) * -0.25, - ) * Quaternion::rotation_y( - s_a.sc.4 - 0.6 + movement1 * 2.0 + movement2 * -2.0, - ) * Quaternion::rotation_z( - s_a.sc.5 + 0.1 + movement1 + movement2, + next.control.orientation = Quaternion::rotation_x(-0.5 + s_a.sc.3 + movement1 * -1.2) + * Quaternion::rotation_y(s_a.sc.4 - 0.6 + movement1 * 1.0) + * Quaternion::rotation_z(s_a.sc.5 + 0.1 + movement1 * 1.57); + next.head.position = Vec3::new( + 0.0 + 2.0 + movement2 * -2.0, + 2.0 + movement2 * -2.0 + s_a.head.0, + s_a.head.1, ); + next.head.orientation = Quaternion::rotation_z(movement2 * -0.4); - next.head.orientation = Quaternion::rotation_z(slow(movement2) * -0.8); - - next.chest.orientation = Quaternion::rotation_x(slow(movement2) * 0.15) + next.chest.orientation = Quaternion::rotation_x(movement2 * 0.15) * Quaternion::rotation_y(movement1 * -0.1 + movement2 * 0.3 + movement3 * -0.1) * Quaternion::rotation_z( -1.0 + movement1 * -0.6 + movement2 * 1.5 + movement3 * 0.5, @@ -111,7 +98,7 @@ impl Animation for SpinAnimation { next.head.orientation = Quaternion::rotation_y(movement1 * 0.1 - movement2 * -0.1) * Quaternion::rotation_z(1.07 + movement1 * 0.4 + movement2 * -1.5); - next.torso.orientation = Quaternion::rotation_z((movement2).sin() * 7.2); + next.torso.orientation = Quaternion::rotation_z(movement2 * 6.28); } if let Some(ToolKind::Axe(_) | ToolKind::Hammer(_) | ToolKind::Dagger(_)) = active_tool_kind diff --git a/voxygen/src/anim/src/character/stand.rs b/voxygen/src/anim/src/character/stand.rs index 0bda28e05a..6f9c53feff 100644 --- a/voxygen/src/anim/src/character/stand.rs +++ b/voxygen/src/anim/src/character/stand.rs @@ -109,6 +109,10 @@ impl Animation for StandAnimation { next.main.orientation = Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); }, + Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => { + next.main.position = Vec3::new(2.0, -5.0, -1.0); + next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57); + }, _ => { next.main.position = Vec3::new(-7.0, -5.0, 15.0); next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); diff --git a/voxygen/src/anim/src/character/swim.rs b/voxygen/src/anim/src/character/swim.rs index 75fc42c783..e3411a190d 100644 --- a/voxygen/src/anim/src/character/swim.rs +++ b/voxygen/src/anim/src/character/swim.rs @@ -178,6 +178,10 @@ impl Animation for SwimAnimation { next.main.orientation = Quaternion::rotation_y(0.25 * PI) * Quaternion::rotation_z(-1.5 * PI); }, + Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => { + next.main.position = Vec3::new(2.0, -5.0, -1.0); + next.main.orientation = Quaternion::rotation_y(-0.5) * Quaternion::rotation_z(1.57); + }, _ => { next.main.position = Vec3::new(-7.0, -5.0, 15.0); next.main.orientation = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); diff --git a/voxygen/src/anim/src/character/swimwield.rs b/voxygen/src/anim/src/character/swimwield.rs index f875421bcf..b75b6af8d9 100644 --- a/voxygen/src/anim/src/character/swimwield.rs +++ b/voxygen/src/anim/src/character/swimwield.rs @@ -359,8 +359,6 @@ impl Animation for SwimWieldAnimation { _ => {}, } - - next.second.scale = match ( active_tool_kind.map(|tk| tk.hands()), second_tool_kind.map(|tk| tk.hands()), diff --git a/voxygen/src/anim/src/character/wield.rs b/voxygen/src/anim/src/character/wield.rs index 42b7281807..cac4429812 100644 --- a/voxygen/src/anim/src/character/wield.rs +++ b/voxygen/src/anim/src/character/wield.rs @@ -50,8 +50,8 @@ impl Animation for WieldAnimation { let foothoril = (anim_time as f32 * 16.0 * lab as f32 + PI * 1.45).sin(); let slowalt = (anim_time as f32 * 6.0 + PI).cos(); - let u_slow = (anim_time as f32 * 1.0 + PI).sin(); - let slow = (anim_time as f32 * 3.0 + PI).sin(); + let u_slow = (anim_time as f32 * 2.5 + PI).sin(); + let slow = (anim_time as f32 * 5.0 + PI).sin(); let u_slowalt = (anim_time as f32 * 3.0 + PI).cos(); let short = (((5.0) @@ -182,37 +182,37 @@ impl Animation for WieldAnimation { next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3) * Quaternion::rotation_y(s_a.hhr.4); - next.control.position = Vec3::new(s_a.hc.0, s_a.hc.1, s_a.hc.2); + next.control.position = + Vec3::new(s_a.hc.0, s_a.hc.1 + speed * 0.2, s_a.hc.2 + speed * 0.8); next.control.orientation = Quaternion::rotation_x(s_a.hc.3 + u_slow * 0.15) - * Quaternion::rotation_y(s_a.hc.4) - * Quaternion::rotation_z(s_a.hc.5 + u_slowalt * 0.08); + * Quaternion::rotation_y(s_a.hc.4 + speed * -0.04) + * Quaternion::rotation_z(s_a.hc.5 + u_slowalt * 0.07); }, Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => { if speed > 0.5 && velocity.z == 0.0 { next.hand_r.position = Vec3::new( 4.0 + s_a.hand.0 + foothoril * 1.3, - -2.0 + s_a.hand.1 + foothoril * -6.5, - -2.0 + s_a.hand.2 - foothoril * 7.0, + s_a.hand.1 + foothoril * -6.5, + 5.0 + s_a.hand.2 - foothoril * 7.0, ); next.hand_r.orientation = Quaternion::rotation_x(0.6 + footrotl * -1.2) * Quaternion::rotation_y(footrotl * -0.4); } else { - next.hand_r.position = Vec3::new(0.0, 0.0, 2.0); + 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.2); + Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4); }; - next.control.position = Vec3::new(-4.0, 7.0, 4.0); + next.main.position = Vec3::new(0.0, 0.0, 0.0); + next.main.orientation = Quaternion::rotation_y(0.0); - next.hand_l.position = Vec3::new(0.0, 0.0, -4.0); - next.hand_l.orientation = - Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0); + next.control.position = Vec3::new(s_a.stc.0, s_a.stc.1, s_a.stc.2); - next.main.position = Vec3::new(0.0, 0.0, 13.2); - next.main.orientation = Quaternion::rotation_y(3.14); + 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(s_a.sthl.3); - next.control.orientation = Quaternion::rotation_x(-0.3 + u_slow * 0.1) - * Quaternion::rotation_y(0.15) - * Quaternion::rotation_z(u_slowalt * 0.1); + next.control.orientation = Quaternion::rotation_x(s_a.stc.3 + u_slow * 0.1) + * Quaternion::rotation_y(s_a.stc.4) + * Quaternion::rotation_z(s_a.stc.5 + u_slowalt * 0.1); }, Some(ToolKind::Shield(_)) => { next.control.position = Vec3::new(0.0, 0.0, 0.0); diff --git a/voxygen/src/anim/src/fish_medium/idle.rs b/voxygen/src/anim/src/fish_medium/idle.rs index d3d08d0986..09b0c820e6 100644 --- a/voxygen/src/anim/src/fish_medium/idle.rs +++ b/voxygen/src/anim/src/fish_medium/idle.rs @@ -31,23 +31,18 @@ impl Animation for IdleAnimation { next.head.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.head.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.torso.position = Vec3::new(0.0, 4.5, 2.0); next.torso.orientation = Quaternion::rotation_x(0.0); - next.rear.position = Vec3::new(0.0, 3.1, -4.5); next.rear.orientation = Quaternion::rotation_z(0.0); - next.tail.position = Vec3::new(0.0, -13.0, 8.0) / 11.0; next.tail.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.fin_l.position = Vec3::new(0.0, -11.7, 11.0) / 11.0; next.fin_l.orientation = Quaternion::rotation_y(0.0); - next.fin_r.position = Vec3::new(0.0, 0.0, 12.0) / 11.0; next.fin_r.orientation = Quaternion::rotation_y(0.0); next diff --git a/voxygen/src/anim/src/fish_medium/jump.rs b/voxygen/src/anim/src/fish_medium/jump.rs index 7fadebb750..7b54e4f476 100644 --- a/voxygen/src/anim/src/fish_medium/jump.rs +++ b/voxygen/src/anim/src/fish_medium/jump.rs @@ -31,23 +31,18 @@ impl Animation for JumpAnimation { next.head.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.head.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.torso.position = Vec3::new(0.0, 4.5, 2.0); next.torso.orientation = Quaternion::rotation_x(0.0); - next.rear.position = Vec3::new(0.0, 3.1, -4.5); next.rear.orientation = Quaternion::rotation_z(0.0); - next.tail.position = Vec3::new(0.0, -13.0, 8.0) / 11.0; next.tail.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.fin_l.position = Vec3::new(0.0, -11.7, 11.0) / 11.0; next.fin_l.orientation = Quaternion::rotation_y(0.0); - next.fin_r.position = Vec3::new(0.0, 0.0, 12.0) / 11.0; next.fin_r.orientation = Quaternion::rotation_y(0.0); next diff --git a/voxygen/src/anim/src/fish_medium/run.rs b/voxygen/src/anim/src/fish_medium/run.rs index 89f05d9d5d..ec875b0441 100644 --- a/voxygen/src/anim/src/fish_medium/run.rs +++ b/voxygen/src/anim/src/fish_medium/run.rs @@ -31,23 +31,18 @@ impl Animation for RunAnimation { next.head.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.head.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.torso.position = Vec3::new(0.0, 4.5, 2.0); next.torso.orientation = Quaternion::rotation_x(0.0); - next.rear.position = Vec3::new(0.0, 3.1, -4.5); next.rear.orientation = Quaternion::rotation_z(0.0); - next.tail.position = Vec3::new(0.0, -13.0, 8.0) / 11.0; next.tail.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.fin_l.position = Vec3::new(0.0, -11.7, 11.0) / 11.0; next.fin_l.orientation = Quaternion::rotation_y(0.0); - next.fin_r.position = Vec3::new(0.0, 0.0, 12.0) / 11.0; next.fin_r.orientation = Quaternion::rotation_y(0.0); next