From 908e099aa5290d579f96fdca1a8ac03d3f4d6df9 Mon Sep 17 00:00:00 2001 From: Justin Shipsey Date: Wed, 29 Jan 2020 06:38:08 +0000 Subject: [PATCH] minor anim tweaks --- assets/voxygen/voxel/armor/hand/assa_left.vox | 3 + .../voxygen/voxel/armor/hand/assa_right.vox | 3 + .../voxel/biped_large_center_manifest.ron | 4 +- .../voxel/biped_large_lateral_manifest.ron | 36 +-- .../voxel/bird_medium_center_manifest.ron | 6 +- .../voxel/bird_medium_lateral_manifest.ron | 64 ++--- .../voxygen/voxel/npc/chicken/male/torso.vox | 2 +- .../voxel/npc/giant/female/shoulder_l.vox | 4 +- .../voxel/npc/giant/female/shoulder_r.vox | 4 +- .../voxel/npc/giant/female/torso_lower.vox | 4 +- .../voxel/npc/giant/male/shoulder_l.vox | 4 +- .../voxel/npc/giant/male/shoulder_r.vox | 4 +- .../voxel/npc/giant/male/torso_lower.vox | 4 +- .../voxel/npc/peacock/female/chest.vox | 3 - .../voxygen/voxel/npc/peacock/female/head.vox | 2 +- .../voxygen/voxel/npc/peacock/female/tail.vox | 2 +- .../voxel/npc/peacock/female/torso.vox | 4 +- .../voxel/npc/peacock/female/wing_l.vox | 2 +- .../voxel/npc/peacock/female/wing_r.vox | 2 +- voxygen/src/anim/biped_large/idle.rs | 110 ++++++-- voxygen/src/anim/biped_large/mod.rs | 75 ++++- voxygen/src/anim/biped_large/run.rs | 127 ++++++--- voxygen/src/anim/bird_medium/idle.rs | 6 +- voxygen/src/anim/bird_medium/mod.rs | 34 +-- voxygen/src/anim/bird_medium/run.rs | 45 +-- voxygen/src/anim/character/attack.rs | 259 ++++++++++++++---- voxygen/src/anim/character/cidle.rs | 50 ++-- voxygen/src/anim/character/roll.rs | 8 +- voxygen/src/anim/character/wield.rs | 63 +++-- voxygen/src/anim/quadruped_medium/mod.rs | 14 +- voxygen/src/anim/quadruped_medium/run.rs | 2 +- voxygen/src/anim/quadruped_small/mod.rs | 2 +- 32 files changed, 653 insertions(+), 299 deletions(-) create mode 100644 assets/voxygen/voxel/armor/hand/assa_left.vox create mode 100644 assets/voxygen/voxel/armor/hand/assa_right.vox delete mode 100644 assets/voxygen/voxel/npc/peacock/female/chest.vox diff --git a/assets/voxygen/voxel/armor/hand/assa_left.vox b/assets/voxygen/voxel/armor/hand/assa_left.vox new file mode 100644 index 0000000000..b103659d78 --- /dev/null +++ b/assets/voxygen/voxel/armor/hand/assa_left.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3c8d6c4226337c43cd1d5b8ab2f251c38ccb9357a524697b672c0e63bf7f41e +size 1240 diff --git a/assets/voxygen/voxel/armor/hand/assa_right.vox b/assets/voxygen/voxel/armor/hand/assa_right.vox new file mode 100644 index 0000000000..2bf33c0563 --- /dev/null +++ b/assets/voxygen/voxel/armor/hand/assa_right.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:38f226fd0c2425db70c294dbe3566138cd49e05fde6c09f3d972de4a88751741 +size 55723 diff --git a/assets/voxygen/voxel/biped_large_center_manifest.ron b/assets/voxygen/voxel/biped_large_center_manifest.ron index 85febe6c84..9e8a1b70c6 100644 --- a/assets/voxygen/voxel/biped_large_center_manifest.ron +++ b/assets/voxygen/voxel/biped_large_center_manifest.ron @@ -9,7 +9,7 @@ center: ("npc.giant.male.torso_upper"), ), torso_lower: ( - offset: (-5.0, 4.5, 4.5), + offset: (-5.0, -4.5, -4.5), center: ("npc.giant.male.torso_lower"), ) ), @@ -23,7 +23,7 @@ center: ("npc.giant.female.torso_upper"), ), torso_lower: ( - offset: (-5.0, 4.5, 4.5), + offset: (-5.0, -4.5, -4.5), center: ("npc.giant.female.torso_lower"), ) ), diff --git a/assets/voxygen/voxel/biped_large_lateral_manifest.ron b/assets/voxygen/voxel/biped_large_lateral_manifest.ron index fccdca78ab..0f05677a48 100644 --- a/assets/voxygen/voxel/biped_large_lateral_manifest.ron +++ b/assets/voxygen/voxel/biped_large_lateral_manifest.ron @@ -1,69 +1,69 @@ ({ (Giant, Male): ( shoulder_l: ( - offset: (-5.0, -5.5, -4.0), - lateral: ("npc.giant.male.shoulder_l"), + offset: (-4.0, -5.5, -4.0), + lateral: ("armor.empty"), ), shoulder_r: ( - offset: (-5.0, -5.5, -4.0), + offset: (-4.0, -5.5, -4.0), lateral: ("npc.giant.male.shoulder_r"), ), hand_l: ( - offset: (-3.0, -2.5, -3.0), + offset: (-3.0, -2.5, -14.0), lateral: ("npc.giant.male.hand_l"), ), hand_r: ( - offset: (-3.0, -2.5, -3.0), + offset: (-3.0, -2.5, -14.0), lateral: ("npc.giant.male.hand_r"), ), leg_l: ( - offset: (-3.0, -3.5, -2.0), + offset: (-3.0, -3.5, -7.0), lateral: ("npc.giant.male.leg_l"), ), leg_r: ( - offset: (-3.0, -3.5, -2.0), + offset: (-3.0, -3.5, -7.0), lateral: ("npc.giant.male.leg_r"), ), foot_l: ( - offset: (-3.0, -5.5, -2.5), + offset: (-3.0, -5.5, -10.5), lateral: ("npc.giant.male.foot_l"), ), foot_r: ( - offset: (-3.0, -5.5, -2.5), + offset: (-3.0, -5.5, -10.5), lateral: ("npc.giant.male.foot_r"), ) ), (Giant, Female): ( shoulder_l: ( - offset: (-5.0, -5.5, -4.0), - lateral: ("npc.giant.female.shoulder_l"), + offset: (-4.0, -5.5, -4.0), + lateral: ("armor.empty"), ), shoulder_r: ( - offset: (-5.0, -5.5, -4.0), + offset: (-4.0, -5.5, -4.0), lateral: ("npc.giant.female.shoulder_r"), ), hand_l: ( - offset: (-3.0, -2.5, -3.0), + offset: (-3.0, -2.5, -14.0), lateral: ("npc.giant.female.hand_l"), ), hand_r: ( - offset: (-3.0, -2.5, -3.0), + offset: (-3.0, -2.5, -14.0), lateral: ("npc.giant.female.hand_r"), ), leg_l: ( - offset: (-3.0, -3.5, -2.0), + offset: (-3.0, -3.5, -7.0), lateral: ("npc.giant.female.leg_l"), ), leg_r: ( - offset: (-3.0, -3.5, -2.0), + offset: (-3.0, -3.5, -7.0), lateral: ("npc.giant.female.leg_r"), ), foot_l: ( - offset: (-3.0, -5.5, -2.5), + offset: (-3.0, -5.5, -10.5), lateral: ("npc.giant.female.foot_l"), ), foot_r: ( - offset: (-3.0, -5.5, -2.5), + offset: (-3.0, -5.5, -10.5), lateral: ("npc.giant.female.foot_r"), ) ), diff --git a/assets/voxygen/voxel/bird_medium_center_manifest.ron b/assets/voxygen/voxel/bird_medium_center_manifest.ron index 565f92f9b6..8dde25c342 100644 --- a/assets/voxygen/voxel/bird_medium_center_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_center_manifest.ron @@ -37,7 +37,7 @@ center: ("npc.chicken.male.torso"), ), tail: ( - offset: (-1.5, -1.5, -3.5), + offset: (-1.5, -2.5, -3.5), center: ("npc.chicken.male.tail"), ) ), @@ -85,7 +85,7 @@ ), (Peacock, Male): ( head: ( - offset: (-2.0, -3.5, -3.0), + offset: (-2.0, -1.5, -6.5), center: ("npc.peacock.male.head"), ), torso: ( @@ -99,7 +99,7 @@ ), (Peacock, Female): ( head: ( - offset: (-2.0, -3.5, -3.5), + offset: (-2.0, -1.5, -6.5), center: ("npc.peacock.female.head"), ), torso: ( diff --git a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron index f6f7aab553..3fef62853c 100644 --- a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron @@ -1,145 +1,145 @@ ({ (Duck, Male): ( wing_l: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -8.0), lateral: ("npc.duck.male.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -8.0), lateral: ("npc.duck.male.wing"), ), foot_l: ( - offset: (-1.0, -1.5, -3.5), + offset: (-1.0, 0.0, -4.0), lateral: ("npc.duck.male.leg_l"), ), foot_r: ( - offset: (-1.0, -1.5, -3.5), + offset: (-1.0, 0.0, -4.0), lateral: ("npc.duck.male.leg_r"), ) ), (Duck, Female): ( wing_l: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -8.0), lateral: ("npc.duck.female.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -8.0), lateral: ("npc.duck.female.wing"), ), foot_l: ( - offset: (-1.0, -1.5, -3.5), + offset: (-1.0, 0.0, -4.0), lateral: ("npc.duck.female.leg_l"), ), foot_r: ( - offset: (-1.0, -1.5, -3.5), + offset: (-1.0, 0.0, -4.0), lateral: ("npc.duck.female.leg_r"), ) ), (Chicken, Male): ( wing_l: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -8.0), lateral: ("npc.chicken.male.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -8.0), lateral: ("npc.chicken.male.wing"), ), foot_l: ( - offset: (-1.0, -1.5, -1.5), + offset: (-1.0, 0.0, -4.0), lateral: ("npc.chicken.male.leg_l"), ), foot_r: ( - offset: (-1.0, -1.5, -1.5), + offset: (-1.0, 0.0, -4.0), lateral: ("npc.chicken.male.leg_r"), ) ), (Chicken, Female): ( wing_l: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -8.0), lateral: ("npc.chicken.female.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -8.0), lateral: ("npc.chicken.female.wing"), ), foot_l: ( - offset: (-1.0, -1.5, -1.5), + offset: (-1.0, 0.0, -4.0), lateral: ("npc.chicken.female.leg_l"), ), foot_r: ( - offset: (-1.0, -1.5, -1.5), + offset: (-1.0, 0.0, -4.0), lateral: ("npc.chicken.female.leg_r"), ) ), (Goose, Male): ( wing_l: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -11.0), lateral: ("npc.goose.male.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -11.0), lateral: ("npc.goose.male.wing"), ), foot_l: ( - offset: (-1.0, -1.5, -1.5), + offset: (-1.0, 0.0, -6.5), lateral: ("npc.goose.male.leg_l"), ), foot_r: ( - offset: (-1.0, -1.5, -1.5), + offset: (-1.0, 0.0, -6.5), lateral: ("npc.goose.male.leg_r"), ) ), (Goose, Female): ( wing_l: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -11.0), lateral: ("npc.goose.female.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -1.5), + offset: (-0.5, -2.5, -11.0), lateral: ("npc.goose.female.wing"), ), foot_l: ( - offset: (-1.0, -1.5, -1.5), + offset: (-1.0, 0.0, -6.5), lateral: ("npc.goose.female.leg_l"), ), foot_r: ( - offset: (-1.0, -1.5, -1.5), + offset: (-1.0, 0.0, -6.5), lateral: ("npc.goose.female.leg_r"), ) ), (Peacock, Male): ( wing_l: ( - offset: (-1.0, -3.5, -2.5), + offset: (-1.0, -3.5, -13.0), lateral: ("npc.peacock.male.wing_l"), ), wing_r: ( - offset: (-1.0, -3.5, -2.5), + offset: (-1.0, -3.5, -13.0), lateral: ("npc.peacock.male.wing_r"), ), foot_l: ( - offset: (-1.0, -1.5, -3.5), + offset: (-1.0, 0.0, -8.0), lateral: ("npc.peacock.male.leg_l"), ), foot_r: ( - offset: (-1.0, -1.5, -3.5), + offset: (-1.0, 0.0, -8.0), lateral: ("npc.peacock.male.leg_r"), ) ), (Peacock, Female): ( wing_l: ( - offset: (-1.0, -3.5, -2.5), + offset: (-1.0, -3.5, -13.0), lateral: ("npc.peacock.female.wing_l"), ), wing_r: ( - offset: (-1.0, -3.5, -2.5), + offset: (-1.0, -3.5, -13.0), lateral: ("npc.peacock.female.wing_r"), ), foot_l: ( - offset: (-1.0, -1.5, -3.5), + offset: (-1.0, 0.0, -8.0), lateral: ("npc.peacock.female.leg_l"), ), foot_r: ( - offset: (-1.0, -1.5, -3.5), + offset: (-1.0, 0.0, -8.0), lateral: ("npc.peacock.female.leg_r"), ) ), diff --git a/assets/voxygen/voxel/npc/chicken/male/torso.vox b/assets/voxygen/voxel/npc/chicken/male/torso.vox index 2adddf0e3c..3ea5fa4fe9 100644 --- a/assets/voxygen/voxel/npc/chicken/male/torso.vox +++ b/assets/voxygen/voxel/npc/chicken/male/torso.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a7455f6b4936d9c1009b17f5b861600e7f3fad5413416e252c91c70bf49c85e4 +oid sha256:4a9c8c0a08bbda030ea72d42d4b79bc2be7d7379e3173cda9b5d2b5dba40e764 size 1576 diff --git a/assets/voxygen/voxel/npc/giant/female/shoulder_l.vox b/assets/voxygen/voxel/npc/giant/female/shoulder_l.vox index f9792d5649..c6c10387c2 100644 --- a/assets/voxygen/voxel/npc/giant/female/shoulder_l.vox +++ b/assets/voxygen/voxel/npc/giant/female/shoulder_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c40dc9568ab2764fcfe0343c1c2591f547ec06cc2f259bfbe063bf135c0bfd5f -size 2120 +oid sha256:9e6d1e8d1801eecec486a67b32ab51c3ddd5bb49562166eb98f4fb49297caa37 +size 1880 diff --git a/assets/voxygen/voxel/npc/giant/female/shoulder_r.vox b/assets/voxygen/voxel/npc/giant/female/shoulder_r.vox index fca8f2940a..3997e1b2e9 100644 --- a/assets/voxygen/voxel/npc/giant/female/shoulder_r.vox +++ b/assets/voxygen/voxel/npc/giant/female/shoulder_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9dd690641b1f3fb441fe9c80fabdaf74d8a57c8c5cfc383755de9398c009c42 -size 2120 +oid sha256:d6717202102e9e0379d652faa110e9211238e16ffe885f5a0b6c9d37f3a3debb +size 1880 diff --git a/assets/voxygen/voxel/npc/giant/female/torso_lower.vox b/assets/voxygen/voxel/npc/giant/female/torso_lower.vox index 9b42645538..14e262784c 100644 --- a/assets/voxygen/voxel/npc/giant/female/torso_lower.vox +++ b/assets/voxygen/voxel/npc/giant/female/torso_lower.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b2bc46d0453a37acff0fb6dad72e89720e4acc58c9b524d28242a4d7efdda20e -size 1868 +oid sha256:8e9c3d59e74bb7c1c3fee2bd0a63b78e2e29ddd34322a7260bf575d743c0434e +size 2172 diff --git a/assets/voxygen/voxel/npc/giant/male/shoulder_l.vox b/assets/voxygen/voxel/npc/giant/male/shoulder_l.vox index f9792d5649..c6c10387c2 100644 --- a/assets/voxygen/voxel/npc/giant/male/shoulder_l.vox +++ b/assets/voxygen/voxel/npc/giant/male/shoulder_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c40dc9568ab2764fcfe0343c1c2591f547ec06cc2f259bfbe063bf135c0bfd5f -size 2120 +oid sha256:9e6d1e8d1801eecec486a67b32ab51c3ddd5bb49562166eb98f4fb49297caa37 +size 1880 diff --git a/assets/voxygen/voxel/npc/giant/male/shoulder_r.vox b/assets/voxygen/voxel/npc/giant/male/shoulder_r.vox index fca8f2940a..3997e1b2e9 100644 --- a/assets/voxygen/voxel/npc/giant/male/shoulder_r.vox +++ b/assets/voxygen/voxel/npc/giant/male/shoulder_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9dd690641b1f3fb441fe9c80fabdaf74d8a57c8c5cfc383755de9398c009c42 -size 2120 +oid sha256:d6717202102e9e0379d652faa110e9211238e16ffe885f5a0b6c9d37f3a3debb +size 1880 diff --git a/assets/voxygen/voxel/npc/giant/male/torso_lower.vox b/assets/voxygen/voxel/npc/giant/male/torso_lower.vox index 9b42645538..14e262784c 100644 --- a/assets/voxygen/voxel/npc/giant/male/torso_lower.vox +++ b/assets/voxygen/voxel/npc/giant/male/torso_lower.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b2bc46d0453a37acff0fb6dad72e89720e4acc58c9b524d28242a4d7efdda20e -size 1868 +oid sha256:8e9c3d59e74bb7c1c3fee2bd0a63b78e2e29ddd34322a7260bf575d743c0434e +size 2172 diff --git a/assets/voxygen/voxel/npc/peacock/female/chest.vox b/assets/voxygen/voxel/npc/peacock/female/chest.vox deleted file mode 100644 index efec8ac0ca..0000000000 --- a/assets/voxygen/voxel/npc/peacock/female/chest.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:24688eaad7d459d4a4c0eba71edaca1ba83ec09552b970ac581c6e2e2081f880 -size 1932 diff --git a/assets/voxygen/voxel/npc/peacock/female/head.vox b/assets/voxygen/voxel/npc/peacock/female/head.vox index 50dc38ee2d..c9ccbf5668 100644 --- a/assets/voxygen/voxel/npc/peacock/female/head.vox +++ b/assets/voxygen/voxel/npc/peacock/female/head.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9318efd5aaca66db669aa8bbb17ac9a86cba2248716eddeae19b34b6dc8a1483 +oid sha256:aef6be7441b1c98a78fd0ff2e9415e5a18983c7b16d8fb9d59c1deb980f25ef1 size 1456 diff --git a/assets/voxygen/voxel/npc/peacock/female/tail.vox b/assets/voxygen/voxel/npc/peacock/female/tail.vox index 85d004020f..e381a80524 100644 --- a/assets/voxygen/voxel/npc/peacock/female/tail.vox +++ b/assets/voxygen/voxel/npc/peacock/female/tail.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb2c1a3591acaea7e963648fd0253edbab593602ff9d006562d18373a82b411d +oid sha256:fb5ee1986c72675cf64ca6ac73b1cc146d81f692f6ece7b4447a5db3fb4c1319 size 1320 diff --git a/assets/voxygen/voxel/npc/peacock/female/torso.vox b/assets/voxygen/voxel/npc/peacock/female/torso.vox index 58b5a9b000..06d52c39f5 100644 --- a/assets/voxygen/voxel/npc/peacock/female/torso.vox +++ b/assets/voxygen/voxel/npc/peacock/female/torso.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3887edeebda253b90f44441205a28eadd1e5b94c9f3868c0f8f610d31af02aba -size 2296 +oid sha256:cd8e7e66447951f875296ced868d357d197b38c4ae9830a5fe120c186021b231 +size 1932 diff --git a/assets/voxygen/voxel/npc/peacock/female/wing_l.vox b/assets/voxygen/voxel/npc/peacock/female/wing_l.vox index 38d478e204..78e4854d28 100644 --- a/assets/voxygen/voxel/npc/peacock/female/wing_l.vox +++ b/assets/voxygen/voxel/npc/peacock/female/wing_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cabee12279731078145b3b3329da1f592401c6eb720fcc58caef9fd09a0c0bd8 +oid sha256:26b84917a45068aca9c8cd63e435dc4f050ae9464e9553741c92758764baeabe size 1236 diff --git a/assets/voxygen/voxel/npc/peacock/female/wing_r.vox b/assets/voxygen/voxel/npc/peacock/female/wing_r.vox index 747d997150..ef87e8929c 100644 --- a/assets/voxygen/voxel/npc/peacock/female/wing_r.vox +++ b/assets/voxygen/voxel/npc/peacock/female/wing_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:abf9f847e7dc9c9ad319082d9b6438d8747185cdef53b4daff8fc6ae4a83ab72 +oid sha256:95312b164b73d4446843cde2a53cbe0f30ceb86d80de2593eb2f845be737b97b size 1236 diff --git a/voxygen/src/anim/biped_large/idle.rs b/voxygen/src/anim/biped_large/idle.rs index be4b954151..ca2ef14125 100644 --- a/voxygen/src/anim/biped_large/idle.rs +++ b/voxygen/src/anim/biped_large/idle.rs @@ -1,5 +1,5 @@ use super::{super::Animation, BipedLargeSkeleton, SkeletonAttr}; -//use std::{f32::consts::PI, ops::Mul}; +use std::{f32::consts::PI, ops::Mul}; use vek::*; pub struct IdleAnimation; @@ -10,56 +10,120 @@ impl Animation for IdleAnimation { fn update_skeleton( skeleton: &Self::Skeleton, - _global_time: Self::Dependency, - _anim_time: f64, + global_time: Self::Dependency, + anim_time: f64, _rate: &mut f32, - _skeleton_attr: &SkeletonAttr, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - next.head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.head.scale = Vec3::one() / 11.0; + let lab = 1.0; + let torso = (anim_time as f32 * lab as f32 + 1.5 * PI).sin(); - next.upper_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + let look = Vec2::new( + ((global_time + anim_time) as f32 / 8.0) + .floor() + .mul(7331.0) + .sin() + * 0.5, + ((global_time + anim_time) as f32 / 8.0) + .floor() + .mul(1337.0) + .sin() + * 0.25, + ); + + next.head.offset = Vec3::new( + 0.0, + skeleton_attr.head.0, + skeleton_attr.head.1 + torso * 0.6, + ) / 8.0; + next.head.ori = Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6); + next.head.scale = Vec3::one() / 8.0; + + next.upper_torso.offset = Vec3::new( + 0.0, + skeleton_attr.upper_torso.0, + skeleton_attr.upper_torso.1 + torso * 0.5, + ) / 8.0; next.upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.upper_torso.scale = Vec3::one() / 11.0; + next.upper_torso.scale = Vec3::one() / 8.0; - next.lower_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.lower_torso.offset = Vec3::new( + 0.0, + skeleton_attr.lower_torso.0, + skeleton_attr.lower_torso.1 + torso * 0.35, + ); next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.lower_torso.scale = Vec3::one(); + next.lower_torso.scale = Vec3::one() * 1.02; - next.shoulder_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.shoulder_l.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.shoulder_l.scale = Vec3::one(); - next.shoulder_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.shoulder_r.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.shoulder_r.scale = Vec3::one(); - next.hand_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.hand_l.offset = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2 + torso * 0.6, + ); next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.hand_l.scale = Vec3::one(); - next.hand_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.hand_r.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2 + torso * 0.6, + ); next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.hand_r.scale = Vec3::one(); - next.leg_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.leg_l.offset = Vec3::new( + -skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2 + torso * 0.2, + ) / 8.0; next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.leg_l.scale = Vec3::one() / 11.0; + next.leg_l.scale = Vec3::one() / 8.0; - next.leg_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.leg_r.offset = Vec3::new( + skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2 + torso * 0.2, + ) / 8.0; next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.leg_r.scale = Vec3::one() / 10.88; + next.leg_r.scale = Vec3::one() / 8.0; - next.foot_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.foot_l.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 8.0; next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.foot_l.scale = Vec3::one(); + next.foot_l.scale = Vec3::one() / 8.0; - next.foot_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.foot_r.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 8.0; next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.foot_r.scale = Vec3::one(); + next.foot_r.scale = Vec3::one() / 8.0; + + next.torso.offset = Vec3::new(0.0, 0.0, 0.0); + next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.torso.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/biped_large/mod.rs b/voxygen/src/anim/biped_large/mod.rs index 0ce749b79b..ecb1a550a5 100644 --- a/voxygen/src/anim/biped_large/mod.rs +++ b/voxygen/src/anim/biped_large/mod.rs @@ -24,6 +24,7 @@ pub struct BipedLargeSkeleton { leg_r: Bone, foot_l: Bone, foot_r: Bone, + torso: Bone, } impl BipedLargeSkeleton { @@ -40,6 +41,7 @@ impl BipedLargeSkeleton { leg_r: Bone::default(), foot_l: Bone::default(), foot_r: Bone::default(), + torso: Bone::default(), } } } @@ -52,23 +54,26 @@ impl Skeleton for BipedLargeSkeleton { let shoulder_r_mat = self.shoulder_r.compute_base_matrix(); let leg_l_mat = self.leg_l.compute_base_matrix(); let leg_r_mat = self.leg_r.compute_base_matrix(); + let torso_mat = self.torso.compute_base_matrix(); [ - FigureBoneData::new(self.head.compute_base_matrix()), - FigureBoneData::new(upper_torso_mat), - FigureBoneData::new(self.lower_torso.compute_base_matrix() * upper_torso_mat), - FigureBoneData::new(shoulder_l_mat * upper_torso_mat), - FigureBoneData::new(shoulder_r_mat * upper_torso_mat), + FigureBoneData::new(torso_mat * self.head.compute_base_matrix()), + FigureBoneData::new(torso_mat * upper_torso_mat), FigureBoneData::new( - self.hand_l.compute_base_matrix() * shoulder_l_mat * upper_torso_mat, + torso_mat * upper_torso_mat * self.lower_torso.compute_base_matrix(), + ), + FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_l_mat), + FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_r_mat), + FigureBoneData::new( + torso_mat * upper_torso_mat * shoulder_l_mat * self.hand_l.compute_base_matrix(), ), FigureBoneData::new( - self.hand_r.compute_base_matrix() * shoulder_r_mat * upper_torso_mat, + torso_mat * upper_torso_mat * shoulder_r_mat * self.hand_r.compute_base_matrix(), ), - FigureBoneData::new(leg_l_mat), - FigureBoneData::new(leg_r_mat), - FigureBoneData::new(self.foot_l.compute_base_matrix() * leg_l_mat), - FigureBoneData::new(self.foot_r.compute_base_matrix() * leg_r_mat), + FigureBoneData::new(torso_mat * leg_l_mat), + FigureBoneData::new(torso_mat * leg_r_mat), + FigureBoneData::new(torso_mat * self.foot_l.compute_base_matrix()), + FigureBoneData::new(torso_mat * self.foot_r.compute_base_matrix()), FigureBoneData::default(), FigureBoneData::default(), FigureBoneData::default(), @@ -89,10 +94,19 @@ impl Skeleton for BipedLargeSkeleton { self.leg_r.interpolate(&target.leg_r, dt); self.foot_l.interpolate(&target.foot_l, dt); self.foot_r.interpolate(&target.foot_r, dt); + self.torso.interpolate(&target.torso, dt); } } -pub struct SkeletonAttr; +pub struct SkeletonAttr { + head: (f32, f32), + upper_torso: (f32, f32), + lower_torso: (f32, f32), + shoulder: (f32, f32, f32), + hand: (f32, f32, f32), + leg: (f32, f32, f32), + foot: (f32, f32, f32), +} impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { type Error = (); @@ -107,12 +121,43 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { impl Default for SkeletonAttr { fn default() -> Self { - Self + Self { + head: (0.0, 0.0), + upper_torso: (0.0, 0.0), + lower_torso: (0.0, 0.0), + shoulder: (0.0, 0.0, 0.0), + hand: (0.0, 0.0, 0.0), + leg: (0.0, 0.0, 0.0), + foot: (0.0, 0.0, 0.0), + } } } impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr { - fn from(_body: &'a comp::biped_large::Body) -> Self { - Self + fn from(body: &'a comp::biped_large::Body) -> Self { + use comp::biped_large::Species::*; + Self { + head: match (body.species, body.body_type) { + (Giant, _) => (0.0, 28.5), + }, + upper_torso: match (body.species, body.body_type) { + (Giant, _) => (0.0, 18.5), + }, + lower_torso: match (body.species, body.body_type) { + (Giant, _) => (1.0, -9.5), + }, + shoulder: match (body.species, body.body_type) { + (Giant, _) => (6.0, 0.5, 2.5), + }, + hand: match (body.species, body.body_type) { + (Giant, _) => (3.5, -1.0, 3.0), + }, + leg: match (body.species, body.body_type) { + (Giant, _) => (3.5, 0.0, 14.0), + }, + foot: match (body.species, body.body_type) { + (Giant, _) => (4.0, 0.5, 11.0), + }, + } } } diff --git a/voxygen/src/anim/biped_large/run.rs b/voxygen/src/anim/biped_large/run.rs index 5ca044d279..c8f8d3f397 100644 --- a/voxygen/src/anim/biped_large/run.rs +++ b/voxygen/src/anim/biped_large/run.rs @@ -1,5 +1,5 @@ use super::{super::Animation, BipedLargeSkeleton, SkeletonAttr}; -//use std::{f32::consts::PI, ops::Mul}; +use std::f32::consts::PI; use vek::*; pub struct RunAnimation; @@ -11,55 +11,112 @@ impl Animation for RunAnimation { fn update_skeleton( skeleton: &Self::Skeleton, (_velocity, _global_time): Self::Dependency, - _anim_time: f64, + anim_time: f64, _rate: &mut f32, - _skeleton_attr: &SkeletonAttr, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - next.head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.head.scale = Vec3::one() / 10.88; + let lab = 14.0; - next.upper_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.upper_torso.scale = Vec3::one() / 10.88; + let legl = (anim_time as f32 * lab as f32).sin(); + let legr = (anim_time as f32 * lab as f32 + PI).sin(); + let belt = (anim_time as f32 * lab as f32 + 1.5 * PI).sin(); - next.lower_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + let foothoril = (anim_time as f32 * lab as f32).sin(); + let foothorir = (anim_time as f32 * lab as f32 + PI).sin(); + + let footvertl = (anim_time as f32 * lab as f32 + PI * 1.4).sin().max(0.0); + let footvertr = (anim_time as f32 * lab as f32 + PI * 0.4).sin().max(0.0); + + next.head.offset = + Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + belt * 1.0) / 8.0; + next.head.ori = Quaternion::rotation_z(belt * 0.1) * Quaternion::rotation_x(0.3); + next.head.scale = Vec3::one() / 8.0; + + next.upper_torso.offset = Vec3::new( + 0.0, + skeleton_attr.upper_torso.0, + skeleton_attr.upper_torso.1 + belt * 1.0, + ) / 8.0; + next.upper_torso.ori = Quaternion::rotation_z(belt * 0.3) * Quaternion::rotation_x(0.0); + next.upper_torso.scale = Vec3::one() / 8.0; + + next.lower_torso.offset = Vec3::new( + 0.0, + skeleton_attr.lower_torso.0, + skeleton_attr.lower_torso.1, + ); next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.lower_torso.scale = Vec3::one() / 10.88; + next.lower_torso.scale = Vec3::one() * 1.02; - next.shoulder_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.shoulder_l.scale = Vec3::one() / 10.88; + next.shoulder_l.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(legr * 0.06); + next.shoulder_l.scale = Vec3::one(); - next.shoulder_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.shoulder_r.scale = Vec3::one() / 10.88; + next.shoulder_r.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(legl * 0.1); + next.shoulder_r.scale = Vec3::one(); - next.hand_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.hand_l.scale = Vec3::one() / 10.88; + next.hand_l.offset = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2, + ); + next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 + legr * 0.5); + next.hand_l.scale = Vec3::one(); - next.hand_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.hand_r.scale = Vec3::one() / 10.88; + next.hand_r.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2, + ); + next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 - legr * 0.5); + next.hand_r.scale = Vec3::one(); - next.leg_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.leg_l.scale = Vec3::one() / 10.88; + next.leg_l.offset = Vec3::new( + -skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2 + belt * 0.4, + ) / 8.0; + next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-legl * 0.3); + next.leg_l.scale = Vec3::one() / 8.0; - next.leg_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.leg_r.scale = Vec3::one() / 10.88; + next.leg_r.offset = Vec3::new( + skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2 + belt * 0.4, + ) / 8.0; + next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-legr * 0.3); + next.leg_r.scale = Vec3::one() / 8.0; - next.foot_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.foot_l.scale = Vec3::one() / 10.88; + next.foot_l.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1 - foothoril * 4.5 - 0.5, + skeleton_attr.foot.2 + footvertl * 6.0, + ) / 8.0; + next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 - legl * 0.5); + next.foot_l.scale = Vec3::one() / 8.0 * 0.98; - next.foot_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.foot_r.scale = Vec3::one() / 10.88; + next.foot_r.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1 - foothorir * 4.5 - 0.5, + skeleton_attr.foot.2 + footvertr * 6.0, + ) / 8.0; + next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 - legr * 0.5); + next.foot_r.scale = Vec3::one() / 8.0 * 0.98; + + next.torso.offset = Vec3::new(0.0, 0.0, 0.0); + next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.3); + next.torso.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/bird_medium/idle.rs b/voxygen/src/anim/bird_medium/idle.rs index c7428b89c6..e6be2fc74c 100644 --- a/voxygen/src/anim/bird_medium/idle.rs +++ b/voxygen/src/anim/bird_medium/idle.rs @@ -17,8 +17,8 @@ impl Animation for IdleAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave_slow = (anim_time as f32 * 3.5).sin(); - let wave_slow_cos = (anim_time as f32 * 3.5).cos(); + let wave_slow = (anim_time as f32 * 4.5).sin(); + let wave_slow_cos = (anim_time as f32 * 4.5).cos(); let duck_head_look = Vec2::new( ((global_time + anim_time) as f32 / 8.0) @@ -35,7 +35,7 @@ impl Animation for IdleAnimation { next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) / 11.0; next.head.ori = Quaternion::rotation_z(duck_head_look.x) - * Quaternion::rotation_x(duck_head_look.y + wave_slow_cos * 0.03); + * Quaternion::rotation_x(-duck_head_look.y.abs() + wave_slow_cos * 0.03); next.head.scale = Vec3::one(); next.torso.offset = Vec3::new( diff --git a/voxygen/src/anim/bird_medium/mod.rs b/voxygen/src/anim/bird_medium/mod.rs index 919fc6eeb3..2dfb13e0db 100644 --- a/voxygen/src/anim/bird_medium/mod.rs +++ b/voxygen/src/anim/bird_medium/mod.rs @@ -100,34 +100,34 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr { use comp::bird_medium::Species::*; Self { head: match (body.species, body.body_type) { - (Duck, _) => (4.0, 4.0), - (Chicken, _) => (4.0, 4.0), + (Duck, _) => (4.0, 3.0), + (Chicken, _) => (4.0, 3.0), (Goose, _) => (5.0, 5.0), - (Peacock, _) => (5.0, 6.0), + (Peacock, _) => (4.0, 7.0), }, chest: match (body.species, body.body_type) { - (Duck, _) => (0.0, 6.0), - (Chicken, _) => (0.0, 6.0), + (Duck, _) => (0.0, 5.0), + (Chicken, _) => (0.0, 5.0), (Goose, _) => (0.0, 8.0), - (Peacock, _) => (0.0, 9.0), + (Peacock, _) => (0.0, 10.0), }, tail: match (body.species, body.body_type) { - (Duck, _) => (-3.5, 3.0), - (Chicken, _) => (-3.5, 3.0), + (Duck, _) => (-3.0, 1.5), + (Chicken, _) => (-3.0, 1.5), (Goose, _) => (-5.0, 3.0), - (Peacock, _) => (-5.0, 2.0), + (Peacock, _) => (-5.5, 2.0), }, wing: match (body.species, body.body_type) { - (Duck, _) => (2.75, 0.0, 0.0), - (Chicken, _) => (2.75, 0.0, 0.0), - (Goose, _) => (3.75, 0.0, 0.0), - (Peacock, _) => (3.0, 0.0, 0.0), + (Duck, _) => (2.75, 0.0, 6.0), + (Chicken, _) => (2.75, 0.0, 6.0), + (Goose, _) => (3.75, -1.0, 9.0), + (Peacock, _) => (3.0, 0.0, 9.0), }, foot: match (body.species, body.body_type) { - (Duck, _) => (2.0, 0.0, 4.0), - (Chicken, _) => (2.0, 0.0, 4.0), - (Goose, _) => (2.0, 0.0, 3.0), - (Peacock, _) => (2.0, 0.5, 3.0), + (Duck, _) => (2.0, -1.5, 4.0), + (Chicken, _) => (2.0, -1.5, 4.0), + (Goose, _) => (2.0, -1.5, 7.0), + (Peacock, _) => (2.0, -2.5, 8.0), }, } } diff --git a/voxygen/src/anim/bird_medium/run.rs b/voxygen/src/anim/bird_medium/run.rs index 70c8d9f5e3..a0e49a824e 100644 --- a/voxygen/src/anim/bird_medium/run.rs +++ b/voxygen/src/anim/bird_medium/run.rs @@ -1,5 +1,5 @@ use super::{super::Animation, BirdMediumSkeleton, SkeletonAttr}; -//use std::{f32::consts::PI, ops::Mul}; +use std::f32::consts::PI; use vek::*; pub struct RunAnimation; @@ -17,24 +17,35 @@ impl Animation for RunAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave = (anim_time as f32 * 18.0).sin(); - let wave_cos = (anim_time as f32 * 18.0).cos(); + let lab = 16.0; //14.0 - next.head.offset = - Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + wave * 0.5) / 11.0; - next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + wave_cos * 0.03); + let footl = (anim_time as f32 * lab as f32 + PI).sin(); + let footr = (anim_time as f32 * lab as f32).sin(); + let center = (anim_time as f32 * lab as f32 + PI / 2.0).sin(); + let centeroffset = (anim_time as f32 * lab as f32 + PI * 1.5).sin(); + + next.head.offset = Vec3::new( + 0.0, + skeleton_attr.head.0, + skeleton_attr.head.1 + center * 0.5, + ) / 11.0; + next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + center * 0.03); next.head.scale = Vec3::one(); next.torso.offset = Vec3::new( 0.0, - skeleton_attr.chest.0, - wave * 0.3 + skeleton_attr.chest.1, + skeleton_attr.chest.0 + centeroffset * 0.6, + center * 0.6 + skeleton_attr.chest.1, ) / 11.0; - next.torso.ori = Quaternion::rotation_y(wave * 0.03); + next.torso.ori = Quaternion::rotation_y(center * 0.05); next.torso.scale = Vec3::one() / 11.0; - next.tail.offset = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1) / 11.0; - next.tail.ori = Quaternion::rotation_x(wave_cos * 0.03); + next.tail.offset = Vec3::new( + 0.0, + skeleton_attr.tail.0, + skeleton_attr.tail.1 + centeroffset * 0.6, + ) / 11.0; + next.tail.ori = Quaternion::rotation_x(center * 0.03); next.tail.scale = Vec3::one(); next.wing_l.offset = Vec3::new( @@ -42,7 +53,7 @@ impl Animation for RunAnimation { skeleton_attr.wing.1, skeleton_attr.wing.2, ) / 11.0; - next.wing_l.ori = Quaternion::rotation_z(0.0); + next.wing_l.ori = Quaternion::rotation_y(footl * 0.3); next.wing_l.scale = Vec3::one() * 1.05; next.wing_r.offset = Vec3::new( @@ -50,23 +61,23 @@ impl Animation for RunAnimation { skeleton_attr.wing.1, skeleton_attr.wing.2, ) / 11.0; - next.wing_r.ori = Quaternion::rotation_y(0.0); + next.wing_r.ori = Quaternion::rotation_y(footr * 0.3); next.wing_r.scale = Vec3::one() * 1.05; next.leg_l.offset = Vec3::new( -skeleton_attr.foot.0, - skeleton_attr.foot.1, + skeleton_attr.foot.1 + footl * 1.0, skeleton_attr.foot.2, ) / 11.0; - next.leg_l.ori = Quaternion::rotation_x(wave_cos * 1.0); + next.leg_l.ori = Quaternion::rotation_x(footl * 0.5); next.leg_l.scale = Vec3::one() / 11.0; next.leg_r.offset = Vec3::new( skeleton_attr.foot.0, - skeleton_attr.foot.1, + skeleton_attr.foot.1 + footr * 1.0, skeleton_attr.foot.2, ) / 11.0; - next.leg_r.ori = Quaternion::rotation_x(wave * 1.0); + next.leg_r.ori = Quaternion::rotation_x(footr * 0.5); next.leg_r.scale = Vec3::one() / 11.0; next } diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index 8ffb9b5772..9b4f24d277 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -14,26 +14,27 @@ impl Animation for AttackAnimation { fn update_skeleton( skeleton: &Self::Skeleton, - (_active_tool_kind, _global_time): Self::Dependency, + (active_tool_kind, _global_time): Self::Dependency, anim_time: f64, _rate: &mut f32, skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave_quicken = 1.0 - (anim_time as f32 * 16.0).cos(); - let wave_quicken_slow = 1.0 - (anim_time as f32 * 12.0).cos(); - let wave_quicken_double = 1.0 - (anim_time as f32 * 24.0).cos(); - let wave_stop_quick = (anim_time as f32 * 16.0).min(PI / 2.0).sin(); + let slow = (anim_time as f32 * 9.0).sin(); + let accel_med = 1.0 - (anim_time as f32 * 16.0).cos(); + let accel_slow = 1.0 - (anim_time as f32 * 12.0).cos(); + let accel_fast = 1.0 - (anim_time as f32 * 24.0).cos(); + let decel = (anim_time as f32 * 16.0).min(PI / 2.0).sin(); next.head.offset = Vec3::new( 0.0 + skeleton_attr.neck_right, -2.0 + skeleton_attr.neck_forward, skeleton_attr.neck_height + 21.0, ); - next.head.ori = Quaternion::rotation_z(wave_stop_quick * -0.25) - * Quaternion::rotation_x(0.0 + wave_stop_quick * -0.1) - * Quaternion::rotation_y(wave_stop_quick * 0.1); + next.head.ori = Quaternion::rotation_z(decel * -0.25) + * Quaternion::rotation_x(0.0 + decel * -0.1) + * Quaternion::rotation_y(decel * 0.1); next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, 7.0); @@ -48,52 +49,206 @@ impl Animation for AttackAnimation { next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.scale = Vec3::one(); - next.l_hand.offset = Vec3::new( - -8.0 + wave_quicken_slow * 10.0, - 8.0 + wave_quicken_double * 3.0, - 0.0, - ); - next.l_hand.ori = Quaternion::rotation_z(-0.8) - * Quaternion::rotation_x(0.0 + wave_quicken * -0.8) - * Quaternion::rotation_y(0.0 + wave_quicken * -0.4); - next.l_hand.scale = Vec3::one() * 1.01; + match active_tool_kind { + //TODO: Inventory + Some(Tool::Sword) => { + next.l_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); + next.l_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new( - -8.0 + wave_quicken_slow * 10.0, - 8.0 + wave_quicken_double * 3.0, - -2.0, - ); - next.r_hand.ori = Quaternion::rotation_z(-0.8) - * Quaternion::rotation_x(0.0 + wave_quicken * -0.8) - * Quaternion::rotation_y(0.0 + wave_quicken * -0.4); - next.r_hand.scale = Vec3::one() * 1.01; + next.r_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0); + next.r_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.r_hand.scale = Vec3::one() * 1.01; - //next.l_foot.offset = Vec3::new( - // -3.4, - // -0.1 + wave_stop_quick * 2.0, - // 8.0 + wave_stop_quick * -4.0, - //); - //next.l_foot.ori = Quaternion::rotation_x(wave_stop_quick * -1.2); - //next.l_foot.scale = Vec3::one(); + next.main.offset = Vec3::new( + -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, + 8.0 + accel_fast * 3.0, + 0.0, + ); + next.main.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.main.scale = Vec3::one(); + } + Some(Tool::Axe) => { + next.l_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); + next.l_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.l_hand.scale = Vec3::one() * 1.01; - //next.r_foot.offset = Vec3::new( - // 3.4, - // -0.1 - wave_stop_quick * -2.0, - // 8.0 + wave_stop_quick * -2.0, - //); - //next.r_foot.ori = Quaternion::rotation_x(wave_stop_quick * 1.2); - //next.r_foot.scale = Vec3::one(); + next.r_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0); + next.r_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -8.0 + wave_quicken_slow * 10.0 + skeleton_attr.weapon_x, - 8.0 + wave_quicken_double * 3.0, - 0.0, - ); - next.main.ori = Quaternion::rotation_z(-0.8) - * Quaternion::rotation_x(0.0 + wave_quicken * -0.8) - * Quaternion::rotation_y(0.0 + wave_quicken * -0.4); - next.main.scale = Vec3::one(); + next.main.offset = Vec3::new( + -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, + 8.0 + accel_fast * 3.0, + 0.0, + ); + next.main.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.main.scale = Vec3::one(); + } + Some(Tool::Hammer) => { + next.l_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); + next.l_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.l_hand.scale = Vec3::one() * 1.01; + next.r_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0); + next.r_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.r_hand.scale = Vec3::one() * 1.01; + + next.main.offset = Vec3::new( + -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, + 8.0 + accel_fast * 3.0, + 0.0, + ); + next.main.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.main.scale = Vec3::one(); + } + Some(Tool::Staff) => { + next.l_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); + next.l_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.l_hand.scale = Vec3::one() * 1.01; + + next.r_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0); + next.r_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.r_hand.scale = Vec3::one() * 1.01; + + next.main.offset = Vec3::new( + -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, + 8.0 + accel_fast * 3.0, + 0.0, + ); + next.main.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.main.scale = Vec3::one(); + } + Some(Tool::Shield) => { + next.l_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); + next.l_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.l_hand.scale = Vec3::one() * 1.01; + + next.r_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0); + next.r_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.r_hand.scale = Vec3::one() * 1.01; + + next.main.offset = Vec3::new( + -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, + 8.0 + accel_fast * 3.0, + 0.0, + ); + next.main.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.main.scale = Vec3::one(); + } + Some(Tool::Bow) => { + next.l_hand.offset = Vec3::new(-7.0, -2.0 + slow * 5.0, -1.0); + next.l_hand.ori = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(-0.3) + * Quaternion::rotation_z(0.3); + next.l_hand.scale = Vec3::one() * 1.01; + next.r_hand.offset = Vec3::new(1.0, 8.0, 2.5); + next.r_hand.ori = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(0.3) + * Quaternion::rotation_z(0.3); + next.r_hand.scale = Vec3::one() * 1.01; + next.main.offset = Vec3::new( + -4.0 + skeleton_attr.weapon_x, + 15.0 + skeleton_attr.weapon_y, + -4.0, + ); + next.main.ori = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(0.4) + * Quaternion::rotation_z(0.0); + next.main.scale = Vec3::one(); + } + Some(Tool::Dagger) => { + next.l_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); + next.l_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.l_hand.scale = Vec3::one() * 1.01; + + next.r_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0); + next.r_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.r_hand.scale = Vec3::one() * 1.01; + + next.main.offset = Vec3::new( + -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, + 8.0 + accel_fast * 3.0, + 0.0, + ); + next.main.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.main.scale = Vec3::one(); + } + Some(Tool::Debug(_)) => { + next.l_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); + next.l_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.l_hand.scale = Vec3::one() * 1.01; + + next.r_hand.offset = + Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0); + next.r_hand.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.r_hand.scale = Vec3::one() * 1.01; + + next.main.offset = Vec3::new( + -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, + 8.0 + accel_fast * 3.0, + 0.0, + ); + next.main.ori = Quaternion::rotation_z(-0.8) + * Quaternion::rotation_x(0.0 + accel_med * -0.8) + * Quaternion::rotation_y(0.0 + accel_med * -0.4); + next.main.scale = Vec3::one(); + } + _ => {} + } next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = Vec3::one() * 1.1; @@ -111,9 +266,9 @@ impl Animation for AttackAnimation { next.lantern.scale = Vec3::one() * 0.0; next.torso.offset = Vec3::new(0.0, -0.2, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_z(wave_stop_quick * -0.2) - * Quaternion::rotation_x(0.0 + wave_stop_quick * -0.2) - * Quaternion::rotation_y(wave_stop_quick * 0.2); + next.torso.ori = Quaternion::rotation_z(decel * -0.2) + * Quaternion::rotation_x(0.0 + decel * -0.2) + * Quaternion::rotation_y(decel * 0.2); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next } diff --git a/voxygen/src/anim/character/cidle.rs b/voxygen/src/anim/character/cidle.rs index 9225204497..fe194ec21e 100644 --- a/voxygen/src/anim/character/cidle.rs +++ b/voxygen/src/anim/character/cidle.rs @@ -138,24 +138,24 @@ impl Animation for CidleAnimation { Some(Tool::Staff) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, - 3.5 + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, + 1.0 + wave_ultra_slow_cos * 0.5, + 5.0 + wave_ultra_slow * 1.0, ); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; + next.l_hand.ori = Quaternion::rotation_x(1.27); + next.l_hand.scale = Vec3::one() * 1.0; next.r_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, - 3.0 + wave_ultra_slow_cos * 0.5, + -1.5 + wave_ultra_slow_cos * 0.5, -2.0 + wave_ultra_slow * 1.0, ); - next.r_hand.ori = Quaternion::rotation_x(-0.3); + next.r_hand.ori = Quaternion::rotation_x(1.27); next.r_hand.scale = Vec3::one() * 1.01; next.main.offset = Vec3::new( -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, + 8.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, + 17.0 + wave_ultra_slow * 1.0, ); - next.main.ori = Quaternion::rotation_x(-0.3) + next.main.ori = Quaternion::rotation_x(-0.3 + PI) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); @@ -187,31 +187,31 @@ impl Animation for CidleAnimation { } Some(Tool::Bow) => { next.l_hand.offset = Vec3::new( - -4.0 + wave_ultra_slow_cos * 1.0, - 5.0 + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, + -1.0 + wave_ultra_slow_cos * 1.0, + 3.0 + wave_ultra_slow_cos * 0.5, + 5.0 + wave_ultra_slow * 1.0, ); - next.l_hand.ori = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(-1.9) - * Quaternion::rotation_z(0.85); + next.l_hand.ori = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(-0.3) + * Quaternion::rotation_z(0.3); next.l_hand.scale = Vec3::one() * 1.01; next.r_hand.offset = Vec3::new( - 2.0 + wave_ultra_slow_cos * 1.0, + 1.0 + wave_ultra_slow_cos * 1.0, 8.0 + wave_ultra_slow_cos * 0.5, - -3.5 + wave_ultra_slow * 1.0, + 2.5 + wave_ultra_slow * 1.0, ); - next.r_hand.ori = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(-1.7) - * Quaternion::rotation_z(0.85); + next.r_hand.ori = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(0.3) + * Quaternion::rotation_z(0.3); next.r_hand.scale = Vec3::one() * 1.01; next.main.offset = Vec3::new( - 9.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 10.0 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, - -3.0 + wave_ultra_slow * 1.0, + -4.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, + 15.0 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, + -4.0 + wave_ultra_slow * 1.0, ); next.main.ori = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(-1.7) - * Quaternion::rotation_z(0.85); + * Quaternion::rotation_y(0.4) + * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } Some(Tool::Dagger) => { diff --git a/voxygen/src/anim/character/roll.rs b/voxygen/src/anim/character/roll.rs index 88ae08afc8..1a38bf730c 100644 --- a/voxygen/src/anim/character/roll.rs +++ b/voxygen/src/anim/character/roll.rs @@ -41,7 +41,7 @@ impl Animation for RollAnimation { next.head.offset = Vec3::new( 0.0 + skeleton_attr.neck_right, -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 21.0 + wave_dub * -8.0, + skeleton_attr.neck_height + 17.0 + wave_dub * -8.0, ); next.head.ori = Quaternion::rotation_x(wave_dub * 0.4); next.head.scale = Vec3::one(); @@ -77,11 +77,11 @@ impl Animation for RollAnimation { Quaternion::rotation_x(wave_slow * 6.5) * Quaternion::rotation_y(wave * 0.3); next.r_hand.scale = Vec3::one(); - next.l_foot.offset = Vec3::new(-3.4, -0.1, 9.0 - 0.0 + wave_dub * -1.2 + wave_slow * 4.0); + next.l_foot.offset = Vec3::new(-3.4, -0.1, 10.0 - 0.0 + wave_dub * -1.2 + wave_slow * 4.0); next.l_foot.ori = Quaternion::rotation_x(wave * 0.6); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, -0.1, 9.0 - 0.0 + wave_dub * -1.0 + wave_slow * 4.0); + next.r_foot.offset = Vec3::new(3.4, -0.1, 10.0 - 0.0 + wave_dub * -1.0 + wave_slow * 4.0); next.r_foot.ori = Quaternion::rotation_x(wave * -0.4); next.r_foot.scale = Vec3::one(); @@ -112,7 +112,7 @@ impl Animation for RollAnimation { next.lantern.scale = Vec3::one() * 0.0; next.torso.offset = - Vec3::new(0.0, 11.0, 0.1 + wave_dub * 16.0) / 11.0 * skeleton_attr.scaler; + Vec3::new(0.0, 0.0, 0.1 + wave_dub * 16.0) / 11.0 * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(wave_slow * 6.5) * Quaternion::rotation_y(tilt); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index 426d230ad9..20b27d1659 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -22,6 +22,9 @@ impl Animation for WieldAnimation { let speed = Vec2::::from(velocity).magnitude(); *rate = speed; + let wave_ultra_slow = (anim_time as f32 * 3.0 + PI).sin(); + let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); + let wave = (anim_time as f32 * 1.0).sin(); let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0).sin(); match active_tool_kind { @@ -84,18 +87,26 @@ impl Animation for WieldAnimation { next.main.scale = Vec3::one(); } Some(Tool::Staff) => { - next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_x(-0.3); + next.l_hand.offset = Vec3::new( + -6.0 + wave_ultra_slow_cos * 1.0, + 1.0 + wave_ultra_slow_cos * 0.5, + 5.0 + wave_ultra_slow * 1.0, + ); + next.l_hand.ori = Quaternion::rotation_x(1.27); + next.l_hand.scale = Vec3::one() * 1.0; + next.r_hand.offset = Vec3::new( + -6.0 + wave_ultra_slow_cos * 1.0, + -1.5 + wave_ultra_slow_cos * 0.5, + -2.0 + wave_ultra_slow * 1.0, + ); + next.r_hand.ori = Quaternion::rotation_x(1.27); next.r_hand.scale = Vec3::one() * 1.01; next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, + -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, + 8.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, + 17.0 + wave_ultra_slow * 1.0, ); - next.main.ori = Quaternion::rotation_x(-0.3) + next.main.ori = Quaternion::rotation_x(-0.3 + PI) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); @@ -118,24 +129,32 @@ impl Animation for WieldAnimation { next.main.scale = Vec3::one(); } Some(Tool::Bow) => { - next.l_hand.offset = Vec3::new(-4.0, 5.0, 0.0); - next.l_hand.ori = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(-1.9) - * Quaternion::rotation_z(0.85); + next.l_hand.offset = Vec3::new( + -1.0 - wave_ultra_slow_cos * 1.0, + 3.0 + wave_ultra_slow_cos * 0.5, + 5.0 + wave_ultra_slow * 1.0, + ); + next.l_hand.ori = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(-0.3) + * Quaternion::rotation_z(0.3); next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(2.0, 8.0, -3.5); - next.r_hand.ori = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(-1.7) - * Quaternion::rotation_z(0.85); + next.r_hand.offset = Vec3::new( + 1.0 + wave_ultra_slow_cos * 1.0, + 8.0 + wave_ultra_slow_cos * 0.5, + 2.5 + wave_ultra_slow * 1.0, + ); + next.r_hand.ori = Quaternion::rotation_x(PI / 2.0) + * Quaternion::rotation_y(0.3) + * Quaternion::rotation_z(0.3); next.r_hand.scale = Vec3::one() * 1.01; next.main.offset = Vec3::new( - 9.0 + skeleton_attr.weapon_x, - 10.0 + skeleton_attr.weapon_y, - -3.0, + -4.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, + 15.0 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, + -4.0 + wave_ultra_slow * 1.0, ); next.main.ori = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(-1.7) - * Quaternion::rotation_z(0.85); + * Quaternion::rotation_y(0.4) + * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); } Some(Tool::Dagger) => { diff --git a/voxygen/src/anim/quadruped_medium/mod.rs b/voxygen/src/anim/quadruped_medium/mod.rs index 9007885c1d..a7ae7c03fd 100644 --- a/voxygen/src/anim/quadruped_medium/mod.rs +++ b/voxygen/src/anim/quadruped_medium/mod.rs @@ -151,12 +151,12 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr { }, tail: match (body.species, body.body_type) { (Wolf, _) => (-6.0, -2.0), - (Saber, _) => (-5.0, -2.0), + (Saber, _) => (-4.0, -2.0), (Viper, _) => (-6.0, -1.0), (Tuskram, _) => (-6.0, -2.0), (Alligator, _) => (-7.0, -1.0), (Monitor, _) => (-7.0, -1.0), - (Lion, _) => (-6.0, -4.0), + (Lion, _) => (-8.0, -6.0), (Tarasque, _) => (-7.0, -2.0), }, torso_back: match (body.species, body.body_type) { @@ -171,12 +171,12 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr { }, torso_mid: match (body.species, body.body_type) { (Wolf, _) => (-7.0, 10.5), - (Saber, _) => (-8.0, 9.5), + (Saber, _) => (-7.0, 9.5), (Viper, _) => (-7.0, 7.0), (Tuskram, _) => (-7.0, 9.0), (Alligator, _) => (-7.0, 6.0), (Monitor, _) => (-7.0, 4.0), - (Lion, _) => (-7.0, 9.0), + (Lion, _) => (-9.0, 9.0), (Tarasque, _) => (-7.0, 8.0), }, ears: match (body.species, body.body_type) { @@ -190,7 +190,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr { (Tarasque, _) => (1.5, -2.0), }, feet_f: match (body.species, body.body_type) { - (Wolf, _) => (5.0, 6.0, 3.0), + (Wolf, _) => (5.0, 6.0, 2.0), (Saber, _) => (4.0, 6.0, 3.0), (Viper, _) => (4.0, 6.0, 3.0), (Tuskram, _) => (4.0, 6.0, 4.5), @@ -200,8 +200,8 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr { (Tarasque, _) => (4.0, 6.0, 3.0), }, feet_b: match (body.species, body.body_type) { - (Wolf, _) => (5.0, -4.0, 3.5), - (Saber, _) => (4.0, -4.0, 3.5), + (Wolf, _) => (5.0, -4.0, 3.0), + (Saber, _) => (4.0, -6.0, 3.5), (Viper, _) => (4.0, -4.0, 3.5), (Tuskram, _) => (4.0, -8.0, 5.5), (Alligator, _) => (4.0, -4.0, 3.5), diff --git a/voxygen/src/anim/quadruped_medium/run.rs b/voxygen/src/anim/quadruped_medium/run.rs index ffaa0633a1..4f6e81dec2 100644 --- a/voxygen/src/anim/quadruped_medium/run.rs +++ b/voxygen/src/anim/quadruped_medium/run.rs @@ -17,7 +17,7 @@ impl Animation for RunAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let lab = 14; //14.0 + let lab = 14; let vertlf = (anim_time as f32 * lab as f32 + PI * 1.8).sin().max(0.15); let vertrfoffset = (anim_time as f32 * lab as f32 + PI * 0.80).sin().max(0.15); let vertlboffset = (anim_time as f32 * lab as f32).sin().max(0.15); diff --git a/voxygen/src/anim/quadruped_small/mod.rs b/voxygen/src/anim/quadruped_small/mod.rs index 2bba14afbd..109313c04e 100644 --- a/voxygen/src/anim/quadruped_small/mod.rs +++ b/voxygen/src/anim/quadruped_small/mod.rs @@ -146,7 +146,7 @@ impl<'a> From<&'a comp::quadruped_small::Body> for SkeletonAttr { (Raccoon, _) => (3.0, -2.0, 3.0), (Quokka, _) => (3.0, -4.0, 3.0), (Dodarock, _) => (4.5, -3.0, 4.0), - (Holladon, _) => (4.0, -4.0, 0.0), + (Holladon, _) => (4.0, -4.0, 3.0), }, } }