From 4ac7307f8f455a0d84a7739a6640220deaf75212 Mon Sep 17 00:00:00 2001 From: Justin Shipsey Date: Fri, 28 Jun 2019 08:24:13 +0000 Subject: [PATCH] minor main menu changes made the settings button's text grey and removed hover/press image as long as it's not functional changed server list placement and spacing --- assets/voxygen/voxel/figure/beard/human/1.vox | 3 + assets/voxygen/voxel/figure/body/empty.vox | 3 + assets/voxygen/voxel/figure/body/hand.vox | 4 +- assets/voxygen/voxel/figure/empty.vox | 3 + .../{eyes_female_1.vox => human/female_1.vox} | 0 .../{eyes_male_1.vox => human/male_1.vox} | 0 .../{hair_human_female_1.vox => female_1.vox} | 0 .../voxygen/voxel/figure/head/Human/head.vox | 3 - .../voxel/figure/head/head_danari_female.vox | 3 + .../voxel/figure/head/head_danari_male.vox | 3 + .../voxel/figure/head/head_dwarf_female.vox | 3 + .../voxel/figure/head/head_dwarf_male.vox | 3 + .../voxel/figure/head/head_elf_female.vox | 3 + .../voxel/figure/head/head_elf_male.vox | 3 + .../voxygen/voxel/figure/head/head_female.vox | 3 + .../voxel/figure/head/head_human_female.vox | 3 + .../{head.vox => head/head_human_male.vox} | 0 .../voxel/figure/head/head_orc_female.vox | 3 + .../voxel/figure/head/head_orc_male.vox | 3 + .../voxygen/voxel/figure/head/head_test2.vox | 3 + .../voxel/figure/head/head_undead_female.vox | 3 + .../voxel/figure/head/head_undead_male.vox | 3 + assets/voxygen/voxel/figure/head/human/1.vox | 3 + .../voxel/figure/head_danari_female.vox | 3 + .../voxygen/voxel/figure/head_danari_male.vox | 3 + .../voxel/figure/head_dwarf_female.vox | 3 + .../voxygen/voxel/figure/head_dwarf_male.vox | 3 + .../voxygen/voxel/figure/head_elf_female.vox | 3 + assets/voxygen/voxel/figure/head_elf_male.vox | 3 + .../voxel/figure/head_human_female.vox | 3 + .../voxygen/voxel/figure/head_human_male.vox | 3 + .../voxygen/voxel/figure/head_orc_female.vox | 3 + assets/voxygen/voxel/figure/head_orc_male.vox | 3 + assets/voxygen/voxel/figure/head_test1.vox | 3 - .../voxel/figure/head_undead_female.vox | 3 + .../voxygen/voxel/figure/head_undead_male.vox | 3 + assets/voxygen/voxel/weapon/axe/axe.vox | 3 - assets/voxygen/voxel/weapon/axe/rusty_2h.vox | 3 + .../voxygen/voxel/weapon/hammer/rusty_2h.vox | 3 + .../{sword_rusty_2h.vox => rusty_2h.vox} | 0 .../voxel/weapon/sword/sword_wood_2h.vox | 3 - assets/voxygen/voxel/weapon/sword/wood_2h.vox | 3 + common/src/comp/actor.rs | 45 +- common/src/inventory/item.rs | 2 +- voxygen/src/anim/character/attack.rs | 36 +- voxygen/src/anim/character/cidle.rs | 6 +- voxygen/src/anim/character/crun.rs | 6 +- voxygen/src/anim/character/gliding.rs | 44 +- voxygen/src/anim/character/idle.rs | 33 +- voxygen/src/anim/character/jump.rs | 24 +- voxygen/src/anim/character/mod.rs | 3 +- voxygen/src/anim/character/roll.rs | 34 +- voxygen/src/anim/character/run.rs | 37 +- voxygen/src/anim/mod.rs | 113 +++++ voxygen/src/anim/quadruped/idle.rs | 6 +- voxygen/src/anim/quadruped/jump.rs | 6 +- voxygen/src/anim/quadruped/run.rs | 6 +- voxygen/src/anim/quadrupedmedium/idle.rs | 6 +- voxygen/src/anim/quadrupedmedium/jump.rs | 6 +- voxygen/src/anim/quadrupedmedium/run.rs | 6 +- voxygen/src/menu/char_selection/mod.rs | 7 +- voxygen/src/menu/char_selection/scene.rs | 21 +- voxygen/src/menu/main/ui.rs | 2 +- voxygen/src/scene/figure.rs | 390 +++++++++++------- 64 files changed, 667 insertions(+), 284 deletions(-) create mode 100644 assets/voxygen/voxel/figure/beard/human/1.vox create mode 100644 assets/voxygen/voxel/figure/body/empty.vox create mode 100644 assets/voxygen/voxel/figure/empty.vox rename assets/voxygen/voxel/figure/eyes/{eyes_female_1.vox => human/female_1.vox} (100%) rename assets/voxygen/voxel/figure/eyes/{eyes_male_1.vox => human/male_1.vox} (100%) rename assets/voxygen/voxel/figure/hair/human/{hair_human_female_1.vox => female_1.vox} (100%) delete mode 100644 assets/voxygen/voxel/figure/head/Human/head.vox create mode 100644 assets/voxygen/voxel/figure/head/head_danari_female.vox create mode 100644 assets/voxygen/voxel/figure/head/head_danari_male.vox create mode 100644 assets/voxygen/voxel/figure/head/head_dwarf_female.vox create mode 100644 assets/voxygen/voxel/figure/head/head_dwarf_male.vox create mode 100644 assets/voxygen/voxel/figure/head/head_elf_female.vox create mode 100644 assets/voxygen/voxel/figure/head/head_elf_male.vox create mode 100644 assets/voxygen/voxel/figure/head/head_female.vox create mode 100644 assets/voxygen/voxel/figure/head/head_human_female.vox rename assets/voxygen/voxel/figure/{head.vox => head/head_human_male.vox} (100%) create mode 100644 assets/voxygen/voxel/figure/head/head_orc_female.vox create mode 100644 assets/voxygen/voxel/figure/head/head_orc_male.vox create mode 100644 assets/voxygen/voxel/figure/head/head_test2.vox create mode 100644 assets/voxygen/voxel/figure/head/head_undead_female.vox create mode 100644 assets/voxygen/voxel/figure/head/head_undead_male.vox create mode 100644 assets/voxygen/voxel/figure/head/human/1.vox create mode 100644 assets/voxygen/voxel/figure/head_danari_female.vox create mode 100644 assets/voxygen/voxel/figure/head_danari_male.vox create mode 100644 assets/voxygen/voxel/figure/head_dwarf_female.vox create mode 100644 assets/voxygen/voxel/figure/head_dwarf_male.vox create mode 100644 assets/voxygen/voxel/figure/head_elf_female.vox create mode 100644 assets/voxygen/voxel/figure/head_elf_male.vox create mode 100644 assets/voxygen/voxel/figure/head_human_female.vox create mode 100644 assets/voxygen/voxel/figure/head_human_male.vox create mode 100644 assets/voxygen/voxel/figure/head_orc_female.vox create mode 100644 assets/voxygen/voxel/figure/head_orc_male.vox delete mode 100644 assets/voxygen/voxel/figure/head_test1.vox create mode 100644 assets/voxygen/voxel/figure/head_undead_female.vox create mode 100644 assets/voxygen/voxel/figure/head_undead_male.vox delete mode 100644 assets/voxygen/voxel/weapon/axe/axe.vox create mode 100644 assets/voxygen/voxel/weapon/axe/rusty_2h.vox create mode 100644 assets/voxygen/voxel/weapon/hammer/rusty_2h.vox rename assets/voxygen/voxel/weapon/sword/{sword_rusty_2h.vox => rusty_2h.vox} (100%) delete mode 100644 assets/voxygen/voxel/weapon/sword/sword_wood_2h.vox create mode 100644 assets/voxygen/voxel/weapon/sword/wood_2h.vox diff --git a/assets/voxygen/voxel/figure/beard/human/1.vox b/assets/voxygen/voxel/figure/beard/human/1.vox new file mode 100644 index 0000000000..8489a322ce --- /dev/null +++ b/assets/voxygen/voxel/figure/beard/human/1.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e9515f72b4595d7867b47c0f58cbc624eace2f043fc6643a3b30e033ca783dc +size 44944 diff --git a/assets/voxygen/voxel/figure/body/empty.vox b/assets/voxygen/voxel/figure/body/empty.vox new file mode 100644 index 0000000000..f7a98b8e9f --- /dev/null +++ b/assets/voxygen/voxel/figure/body/empty.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c520c6867ddad09d2839a9b74ecff16e5cdc1bd636c1766eaf1551de66a9b447 +size 44204 diff --git a/assets/voxygen/voxel/figure/body/hand.vox b/assets/voxygen/voxel/figure/body/hand.vox index aaffa6e9a4..f97716676e 100644 --- a/assets/voxygen/voxel/figure/body/hand.vox +++ b/assets/voxygen/voxel/figure/body/hand.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b7d3bb891d9996d320135f6ca9a85bfdd014afbb497f24d621cd39793eac8648 -size 44379 +oid sha256:ce4c550cb0cd0d89056eaa7d0f8c940a3c264e335d507a0022119474ad93f45b +size 1272 diff --git a/assets/voxygen/voxel/figure/empty.vox b/assets/voxygen/voxel/figure/empty.vox new file mode 100644 index 0000000000..f7a98b8e9f --- /dev/null +++ b/assets/voxygen/voxel/figure/empty.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c520c6867ddad09d2839a9b74ecff16e5cdc1bd636c1766eaf1551de66a9b447 +size 44204 diff --git a/assets/voxygen/voxel/figure/eyes/eyes_female_1.vox b/assets/voxygen/voxel/figure/eyes/human/female_1.vox similarity index 100% rename from assets/voxygen/voxel/figure/eyes/eyes_female_1.vox rename to assets/voxygen/voxel/figure/eyes/human/female_1.vox diff --git a/assets/voxygen/voxel/figure/eyes/eyes_male_1.vox b/assets/voxygen/voxel/figure/eyes/human/male_1.vox similarity index 100% rename from assets/voxygen/voxel/figure/eyes/eyes_male_1.vox rename to assets/voxygen/voxel/figure/eyes/human/male_1.vox diff --git a/assets/voxygen/voxel/figure/hair/human/hair_human_female_1.vox b/assets/voxygen/voxel/figure/hair/human/female_1.vox similarity index 100% rename from assets/voxygen/voxel/figure/hair/human/hair_human_female_1.vox rename to assets/voxygen/voxel/figure/hair/human/female_1.vox diff --git a/assets/voxygen/voxel/figure/head/Human/head.vox b/assets/voxygen/voxel/figure/head/Human/head.vox deleted file mode 100644 index 52bbb4020a..0000000000 --- a/assets/voxygen/voxel/figure/head/Human/head.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b0edd8dfa17958199cdaa8e5b44503b79ca84fb70cc234f3f5d047b44e1e8a13 -size 3416 diff --git a/assets/voxygen/voxel/figure/head/head_danari_female.vox b/assets/voxygen/voxel/figure/head/head_danari_female.vox new file mode 100644 index 0000000000..e01876e317 --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_danari_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18899c4dfb1dba8730a097ae5d904688338cc74a7dbc083cb51d3f1b910e9ef7 +size 4288 diff --git a/assets/voxygen/voxel/figure/head/head_danari_male.vox b/assets/voxygen/voxel/figure/head/head_danari_male.vox new file mode 100644 index 0000000000..fcb3214afc --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_danari_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96398d31aa2b019b1efa58d615267eeab357e7a9bbab305e192ec9363a26479c +size 4104 diff --git a/assets/voxygen/voxel/figure/head/head_dwarf_female.vox b/assets/voxygen/voxel/figure/head/head_dwarf_female.vox new file mode 100644 index 0000000000..3a2f18e355 --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_dwarf_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70424ea32cc20f5101ce5d6877a37ceb67a1ae47509ef2710cab2c29b15c3109 +size 4392 diff --git a/assets/voxygen/voxel/figure/head/head_dwarf_male.vox b/assets/voxygen/voxel/figure/head/head_dwarf_male.vox new file mode 100644 index 0000000000..f1bb88b59a --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_dwarf_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1b01897892239ddca087b225e0e35bad47f3d0feb23122bba899c1ea9131fc3 +size 3824 diff --git a/assets/voxygen/voxel/figure/head/head_elf_female.vox b/assets/voxygen/voxel/figure/head/head_elf_female.vox new file mode 100644 index 0000000000..b87fcf2f0d --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_elf_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3503d62ba3971c4d2bfc02adf10ea3a449356281f4381c5308aa472fa43a2588 +size 4952 diff --git a/assets/voxygen/voxel/figure/head/head_elf_male.vox b/assets/voxygen/voxel/figure/head/head_elf_male.vox new file mode 100644 index 0000000000..b6af9be9c1 --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_elf_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2f04815b2aadf653abe034916de8a7b27cd124944df66bf705550d4aea4d828 +size 4416 diff --git a/assets/voxygen/voxel/figure/head/head_female.vox b/assets/voxygen/voxel/figure/head/head_female.vox new file mode 100644 index 0000000000..b9410a8c4f --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d95c29862e6e17b26193fb16bd7680e6c27c3550ae45174374e4eb5e6bc1d79 +size 5168 diff --git a/assets/voxygen/voxel/figure/head/head_human_female.vox b/assets/voxygen/voxel/figure/head/head_human_female.vox new file mode 100644 index 0000000000..9a33854f2d --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_human_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:808c77d7ed81aab362bc92a3d5273d1f836043127e3c0d8db7a5864aa58f44b7 +size 5168 diff --git a/assets/voxygen/voxel/figure/head.vox b/assets/voxygen/voxel/figure/head/head_human_male.vox similarity index 100% rename from assets/voxygen/voxel/figure/head.vox rename to assets/voxygen/voxel/figure/head/head_human_male.vox diff --git a/assets/voxygen/voxel/figure/head/head_orc_female.vox b/assets/voxygen/voxel/figure/head/head_orc_female.vox new file mode 100644 index 0000000000..31eb6b37b9 --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_orc_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cca256ad0e5e99dc97b5d6a0e3ad65f5a55a97417be4686a31122ca7539b988a +size 46891 diff --git a/assets/voxygen/voxel/figure/head/head_orc_male.vox b/assets/voxygen/voxel/figure/head/head_orc_male.vox new file mode 100644 index 0000000000..49e36869b0 --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_orc_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de5333722f1c5e018f6cffa3abd40283fd4dda574e50a5e8a7851a3a344633ae +size 46831 diff --git a/assets/voxygen/voxel/figure/head/head_test2.vox b/assets/voxygen/voxel/figure/head/head_test2.vox new file mode 100644 index 0000000000..cf6e226b2c --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_test2.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ad42b15a2661f7fc3a7a20b68fade498ee66360fe91efacd05a724f80653b2c +size 4624 diff --git a/assets/voxygen/voxel/figure/head/head_undead_female.vox b/assets/voxygen/voxel/figure/head/head_undead_female.vox new file mode 100644 index 0000000000..d7c83f6d63 --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_undead_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5cc8fbc43273908a486423ebf1358b5a78bf773593a5bc645a30a8be936432b +size 3904 diff --git a/assets/voxygen/voxel/figure/head/head_undead_male.vox b/assets/voxygen/voxel/figure/head/head_undead_male.vox new file mode 100644 index 0000000000..a637b1406e --- /dev/null +++ b/assets/voxygen/voxel/figure/head/head_undead_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef0560a5e4aeb7c9d24072b4b9b9430d206089aa4bee2532a20ba32b9624bd80 +size 4144 diff --git a/assets/voxygen/voxel/figure/head/human/1.vox b/assets/voxygen/voxel/figure/head/human/1.vox new file mode 100644 index 0000000000..c081f1bd2c --- /dev/null +++ b/assets/voxygen/voxel/figure/head/human/1.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74c2cc8b33aac88443a35dff1cb227a13dad5dd8aa8a08a053498da72aad2a0e +size 46523 diff --git a/assets/voxygen/voxel/figure/head_danari_female.vox b/assets/voxygen/voxel/figure/head_danari_female.vox new file mode 100644 index 0000000000..e01876e317 --- /dev/null +++ b/assets/voxygen/voxel/figure/head_danari_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18899c4dfb1dba8730a097ae5d904688338cc74a7dbc083cb51d3f1b910e9ef7 +size 4288 diff --git a/assets/voxygen/voxel/figure/head_danari_male.vox b/assets/voxygen/voxel/figure/head_danari_male.vox new file mode 100644 index 0000000000..fcb3214afc --- /dev/null +++ b/assets/voxygen/voxel/figure/head_danari_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96398d31aa2b019b1efa58d615267eeab357e7a9bbab305e192ec9363a26479c +size 4104 diff --git a/assets/voxygen/voxel/figure/head_dwarf_female.vox b/assets/voxygen/voxel/figure/head_dwarf_female.vox new file mode 100644 index 0000000000..3a2f18e355 --- /dev/null +++ b/assets/voxygen/voxel/figure/head_dwarf_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70424ea32cc20f5101ce5d6877a37ceb67a1ae47509ef2710cab2c29b15c3109 +size 4392 diff --git a/assets/voxygen/voxel/figure/head_dwarf_male.vox b/assets/voxygen/voxel/figure/head_dwarf_male.vox new file mode 100644 index 0000000000..f1bb88b59a --- /dev/null +++ b/assets/voxygen/voxel/figure/head_dwarf_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1b01897892239ddca087b225e0e35bad47f3d0feb23122bba899c1ea9131fc3 +size 3824 diff --git a/assets/voxygen/voxel/figure/head_elf_female.vox b/assets/voxygen/voxel/figure/head_elf_female.vox new file mode 100644 index 0000000000..b87fcf2f0d --- /dev/null +++ b/assets/voxygen/voxel/figure/head_elf_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3503d62ba3971c4d2bfc02adf10ea3a449356281f4381c5308aa472fa43a2588 +size 4952 diff --git a/assets/voxygen/voxel/figure/head_elf_male.vox b/assets/voxygen/voxel/figure/head_elf_male.vox new file mode 100644 index 0000000000..b6af9be9c1 --- /dev/null +++ b/assets/voxygen/voxel/figure/head_elf_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2f04815b2aadf653abe034916de8a7b27cd124944df66bf705550d4aea4d828 +size 4416 diff --git a/assets/voxygen/voxel/figure/head_human_female.vox b/assets/voxygen/voxel/figure/head_human_female.vox new file mode 100644 index 0000000000..9a33854f2d --- /dev/null +++ b/assets/voxygen/voxel/figure/head_human_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:808c77d7ed81aab362bc92a3d5273d1f836043127e3c0d8db7a5864aa58f44b7 +size 5168 diff --git a/assets/voxygen/voxel/figure/head_human_male.vox b/assets/voxygen/voxel/figure/head_human_male.vox new file mode 100644 index 0000000000..bc3e4f3949 --- /dev/null +++ b/assets/voxygen/voxel/figure/head_human_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adb056231cc8f1cda9e9f2047acdff88182a50e724b5c56733963d0544641ba6 +size 47807 diff --git a/assets/voxygen/voxel/figure/head_orc_female.vox b/assets/voxygen/voxel/figure/head_orc_female.vox new file mode 100644 index 0000000000..784f986ab6 --- /dev/null +++ b/assets/voxygen/voxel/figure/head_orc_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6c8acfe5845b88f1547748aaa40123b848adaab71b53ad5458be3178f17a55f +size 58215 diff --git a/assets/voxygen/voxel/figure/head_orc_male.vox b/assets/voxygen/voxel/figure/head_orc_male.vox new file mode 100644 index 0000000000..49e36869b0 --- /dev/null +++ b/assets/voxygen/voxel/figure/head_orc_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de5333722f1c5e018f6cffa3abd40283fd4dda574e50a5e8a7851a3a344633ae +size 46831 diff --git a/assets/voxygen/voxel/figure/head_test1.vox b/assets/voxygen/voxel/figure/head_test1.vox deleted file mode 100644 index fb8d2832fe..0000000000 --- a/assets/voxygen/voxel/figure/head_test1.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a166d4b60b7caeeb9ecc194a23b1df127c839de17564de0aa85cbe685136794d -size 4608 diff --git a/assets/voxygen/voxel/figure/head_undead_female.vox b/assets/voxygen/voxel/figure/head_undead_female.vox new file mode 100644 index 0000000000..d7c83f6d63 --- /dev/null +++ b/assets/voxygen/voxel/figure/head_undead_female.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5cc8fbc43273908a486423ebf1358b5a78bf773593a5bc645a30a8be936432b +size 3904 diff --git a/assets/voxygen/voxel/figure/head_undead_male.vox b/assets/voxygen/voxel/figure/head_undead_male.vox new file mode 100644 index 0000000000..a637b1406e --- /dev/null +++ b/assets/voxygen/voxel/figure/head_undead_male.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef0560a5e4aeb7c9d24072b4b9b9430d206089aa4bee2532a20ba32b9624bd80 +size 4144 diff --git a/assets/voxygen/voxel/weapon/axe/axe.vox b/assets/voxygen/voxel/weapon/axe/axe.vox deleted file mode 100644 index 8dee3fe354..0000000000 --- a/assets/voxygen/voxel/weapon/axe/axe.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a4d2ec2a3048feb6505be9b39672cd2d70262756d9d574a3596151fa16e183b8 -size 1564 diff --git a/assets/voxygen/voxel/weapon/axe/rusty_2h.vox b/assets/voxygen/voxel/weapon/axe/rusty_2h.vox new file mode 100644 index 0000000000..4129ab53e7 --- /dev/null +++ b/assets/voxygen/voxel/weapon/axe/rusty_2h.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1b662cab3bfddbbd921529b38458a0c547bbad74bd08af6e4abbe2106a4f48f +size 44672 diff --git a/assets/voxygen/voxel/weapon/hammer/rusty_2h.vox b/assets/voxygen/voxel/weapon/hammer/rusty_2h.vox new file mode 100644 index 0000000000..e1dd0aaf70 --- /dev/null +++ b/assets/voxygen/voxel/weapon/hammer/rusty_2h.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a065744135f11ea5b0773c7da00d429f873051c68ccac310df9a9c4ad179e7cd +size 45403 diff --git a/assets/voxygen/voxel/weapon/sword/sword_rusty_2h.vox b/assets/voxygen/voxel/weapon/sword/rusty_2h.vox similarity index 100% rename from assets/voxygen/voxel/weapon/sword/sword_rusty_2h.vox rename to assets/voxygen/voxel/weapon/sword/rusty_2h.vox diff --git a/assets/voxygen/voxel/weapon/sword/sword_wood_2h.vox b/assets/voxygen/voxel/weapon/sword/sword_wood_2h.vox deleted file mode 100644 index 5394e57cac..0000000000 --- a/assets/voxygen/voxel/weapon/sword/sword_wood_2h.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:65b30ab854142755ca70727b42c32deff7a0dfd5e619c8bf73a2cd4685ecc079 -size 44628 diff --git a/assets/voxygen/voxel/weapon/sword/wood_2h.vox b/assets/voxygen/voxel/weapon/sword/wood_2h.vox new file mode 100644 index 0000000000..784e4666e0 --- /dev/null +++ b/assets/voxygen/voxel/weapon/sword/wood_2h.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea1fe735a3a065068b803dc9a323ef88c4402467d60d31c0bb9a2c7c663abdeb +size 44628 diff --git a/common/src/comp/actor.rs b/common/src/comp/actor.rs index 07938a1af0..ab7f6bb1f7 100644 --- a/common/src/comp/actor.rs +++ b/common/src/comp/actor.rs @@ -18,14 +18,8 @@ pub enum BodyType { Unspecified, } -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -pub enum Head { - Default, -} - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Chest { - Default, Blue, Brown, Dark, @@ -35,13 +29,11 @@ pub enum Chest { #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Belt { - //Default, Dark, } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Pants { - Default, Blue, Brown, Dark, @@ -56,13 +48,13 @@ pub enum Hand { #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Foot { - Default, Dark, } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Shoulder { - Default, + None, + Brown1, } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -165,9 +157,7 @@ pub const ALL_RACES: [Race; 6] = [ Race::Undead, ]; pub const ALL_BODY_TYPES: [BodyType; 3] = [BodyType::Female, BodyType::Male, BodyType::Unspecified]; -pub const ALL_HEADS: [Head; 1] = [Head::Default]; -pub const ALL_CHESTS: [Chest; 6] = [ - Chest::Default, +pub const ALL_CHESTS: [Chest; 5] = [ Chest::Blue, Chest::Brown, Chest::Dark, @@ -178,8 +168,7 @@ pub const ALL_BELTS: [Belt; 1] = [ //Belt::Default, Belt::Dark, ]; -pub const ALL_PANTS: [Pants; 6] = [ - Pants::Default, +pub const ALL_PANTS: [Pants; 5] = [ Pants::Blue, Pants::Brown, Pants::Dark, @@ -187,7 +176,7 @@ pub const ALL_PANTS: [Pants; 6] = [ Pants::Orange, ]; pub const ALL_HANDS: [Hand; 1] = [Hand::Default]; -pub const ALL_FEET: [Foot; 2] = [Foot::Default, Foot::Dark]; +pub const ALL_FEET: [Foot; 1] = [Foot::Dark]; pub const ALL_WEAPONS: [Weapon; 7] = [ Weapon::Daggers, Weapon::SwordShield, @@ -197,14 +186,13 @@ pub const ALL_WEAPONS: [Weapon; 7] = [ Weapon::Bow, Weapon::Staff, ]; -pub const ALL_SHOULDERS: [Shoulder; 1] = [Shoulder::Default]; +pub const ALL_SHOULDERS: [Shoulder; 2] = [Shoulder::None, Shoulder::Brown1]; pub const ALL_DRAW: [Draw; 1] = [Draw::Default]; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct HumanoidBody { pub race: Race, pub body_type: BodyType, - pub head: Head, pub chest: Chest, pub belt: Belt, pub pants: Pants, @@ -221,7 +209,6 @@ impl HumanoidBody { Self { race: *(&ALL_RACES).choose(&mut rng).unwrap(), body_type: *(&ALL_BODY_TYPES).choose(&mut rng).unwrap(), - head: *(&ALL_HEADS).choose(&mut rng).unwrap(), chest: *(&ALL_CHESTS).choose(&mut rng).unwrap(), belt: *(&ALL_BELTS).choose(&mut rng).unwrap(), pants: *(&ALL_PANTS).choose(&mut rng).unwrap(), @@ -234,14 +221,6 @@ impl HumanoidBody { } } /////////// -const ALL_QRACES: [Race; 6] = [ - Race::Danari, - Race::Dwarf, - Race::Elf, - Race::Human, - Race::Orc, - Race::Undead, -]; const ALL_QBODY_TYPES: [BodyType; 3] = [BodyType::Female, BodyType::Male, BodyType::Unspecified]; const ALL_QPIG_HEADS: [PigHead; 1] = [PigHead::Default]; const ALL_QPIG_CHESTS: [PigChest; 1] = [PigChest::Default]; @@ -250,7 +229,6 @@ const ALL_QPIG_LEG_RS: [PigLegR; 1] = [PigLegR::Default]; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct QuadrupedBody { - pub race: Race, pub body_type: BodyType, pub pig_head: PigHead, pub pig_chest: PigChest, @@ -262,7 +240,6 @@ impl QuadrupedBody { pub fn random() -> Self { let mut rng = thread_rng(); Self { - race: *(&ALL_QRACES).choose(&mut rng).unwrap(), body_type: *(&ALL_QBODY_TYPES).choose(&mut rng).unwrap(), pig_head: *(&ALL_QPIG_HEADS).choose(&mut rng).unwrap(), pig_chest: *(&ALL_QPIG_CHESTS).choose(&mut rng).unwrap(), @@ -272,14 +249,6 @@ impl QuadrupedBody { } } ///////////// -const ALL_QMRACES: [Race; 6] = [ - Race::Danari, - Race::Dwarf, - Race::Elf, - Race::Human, - Race::Orc, - Race::Undead, -]; const ALL_QMBODY_TYPES: [BodyType; 3] = [BodyType::Female, BodyType::Male, BodyType::Unspecified]; const ALL_QMWOLF_HEADS_UPPER: [WolfHeadUpper; 1] = [WolfHeadUpper::Default]; const ALL_QMWOLF_JAWS: [WolfJaw; 1] = [WolfJaw::Default]; @@ -295,7 +264,6 @@ const ALL_QMWOLF_FEET_RB: [WolfFootRB; 1] = [WolfFootRB::Default]; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct QuadrupedMediumBody { - pub race: Race, pub body_type: BodyType, pub wolf_head_upper: WolfHeadUpper, pub wolf_jaw: WolfJaw, @@ -314,7 +282,6 @@ impl QuadrupedMediumBody { pub fn random() -> Self { let mut rng = thread_rng(); Self { - race: *(&ALL_QMRACES).choose(&mut rng).unwrap(), body_type: *(&ALL_QMBODY_TYPES).choose(&mut rng).unwrap(), wolf_head_upper: *(&ALL_QMWOLF_HEADS_UPPER).choose(&mut rng).unwrap(), wolf_jaw: *(&ALL_QMWOLF_JAWS).choose(&mut rng).unwrap(), diff --git a/common/src/inventory/item.rs b/common/src/inventory/item.rs index b8082ac6f9..25550dbe9d 100644 --- a/common/src/inventory/item.rs +++ b/common/src/inventory/item.rs @@ -4,7 +4,7 @@ use specs::{Component, VecStorage}; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Armor { // TODO: Don't make armor be a body part. Wearing enemy's head is funny but also creepy thing to do. - Helmet(actor::Head), + Helmet, Shoulders(actor::Shoulder), Chestplate(actor::Chest), Belt(actor::Belt), diff --git a/voxygen/src/anim/character/attack.rs b/voxygen/src/anim/character/attack.rs index 4676411c0c..55e817971b 100644 --- a/voxygen/src/anim/character/attack.rs +++ b/voxygen/src/anim/character/attack.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, CharacterSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + CharacterSkeleton, +}; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -15,6 +18,7 @@ impl Animation for AttackAnimation { skeleton: &Self::Skeleton, global_time: f64, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); @@ -24,11 +28,15 @@ impl Animation for AttackAnimation { let wave_quick = (anim_time as f32 * 0.5).sin(); let wave_stop_quick = (anim_time as f32 * 16.0).min(PI / 2.0).sin(); - next.head.offset = Vec3::new(0.0, 2.0, 11.0); + next.head.offset = Vec3::new( + 0.0, + 0.0 + skeleton_attr.neck_forward, + skeleton_attr.neck_height + 15.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.scale = Vec3::one(); + next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, 7.0); next.chest.ori = Quaternion::rotation_x(0.0); @@ -72,7 +80,11 @@ impl Animation for AttackAnimation { next.r_foot.ori = Quaternion::rotation_x(wave_stop_quick * 1.2); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-7.0, -2.0, 5.0); + next.weapon.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -2.0 + skeleton_attr.weapon_y, + 5.0, + ); next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.scale = Vec3::one() * 0.0; @@ -89,30 +101,32 @@ impl Animation for AttackAnimation { next.draw.scale = Vec3::one() * 0.0; next.left_equip.offset = Vec3::new( - -8.0 + wave_quicken_slow * 10.0, + -8.0 + wave_quicken_slow * 10.0 + skeleton_attr.weapon_x, 4.0 + wave_quicken_double * 3.0, 9.0, - ) / 11.0; + ) / 11.0 + * skeleton_attr.scaler; next.left_equip.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.left_equip.scale = Vec3::one() / 11.0; + next.left_equip.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next.right_equip.offset = Vec3::new( -8.0 + wave_quicken_slow * 10.0, 4.0 + wave_quicken_double * 3.0, 9.0, - ) / 11.0; + ) / 11.0 + * skeleton_attr.scaler; next.right_equip.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.right_equip.scale = Vec3::one() / 11.0; + next.right_equip.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.torso.offset = Vec3::new(0.0, -0.2, 0.1); + 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.scale = Vec3::one() / 11.0; + 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 7baff85c1e..afdc76ea71 100644 --- a/voxygen/src/anim/character/cidle.rs +++ b/voxygen/src/anim/character/cidle.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, CharacterSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + CharacterSkeleton, +}; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -12,6 +15,7 @@ impl Animation for CidleAnimation { skeleton: &Self::Skeleton, global_time: f64, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); diff --git a/voxygen/src/anim/character/crun.rs b/voxygen/src/anim/character/crun.rs index 7b1adb5047..cd7e423733 100644 --- a/voxygen/src/anim/character/crun.rs +++ b/voxygen/src/anim/character/crun.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, CharacterSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + CharacterSkeleton, +}; use std::ops::Mul; use vek::*; @@ -12,6 +15,7 @@ impl Animation for CrunAnimation { skeleton: &Self::Skeleton, (velocity, global_time): Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); diff --git a/voxygen/src/anim/character/gliding.rs b/voxygen/src/anim/character/gliding.rs index 82edf35f15..feff70fbf5 100644 --- a/voxygen/src/anim/character/gliding.rs +++ b/voxygen/src/anim/character/gliding.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, CharacterSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + CharacterSkeleton, +}; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -12,6 +15,7 @@ impl Animation for GlidingAnimation { skeleton: &Self::Skeleton, (velocity, global_time): Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); let wave_slow = (anim_time as f32 * 7.0).sin(); @@ -35,44 +39,54 @@ impl Animation for GlidingAnimation { .sin() * 0.25, ); - next.head.offset = Vec3::new(0.0, 2.0, 2.0); + next.head.offset = Vec3::new( + 0.0, + 0.0 + skeleton_attr.neck_forward, + skeleton_attr.neck_height + 6.0, + ); next.head.ori = Quaternion::rotation_x(0.35 - wave_very_slow * 0.10 + head_look.y) * Quaternion::rotation_z(head_look.x + wave_very_slow_cos * 0.15); - next.head.scale = Vec3::one(); + next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, -2.0); - next.chest.ori = Quaternion::rotation_z(wave_very_slow_cos * 0.15); + next.chest.ori = Quaternion::rotation_z(wave_very_slow_cos * 0.2); next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, 0.0, -4.0); - next.belt.ori = Quaternion::rotation_z(wave_very_slow_cos * 0.20); + next.belt.ori = Quaternion::rotation_z(wave_very_slow_cos * 0.25); next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, 0.0, -7.0); next.shorts.ori = Quaternion::rotation_z(wave_very_slow_cos * 0.25); next.shorts.scale = Vec3::one(); - next.l_hand.offset = Vec3::new(-10.0, -2.0 + wave_very_slow * 0.10, 10.5); - next.l_hand.ori = Quaternion::rotation_x(1.0 + wave_very_slow_cos * -0.10); + next.l_hand.offset = Vec3::new(-10.0, -5.0 + wave_very_slow * 0.1, 8.5); + next.l_hand.ori = + Quaternion::rotation_x(1.0 + wave_very_slow_cos * -0.1) * skeleton_attr.scaler; next.l_hand.scale = Vec3::one(); - next.r_hand.offset = Vec3::new(10.0, -2.0 + wave_very_slow * 0.10, 10.5); + next.r_hand.offset = Vec3::new(10.0, -5.0 + wave_very_slow * 0.1, 8.5); next.r_hand.ori = Quaternion::rotation_x(1.0 + wave_very_slow_cos * -0.10); next.r_hand.scale = Vec3::one(); next.l_foot.offset = Vec3::new(-3.4, 1.0, -2.0); next.l_foot.ori = Quaternion::rotation_x( - (wave_stop * -0.7 - wave_slow_cos * -0.21 + wave_very_slow * 0.19) * velocity * 0.07, + (wave_stop * -0.7 - wave_slow_cos * -0.21 + wave_very_slow * 0.19) * velocity * 0.04, ); + next.l_foot.scale = Vec3::one(); next.r_foot.offset = Vec3::new(3.4, 1.0, -2.0); next.r_foot.ori = Quaternion::rotation_x( - (wave_stop * -0.8 + wave_slow * -0.25 + wave_very_slow_alt * 0.13) * velocity * 0.07, + (wave_stop * -0.8 + wave_slow * -0.25 + wave_very_slow_alt * 0.13) * velocity * 0.04, ); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-7.0, -5.0, 15.0); + next.weapon.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 15.0, + ); next.weapon.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.weapon.scale = Vec3::one(); @@ -84,7 +98,7 @@ impl Animation for GlidingAnimation { next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = Vec3::one() * 1.04; - next.draw.offset = Vec3::new(0.0, -9.0 + wave_very_slow * 0.10, 8.0); + next.draw.offset = Vec3::new(0.0, -13.0 + wave_very_slow * 0.10, 6.0); next.draw.ori = Quaternion::rotation_x(1.0)//0.95 - wave_very_slow * 0.08) * Quaternion::rotation_y(wave_very_slow_cos * 0.04); next.draw.scale = Vec3::one(); @@ -94,12 +108,12 @@ impl Animation for GlidingAnimation { next.left_equip.scale = Vec3::one() * 0.0; next.right_equip.offset = Vec3::new(0.0, 0.0, -5.0) / 11.0; - next.right_equip.ori = Quaternion::rotation_x(0.0);; + next.right_equip.ori = Quaternion::rotation_x(0.0); next.right_equip.scale = Vec3::one() * 0.0; - next.torso.offset = Vec3::new(0.0, -0.2, 10.0) / 11.0; + next.torso.offset = Vec3::new(0.0, 6.0, 15.0) / 11.0 * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(-0.05 * velocity + wave_very_slow * 0.10); - next.torso.scale = Vec3::one() / 11.0; + next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next } diff --git a/voxygen/src/anim/character/idle.rs b/voxygen/src/anim/character/idle.rs index 8b68ff656b..a628c8b37c 100644 --- a/voxygen/src/anim/character/idle.rs +++ b/voxygen/src/anim/character/idle.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, CharacterSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + CharacterSkeleton, +}; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -15,27 +18,35 @@ impl Animation for IdleAnimation { skeleton: &Self::Skeleton, global_time: f64, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); + let wave = (anim_time as f32 * 4.0).sin(); + let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); let wave_ultra_slow_cos = (anim_time as f32 * 1.0 + PI).cos(); let head_look = Vec2::new( - ((global_time + anim_time) as f32 / 8.0) + ((global_time + anim_time) as f32 / 12.0) .floor() .mul(7331.0) .sin() * 0.5, - ((global_time + anim_time) as f32 / 8.0) + ((global_time + anim_time) as f32 / 12.0) .floor() .mul(1337.0) .sin() * 0.25, ); - next.head.offset = Vec3::new(0.0, 2.0, 11.0 + wave_ultra_slow * 0.3); - next.head.ori = Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y); - next.head.scale = Vec3::one(); + next.head.offset = Vec3::new( + 0.0, + 0.0 + skeleton_attr.neck_forward, + skeleton_attr.neck_height + 15.0 + wave_ultra_slow * 0.3, + ); + next.head.ori = + Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y.abs()); + next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_ultra_slow * 0.3); next.chest.ori = Quaternion::rotation_x(0.0); @@ -74,7 +85,11 @@ impl Animation for IdleAnimation { next.r_foot.ori = Quaternion::identity(); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-7.0, -5.0, 15.0); + next.weapon.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 15.0, + ); next.weapon.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.weapon.scale = Vec3::one(); @@ -98,9 +113,9 @@ impl Animation for IdleAnimation { next.right_equip.ori = Quaternion::rotation_x(0.0);; next.right_equip.scale = Vec3::one() * 0.0; - next.torso.offset = Vec3::new(0.0, -0.2, 0.1); + next.torso.offset = Vec3::new(0.0, -0.2, 0.1) * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(0.0); - next.torso.scale = Vec3::one() / 11.0; + next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next } diff --git a/voxygen/src/anim/character/jump.rs b/voxygen/src/anim/character/jump.rs index d3487b388f..b290ecc290 100644 --- a/voxygen/src/anim/character/jump.rs +++ b/voxygen/src/anim/character/jump.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, CharacterSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + CharacterSkeleton, +}; use std::f32::consts::PI; use vek::*; @@ -12,6 +15,7 @@ impl Animation for JumpAnimation { skeleton: &Self::Skeleton, global_time: f64, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); let wave = (anim_time as f32 * 14.0).sin(); @@ -19,9 +23,13 @@ impl Animation for JumpAnimation { let wave_stop = (anim_time as f32 * 4.5).min(PI / 2.0).sin(); let wave_stop_alt = (anim_time as f32 * 5.0).min(PI / 2.0).sin(); - next.head.offset = Vec3::new(0.0, 3.0, 13.0); + next.head.offset = Vec3::new( + 0.0, + 0.0 + skeleton_attr.neck_forward, + skeleton_attr.neck_height + 15.0, + ); next.head.ori = Quaternion::rotation_x(0.25 + wave_stop * 0.1 + wave_slow * 0.04); - next.head.scale = Vec3::one(); + next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, 8.0); next.chest.ori = Quaternion::rotation_z(0.0); @@ -59,7 +67,11 @@ impl Animation for JumpAnimation { next.r_foot.ori = Quaternion::rotation_x(wave_stop * 1.2 + wave_slow * 0.2); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-7.0, -5.0, 15.0); + next.weapon.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 15.0, + ); next.weapon.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.weapon.scale = Vec3::one(); @@ -83,9 +95,9 @@ impl Animation for JumpAnimation { next.right_equip.ori = Quaternion::rotation_x(0.0);; next.right_equip.scale = Vec3::one() * 0.0; - next.torso.offset = Vec3::new(0.0, -0.2, 0.0); + next.torso.offset = Vec3::new(0.0, -0.2, 0.0) * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(-0.2); - next.torso.scale = Vec3::one() / 11.0; + next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next } diff --git a/voxygen/src/anim/character/mod.rs b/voxygen/src/anim/character/mod.rs index 0df69ad69b..0285413e21 100644 --- a/voxygen/src/anim/character/mod.rs +++ b/voxygen/src/anim/character/mod.rs @@ -69,8 +69,9 @@ impl Skeleton for CharacterSkeleton { let torso_mat = self.torso.compute_base_matrix(); let l_hand_mat = self.l_hand.compute_base_matrix(); let weapon_mat = self.weapon.compute_base_matrix(); + let head_mat = self.head.compute_base_matrix(); [ - FigureBoneData::new(torso_mat * self.head.compute_base_matrix()), + FigureBoneData::new(torso_mat * head_mat), FigureBoneData::new(torso_mat * chest_mat), FigureBoneData::new(torso_mat * self.belt.compute_base_matrix()), FigureBoneData::new(torso_mat * self.shorts.compute_base_matrix()), diff --git a/voxygen/src/anim/character/roll.rs b/voxygen/src/anim/character/roll.rs index f5fa454ab8..cfb0ae2c80 100644 --- a/voxygen/src/anim/character/roll.rs +++ b/voxygen/src/anim/character/roll.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, CharacterSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + CharacterSkeleton, +}; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -12,6 +15,7 @@ impl Animation for RollAnimation { skeleton: &Self::Skeleton, global_time: f64, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); @@ -22,20 +26,24 @@ impl Animation for RollAnimation { let wave_slow = (anim_time as f32 * 2.8 + PI).sin(); let wave_dub = (anim_time as f32 * 5.5).sin(); - next.head.offset = Vec3::new(0.0, 0.0 + wave_slow * -3.0, 9.0 + wave_dub * -5.0); + next.head.offset = Vec3::new( + 0.0, + -2.0 + wave_slow * -3.0 + skeleton_attr.neck_forward, + skeleton_attr.neck_height + 9.0 + wave_dub * -5.0, + ); next.head.ori = Quaternion::rotation_x(wave_dub * -0.4); next.head.scale = Vec3::one(); next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_dub * -2.5); - next.chest.ori = Quaternion::rotation_x(wave_dub * -0.5); + next.chest.ori = Quaternion::rotation_x(wave_dub * -0.5 + wave_slow * 4.0); next.chest.scale = Vec3::one() * 1.01; next.belt.offset = Vec3::new(0.0, 0.0, 5.0); - next.belt.ori = Quaternion::rotation_x(0.0); + next.belt.ori = Quaternion::rotation_x(0.0 + wave_slow * 4.0); next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, 0.0, 2.0); - next.shorts.ori = Quaternion::rotation_x(0.0); + next.shorts.ori = Quaternion::rotation_x(0.0 + wave_slow * 4.0); next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( @@ -65,9 +73,14 @@ impl Animation for RollAnimation { next.r_foot.ori = Quaternion::rotation_x(wave * -0.4); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-7.0, -7.0, 15.0); - next.weapon.ori = - Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + wave_quick * 1.0); + next.weapon.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 15.0, + ); + next.weapon.ori = Quaternion::rotation_y(2.5) + * Quaternion::rotation_z(1.57) + * Quaternion::rotation_x(0.0); next.weapon.scale = Vec3::one(); next.l_shoulder.offset = Vec3::new(-10.0, -3.2, 2.5); @@ -90,9 +103,10 @@ impl Animation for RollAnimation { next.right_equip.ori = Quaternion::rotation_x(0.0);; next.right_equip.scale = Vec3::one() * 0.0; - next.torso.offset = Vec3::new(0.0, -2.2, 0.1 + wave_dub * 16.0) / 11.0; + next.torso.offset = + Vec3::new(0.0, -2.2, 0.1 + wave_dub * 16.0) / 11.0 * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(wave_slow * 6.0); - next.torso.scale = Vec3::one() / 11.0; + next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next } } diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index 0e2cf4474f..211ff9b9b6 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, CharacterSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + CharacterSkeleton, +}; use std::f32::consts::PI; use std::ops::Mul; use vek::*; @@ -13,6 +16,7 @@ impl Animation for RunAnimation { skeleton: &Self::Skeleton, (velocity, global_time): Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); @@ -35,10 +39,14 @@ impl Animation for RunAnimation { * 0.1, ); - next.head.offset = Vec3::new(0.0, 3.0, 12.0 + wave_cos * 1.3); + next.head.offset = Vec3::new( + 0.0, + -1.0 + skeleton_attr.neck_forward, + skeleton_attr.neck_height + 15.0 + wave_cos * 1.3, + ); next.head.ori = Quaternion::rotation_z(head_look.x + wave * 0.1) * Quaternion::rotation_x(head_look.y + 0.35); - next.head.scale = Vec3::one(); + next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_cos * 1.1); next.chest.ori = Quaternion::rotation_z(wave * 0.1); @@ -58,7 +66,7 @@ impl Animation for RunAnimation { 7.0 - wave * 1.5, ); next.l_hand.ori = Quaternion::rotation_x(wave_cos * 0.8); - next.l_hand.scale = Vec3::one() * 1.0; + next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( 7.5 - wave_cos_dub * 1.0, @@ -66,17 +74,21 @@ impl Animation for RunAnimation { 7.0 + wave * 1.5, ); next.r_hand.ori = Quaternion::rotation_x(wave_cos * -0.8); - next.r_hand.scale = Vec3::one() * 1.0; + next.r_hand.scale = Vec3::one(); - next.l_foot.offset = Vec3::new(-3.4, 0.0 + wave_cos * 1.0, 7.0); - next.l_foot.ori = Quaternion::rotation_x(-0.0 - wave_cos * 1.3); + next.l_foot.offset = Vec3::new(-3.4, 0.0 + wave_cos * 1.0, 6.0 - wave_cos_dub * 0.11); + next.l_foot.ori = Quaternion::rotation_x(-0.0 - wave_cos * 1.5); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, 0.0 - wave_cos * 1.0, 7.0); - next.r_foot.ori = Quaternion::rotation_x(-0.0 + wave_cos * 1.3); + next.r_foot.offset = Vec3::new(3.4, 0.0 - wave_cos * 1.0, 6.0 - wave_cos_dub * 0.11); + next.r_foot.ori = Quaternion::rotation_x(-0.0 + wave_cos * 1.5); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-7.0, -5.0, 15.0); + next.weapon.offset = Vec3::new( + -7.0 + skeleton_attr.weapon_x, + -5.0 + skeleton_attr.weapon_y, + 15.0, + ); next.weapon.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + wave_cos * 0.25); next.weapon.scale = Vec3::one(); @@ -101,10 +113,11 @@ impl Animation for RunAnimation { next.right_equip.ori = Quaternion::rotation_x(0.0);; next.right_equip.scale = Vec3::one() * 0.0; - next.torso.offset = Vec3::new(0.0, -0.2, 0.4); + next.torso.offset = + Vec3::new(0.0, -0.2 + wave * -0.08, 0.4 + wave_cos_dub * 0.11) * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(wave_stop * velocity * -0.06 + wave_diff * velocity * -0.005); - next.torso.scale = Vec3::one() / 11.0; + next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next } diff --git a/voxygen/src/anim/mod.rs b/voxygen/src/anim/mod.rs index ab6618399f..15864c1f72 100644 --- a/voxygen/src/anim/mod.rs +++ b/voxygen/src/anim/mod.rs @@ -4,6 +4,7 @@ pub mod quadruped; pub mod quadrupedmedium; use crate::render::FigureBoneData; +use common::comp::actor::{BodyType, HumanoidBody, Race, Weapon}; use vek::*; #[derive(Copy, Clone)] @@ -45,6 +46,117 @@ pub trait Skeleton: Send + Sync + 'static { fn interpolate(&mut self, target: &Self, dt: f32); } +pub struct SkeletonAttr { + scaler: f32, + head_scale: f32, + neck_height: f32, + neck_forward: f32, + weapon_x: f32, + weapon_y: f32, +} + +impl Default for SkeletonAttr { + fn default() -> Self { + Self { + scaler: 1.0, + head_scale: 1.0, + neck_height: 1.0, + neck_forward: 1.0, + weapon_x: 1.0, + weapon_y: 1.0, + } + } +} + +impl<'a> From<&'a HumanoidBody> for SkeletonAttr { + fn from(body: &'a HumanoidBody) -> Self { + Self { + scaler: match (body.race, body.body_type) { + (Race::Orc, BodyType::Male) => 1.2, + (Race::Orc, BodyType::Female) => 1.0, + (Race::Human, BodyType::Male) => 1.0, + (Race::Human, BodyType::Female) => 0.90, + (Race::Elf, BodyType::Male) => 1.10, + (Race::Elf, BodyType::Female) => 1.0, + (Race::Dwarf, BodyType::Male) => 0.92, + (Race::Dwarf, BodyType::Female) => 0.89, + (Race::Undead, BodyType::Male) => 1.0, + (Race::Undead, BodyType::Female) => 0.90, + (Race::Danari, BodyType::Male) => 0.85, + (Race::Danari, BodyType::Female) => 0.82, + _ => 1.0, + }, + head_scale: match (body.race, body.body_type) { + (Race::Orc, BodyType::Male) => 0.9, + (Race::Orc, BodyType::Female) => 0.88, + (Race::Human, BodyType::Male) => 1.0, + (Race::Human, BodyType::Female) => 1.0, + (Race::Elf, BodyType::Male) => 0.9, + (Race::Elf, BodyType::Female) => 0.9, + (Race::Dwarf, BodyType::Male) => 1.0, + (Race::Dwarf, BodyType::Female) => 1.0, + (Race::Undead, BodyType::Male) => 1.0, + (Race::Undead, BodyType::Female) => 1.0, + (Race::Danari, BodyType::Male) => 1.11, + (Race::Danari, BodyType::Female) => 1.11, + _ => 1.0, + }, + neck_height: match (body.race, body.body_type) { + (Race::Orc, BodyType::Male) => -1.0, + (Race::Orc, BodyType::Female) => -2.0, + (Race::Human, BodyType::Male) => 0.0, + (Race::Human, BodyType::Female) => -2.0, + (Race::Elf, BodyType::Male) => -0.5, + (Race::Elf, BodyType::Female) => -1.5, + (Race::Dwarf, BodyType::Male) => -0.0, + (Race::Dwarf, BodyType::Female) => -1.0, + (Race::Undead, BodyType::Male) => -1.0, + (Race::Undead, BodyType::Female) => -1.0, + (Race::Danari, BodyType::Male) => 0.5, + (Race::Danari, BodyType::Female) => -0.5, + _ => 1.0, + }, + neck_forward: match (body.race, body.body_type) { + (Race::Orc, BodyType::Male) => -1.0, + (Race::Orc, BodyType::Female) => 2.0, + (Race::Human, BodyType::Male) => 1.0, + (Race::Human, BodyType::Female) => 1.0, + (Race::Elf, BodyType::Male) => -0.5, + (Race::Elf, BodyType::Female) => -0.5, + (Race::Dwarf, BodyType::Male) => 0.0, + (Race::Dwarf, BodyType::Female) => 2.0, + (Race::Undead, BodyType::Male) => 1.0, + (Race::Undead, BodyType::Female) => 1.0, + (Race::Danari, BodyType::Male) => 0.5, + (Race::Danari, BodyType::Female) => 0.0, + _ => 1.0, + }, + weapon_x: match body.weapon { + Weapon::Sword => 0.0, + Weapon::Axe => 3.0, + Weapon::Hammer => 0.0, + Weapon::SwordShield => 3.0, + Weapon::Staff => 3.0, + Weapon::Bow => 0.0, + Weapon::Daggers => 0.0, + + _ => 1.0, + }, + weapon_y: match body.weapon { + Weapon::Sword => -1.0, + Weapon::Axe => 0.0, + Weapon::Hammer => -2.0, + Weapon::SwordShield => 0.0, + Weapon::Staff => 0.0, + Weapon::Bow => -2.0, + Weapon::Daggers => -2.0, + + _ => 1.0, + }, + } + } +} + pub trait Animation { type Skeleton; type Dependency; @@ -54,5 +166,6 @@ pub trait Animation { skeleton: &Self::Skeleton, dependency: Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton; } diff --git a/voxygen/src/anim/quadruped/idle.rs b/voxygen/src/anim/quadruped/idle.rs index 63c82e8a0a..5d46bd769d 100644 --- a/voxygen/src/anim/quadruped/idle.rs +++ b/voxygen/src/anim/quadruped/idle.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, QuadrupedSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + QuadrupedSkeleton, +}; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -12,6 +15,7 @@ impl Animation for IdleAnimation { skeleton: &Self::Skeleton, global_time: Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); diff --git a/voxygen/src/anim/quadruped/jump.rs b/voxygen/src/anim/quadruped/jump.rs index 2c08e3eeed..f42d7b010d 100644 --- a/voxygen/src/anim/quadruped/jump.rs +++ b/voxygen/src/anim/quadruped/jump.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, QuadrupedSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + QuadrupedSkeleton, +}; use std::f32::consts::PI; use vek::*; @@ -12,6 +15,7 @@ impl Animation for JumpAnimation { skeleton: &Self::Skeleton, (velocity, global_time): Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); diff --git a/voxygen/src/anim/quadruped/run.rs b/voxygen/src/anim/quadruped/run.rs index eca624e79a..543c98f49f 100644 --- a/voxygen/src/anim/quadruped/run.rs +++ b/voxygen/src/anim/quadruped/run.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, QuadrupedSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + QuadrupedSkeleton, +}; use std::f32::consts::PI; use vek::*; @@ -12,6 +15,7 @@ impl Animation for RunAnimation { skeleton: &Self::Skeleton, (velocity, global_time): Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); diff --git a/voxygen/src/anim/quadrupedmedium/idle.rs b/voxygen/src/anim/quadrupedmedium/idle.rs index bc6578d498..e42ed053ca 100644 --- a/voxygen/src/anim/quadrupedmedium/idle.rs +++ b/voxygen/src/anim/quadrupedmedium/idle.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, QuadrupedMediumSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + QuadrupedMediumSkeleton, +}; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -12,6 +15,7 @@ impl Animation for IdleAnimation { skeleton: &Self::Skeleton, global_time: Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); diff --git a/voxygen/src/anim/quadrupedmedium/jump.rs b/voxygen/src/anim/quadrupedmedium/jump.rs index 9813b5f16c..9c974e9226 100644 --- a/voxygen/src/anim/quadrupedmedium/jump.rs +++ b/voxygen/src/anim/quadrupedmedium/jump.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, QuadrupedMediumSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + QuadrupedMediumSkeleton, +}; use std::f32::consts::PI; use vek::*; @@ -12,6 +15,7 @@ impl Animation for JumpAnimation { skeleton: &Self::Skeleton, global_time: Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); diff --git a/voxygen/src/anim/quadrupedmedium/run.rs b/voxygen/src/anim/quadrupedmedium/run.rs index bd06aefd9c..9fbe593085 100644 --- a/voxygen/src/anim/quadrupedmedium/run.rs +++ b/voxygen/src/anim/quadrupedmedium/run.rs @@ -1,4 +1,7 @@ -use super::{super::Animation, QuadrupedMediumSkeleton}; +use super::{ + super::{Animation, SkeletonAttr}, + QuadrupedMediumSkeleton, +}; use std::{f32::consts::PI, ops::Mul}; use vek::*; @@ -12,6 +15,7 @@ impl Animation for RunAnimation { skeleton: &Self::Skeleton, (velocity, global_time): Self::Dependency, anim_time: f64, + skeleton_attr: &SkeletonAttr, ) -> Self::Skeleton { let mut next = (*skeleton).clone(); diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 62f5468959..f3d5bbdd46 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -90,8 +90,11 @@ impl PlayState for CharSelectionState { global_state.maintain(); // Maintain the scene. - self.scene - .maintain(global_state.window.renderer_mut(), &self.client.borrow()); + self.scene.maintain( + global_state.window.renderer_mut(), + &self.client.borrow(), + self.char_selection_ui.character_body, + ); // Render the scene. self.scene.render( diff --git a/voxygen/src/menu/char_selection/scene.rs b/voxygen/src/menu/char_selection/scene.rs index f18c191fc1..9407a4d7dd 100644 --- a/voxygen/src/menu/char_selection/scene.rs +++ b/voxygen/src/menu/char_selection/scene.rs @@ -2,7 +2,7 @@ use crate::{ anim::{ character::{CharacterSkeleton, IdleAnimation}, fixture::FixtureSkeleton, - Animation, Skeleton, + Animation, Skeleton, SkeletonAttr, }, render::{ create_pp_mesh, create_skybox_mesh, Consts, FigurePipeline, Globals, Model, @@ -14,7 +14,10 @@ use crate::{ }, }; use client::Client; -use common::{comp, state::DeltaTime}; +use common::{ + comp::{Body, HumanoidBody}, + state::DeltaTime, +}; use log::error; use vek::*; @@ -76,7 +79,7 @@ impl Scene { &self.globals } - pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client) { + pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client, body: HumanoidBody) { self.camera.set_focus_pos(Vec3::unit_z() * 2.0); self.camera.update(client.state().get_time()); self.camera.set_distance(4.2); @@ -107,6 +110,7 @@ impl Scene { self.figure_state.skeleton_mut(), client.state().get_time(), client.state().get_time(), + &SkeletonAttr::from(&body), ); self.figure_state.skeleton_mut().interpolate( &tgt_skeleton, @@ -122,14 +126,13 @@ impl Scene { ); } - pub fn render(&mut self, renderer: &mut Renderer, client: &Client, body: comp::HumanoidBody) { + pub fn render(&mut self, renderer: &mut Renderer, client: &Client, body: HumanoidBody) { renderer.render_skybox(&self.skybox.model, &self.globals, &self.skybox.locals); - let model = self.figure_model_cache.get_or_create_model( - renderer, - comp::Body::Humanoid(body), - client.get_tick(), - ); + let model = &self + .figure_model_cache + .get_or_create_model(renderer, Body::Humanoid(body), client.get_tick()) + .0; renderer.render_figure( model, diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index 99f8b6a7e5..a5a53d11af 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -493,7 +493,7 @@ impl MainMenuUi { .set(self.ids.servers_button, ui_widgets) .was_clicked() { - self.show_servers = true; + self.show_servers = !self.show_servers; }; } diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 44e7f9b828..d94cc99ac3 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -3,7 +3,7 @@ use crate::{ character::{self, CharacterSkeleton}, quadruped::{self, QuadrupedSkeleton}, quadrupedmedium::{self, QuadrupedMediumSkeleton}, - Animation, Skeleton, + Animation, Skeleton, SkeletonAttr, }, mesh::Meshable, render::{ @@ -16,8 +16,8 @@ use common::{ comp::{ self, actor::{ - Belt, Chest, Draw, Foot, Hand, Head, Pants, PigChest, PigHead, PigLegL, PigLegR, - Shoulder, Weapon, WolfEars, WolfFootLB, WolfFootLF, WolfFootRB, WolfFootRF, + Belt, BodyType, Chest, Draw, Foot, Hand, Pants, PigChest, PigHead, PigLegL, PigLegR, + Race, Shoulder, Weapon, WolfEars, WolfFootLB, WolfFootLF, WolfFootRB, WolfFootRF, WolfHeadLower, WolfHeadUpper, WolfJaw, WolfTail, WolfTorsoBack, WolfTorsoMid, }, Body, @@ -36,7 +36,7 @@ use vek::*; const DAMAGE_FADE_COEFFICIENT: f64 = 5.0; pub struct FigureModelCache { - models: HashMap, u64)>, + models: HashMap, SkeletonAttr), u64)>, } impl FigureModelCache { @@ -51,7 +51,7 @@ impl FigureModelCache { renderer: &mut Renderer, body: Body, tick: u64, - ) -> &Model { + ) -> &(Model, SkeletonAttr) { match self.models.get_mut(&body) { Some((_model, last_used)) => { *last_used = tick; @@ -63,7 +63,7 @@ impl FigureModelCache { { let bone_meshes = match body { Body::Humanoid(body) => [ - Some(Self::load_head(body.head)), + Some(Self::load_head(body.race, body.body_type)), Some(Self::load_chest(body.chest)), Some(Self::load_belt(body.belt)), Some(Self::load_pants(body.pants)), @@ -118,6 +118,11 @@ impl FigureModelCache { ], }; + let skeleton_attr = match body { + Body::Humanoid(body) => SkeletonAttr::from(&body), + _ => SkeletonAttr::default(), + }; + let mut mesh = Mesh::new(); bone_meshes .iter() @@ -129,7 +134,7 @@ impl FigureModelCache { }) }); - renderer.create_model(&mesh).unwrap() + (renderer.create_model(&mesh).unwrap(), skeleton_attr) }, tick, ), @@ -153,19 +158,75 @@ impl FigureModelCache { .generate_mesh(position) } - fn load_head(head: Head) -> Mesh { - Self::load_mesh( - match head { - Head::Default => "figure/head.vox", - }, - Vec3::new(-7.0, -5.5, -6.0), - ) + fn load_head(race: Race, body_type: BodyType) -> Mesh { + let (name, offset) = match (race, body_type) { + (Race::Human, BodyType::Male) => ( + "figure/head/head_human_male.vox", + Vec3::new(-7.0, -5.5, -9.25), + ), + (Race::Human, BodyType::Female) => ( + "figure/head/head_human_female.vox", + Vec3::new(-7.0, -7.5, -3.25), + ), + (Race::Elf, BodyType::Male) => ( + "figure/head/head_elf_male.vox", + Vec3::new(-9.0, -6.5, -3.75), + ), + (Race::Elf, BodyType::Female) => ( + "figure/head/head_elf_female.vox", + Vec3::new(-8.0, -5.5, -3.0), + ), + (Race::Dwarf, BodyType::Male) => ( + "figure/head/head_dwarf_male.vox", + Vec3::new(-6.0, -5.0, -12.5), + ), + (Race::Dwarf, BodyType::Female) => ( + "figure/head/head_dwarf_female.vox", + Vec3::new(-6.0, -6.0, -9.25), + ), + (Race::Orc, BodyType::Male) => ( + "figure/head/head_orc_male.vox", + Vec3::new(-8.0, -6.0, -2.75), + ), + (Race::Orc, BodyType::Female) => ( + "figure/head/head_orc_female.vox", + Vec3::new(-8.0, -5.5, -2.75), + ), + (Race::Undead, BodyType::Male) => ( + "figure/head/head_undead_male.vox", + Vec3::new(-5.5, -5.0, -2.5), + ), + (Race::Undead, BodyType::Female) => ( + "figure/head/head_undead_female.vox", + Vec3::new(-6.0, -5.0, -2.5), + ), + (Race::Danari, BodyType::Male) => ( + "figure/head/head_danari_male.vox", + Vec3::new(-9.0, -5.0, -2.75), + ), + (Race::Danari, BodyType::Female) => ( + "figure/head/head_danari_female.vox", + Vec3::new(-9.0, -5.5, -2.5), + ), + _ => { + warn!("Invalid race, body_type combination for figure head"); + ("figure/head/head_human_male", Vec3::new(-7.0, -7.0, -9.25)) + } + }; + Self::load_mesh(name, offset) } + // loads models with different offsets + // fn load_beard(beard: Beard) -> Mesh { + // let (name, offset) = match beard { + // Beard::None => ("figure/body/empty.vox", Vec3::new(0.0, 0.0, 0.0)), + // Beard::Human1 => ("figure/empty.vox", Vec3::new(0.0, 0.0, 0.0)), + // }; + // Self::load_mesh(name, offset) + // } fn load_chest(chest: Chest) -> Mesh { Self::load_mesh( match chest { - Chest::Default => "figure/body/chest_male.vox", Chest::Blue => "armor/chest/chest_blue.vox", Chest::Brown => "armor/chest/chest_brown.vox", Chest::Dark => "armor/chest/chest_dark.vox", @@ -189,7 +250,6 @@ impl FigureModelCache { fn load_pants(pants: Pants) -> Mesh { Self::load_mesh( match pants { - Pants::Default => "figure/body/pants_male.vox", Pants::Blue => "armor/pants/pants_blue.vox", Pants::Brown => "armor/pants/pants_brown.vox", Pants::Dark => "armor/pants/pants_dark.vox", @@ -221,7 +281,6 @@ impl FigureModelCache { fn load_left_foot(foot: Foot) -> Mesh { Self::load_mesh( match foot { - Foot::Default => "figure/body/foot.vox", Foot::Dark => "armor/foot/foot_dark.vox", }, Vec3::new(-2.5, -3.5, -9.0), @@ -231,7 +290,6 @@ impl FigureModelCache { fn load_right_foot(foot: Foot) -> Mesh { Self::load_mesh( match foot { - Foot::Default => "figure/body/foot.vox", Foot::Dark => "armor/foot/foot_dark.vox", }, Vec3::new(-2.5, -3.5, -9.0), @@ -239,20 +297,24 @@ impl FigureModelCache { } fn load_weapon(weapon: Weapon) -> Mesh { - Self::load_mesh( - match weapon { - Weapon::Sword => "weapon/sword/sword_rusty_2h.vox", - // TODO actually match against other weapons and set the right model - _ => "weapon/sword/sword_rusty_2h.vox", - }, - Vec3::new(-1.5, -6.5, -4.0), - ) + let (name, offset) = match weapon { + Weapon::Sword => ("weapon/sword/rusty_2h.vox", Vec3::new(-1.5, -6.5, -4.0)), + Weapon::Hammer => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)), + Weapon::Axe => ("weapon/axe/rusty_2h.vox", Vec3::new(-1.5, -6.5, -4.0)), + Weapon::Sword => ("weapon/sword/wood_2h.vox", Vec3::new(-1.5, -6.5, -4.0)), + Weapon::Daggers => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)), + Weapon::SwordShield => ("weapon/axe/rusty_2h.vox", Vec3::new(-2.5, -6.5, -2.0)), + Weapon::Bow => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)), + Weapon::Staff => ("weapon/axe/rusty_2h.vox", Vec3::new(-2.5, -6.5, -2.0)), + }; + Self::load_mesh(name, offset) } fn load_left_shoulder(shoulder: Shoulder) -> Mesh { Self::load_mesh( match shoulder { - Shoulder::Default => "armor/shoulder/shoulder_l_brown.vox", + Shoulder::None => "figure/empty.vox", + Shoulder::Brown1 => "armor/shoulder/shoulder_l_brown.vox", }, Vec3::new(2.5, -0.5, 0.0), ) @@ -261,7 +323,8 @@ impl FigureModelCache { fn load_right_shoulder(shoulder: Shoulder) -> Mesh { Self::load_mesh( match shoulder { - Shoulder::Default => "armor/shoulder/shoulder_r_brown.vox", + Shoulder::None => "figure/empty.vox", + Shoulder::Brown1 => "armor/shoulder/shoulder_r_brown.vox", }, Vec3::new(2.5, -0.5, 0.0), ) @@ -277,13 +340,17 @@ impl FigureModelCache { } fn load_left_equip(weapon: Weapon) -> Mesh { - Self::load_mesh( - match weapon { - Weapon::Sword => "weapon/sword/sword_rusty_2h.vox", - _ => "weapon/sword/sword_rusty_2h.vox", - }, - Vec3::new(-1.5, -6.5, -4.5), - ) + let (name, offset) = match weapon { + Weapon::Sword => ("weapon/sword/rusty_2h.vox", Vec3::new(-1.5, -6.5, -4.0)), + Weapon::Hammer => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)), + Weapon::Axe => ("weapon/axe/rusty_2h.vox", Vec3::new(-2.5, -6.5, -4.0)), + Weapon::Sword => ("weapon/sword/wood_2h.vox", Vec3::new(-1.5, -6.5, -4.0)), + Weapon::Daggers => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)), + Weapon::SwordShield => ("weapon/axe/rusty_2h.vox", Vec3::new(-2.5, -6.5, -2.0)), + Weapon::Bow => ("weapon/hammer/rusty_2h.vox", Vec3::new(-2.5, -5.5, -4.0)), + Weapon::Staff => ("weapon/axe/rusty_2h.vox", Vec3::new(-2.5, -6.5, -2.0)), + }; + Self::load_mesh(name, offset) } fn load_right_equip(hand: Hand) -> Mesh { @@ -294,6 +361,7 @@ impl FigureModelCache { Vec3::new(-2.0, -2.5, -5.0), ) } + ///////// fn load_pig_head(pig_head: PigHead) -> Mesh { Self::load_mesh( @@ -472,6 +540,7 @@ impl FigureMgr { pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client) { let time = client.state().get_time(); + let tick = client.get_tick(); let ecs = client.state().ecs(); let view_distance = client.view_distance().unwrap_or(1); let dt = client.state().get_delta_time(); @@ -528,127 +597,153 @@ impl FigureMgr { .unwrap_or(Rgba::broadcast(1.0)); match actor { - comp::Actor::Character { body, .. } => match body { - Body::Humanoid(_) => { - let state = self.character_states.entry(entity).or_insert_with(|| { - FigureState::new(renderer, CharacterSkeleton::new()) - }); + comp::Actor::Character { body, .. } => { + let skeleton_attr = &self + .model_cache + .get_or_create_model(renderer, *body, tick) + .1; - let target_skeleton = match animation_info.animation { - comp::Animation::Idle => character::IdleAnimation::update_skeleton( - state.skeleton_mut(), - time, - animation_info.time, - ), - comp::Animation::Run => character::RunAnimation::update_skeleton( - state.skeleton_mut(), - (vel.0.magnitude(), time), - animation_info.time, - ), - comp::Animation::Jump => character::JumpAnimation::update_skeleton( - state.skeleton_mut(), - time, - animation_info.time, - ), - comp::Animation::Attack => character::AttackAnimation::update_skeleton( - state.skeleton_mut(), - time, - animation_info.time, - ), - comp::Animation::Roll => character::RollAnimation::update_skeleton( - state.skeleton_mut(), - time, - animation_info.time, - ), - comp::Animation::Crun => character::CrunAnimation::update_skeleton( - state.skeleton_mut(), - (vel.0.magnitude(), time), - animation_info.time, - ), - comp::Animation::Cidle => character::CidleAnimation::update_skeleton( - state.skeleton_mut(), - time, - animation_info.time, - ), - comp::Animation::Gliding => { - character::GlidingAnimation::update_skeleton( - state.skeleton_mut(), - (vel.0.magnitude(), time), - animation_info.time, - ) - } - }; + match body { + Body::Humanoid(_) => { + let state = self.character_states.entry(entity).or_insert_with(|| { + FigureState::new(renderer, CharacterSkeleton::new()) + }); - state.skeleton.interpolate(&target_skeleton, dt); - state.update(renderer, pos.0, ori.0, col, dt); - } - Body::Quadruped(_) => { - let state = self.quadruped_states.entry(entity).or_insert_with(|| { - FigureState::new(renderer, QuadrupedSkeleton::new()) - }); - - let target_skeleton = match animation_info.animation { - comp::Animation::Run => quadruped::RunAnimation::update_skeleton( - state.skeleton_mut(), - (vel.0.magnitude(), time), - animation_info.time, - ), - comp::Animation::Idle => quadruped::IdleAnimation::update_skeleton( - state.skeleton_mut(), - time, - animation_info.time, - ), - comp::Animation::Jump => quadruped::JumpAnimation::update_skeleton( - state.skeleton_mut(), - (vel.0.magnitude(), time), - animation_info.time, - ), - - // TODO! - _ => state.skeleton_mut().clone(), - }; - - state.skeleton.interpolate(&target_skeleton, dt); - state.update(renderer, pos.0, ori.0, col, dt); - } - Body::QuadrupedMedium(_) => { - let state = - self.quadruped_medium_states - .entry(entity) - .or_insert_with(|| { - FigureState::new(renderer, QuadrupedMediumSkeleton::new()) - }); - - let target_skeleton = match animation_info.animation { - comp::Animation::Run => quadrupedmedium::RunAnimation::update_skeleton( - state.skeleton_mut(), - (vel.0.magnitude(), time), - animation_info.time, - ), - comp::Animation::Idle => { - quadrupedmedium::IdleAnimation::update_skeleton( + let target_skeleton = match animation_info.animation { + comp::Animation::Idle => character::IdleAnimation::update_skeleton( state.skeleton_mut(), time, animation_info.time, - ) - } - comp::Animation::Jump => { - quadrupedmedium::JumpAnimation::update_skeleton( + skeleton_attr, + ), + comp::Animation::Run => character::RunAnimation::update_skeleton( state.skeleton_mut(), (vel.0.magnitude(), time), animation_info.time, - ) - } + skeleton_attr, + ), + comp::Animation::Jump => character::JumpAnimation::update_skeleton( + state.skeleton_mut(), + time, + animation_info.time, + skeleton_attr, + ), + comp::Animation::Attack => { + character::AttackAnimation::update_skeleton( + state.skeleton_mut(), + time, + animation_info.time, + skeleton_attr, + ) + } + comp::Animation::Roll => character::RollAnimation::update_skeleton( + state.skeleton_mut(), + time, + animation_info.time, + skeleton_attr, + ), + comp::Animation::Crun => character::CrunAnimation::update_skeleton( + state.skeleton_mut(), + (vel.0.magnitude(), time), + animation_info.time, + skeleton_attr, + ), + comp::Animation::Cidle => { + character::CidleAnimation::update_skeleton( + state.skeleton_mut(), + time, + animation_info.time, + skeleton_attr, + ) + } + comp::Animation::Gliding => { + character::GlidingAnimation::update_skeleton( + state.skeleton_mut(), + (vel.0.magnitude(), time), + animation_info.time, + skeleton_attr, + ) + } + }; - // TODO! - _ => state.skeleton_mut().clone(), - }; + state.skeleton.interpolate(&target_skeleton, dt); + state.update(renderer, pos.0, ori.0, col, dt); + } + Body::Quadruped(_) => { + let state = self.quadruped_states.entry(entity).or_insert_with(|| { + FigureState::new(renderer, QuadrupedSkeleton::new()) + }); - state.skeleton.interpolate(&target_skeleton, dt); - state.update(renderer, pos.0, ori.0, col, dt); + let target_skeleton = match animation_info.animation { + comp::Animation::Run => quadruped::RunAnimation::update_skeleton( + state.skeleton_mut(), + (vel.0.magnitude(), time), + animation_info.time, + skeleton_attr, + ), + comp::Animation::Idle => quadruped::IdleAnimation::update_skeleton( + state.skeleton_mut(), + time, + animation_info.time, + skeleton_attr, + ), + comp::Animation::Jump => quadruped::JumpAnimation::update_skeleton( + state.skeleton_mut(), + (vel.0.magnitude(), time), + animation_info.time, + skeleton_attr, + ), + + // TODO! + _ => state.skeleton_mut().clone(), + }; + + state.skeleton.interpolate(&target_skeleton, dt); + state.update(renderer, pos.0, ori.0, col, dt); + } + Body::QuadrupedMedium(_) => { + let state = + self.quadruped_medium_states + .entry(entity) + .or_insert_with(|| { + FigureState::new(renderer, QuadrupedMediumSkeleton::new()) + }); + + let target_skeleton = match animation_info.animation { + comp::Animation::Run => { + quadrupedmedium::RunAnimation::update_skeleton( + state.skeleton_mut(), + (vel.0.magnitude(), time), + animation_info.time, + skeleton_attr, + ) + } + comp::Animation::Idle => { + quadrupedmedium::IdleAnimation::update_skeleton( + state.skeleton_mut(), + time, + animation_info.time, + skeleton_attr, + ) + } + comp::Animation::Jump => { + quadrupedmedium::JumpAnimation::update_skeleton( + state.skeleton_mut(), + (vel.0.magnitude(), time), + animation_info.time, + skeleton_attr, + ) + } + + // TODO! + _ => state.skeleton_mut().clone(), + }; + + state.skeleton.interpolate(&target_skeleton, dt); + state.update(renderer, pos.0, ori.0, col, dt); + } } - }, - // TODO: Non-character actors + } // TODO: Non-character actors } } @@ -715,7 +810,10 @@ impl FigureMgr { .get(&entity) .map(|state| (state.locals(), state.bone_consts())), } { - let model = self.model_cache.get_or_create_model(renderer, *body, tick); + let model = &self + .model_cache + .get_or_create_model(renderer, *body, tick) + .0; renderer.render_figure(model, globals, locals, bone_consts); } else {