From 40360ff149e54572eea62e135b177ea85c96722d Mon Sep 17 00:00:00 2001 From: Robin Gilh Date: Sat, 25 Apr 2020 15:20:37 +0200 Subject: [PATCH 01/19] Dragon work --- assets/common/npc_names.json | 14 + .../voxygen/voxel/dragon_center_manifest.ron | 46 ++ .../voxygen/voxel/dragon_lateral_manifest.ron | 70 +++ assets/voxygen/voxel/npc/dragon/wing_in_l.vox | 3 - assets/voxygen/voxel/npc/dragon/wing_in_r.vox | 3 - .../voxygen/voxel/npc/dragon/wing_out_l.vox | 3 - .../voxygen/voxel/npc/dragon/wing_out_r.vox | 3 - .../female}/chest_front.vox | 0 .../female}/chest_rear.vox | 0 .../{dragon => reddragon/female}/foot_bl.vox | 0 .../{dragon => reddragon/female}/foot_br.vox | 0 .../{dragon => reddragon/female}/foot_fl.vox | 0 .../{dragon => reddragon/female}/foot_fr.vox | 0 .../npc/{dragon => reddragon/female}/head.vox | 0 .../female}/tail_front.vox | 0 .../female}/tail_rear.vox | 0 .../voxel/npc/reddragon/female/wing_in_l.vox | 3 + .../voxel/npc/reddragon/female/wing_in_r.vox | 3 + .../voxel/npc/reddragon/female/wing_out_l.vox | 3 + .../voxel/npc/reddragon/female/wing_out_r.vox | 3 + .../voxel/npc/reddragon/male/chest_front.vox | 3 + .../voxel/npc/reddragon/male/chest_rear.vox | 3 + .../voxel/npc/reddragon/male/foot_bl.vox | 3 + .../voxel/npc/reddragon/male/foot_br.vox | 3 + .../voxel/npc/reddragon/male/foot_fl.vox | 3 + .../voxel/npc/reddragon/male/foot_fr.vox | 3 + .../voxygen/voxel/npc/reddragon/male/head.vox | 3 + .../voxel/npc/reddragon/male/tail_front.vox | 3 + .../voxel/npc/reddragon/male/tail_rear.vox | 3 + .../voxel/npc/reddragon/male/wing_in_l.vox | 3 + .../voxel/npc/reddragon/male/wing_in_r.vox | 3 + .../voxel/npc/reddragon/male/wing_out_l.vox | 3 + .../voxel/npc/reddragon/male/wing_out_r.vox | 3 + common/src/comp/body.rs | 2 + common/src/comp/body/dragon.rs | 165 ++---- common/src/generation.rs | 3 + common/src/npc.rs | 13 +- voxygen/src/anim/dragon/mod.rs | 81 ++- voxygen/src/scene/figure/cache.rs | 95 +++- voxygen/src/scene/figure/load.rs | 477 ++++++++++++------ world/src/lib.rs | 2 +- 41 files changed, 713 insertions(+), 318 deletions(-) create mode 100644 assets/voxygen/voxel/dragon_center_manifest.ron create mode 100644 assets/voxygen/voxel/dragon_lateral_manifest.ron delete mode 100644 assets/voxygen/voxel/npc/dragon/wing_in_l.vox delete mode 100644 assets/voxygen/voxel/npc/dragon/wing_in_r.vox delete mode 100644 assets/voxygen/voxel/npc/dragon/wing_out_l.vox delete mode 100644 assets/voxygen/voxel/npc/dragon/wing_out_r.vox rename assets/voxygen/voxel/npc/{dragon => reddragon/female}/chest_front.vox (100%) rename assets/voxygen/voxel/npc/{dragon => reddragon/female}/chest_rear.vox (100%) rename assets/voxygen/voxel/npc/{dragon => reddragon/female}/foot_bl.vox (100%) rename assets/voxygen/voxel/npc/{dragon => reddragon/female}/foot_br.vox (100%) rename assets/voxygen/voxel/npc/{dragon => reddragon/female}/foot_fl.vox (100%) rename assets/voxygen/voxel/npc/{dragon => reddragon/female}/foot_fr.vox (100%) rename assets/voxygen/voxel/npc/{dragon => reddragon/female}/head.vox (100%) rename assets/voxygen/voxel/npc/{dragon => reddragon/female}/tail_front.vox (100%) rename assets/voxygen/voxel/npc/{dragon => reddragon/female}/tail_rear.vox (100%) create mode 100644 assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/chest_front.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/foot_br.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/head.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/tail_front.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox diff --git a/assets/common/npc_names.json b/assets/common/npc_names.json index bced2a7ad1..88b237ac4d 100644 --- a/assets/common/npc_names.json +++ b/assets/common/npc_names.json @@ -539,5 +539,19 @@ "generic": "Fungome" } } + }, + "dragon": { + "body": { + "keyword": "dragon", + "names": [ + "Smaug" + ] + }, + "species": { + "reddragon": { + "keyword": "reddragon", + "generic": "Reddragon" + } + } } } diff --git a/assets/voxygen/voxel/dragon_center_manifest.ron b/assets/voxygen/voxel/dragon_center_manifest.ron new file mode 100644 index 0000000000..a4f492c4e1 --- /dev/null +++ b/assets/voxygen/voxel/dragon_center_manifest.ron @@ -0,0 +1,46 @@ +({ + (Reddragon, Male): ( + head: ( + offset: (-7.0, -9.0, -5.5), + center: ("npc.reddragon.male.head"), + ), + chest_front: ( + offset: (-7.0, 4.5, 5.0), + center: ("npc.reddragon.male.chest_front"), + ), + chest_rear: ( + offset: (-7.0, -4.5, 5.0), + center: ("npc.reddragon.male.chest_rear"), + ), + tail_front: ( + offset: (-7.0, -4.5, -5.0), + center: ("npc.reddragon.male.tail_front"), + ), + tail_rear: ( + offset: (-7.0, -4.5, -5.0), + center: ("npc.reddragon.male.tail_rear"), + ) + ), + (Reddragon, Female): ( + head: ( + offset: (-7.0, -9.0, -5.5), + center: ("npc.reddragon.female.head"), + ), + chest_front: ( + offset: (-7.0, 4.5, 5.0), + center: ("npc.reddragon.female.chest_front"), + ), + chest_rear: ( + offset: (-7.0, -4.5, 5.0), + center: ("npc.reddragon.female.chest_rear"), + ), + tail_front: ( + offset: (-7.0, -4.5, -5.0), + center: ("npc.reddragon.female.tail_front"), + ), + tail_rear: ( + offset: (-7.0, -4.5, -5.0), + center: ("npc.reddragon.female.tail_rear"), + ) + ), +}) diff --git a/assets/voxygen/voxel/dragon_lateral_manifest.ron b/assets/voxygen/voxel/dragon_lateral_manifest.ron new file mode 100644 index 0000000000..d9e64fb684 --- /dev/null +++ b/assets/voxygen/voxel/dragon_lateral_manifest.ron @@ -0,0 +1,70 @@ +({ + (Reddragon, Male): ( + wing_in_l: ( + offset: (20.0, 20.0, 5.0), + lateral: ("npc.reddragon.male.wing_in_l"), + ), + wing_in_r: ( + offset: (20.0, 20.0, 5.0), + lateral: ("npc.reddragon.male.wing_in_r"), + ), + wing_out_l: ( + offset: (20.0, 20.0, 5.0), + lateral: ("npc.reddragon.male.wing_out_l"), + ), + wing_out_r: ( + offset: (20.0, 20.0, 5.0), + lateral: ("npc.reddragon.male.wing_out_r"), + ), + foot_fl: ( + offset: (-2.5, -4.0, -1.5), + lateral: ("npc.reddragon.male.foot_fl"), + ), + foot_fr: ( + offset: (-2.5, -4.0, -1.5), + lateral: ("npc.reddragon.male.foot_fr"), + ), + foot_bl: ( + offset: (-2.5, -4.0, -3.0), + lateral: ("npc.reddragon.male.foot_bl"), + ), + foot_br: ( + offset: (-2.5, -4.0, -3.0), + lateral: ("npc.reddragon.male.foot_br"), + ) + ), + (Reddragon, Female): ( + wing_in_l: ( + offset: (20.0, 20.0, 5.0), + lateral: ("npc.reddragon.female.wing_in_l"), + ), + wing_in_r: ( + offset: (20.0, 20.0, 5.0), + lateral: ("npc.reddragon.female.wing_in_r"), + ), + wing_out_l: ( + offset: (20.0, 20.0, 5.0), + lateral: ("npc.reddragon.female.wing_out_l"), + ), + wing_out_r: ( + offset: (20.0, 20.0, 5.0), + lateral: ("npc.reddragon.female.wing_out_r"), + ), + foot_fl: ( + offset: (-2.5, -4.0, -1.5), + lateral: ("npc.reddragon.female.foot_fl"), + ), + foot_fr: ( + offset: (-2.5, -4.0, -1.5), + lateral: ("npc.reddragon.female.foot_fr"), + ), + foot_bl: ( + offset: (-2.5, -4.0, -3.0), + lateral: ("npc.reddragon.female.foot_bl"), + ), + foot_br: ( + offset: (-2.5, -4.0, -3.0), + lateral: ("npc.reddragon.female.foot_br"), + ) + ), +}) \ No newline at end of file diff --git a/assets/voxygen/voxel/npc/dragon/wing_in_l.vox b/assets/voxygen/voxel/npc/dragon/wing_in_l.vox deleted file mode 100644 index 217aa90fa2..0000000000 --- a/assets/voxygen/voxel/npc/dragon/wing_in_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:71a8f3a854354946d80fd9c90839ac67549508c490ae342c8d5a9dc4b1f5ff6b -size 2884 diff --git a/assets/voxygen/voxel/npc/dragon/wing_in_r.vox b/assets/voxygen/voxel/npc/dragon/wing_in_r.vox deleted file mode 100644 index 9ca1b76e22..0000000000 --- a/assets/voxygen/voxel/npc/dragon/wing_in_r.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ddbdc71bb337dc45b4d32e2f3d9a11845e198ac17215e09ace38638a2c567b44 -size 2884 diff --git a/assets/voxygen/voxel/npc/dragon/wing_out_l.vox b/assets/voxygen/voxel/npc/dragon/wing_out_l.vox deleted file mode 100644 index 2f54e5758a..0000000000 --- a/assets/voxygen/voxel/npc/dragon/wing_out_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6bcab7b445899e1f24d7f61b468782612a79b36636786975b00a33e1ad266ab6 -size 3544 diff --git a/assets/voxygen/voxel/npc/dragon/wing_out_r.vox b/assets/voxygen/voxel/npc/dragon/wing_out_r.vox deleted file mode 100644 index 960761f385..0000000000 --- a/assets/voxygen/voxel/npc/dragon/wing_out_r.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3c076249b9a357865e20f146b54fbfa4f2a7e82c3542fec09c99467d691ea5de -size 3544 diff --git a/assets/voxygen/voxel/npc/dragon/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox similarity index 100% rename from assets/voxygen/voxel/npc/dragon/chest_front.vox rename to assets/voxygen/voxel/npc/reddragon/female/chest_front.vox diff --git a/assets/voxygen/voxel/npc/dragon/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox similarity index 100% rename from assets/voxygen/voxel/npc/dragon/chest_rear.vox rename to assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox diff --git a/assets/voxygen/voxel/npc/dragon/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox similarity index 100% rename from assets/voxygen/voxel/npc/dragon/foot_bl.vox rename to assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox diff --git a/assets/voxygen/voxel/npc/dragon/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox similarity index 100% rename from assets/voxygen/voxel/npc/dragon/foot_br.vox rename to assets/voxygen/voxel/npc/reddragon/female/foot_br.vox diff --git a/assets/voxygen/voxel/npc/dragon/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox similarity index 100% rename from assets/voxygen/voxel/npc/dragon/foot_fl.vox rename to assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox diff --git a/assets/voxygen/voxel/npc/dragon/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox similarity index 100% rename from assets/voxygen/voxel/npc/dragon/foot_fr.vox rename to assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox diff --git a/assets/voxygen/voxel/npc/dragon/head.vox b/assets/voxygen/voxel/npc/reddragon/female/head.vox similarity index 100% rename from assets/voxygen/voxel/npc/dragon/head.vox rename to assets/voxygen/voxel/npc/reddragon/female/head.vox diff --git a/assets/voxygen/voxel/npc/dragon/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox similarity index 100% rename from assets/voxygen/voxel/npc/dragon/tail_front.vox rename to assets/voxygen/voxel/npc/reddragon/female/tail_front.vox diff --git a/assets/voxygen/voxel/npc/dragon/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox similarity index 100% rename from assets/voxygen/voxel/npc/dragon/tail_rear.vox rename to assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox new file mode 100644 index 0000000000..41307eb524 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b6de1eab081ed802022e61f5272e88b40d661ea2e485ed096293bad5a1588c8 +size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox new file mode 100644 index 0000000000..ef5fe55a9a --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:079da56ff2c225ed8d4edd13c61c2803f324e49b29a0eea69c485f7cc68c9587 +size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox new file mode 100644 index 0000000000..93ca39dde2 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8664be051f079672954ab69ae9f25a8323d64285987eab10744194f77c740400 +size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox new file mode 100644 index 0000000000..e56d2dde7d --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2d671e167445954ffad79a4305c90407a0a506c71c143287941d417da9edf78 +size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox new file mode 100644 index 0000000000..5385ca652f --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccb3946a7b70bbe3bbca76b0930651b1fafb6f10cf466d730dc838a8dd900102 +size 4556 diff --git a/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox new file mode 100644 index 0000000000..03c2c36ca0 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5d9f4fa579f6456f4a642f94d6388074422858d7c4053e339e253bb0b86f888 +size 6080 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox new file mode 100644 index 0000000000..d9ad85b152 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3392c489527b685662705bdba578d8f2f12788c00a881885edd45505f741124 +size 1408 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox new file mode 100644 index 0000000000..5f3d81ec51 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff5cc1eac6b2939d3658e21228f87366327665ae70dd83d5af92ac3b3dae0fb4 +size 1408 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox new file mode 100644 index 0000000000..f1e67b65c8 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed4cb29ddba38424eb238ce2c3df7ea9b67d2e3b4f902194588f67a41f759b89 +size 1408 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox new file mode 100644 index 0000000000..03497e9382 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a5b309ae1146a4a5dab72e7bd534201b9ccbddcdc512d0a5619e4ef6880eefa +size 1408 diff --git a/assets/voxygen/voxel/npc/reddragon/male/head.vox b/assets/voxygen/voxel/npc/reddragon/male/head.vox new file mode 100644 index 0000000000..d27c554eac --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3c6dcc28719e148e572786722426103d4e4e7af05b815e8328ee71515db813a +size 3040 diff --git a/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox new file mode 100644 index 0000000000..27a01ab209 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da84212d78276b933a4b374c7b038d0ca5026c5be0d14a0dc93cb3fe15771d0c +size 1784 diff --git a/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox new file mode 100644 index 0000000000..41d539f783 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26867c50e937a64890489706c33fe8b06d43138ff134c7fdaf165128ef24c470 +size 1392 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox new file mode 100644 index 0000000000..41307eb524 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b6de1eab081ed802022e61f5272e88b40d661ea2e485ed096293bad5a1588c8 +size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox new file mode 100644 index 0000000000..ef5fe55a9a --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:079da56ff2c225ed8d4edd13c61c2803f324e49b29a0eea69c485f7cc68c9587 +size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox new file mode 100644 index 0000000000..93ca39dde2 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8664be051f079672954ab69ae9f25a8323d64285987eab10744194f77c740400 +size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox new file mode 100644 index 0000000000..e56d2dde7d --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2d671e167445954ffad79a4305c90407a0a506c71c143287941d417da9edf78 +size 58012 diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 4545478126..a69cc9b961 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -60,6 +60,7 @@ pub struct AllBodies { pub biped_large: BodyData>, pub golem: BodyData>, pub critter: BodyData>, + pub dragon: BodyData>, } /// Can only retrieve body metadata by direct index. @@ -76,6 +77,7 @@ impl core::ops::Index for AllBodies &self.biped_large.body, NpcKind::StoneGolem => &self.golem.body, NpcKind::Rat => &self.critter.body, + NpcKind::Reddragon => &self.dragon.body, } } } diff --git a/common/src/comp/body/dragon.rs b/common/src/comp/body/dragon.rs index 94c23ce9b9..8591ba74e1 100644 --- a/common/src/comp/body/dragon.rs +++ b/common/src/comp/body/dragon.rs @@ -2,128 +2,69 @@ use rand::{seq::SliceRandom, thread_rng}; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Body { - pub head: Head, - pub chest_front: ChestFront, - pub chest_rear: ChestRear, - pub tail_front: TailFront, - pub tail_rear: TailRear, - pub wing_in_l: WingInL, - pub wing_in_r: WingInR, - pub wing_out_l: WingOutL, - pub wing_out_r: WingOutR, - pub foot_fl: FootFL, - pub foot_fr: FootFR, - pub foot_bl: FootBL, - pub foot_br: FootBR, + pub species: Species, + pub body_type: BodyType, } + impl Body { pub fn random() -> Self { let mut rng = thread_rng(); - Self { - head: *(&ALL_HEADS).choose(&mut rng).unwrap(), - chest_front: *(&ALL_CHEST_FRONTS).choose(&mut rng).unwrap(), - chest_rear: *(&ALL_CHEST_REARS).choose(&mut rng).unwrap(), - tail_front: *(&ALL_TAIL_FRONTS).choose(&mut rng).unwrap(), - tail_rear: *(&ALL_TAIL_REARS).choose(&mut rng).unwrap(), - wing_in_l: *(&ALL_WING_IN_LS).choose(&mut rng).unwrap(), - wing_in_r: *(&ALL_WING_IN_RS).choose(&mut rng).unwrap(), - wing_out_l: *(&ALL_WING_OUT_LS).choose(&mut rng).unwrap(), - wing_out_r: *(&ALL_WING_OUT_RS).choose(&mut rng).unwrap(), - foot_fl: *(&ALL_FOOT_FLS).choose(&mut rng).unwrap(), - foot_fr: *(&ALL_FOOT_FRS).choose(&mut rng).unwrap(), - foot_bl: *(&ALL_FOOT_BLS).choose(&mut rng).unwrap(), - foot_br: *(&ALL_FOOT_BRS).choose(&mut rng).unwrap(), + let species = *(&ALL_SPECIES).choose(&mut rng).unwrap(); + Self::random_with(&mut rng, &species) + } + + #[inline] + pub fn random_with(rng: &mut impl rand::Rng, &species: &Species) -> Self { + let body_type = *(&ALL_BODY_TYPES).choose(rng).unwrap(); + Self { species, body_type } + } +} + +impl From for super::Body { + fn from(body: Body) -> Self { super::Body::Dragon(body) } +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[repr(u32)] +pub enum Species { + Reddragon = 0, +} + +/// Data representing per-species generic data. +/// +/// NOTE: Deliberately don't (yet?) implement serialize. +#[derive(Clone, Debug, Deserialize)] +pub struct AllSpecies { + pub reddragon: SpeciesMeta, +} + +impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies { + type Output = SpeciesMeta; + + #[inline] + fn index(&self, &index: &'a Species) -> &Self::Output { + match index { + Species::Reddragon => &self.reddragon, } } } -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum Head { - Default, +pub const ALL_SPECIES: [Species; 1] = [ + Species::Reddragon, +]; + +impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type Item = Species; + + type IntoIter = impl Iterator; + + fn into_iter(self) -> Self::IntoIter { ALL_SPECIES.iter().copied() } } -const ALL_HEADS: [Head; 1] = [Head::Default]; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[repr(u32)] -pub enum ChestFront { - Default, +pub enum BodyType { + Female = 0, + Male = 1, } -const ALL_CHEST_FRONTS: [ChestFront; 1] = [ChestFront::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum ChestRear { - Default, -} -const ALL_CHEST_REARS: [ChestRear; 1] = [ChestRear::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum TailFront { - Default, -} -const ALL_TAIL_FRONTS: [TailFront; 1] = [TailFront::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum TailRear { - Default, -} -const ALL_TAIL_REARS: [TailRear; 1] = [TailRear::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum WingInL { - Default, -} -const ALL_WING_IN_LS: [WingInL; 1] = [WingInL::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum WingInR { - Default, -} -const ALL_WING_IN_RS: [WingInR; 1] = [WingInR::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum WingOutL { - Default, -} -const ALL_WING_OUT_LS: [WingOutL; 1] = [WingOutL::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum WingOutR { - Default, -} -const ALL_WING_OUT_RS: [WingOutR; 1] = [WingOutR::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum FootFL { - Default, -} -const ALL_FOOT_FLS: [FootFL; 1] = [FootFL::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum FootFR { - Default, -} -const ALL_FOOT_FRS: [FootFR; 1] = [FootFR::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum FootBL { - Default, -} -const ALL_FOOT_BLS: [FootBL; 1] = [FootBL::Default]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -#[repr(u32)] -pub enum FootBR { - Default, -} -const ALL_FOOT_BRS: [FootBR; 1] = [FootBR::Default]; +pub const ALL_BODY_TYPES: [BodyType; 2] = [BodyType::Female, BodyType::Male]; diff --git a/common/src/generation.rs b/common/src/generation.rs index 22cf420021..15850ebb64 100644 --- a/common/src/generation.rs +++ b/common/src/generation.rs @@ -79,6 +79,9 @@ impl EntityInfo { Body::QuadrupedSmall(body) => { Some(get_npc_name(&NPC_NAMES.quadruped_small, body.species)) }, + Body::Dragon(body) => { + Some(get_npc_name(&NPC_NAMES.dragon, body.species)) + }, _ => None, } .map(|s| { diff --git a/common/src/npc.rs b/common/src/npc.rs index fc08070dea..97d42e9b43 100644 --- a/common/src/npc.rs +++ b/common/src/npc.rs @@ -15,9 +15,10 @@ pub enum NpcKind { Ogre, Rat, StoneGolem, + Reddragon, } -pub const ALL_NPCS: [NpcKind; 7] = [ +pub const ALL_NPCS: [NpcKind; 8] = [ NpcKind::Humanoid, NpcKind::Wolf, NpcKind::Pig, @@ -25,6 +26,7 @@ pub const ALL_NPCS: [NpcKind; 7] = [ NpcKind::Ogre, NpcKind::Rat, NpcKind::StoneGolem, + NpcKind::Reddragon, ]; /// Body-specific NPC name metadata. @@ -91,6 +93,7 @@ pub fn kind_to_body(kind: NpcKind) -> Body { NpcKind::Ogre => comp::biped_large::Body::random().into(), NpcKind::Rat => comp::critter::Body::random().into(), NpcKind::StoneGolem => comp::golem::Body::random().into(), + NpcKind::Reddragon => comp::critter::Body::random().into(), } } @@ -212,6 +215,14 @@ impl NpcBody { comp::golem::Body::random_with, ) }) + .or_else(|| { + parse( + s, + NpcKind::Reddragon, + &npc_names.dragon, + comp::dragon::Body::random_with, + ) + }) .ok_or(()) } } diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index 67cf9c5317..b997fab2f7 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -10,7 +10,7 @@ use crate::render::FigureBoneData; use common::comp::{self}; use vek::Vec3; -#[derive(Clone)] +#[derive(Clone, Default)] pub struct DragonSkeleton { head: Bone, chest_front: Bone, @@ -28,23 +28,7 @@ pub struct DragonSkeleton { } impl DragonSkeleton { - pub fn new() -> Self { - Self { - head: Bone::default(), - chest_front: Bone::default(), - chest_rear: Bone::default(), - tail_front: Bone::default(), - tail_rear: Bone::default(), - wing_in_l: Bone::default(), - wing_in_r: Bone::default(), - wing_out_l: Bone::default(), - wing_out_r: Bone::default(), - foot_fl: Bone::default(), - foot_fr: Bone::default(), - foot_bl: Bone::default(), - foot_br: Bone::default(), - } - } + pub fn new() -> Self { Self::default() } } impl Skeleton for DragonSkeleton { @@ -98,7 +82,17 @@ impl Skeleton for DragonSkeleton { } } -pub struct SkeletonAttr; +pub struct SkeletonAttr { + head: (f32, f32), + chest_front: (f32, f32), + chest_rear: (f32, f32), + tail_front: (f32, f32), + tail_rear: (f32, f32), + wing_in: (f32, f32), + wing_out: (f32, f32), + feet_f: (f32, f32, f32), + feet_b: (f32, f32, f32), +} impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { type Error = (); @@ -112,9 +106,52 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { } impl Default for SkeletonAttr { - fn default() -> Self { Self } + fn default() -> Self { + Self { + head: (0.0, 0.0), + chest_front: (0.0, 0.0), + chest_rear: (0.0, 0.0), + tail_front: (0.0, 0.0), + tail_rear: (0.0, 0.0), + wing_in: (0.0, 0.0), + wing_out: (0.0, 0.0), + feet_f: (0.0, 0.0, 0.0), + feet_b: (0.0, 0.0, 0.0), + } + } } impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { - fn from(_body: &'a comp::dragon::Body) -> Self { Self } -} + fn from(body: &'a comp::dragon::Body) -> Self { + use comp::dragon::Species::*; + Self { + head: match (body.species, body.body_type) { + (Reddragon, _) => (4.0, 3.0), + }, + chest_front: match (body.species, body.body_type) { + (Reddragon, _) => (0.0, 5.0), + }, + chest_rear: match (body.species, body.body_type) { + (Reddragon, _) => (0.0, 5.0), + }, + tail_front: match (body.species, body.body_type) { + (Reddragon, _) => (-3.0, 1.5), + }, + tail_rear: match (body.species, body.body_type) { + (Reddragon, _) => (-3.0, 1.5), + }, + wing_in: match (body.species, body.body_type) { + (Reddragon, _) => (2.75, 0.0), + }, + wing_out: match (body.species, body.body_type) { + (Reddragon, _) => (2.75, 0.0), + }, + feet_f: match (body.species, body.body_type) { + (Reddragon, _) => (2.0, -1.5, 4.0), + }, + feet_b: match (body.species, body.body_type) { + (Reddragon, _) => (2.0, -1.5, 4.0), + }, + } + } +} \ No newline at end of file diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index d06f72cd1e..4ca5547771 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -410,24 +410,83 @@ impl FigureModelCache { None, None, ], - Body::Dragon(body) => [ - Some(mesh_dragon_head(body.head, generate_mesh)), - Some(mesh_dragon_chest_front(body.chest_front, generate_mesh)), - Some(mesh_dragon_chest_rear(body.chest_rear, generate_mesh)), - Some(mesh_dragon_tail_front(body.tail_front, generate_mesh)), - Some(mesh_dragon_tail_rear(body.tail_rear, generate_mesh)), - Some(mesh_dragon_wing_in_l(body.wing_in_l, generate_mesh)), - Some(mesh_dragon_wing_in_r(body.wing_in_r, generate_mesh)), - Some(mesh_dragon_wing_out_l(body.wing_out_l, generate_mesh)), - Some(mesh_dragon_wing_out_r(body.wing_out_r, generate_mesh)), - Some(mesh_dragon_foot_fl(body.foot_fl, generate_mesh)), - Some(mesh_dragon_foot_fr(body.foot_fr, generate_mesh)), - Some(mesh_dragon_foot_bl(body.foot_bl, generate_mesh)), - Some(mesh_dragon_foot_br(body.foot_br, generate_mesh)), - None, - None, - None, - ], + Body::Dragon(body) => { + let dragon_center_spec = + DragonCenterSpec::load_watched(manifest_indicator); + let dragon_lateral_spec = + DragonLateralSpec::load_watched(manifest_indicator); + + [ + Some(dragon_center_spec.mesh_head( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_center_spec.mesh_chest_front( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_center_spec.mesh_chest_rear( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_center_spec.mesh_tail_front( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_center_spec.mesh_tail_rear( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_lateral_spec.mesh_wing_in_l( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_lateral_spec.mesh_wing_in_r( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_lateral_spec.mesh_wing_out_l( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_lateral_spec.mesh_wing_out_r( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_lateral_spec.mesh_foot_fl( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_lateral_spec.mesh_foot_fr( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_lateral_spec.mesh_foot_bl( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_lateral_spec.mesh_foot_br( + body.species, + body.body_type, + generate_mesh, + )), + None, + None, + None, + ] + }, Body::BirdSmall(body) => [ Some(mesh_bird_small_head(body.head, generate_mesh)), Some(mesh_bird_small_torso(body.torso, generate_mesh)), diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 3b1debba8f..1bfd77b30f 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -6,7 +6,8 @@ use common::{ bird_medium::{BodyType as BMBodyType, Species as BMSpecies}, bird_small, critter::{BodyType as CBodyType, Species as CSpecies}, - dragon, fish_medium, fish_small, + dragon::{BodyType as DBodyType, Species as DSpecies}, + fish_medium, fish_small, golem::{BodyType as GBodyType, Species as GSpecies}, humanoid::{Body, BodyType, EyeColor, Race, Skin}, item::{ @@ -1865,173 +1866,345 @@ pub fn mesh_fish_medium_fin_r( ) } -pub fn mesh_dragon_head( - head: dragon::Head, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match head { - dragon::Head::Default => "npc.dragon.head", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) +//// + +#[derive(Serialize, Deserialize)] +pub struct DragonCenterSpec(HashMap<(DSpecies, DBodyType), SidedDCenterVoxSpec>); + +#[derive(Serialize, Deserialize)] +struct SidedDCenterVoxSpec { + head: DragonCenterSubSpec, + chest_front: DragonCenterSubSpec, + chest_rear: DragonCenterSubSpec, + tail_front: DragonCenterSubSpec, + tail_rear: DragonCenterSubSpec, +} +#[derive(Serialize, Deserialize)] +struct DragonCenterSubSpec { + offset: [f32; 3], // Should be relative to initial origin + center: VoxSimple, } -pub fn mesh_dragon_chest_front( - chest_front: dragon::ChestFront, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match chest_front { - dragon::ChestFront::Default => "npc.dragon.chest_front", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) +#[derive(Serialize, Deserialize)] +pub struct DragonLateralSpec(HashMap<(DSpecies, DBodyType), SidedDLateralVoxSpec>); + +#[derive(Serialize, Deserialize)] +struct SidedDLateralVoxSpec { + wing_in_l: DragonLateralSubSpec, + wing_in_r: DragonLateralSubSpec, + wing_out_l: DragonLateralSubSpec, + wing_out_r: DragonLateralSubSpec, + foot_fl: DragonLateralSubSpec, + foot_fr: DragonLateralSubSpec, + foot_bl: DragonLateralSubSpec, + foot_br: DragonLateralSubSpec, +} +#[derive(Serialize, Deserialize)] +struct DragonLateralSubSpec { + offset: [f32; 3], // Should be relative to initial origin + lateral: VoxSimple, } -pub fn mesh_dragon_chest_rear( - chest_rear: dragon::ChestRear, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match chest_rear { - dragon::ChestRear::Default => "npc.dragon.chest_rear", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) +impl Asset for DragonCenterSpec { + const ENDINGS: &'static [&'static str] = &["ron"]; + + fn parse(buf_reader: BufReader) -> Result { + ron::de::from_reader(buf_reader).map_err(assets::Error::parse_error) + } } -pub fn mesh_dragon_tail_front( - tail_front: dragon::TailFront, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match tail_front { - dragon::TailFront::Default => "npc.dragon.tail_front", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) +impl Asset for DragonLateralSpec { + const ENDINGS: &'static [&'static str] = &["ron"]; + + fn parse(buf_reader: BufReader) -> Result { + ron::de::from_reader(buf_reader).map_err(assets::Error::parse_error) + } } -pub fn mesh_dragon_tail_rear( - tail_rear: dragon::TailRear, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match tail_rear { - dragon::TailRear::Default => "npc.dragon.tail_rear", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) -} +impl DragonCenterSpec { + pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc { + assets::load_watched::("voxygen.voxel.dragon_center_manifest", indicator) + .unwrap() + } -pub fn mesh_dragon_wing_in_l( - wing_in_l: dragon::WingInL, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match wing_in_l { - dragon::WingInL::Default => "npc.dragon.wing_in_l", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) -} + pub fn mesh_head( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No head specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let center = graceful_load_segment(&spec.head.center.0); -pub fn mesh_dragon_wing_in_r( - wing_in_r: dragon::WingInR, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match wing_in_r { - dragon::WingInR::Default => "npc.dragon.wing_in_r", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) -} + generate_mesh(¢er, Vec3::from(spec.head.offset)) + } -pub fn mesh_dragon_wing_out_l( - wing_out_l: dragon::WingOutL, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match wing_out_l { - dragon::WingOutL::Default => "npc.dragon.wing_out_l", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) -} + pub fn mesh_chest_front( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No chest front specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let center = graceful_load_segment(&spec.chest_front.center.0); -pub fn mesh_dragon_wing_out_r( - wing_out_r: dragon::WingOutR, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match wing_out_r { - dragon::WingOutR::Default => "npc.dragon.wing_out_r", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) -} + generate_mesh(¢er, Vec3::from(spec.chest_front.offset)) + } + + pub fn mesh_chest_rear( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No chest rear specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let center = graceful_load_segment(&spec.chest_rear.center.0); -pub fn mesh_dragon_foot_fl( - foot_fl: dragon::FootFL, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match foot_fl { - dragon::FootFL::Default => "npc.dragon.foot_fl", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) -} + generate_mesh(¢er, Vec3::from(spec.chest_rear.offset)) + } -pub fn mesh_dragon_foot_fr( - foot_fr: dragon::FootFR, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match foot_fr { - dragon::FootFR::Default => "npc.dragon.foot_fr", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) -} + pub fn mesh_tail_front( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No tail front specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let center = graceful_load_segment(&spec.tail_front.center.0); -pub fn mesh_dragon_foot_bl( - foot_bl: dragon::FootBL, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match foot_bl { - dragon::FootBL::Default => "npc.dragon.foot_bl", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) -} + generate_mesh(¢er, Vec3::from(spec.tail_front.offset)) + } -pub fn mesh_dragon_foot_br( - foot_br: dragon::FootBR, - generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, -) -> Mesh { - load_mesh( - match foot_br { - dragon::FootBR::Default => "npc.dragon.foot_br", - }, - Vec3::new(-7.0, -6.0, -6.0), - generate_mesh, - ) + pub fn mesh_tail_rear( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No tail rear specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let center = graceful_load_segment(&spec.tail_rear.center.0); + + generate_mesh(¢er, Vec3::from(spec.tail_rear.offset)) + } +} +impl DragonLateralSpec { + pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc { + assets::load_watched::("voxygen.voxel.dragon_lateral_manifest", indicator) + .unwrap() + } + + pub fn mesh_wing_in_l( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let lateral = graceful_load_segment(&spec.wing_in_l.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.wing_in_l.offset)) + } + + pub fn mesh_wing_in_r( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let lateral = graceful_load_segment(&spec.wing_in_r.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.wing_in_r.offset)) + } + + pub fn mesh_wing_out_l( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let lateral = graceful_load_segment(&spec.wing_out_l.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.wing_out_l.offset)) + } + + pub fn mesh_wing_out_r( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let lateral = graceful_load_segment(&spec.wing_out_r.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.wing_out_r.offset)) + } + + pub fn mesh_foot_fl( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No foot specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let lateral = graceful_load_segment(&spec.foot_fl.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.foot_fl.offset)) + } + + pub fn mesh_foot_fr( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No foot specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let lateral = graceful_load_segment(&spec.foot_fr.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.foot_fr.offset)) + } + + pub fn mesh_foot_bl( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No foot specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let lateral = graceful_load_segment(&spec.foot_bl.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.foot_bl.offset)) + } + + pub fn mesh_foot_br( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No foot specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let lateral = graceful_load_segment(&spec.foot_br.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.foot_br.offset)) + } } //// diff --git a/world/src/lib.rs b/world/src/lib.rs index 6f47c7a311..41b8a54b36 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -21,7 +21,7 @@ use crate::{ util::{Grid, Sampler}, }; use common::{ - comp::{self, bird_medium, critter, quadruped_medium, quadruped_small}, + comp::{self, bird_medium, critter, quadruped_medium, quadruped_small, dragon}, generation::{ChunkSupplement, EntityInfo}, terrain::{Block, BlockKind, TerrainChunk, TerrainChunkMeta, TerrainChunkSize}, vol::{ReadVol, RectVolSize, Vox, WriteVol}, From edcde8450589bc84b71fbf9ef4c8e05c57d55803 Mon Sep 17 00:00:00 2001 From: Robin Gilh Date: Sun, 26 Apr 2020 01:47:35 +0200 Subject: [PATCH 02/19] Dragon work 2 --- .../voxygen/voxel/dragon_center_manifest.ron | 20 +++--- .../voxygen/voxel/dragon_lateral_manifest.ron | 16 ++--- voxygen/src/anim/dragon/idle.rs | 72 ++++++++++++++----- voxygen/src/anim/dragon/jump.rs | 2 +- voxygen/src/anim/dragon/mod.rs | 18 ++--- voxygen/src/anim/dragon/run.rs | 2 +- 6 files changed, 85 insertions(+), 45 deletions(-) diff --git a/assets/voxygen/voxel/dragon_center_manifest.ron b/assets/voxygen/voxel/dragon_center_manifest.ron index a4f492c4e1..bb906eeba8 100644 --- a/assets/voxygen/voxel/dragon_center_manifest.ron +++ b/assets/voxygen/voxel/dragon_center_manifest.ron @@ -1,45 +1,45 @@ ({ (Reddragon, Male): ( head: ( - offset: (-7.0, -9.0, -5.5), + offset: (-4.5, -2.0, -7.5), center: ("npc.reddragon.male.head"), ), chest_front: ( - offset: (-7.0, 4.5, 5.0), + offset: (-6.5, -6.0, -6.0), center: ("npc.reddragon.male.chest_front"), ), chest_rear: ( - offset: (-7.0, -4.5, 5.0), + offset: (-6.5, -7.0, -6.0), center: ("npc.reddragon.male.chest_rear"), ), tail_front: ( - offset: (-7.0, -4.5, -5.0), + offset: (-2.5, -5.5, -3.0), center: ("npc.reddragon.male.tail_front"), ), tail_rear: ( - offset: (-7.0, -4.5, -5.0), + offset: (-1.5, -7.0, -2.5), center: ("npc.reddragon.male.tail_rear"), ) ), (Reddragon, Female): ( head: ( - offset: (-7.0, -9.0, -5.5), + offset: (-4.5, -2.0, -7.5), center: ("npc.reddragon.female.head"), ), chest_front: ( - offset: (-7.0, 4.5, 5.0), + offset: (-6.5, -6.0, -6.0), center: ("npc.reddragon.female.chest_front"), ), chest_rear: ( - offset: (-7.0, -4.5, 5.0), + offset: (-6.5, -7.0, -6.0), center: ("npc.reddragon.female.chest_rear"), ), tail_front: ( - offset: (-7.0, -4.5, -5.0), + offset: (-2.5, -5.5, -3.0), center: ("npc.reddragon.female.tail_front"), ), tail_rear: ( - offset: (-7.0, -4.5, -5.0), + offset: (-1.5, -7.0, -2.5), center: ("npc.reddragon.female.tail_rear"), ) ), diff --git a/assets/voxygen/voxel/dragon_lateral_manifest.ron b/assets/voxygen/voxel/dragon_lateral_manifest.ron index d9e64fb684..63aef007dd 100644 --- a/assets/voxygen/voxel/dragon_lateral_manifest.ron +++ b/assets/voxygen/voxel/dragon_lateral_manifest.ron @@ -1,35 +1,35 @@ ({ (Reddragon, Male): ( wing_in_l: ( - offset: (20.0, 20.0, 5.0), + offset: (-0.5, -3.5, -27.0), lateral: ("npc.reddragon.male.wing_in_l"), ), wing_in_r: ( - offset: (20.0, 20.0, 5.0), + offset: (-0.5, -3.5, -27.0), lateral: ("npc.reddragon.male.wing_in_r"), ), wing_out_l: ( - offset: (20.0, 20.0, 5.0), + offset: (-0.5, -3.5, -27.0), lateral: ("npc.reddragon.male.wing_out_l"), ), wing_out_r: ( - offset: (20.0, 20.0, 5.0), + offset: (-0.5, -3.5, -27.0), lateral: ("npc.reddragon.male.wing_out_r"), ), foot_fl: ( - offset: (-2.5, -4.0, -1.5), + offset: (-2.5, 0.0, -6.0), lateral: ("npc.reddragon.male.foot_fl"), ), foot_fr: ( - offset: (-2.5, -4.0, -1.5), + offset: (-2.5, 0.0, -6.0), lateral: ("npc.reddragon.male.foot_fr"), ), foot_bl: ( - offset: (-2.5, -4.0, -3.0), + offset: (-2.5, 0.0, -7.0), lateral: ("npc.reddragon.male.foot_bl"), ), foot_br: ( - offset: (-2.5, -4.0, -3.0), + offset: (-2.5, 0.0, -7.0), lateral: ("npc.reddragon.male.foot_br"), ) ), diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index 94b461bfcd..a732fd3615 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -1,7 +1,6 @@ use super::{super::Animation, DragonSkeleton, SkeletonAttr}; //use std::{f32::consts::PI, ops::Mul}; use vek::*; - pub struct IdleAnimation; impl Animation for IdleAnimation { @@ -17,55 +16,96 @@ impl Animation for IdleAnimation { ) -> 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; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const HEAD_X: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const HEAD_Z: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const CHEST_F_X: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const CHEST_F_Z: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const CHEST_R_X: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const CHEST_R_Z: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const TAIL_F_X: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const TAIL_F_Z: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const TAIL_R_X: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const TAIL_R_Z: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const WING_IN_X: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const WING_IN_Z: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const WING_OUT_X: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const WING_OUT_Z: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const FEET_F_X: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const FEET_F_Y: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const FEET_F_Z: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const FEET_B_X: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const FEET_B_Y: f32 = 0.0; + #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + const FEET_B_Z: f32 = 0.0; - next.chest_front.offset = Vec3::new(0.0, 4.5, 2.0); + next.head.offset = Vec3::new(0.0, *HEAD_X, *HEAD_Z); + next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.head.scale = Vec3::one() * 1.01; + + next.chest_front.offset = Vec3::new(0.0, *CHEST_F_X, *CHEST_F_Z); next.chest_front.ori = Quaternion::rotation_x(0.0); next.chest_front.scale = Vec3::one() * 1.01; - next.chest_rear.offset = Vec3::new(0.0, 4.5, 2.0); + next.chest_rear.offset = Vec3::new(0.0, *CHEST_R_X, *CHEST_R_Z); next.chest_rear.ori = Quaternion::rotation_x(0.0); next.chest_rear.scale = Vec3::one() * 1.01; - next.tail_front.offset = Vec3::new(0.0, 4.5, 2.0); + next.tail_front.offset = Vec3::new(0.0, *TAIL_F_X, *TAIL_F_Z); next.tail_front.ori = Quaternion::rotation_x(0.0); next.tail_front.scale = Vec3::one() * 1.01; - next.tail_rear.offset = Vec3::new(0.0, 4.5, 2.0); + next.tail_rear.offset = Vec3::new(0.0, *TAIL_R_X, *TAIL_R_Z); next.tail_rear.ori = Quaternion::rotation_x(0.0); next.tail_rear.scale = Vec3::one() * 1.01; - next.wing_in_l.offset = Vec3::new(0.0, 4.5, 2.0); + next.wing_in_l.offset = Vec3::new(0.0, *WING_IN_X, *WING_IN_Z); next.wing_in_l.ori = Quaternion::rotation_x(0.0); next.wing_in_l.scale = Vec3::one() * 1.01; - next.wing_in_r.offset = Vec3::new(0.0, 4.5, 2.0); + next.wing_in_r.offset = Vec3::new(0.0, *WING_IN_X, *WING_IN_Z); next.wing_in_r.ori = Quaternion::rotation_x(0.0); next.wing_in_r.scale = Vec3::one() * 1.01; - next.wing_out_l.offset = Vec3::new(0.0, 4.5, 2.0); + next.wing_out_l.offset = Vec3::new(0.0, *WING_OUT_X, *WING_OUT_Z); next.wing_out_l.ori = Quaternion::rotation_x(0.0); next.wing_out_l.scale = Vec3::one() * 1.01; - next.wing_out_r.offset = Vec3::new(0.0, 4.5, 2.0); + next.wing_out_r.offset = Vec3::new(0.0, *WING_OUT_X, *WING_OUT_Z); next.wing_out_r.ori = Quaternion::rotation_x(0.0); next.wing_out_r.scale = Vec3::one() * 1.01; - next.foot_fl.offset = Vec3::new(0.0, 4.5, 2.0); + next.foot_fl.offset = Vec3::new(*FEET_F_X, *FEET_F_Y, *FEET_F_Z); next.foot_fl.ori = Quaternion::rotation_x(0.0); next.foot_fl.scale = Vec3::one() * 1.01; - next.foot_fr.offset = Vec3::new(0.0, 4.5, 2.0); + next.foot_fr.offset = Vec3::new(*FEET_F_X, *FEET_F_Y, *FEET_F_Z); next.foot_fr.ori = Quaternion::rotation_x(0.0); next.foot_fr.scale = Vec3::one() * 1.01; - next.foot_bl.offset = Vec3::new(0.0, 4.5, 2.0); + next.foot_bl.offset = Vec3::new(*FEET_F_X, *FEET_B_Y, *FEET_B_Z); next.foot_bl.ori = Quaternion::rotation_x(0.0); next.foot_bl.scale = Vec3::one() * 1.01; - next.foot_br.offset = Vec3::new(0.0, 4.5, 2.0); + next.foot_br.offset = Vec3::new(*FEET_F_X, *FEET_B_Y, *FEET_B_Z); next.foot_br.ori = Quaternion::rotation_x(0.0); next.foot_br.scale = Vec3::one() * 1.01; next diff --git a/voxygen/src/anim/dragon/jump.rs b/voxygen/src/anim/dragon/jump.rs index 4d34b638a7..d699d23050 100644 --- a/voxygen/src/anim/dragon/jump.rs +++ b/voxygen/src/anim/dragon/jump.rs @@ -19,7 +19,7 @@ impl Animation for JumpAnimation { 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; + next.head.scale = Vec3::one() * 1.01; next.chest_front.offset = Vec3::new(0.0, 4.5, 2.0); next.chest_front.ori = Quaternion::rotation_x(0.0); diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index b997fab2f7..c144141096 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -126,31 +126,31 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { use comp::dragon::Species::*; Self { head: match (body.species, body.body_type) { - (Reddragon, _) => (4.0, 3.0), + (Reddragon, _) => (0.0, 0.0), }, chest_front: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 5.0), + (Reddragon, _) => (0.0, 0.0), }, chest_rear: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 5.0), + (Reddragon, _) => (0.0, 0.0), }, tail_front: match (body.species, body.body_type) { - (Reddragon, _) => (-3.0, 1.5), + (Reddragon, _) => (0.0, 0.0), }, tail_rear: match (body.species, body.body_type) { - (Reddragon, _) => (-3.0, 1.5), + (Reddragon, _) => (0.0, 0.0), }, wing_in: match (body.species, body.body_type) { - (Reddragon, _) => (2.75, 0.0), + (Reddragon, _) => (0.0, 0.0), }, wing_out: match (body.species, body.body_type) { - (Reddragon, _) => (2.75, 0.0), + (Reddragon, _) => (0.0, 0.0), }, feet_f: match (body.species, body.body_type) { - (Reddragon, _) => (2.0, -1.5, 4.0), + (Reddragon, _) => (0.0, 0.0, 0.0), }, feet_b: match (body.species, body.body_type) { - (Reddragon, _) => (2.0, -1.5, 4.0), + (Reddragon, _) => (0.0, 0.0, 0.0), }, } } diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index af4c76a4cf..2165c07ddf 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -19,7 +19,7 @@ impl Animation for RunAnimation { 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; + next.head.scale = Vec3::one() * 1.01; next.chest_front.offset = Vec3::new(0.0, 4.5, 2.0); next.chest_front.ori = Quaternion::rotation_x(0.0); From 33f8a47cfafc60257b14a9e9198524976cef4355 Mon Sep 17 00:00:00 2001 From: Snowram Date: Sun, 3 May 2020 00:55:14 +0200 Subject: [PATCH 03/19] Symmetry of dragon skeleton --- .../npc/reddragon/female/chest_front.vox | 4 +- .../voxel/npc/reddragon/female/chest_rear.vox | 4 +- .../voxel/npc/reddragon/female/foot_bl.vox | 4 +- .../voxel/npc/reddragon/female/foot_br.vox | 4 +- .../voxel/npc/reddragon/female/foot_fl.vox | 4 +- .../voxel/npc/reddragon/female/foot_fr.vox | 4 +- .../voxel/npc/reddragon/female/head.vox | 4 +- .../voxel/npc/reddragon/female/tail_front.vox | 4 +- .../voxel/npc/reddragon/female/tail_rear.vox | 4 +- .../voxel/npc/reddragon/female/wing_in_l.vox | 2 +- .../voxel/npc/reddragon/female/wing_in_r.vox | 2 +- .../voxel/npc/reddragon/female/wing_out_l.vox | 2 +- .../voxel/npc/reddragon/female/wing_out_r.vox | 2 +- .../voxel/npc/reddragon/male/chest_front.vox | 4 +- .../voxel/npc/reddragon/male/chest_rear.vox | 4 +- .../voxel/npc/reddragon/male/foot_bl.vox | 4 +- .../voxel/npc/reddragon/male/foot_br.vox | 4 +- .../voxel/npc/reddragon/male/foot_fl.vox | 4 +- .../voxel/npc/reddragon/male/foot_fr.vox | 4 +- .../voxygen/voxel/npc/reddragon/male/head.vox | 4 +- .../voxel/npc/reddragon/male/tail_front.vox | 4 +- .../voxel/npc/reddragon/male/tail_rear.vox | 4 +- .../voxel/npc/reddragon/male/wing_in_l.vox | 2 +- .../voxel/npc/reddragon/male/wing_in_r.vox | 2 +- .../voxel/npc/reddragon/male/wing_out_l.vox | 2 +- .../voxel/npc/reddragon/male/wing_out_r.vox | 2 +- voxygen/src/anim/biped_large/mod.rs | 246 ++++++++++-------- voxygen/src/anim/dragon/idle.rs | 57 ++-- voxygen/src/anim/dragon/mod.rs | 34 ++- world/src/lib.rs | 2 +- 30 files changed, 236 insertions(+), 191 deletions(-) diff --git a/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox index 5385ca652f..549939b87c 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccb3946a7b70bbe3bbca76b0930651b1fafb6f10cf466d730dc838a8dd900102 -size 4556 +oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b +size 59039 diff --git a/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox index 03c2c36ca0..8db58555b4 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5d9f4fa579f6456f4a642f94d6388074422858d7c4053e339e253bb0b86f888 -size 6080 +oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 +size 60563 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox index d9ad85b152..fe31aadd1a 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c3392c489527b685662705bdba578d8f2f12788c00a881885edd45505f741124 -size 1408 +oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox index 5f3d81ec51..08037dbe38 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ff5cc1eac6b2939d3658e21228f87366327665ae70dd83d5af92ac3b3dae0fb4 -size 1408 +oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox index f1e67b65c8..e71b7a0694 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ed4cb29ddba38424eb238ce2c3df7ea9b67d2e3b4f902194588f67a41f759b89 -size 1408 +oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox index 03497e9382..926f224e9a 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a5b309ae1146a4a5dab72e7bd534201b9ccbddcdc512d0a5619e4ef6880eefa -size 1408 +oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/head.vox b/assets/voxygen/voxel/npc/reddragon/female/head.vox index d27c554eac..f20fcb90dd 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/head.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/head.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3c6dcc28719e148e572786722426103d4e4e7af05b815e8328ee71515db813a -size 3040 +oid sha256:64b03f5b6dc36ab671f1e22280950f71f2fbe7a66b28490226c649290e7310b3 +size 57523 diff --git a/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox index 27a01ab209..f60dc1b402 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da84212d78276b933a4b374c7b038d0ca5026c5be0d14a0dc93cb3fe15771d0c -size 1784 +oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 +size 56267 diff --git a/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox index 41d539f783..3bdb2326ff 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26867c50e937a64890489706c33fe8b06d43138ff134c7fdaf165128ef24c470 -size 1392 +oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f +size 55875 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox index 41307eb524..848877f125 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b6de1eab081ed802022e61f5272e88b40d661ea2e485ed096293bad5a1588c8 +oid sha256:2ac7dcba1d88007c93479a6c88cc68ba52c963bfd1452790a6fdee5c4f84cfa7 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox index ef5fe55a9a..256e132edd 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:079da56ff2c225ed8d4edd13c61c2803f324e49b29a0eea69c485f7cc68c9587 +oid sha256:fe7f85574d91447578169d60f60b71ab88f81aa45f6d5b3a39a01ce79b37c131 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox index 93ca39dde2..1b25c929af 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8664be051f079672954ab69ae9f25a8323d64285987eab10744194f77c740400 +oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox index e56d2dde7d..020fd84512 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2d671e167445954ffad79a4305c90407a0a506c71c143287941d417da9edf78 +oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox index 5385ca652f..549939b87c 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccb3946a7b70bbe3bbca76b0930651b1fafb6f10cf466d730dc838a8dd900102 -size 4556 +oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b +size 59039 diff --git a/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox index 03c2c36ca0..8db58555b4 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5d9f4fa579f6456f4a642f94d6388074422858d7c4053e339e253bb0b86f888 -size 6080 +oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 +size 60563 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox index d9ad85b152..fe31aadd1a 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c3392c489527b685662705bdba578d8f2f12788c00a881885edd45505f741124 -size 1408 +oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox index 5f3d81ec51..08037dbe38 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ff5cc1eac6b2939d3658e21228f87366327665ae70dd83d5af92ac3b3dae0fb4 -size 1408 +oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox index f1e67b65c8..e71b7a0694 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ed4cb29ddba38424eb238ce2c3df7ea9b67d2e3b4f902194588f67a41f759b89 -size 1408 +oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox index 03497e9382..926f224e9a 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a5b309ae1146a4a5dab72e7bd534201b9ccbddcdc512d0a5619e4ef6880eefa -size 1408 +oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/head.vox b/assets/voxygen/voxel/npc/reddragon/male/head.vox index d27c554eac..f20fcb90dd 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/head.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/head.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3c6dcc28719e148e572786722426103d4e4e7af05b815e8328ee71515db813a -size 3040 +oid sha256:64b03f5b6dc36ab671f1e22280950f71f2fbe7a66b28490226c649290e7310b3 +size 57523 diff --git a/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox index 27a01ab209..f60dc1b402 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da84212d78276b933a4b374c7b038d0ca5026c5be0d14a0dc93cb3fe15771d0c -size 1784 +oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 +size 56267 diff --git a/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox index 41d539f783..3bdb2326ff 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26867c50e937a64890489706c33fe8b06d43138ff134c7fdaf165128ef24c470 -size 1392 +oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f +size 55875 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox index 41307eb524..848877f125 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b6de1eab081ed802022e61f5272e88b40d661ea2e485ed096293bad5a1588c8 +oid sha256:2ac7dcba1d88007c93479a6c88cc68ba52c963bfd1452790a6fdee5c4f84cfa7 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox index ef5fe55a9a..256e132edd 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:079da56ff2c225ed8d4edd13c61c2803f324e49b29a0eea69c485f7cc68c9587 +oid sha256:fe7f85574d91447578169d60f60b71ab88f81aa45f6d5b3a39a01ce79b37c131 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox index 93ca39dde2..1b25c929af 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8664be051f079672954ab69ae9f25a8323d64285987eab10744194f77c740400 +oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox index e56d2dde7d..020fd84512 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2d671e167445954ffad79a4305c90407a0a506c71c143287941d417da9edf78 +oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e size 58012 diff --git a/voxygen/src/anim/biped_large/mod.rs b/voxygen/src/anim/biped_large/mod.rs index 5ff549c924..8438ef999a 100644 --- a/voxygen/src/anim/biped_large/mod.rs +++ b/voxygen/src/anim/biped_large/mod.rs @@ -1,116 +1,114 @@ +pub mod fly; pub mod idle; -pub mod jump; pub mod run; // Reexports -pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; +pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; use super::{Bone, Skeleton}; use crate::render::FigureBoneData; use common::comp::{self}; -use vek::Vec3; -#[derive(Clone)] -pub struct BipedLargeSkeleton { - head: Bone, - upper_torso: Bone, - lower_torso: Bone, - shoulder_l: Bone, - shoulder_r: Bone, - hand_l: Bone, - hand_r: Bone, - leg_l: Bone, - leg_r: Bone, - foot_l: Bone, - foot_r: Bone, - torso: Bone, +#[derive(Clone, Default)] +pub struct DragonSkeleton { + head_upper: Bone, + head_lower: Bone, + jaw: Bone, + chest_front: Bone, + chest_rear: Bone, + tail_front: Bone, + tail_rear: Bone, + wing_in_l: Bone, + wing_in_r: Bone, + wing_out_l: Bone, + wing_out_r: Bone, + foot_fl: Bone, + foot_fr: Bone, + foot_bl: Bone, + foot_br: Bone, } -impl BipedLargeSkeleton { - pub fn new() -> Self { - Self { - head: Bone::default(), - upper_torso: Bone::default(), - lower_torso: Bone::default(), - shoulder_l: Bone::default(), - shoulder_r: Bone::default(), - hand_l: Bone::default(), - hand_r: Bone::default(), - leg_l: Bone::default(), - leg_r: Bone::default(), - foot_l: Bone::default(), - foot_r: Bone::default(), - torso: Bone::default(), - } - } +impl DragonSkeleton { + pub fn new() -> Self { Self::default() } } -impl Skeleton for BipedLargeSkeleton { +impl Skeleton for DragonSkeleton { type Attr = SkeletonAttr; - fn bone_count(&self) -> usize { 11 } + fn bone_count(&self) -> usize { 15 } - fn compute_matrices(&self) -> ([FigureBoneData; 16], Vec3) { - let upper_torso_mat = self.upper_torso.compute_base_matrix(); - let shoulder_l_mat = self.shoulder_l.compute_base_matrix(); - 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(); + fn compute_matrices(&self) -> [FigureBoneData; 16] { + let head_upper_mat = self.head_upper.compute_base_matrix(); + let head_lower_mat = self.head_lower.compute_base_matrix(); + let chest_front_mat = self.chest_front.compute_base_matrix(); + let chest_rear_mat = self.chest_rear.compute_base_matrix(); + let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); + let wing_in_r_mat = self.wing_in_r.compute_base_matrix(); + let tail_front_mat = self.tail_front.compute_base_matrix(); - ( - [ - FigureBoneData::new(torso_mat * upper_torso_mat * self.head.compute_base_matrix()), - FigureBoneData::new(torso_mat * upper_torso_mat), - FigureBoneData::new( - 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 * self.hand_l.compute_base_matrix(), - ), - FigureBoneData::new( - torso_mat * upper_torso_mat * self.hand_r.compute_base_matrix(), - ), - FigureBoneData::new(torso_mat * upper_torso_mat * leg_l_mat), - FigureBoneData::new(torso_mat * upper_torso_mat * leg_r_mat), - FigureBoneData::new(self.foot_l.compute_base_matrix()), - FigureBoneData::new(self.foot_r.compute_base_matrix()), - FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), - ], - Vec3::default(), - ) + [ + FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat), + FigureBoneData::new(chest_front_mat * head_lower_mat), + FigureBoneData::new( + chest_front_mat * head_lower_mat * head_upper_mat * self.jaw.compute_base_matrix(), + ), + FigureBoneData::new(chest_front_mat), + FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat), + FigureBoneData::new( + chest_front_mat + * chest_rear_mat + * tail_front_mat + * self.tail_rear.compute_base_matrix(), + ), + FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), + FigureBoneData::new( + chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix(), + ), + FigureBoneData::new( + chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix(), + ), + FigureBoneData::new(self.foot_fl.compute_base_matrix()), + FigureBoneData::new(self.foot_fr.compute_base_matrix()), + FigureBoneData::new(self.foot_bl.compute_base_matrix()), + FigureBoneData::new(self.foot_br.compute_base_matrix()), + FigureBoneData::default(), + ] } fn interpolate(&mut self, target: &Self, dt: f32) { - self.head.interpolate(&target.head, dt); - self.upper_torso.interpolate(&target.upper_torso, dt); - self.lower_torso.interpolate(&target.lower_torso, dt); - self.shoulder_l.interpolate(&target.shoulder_l, dt); - self.shoulder_r.interpolate(&target.shoulder_r, dt); - self.hand_l.interpolate(&target.hand_l, dt); - self.hand_r.interpolate(&target.hand_r, dt); - self.leg_l.interpolate(&target.leg_l, dt); - 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); + self.head_upper.interpolate(&target.head_upper, dt); + self.head_lower.interpolate(&target.head_lower, dt); + self.jaw.interpolate(&target.jaw, dt); + self.chest_front.interpolate(&target.chest_front, dt); + self.chest_rear.interpolate(&target.chest_rear, dt); + self.tail_front.interpolate(&target.tail_front, dt); + self.tail_rear.interpolate(&target.tail_rear, dt); + self.wing_in_l.interpolate(&target.wing_in_l, dt); + self.wing_in_r.interpolate(&target.wing_in_r, dt); + self.wing_out_l.interpolate(&target.wing_out_l, dt); + self.wing_out_r.interpolate(&target.wing_out_r, dt); + self.foot_fl.interpolate(&target.foot_fl, dt); + self.foot_fr.interpolate(&target.foot_fr, dt); + self.foot_bl.interpolate(&target.foot_bl, dt); + self.foot_br.interpolate(&target.foot_br, dt); } } 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), + head_upper: (f32, f32), + head_lower: (f32, f32), + jaw: (f32, f32), + chest_front: (f32, f32), + chest_rear: (f32, f32), + tail_front: (f32, f32), + tail_rear: (f32, f32), + wing_in: (f32, f32, f32), + wing_out: (f32, f32, f32), + feet_f: (f32, f32, f32), + feet_b: (f32, f32, f32), + height: f32, } impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { @@ -118,7 +116,7 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { fn try_from(body: &'a comp::Body) -> Result { match body { - comp::Body::BipedLarge(body) => Ok(SkeletonAttr::from(body)), + comp::Body::Dragon(body) => Ok(SkeletonAttr::from(body)), _ => Err(()), } } @@ -127,41 +125,61 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { impl Default for SkeletonAttr { fn default() -> 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), + head_upper: (0.0, 0.0), + head_lower: (0.0, 0.0), + jaw: (0.0, 0.0), + chest_front: (0.0, 0.0), + chest_rear: (0.0, 0.0), + tail_front: (0.0, 0.0), + tail_rear: (0.0, 0.0), + wing_in: (0.0, 0.0, 0.0), + wing_out: (0.0, 0.0, 0.0), + feet_f: (0.0, 0.0, 0.0), + feet_b: (0.0, 0.0, 0.0), + height: (0.0), } } } -impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr { - fn from(body: &'a comp::biped_large::Body) -> Self { - use comp::biped_large::Species::*; +impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { + fn from(body: &'a comp::dragon::Body) -> Self { + use comp::dragon::Species::*; Self { - head: match (body.species, body.body_type) { - (Ogre, _) => (3.0, 6.0), + head_upper: match (body.species, body.body_type) { + (Reddragon, _) => (2.5, 4.5), }, - upper_torso: match (body.species, body.body_type) { - (Ogre, _) => (0.0, 20.0), + head_lower: match (body.species, body.body_type) { + (Reddragon, _) => (7.5, 3.5), }, - lower_torso: match (body.species, body.body_type) { - (Ogre, _) => (1.0, -9.5), + jaw: match (body.species, body.body_type) { + (Reddragon, _) => (7.0, -5.0), }, - shoulder: match (body.species, body.body_type) { - (Ogre, _) => (6.1, 0.5, 2.5), + chest_front: match (body.species, body.body_type) { + (Reddragon, _) => (0.0, 14.0), }, - hand: match (body.species, body.body_type) { - (Ogre, _) => (10.5, -1.0, 0.5), + chest_rear: match (body.species, body.body_type) { + (Reddragon, _) => (-12.5, 0.0), }, - leg: match (body.species, body.body_type) { - (Ogre, _) => (0.0, 0.0, -6.0), + tail_front: match (body.species, body.body_type) { + (Reddragon, _) => (-6.5, 1.5), }, - foot: match (body.species, body.body_type) { - (Ogre, _) => (4.0, 0.5, 2.5), + tail_rear: match (body.species, body.body_type) { + (Reddragon, _) => (-11.5, -1.0), + }, + wing_in: match (body.species, body.body_type) { + (Reddragon, _) => (2.5, -16.5, 0.0), + }, + wing_out: match (body.species, body.body_type) { + (Reddragon, _) => (23.0, 0.5, 4.0), + }, + feet_f: match (body.species, body.body_type) { + (Reddragon, _) => (6.0, 0.0, 1.5), + }, + feet_b: match (body.species, body.body_type) { + (Reddragon, _) => (6.0, -15.0, 3.0), + }, + height: match (body.species, body.body_type) { + (Reddragon, _) => (1.0), }, } } diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index a732fd3615..7453edec83 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -1,6 +1,7 @@ use super::{super::Animation, DragonSkeleton, SkeletonAttr}; //use std::{f32::consts::PI, ops::Mul}; use vek::*; + pub struct IdleAnimation; impl Animation for IdleAnimation { @@ -16,45 +17,49 @@ impl Animation for IdleAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const HEAD_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const HEAD_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_F_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_F_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_R_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_R_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_F_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_F_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_R_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_R_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_IN_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] + const WING_IN_Y: f32 = 0.0; + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_IN_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_OUT_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] + const WING_OUT_Y: f32 = 0.0; + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_OUT_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_Y: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_B_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_B_Y: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_B_Z: f32 = 0.0; next.head.offset = Vec3::new(0.0, *HEAD_X, *HEAD_Z); @@ -77,19 +82,19 @@ impl Animation for IdleAnimation { next.tail_rear.ori = Quaternion::rotation_x(0.0); next.tail_rear.scale = Vec3::one() * 1.01; - next.wing_in_l.offset = Vec3::new(0.0, *WING_IN_X, *WING_IN_Z); + next.wing_in_l.offset = Vec3::new(*WING_IN_X, *WING_IN_Y, *WING_IN_Z); next.wing_in_l.ori = Quaternion::rotation_x(0.0); next.wing_in_l.scale = Vec3::one() * 1.01; - next.wing_in_r.offset = Vec3::new(0.0, *WING_IN_X, *WING_IN_Z); + next.wing_in_r.offset = Vec3::new(-*WING_IN_X, *WING_IN_Y, *WING_IN_Z); next.wing_in_r.ori = Quaternion::rotation_x(0.0); next.wing_in_r.scale = Vec3::one() * 1.01; - next.wing_out_l.offset = Vec3::new(0.0, *WING_OUT_X, *WING_OUT_Z); + next.wing_out_l.offset = Vec3::new(*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z); next.wing_out_l.ori = Quaternion::rotation_x(0.0); next.wing_out_l.scale = Vec3::one() * 1.01; - next.wing_out_r.offset = Vec3::new(0.0, *WING_OUT_X, *WING_OUT_Z); + next.wing_out_r.offset = Vec3::new(-*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z); next.wing_out_r.ori = Quaternion::rotation_x(0.0); next.wing_out_r.scale = Vec3::one() * 1.01; @@ -97,7 +102,7 @@ impl Animation for IdleAnimation { next.foot_fl.ori = Quaternion::rotation_x(0.0); next.foot_fl.scale = Vec3::one() * 1.01; - next.foot_fr.offset = Vec3::new(*FEET_F_X, *FEET_F_Y, *FEET_F_Z); + next.foot_fr.offset = Vec3::new(-*FEET_F_X, *FEET_F_Y, *FEET_F_Z); next.foot_fr.ori = Quaternion::rotation_x(0.0); next.foot_fr.scale = Vec3::one() * 1.01; @@ -105,7 +110,7 @@ impl Animation for IdleAnimation { next.foot_bl.ori = Quaternion::rotation_x(0.0); next.foot_bl.scale = Vec3::one() * 1.01; - next.foot_br.offset = Vec3::new(*FEET_F_X, *FEET_B_Y, *FEET_B_Z); + next.foot_br.offset = Vec3::new(-*FEET_F_X, *FEET_B_Y, *FEET_B_Z); next.foot_br.ori = Quaternion::rotation_x(0.0); next.foot_br.scale = Vec3::one() * 1.01; next diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index c144141096..4324d9053a 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -38,10 +38,12 @@ impl Skeleton for DragonSkeleton { fn compute_matrices(&self) -> ([FigureBoneData; 16], Vec3) { let chest_front_mat = self.chest_front.compute_base_matrix(); + let chest_rear_mat = self.chest_rear.compute_base_matrix(); let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); let wing_in_r_mat = self.wing_in_r.compute_base_matrix(); let tail_front_mat = self.tail_front.compute_base_matrix(); +<<<<<<< HEAD ( [ FigureBoneData::new(self.head.compute_base_matrix() * chest_front_mat), @@ -63,6 +65,26 @@ impl Skeleton for DragonSkeleton { ], Vec3::default(), ) +======= + [ + FigureBoneData::new(self.head.compute_base_matrix() * chest_front_mat), + FigureBoneData::new(chest_front_mat), + FigureBoneData::new(self.chest_rear.compute_base_matrix() * chest_front_mat), + FigureBoneData::new(chest_rear_mat * self.tail_front.compute_base_matrix()), + FigureBoneData::new(self.tail_rear.compute_base_matrix() * tail_front_mat), + FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), + FigureBoneData::new(self.wing_out_l.compute_base_matrix() * wing_in_l_mat), + FigureBoneData::new(self.wing_out_r.compute_base_matrix() * wing_in_r_mat), + FigureBoneData::new(self.foot_fl.compute_base_matrix()), + FigureBoneData::new(self.foot_fr.compute_base_matrix()), + FigureBoneData::new(self.foot_bl.compute_base_matrix()), + FigureBoneData::new(self.foot_br.compute_base_matrix()), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), + ] +>>>>>>> Symmetry of dragon skeleton } fn interpolate(&mut self, target: &Self, dt: f32) { @@ -88,8 +110,8 @@ pub struct SkeletonAttr { chest_rear: (f32, f32), tail_front: (f32, f32), tail_rear: (f32, f32), - wing_in: (f32, f32), - wing_out: (f32, f32), + wing_in: (f32, f32, f32), + wing_out: (f32, f32, f32), feet_f: (f32, f32, f32), feet_b: (f32, f32, f32), } @@ -113,8 +135,8 @@ impl Default for SkeletonAttr { chest_rear: (0.0, 0.0), tail_front: (0.0, 0.0), tail_rear: (0.0, 0.0), - wing_in: (0.0, 0.0), - wing_out: (0.0, 0.0), + wing_in: (0.0, 0.0, 0.0), + wing_out: (0.0, 0.0, 0.0), feet_f: (0.0, 0.0, 0.0), feet_b: (0.0, 0.0, 0.0), } @@ -141,10 +163,10 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { (Reddragon, _) => (0.0, 0.0), }, wing_in: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0), + (Reddragon, _) => (0.0, 0.0, 0.0), }, wing_out: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0), + (Reddragon, _) => (0.0, 0.0, 0.0), }, feet_f: match (body.species, body.body_type) { (Reddragon, _) => (0.0, 0.0, 0.0), diff --git a/world/src/lib.rs b/world/src/lib.rs index 41b8a54b36..6f47c7a311 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -21,7 +21,7 @@ use crate::{ util::{Grid, Sampler}, }; use common::{ - comp::{self, bird_medium, critter, quadruped_medium, quadruped_small, dragon}, + comp::{self, bird_medium, critter, quadruped_medium, quadruped_small}, generation::{ChunkSupplement, EntityInfo}, terrain::{Block, BlockKind, TerrainChunk, TerrainChunkMeta, TerrainChunkSize}, vol::{ReadVol, RectVolSize, Vox, WriteVol}, From 7f0d1e954367a4d94e34c7f75d09092fc9b2db82 Mon Sep 17 00:00:00 2001 From: Snowram Date: Sun, 3 May 2020 02:03:21 +0200 Subject: [PATCH 04/19] Initial idle animation work --- voxygen/src/anim/dragon/idle.rs | 179 +++++++++++++++++--------------- voxygen/src/anim/dragon/mod.rs | 63 +++++++++-- voxygen/src/scene/figure/mod.rs | 3 +- 3 files changed, 152 insertions(+), 93 deletions(-) diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index 7453edec83..fa0b5018f4 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -1,5 +1,5 @@ use super::{super::Animation, DragonSkeleton, SkeletonAttr}; -//use std::{f32::consts::PI, ops::Mul}; +use std::ops::Mul; use vek::*; pub struct IdleAnimation; @@ -10,109 +10,122 @@ 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(); - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const HEAD_X: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const HEAD_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const CHEST_F_X: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const CHEST_F_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const CHEST_R_X: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const CHEST_R_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const TAIL_F_X: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const TAIL_F_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const TAIL_R_X: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const TAIL_R_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const WING_IN_X: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const WING_IN_Y: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const WING_IN_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const WING_OUT_X: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const WING_OUT_Y: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const WING_OUT_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const FEET_F_X: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const FEET_F_Y: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const FEET_F_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const FEET_B_X: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const FEET_B_Y: f32 = 0.0; - #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] - const FEET_B_Z: f32 = 0.0; + let wave_slow = (anim_time as f32 * 4.5).sin(); + let wave_slow_cos = (anim_time as f32 * 4.5).cos(); - next.head.offset = Vec3::new(0.0, *HEAD_X, *HEAD_Z); - next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.head.scale = Vec3::one() * 1.01; + let duck_head_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.chest_front.offset = Vec3::new(0.0, *CHEST_F_X, *CHEST_F_Z); - next.chest_front.ori = Quaternion::rotation_x(0.0); - next.chest_front.scale = Vec3::one() * 1.01; + next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1); + next.head.ori = Quaternion::rotation_z(duck_head_look.x) + * Quaternion::rotation_x(-duck_head_look.y.abs() + wave_slow_cos * 0.03); + next.head.scale = Vec3::one(); - next.chest_rear.offset = Vec3::new(0.0, *CHEST_R_X, *CHEST_R_Z); - next.chest_rear.ori = Quaternion::rotation_x(0.0); - next.chest_rear.scale = Vec3::one() * 1.01; + next.chest_front.offset = Vec3::new( + 0.0, + skeleton_attr.chest_front.0, + wave_slow * 0.3 + skeleton_attr.chest_front.1, + ) * 1.05; + next.chest_front.ori = Quaternion::rotation_y(wave_slow * 0.03); + next.chest_front.scale = Vec3::one() * 1.05; - next.tail_front.offset = Vec3::new(0.0, *TAIL_F_X, *TAIL_F_Z); - next.tail_front.ori = Quaternion::rotation_x(0.0); - next.tail_front.scale = Vec3::one() * 1.01; + next.chest_rear.offset = Vec3::new( + 0.0, + skeleton_attr.chest_rear.0, + wave_slow * 0.3 + skeleton_attr.chest_rear.1, + ) * 1.05; + next.chest_rear.ori = Quaternion::rotation_y(wave_slow * 0.03); + next.chest_rear.scale = Vec3::one() * 1.05; - next.tail_rear.offset = Vec3::new(0.0, *TAIL_R_X, *TAIL_R_Z); - next.tail_rear.ori = Quaternion::rotation_x(0.0); - next.tail_rear.scale = Vec3::one() * 1.01; + next.tail_front.offset = Vec3::new(0.0, skeleton_attr.tail_front.0, skeleton_attr.tail_front.1); + next.tail_front.ori = Quaternion::rotation_x(wave_slow_cos * 0.03); + next.tail_front.scale = Vec3::one(); - next.wing_in_l.offset = Vec3::new(*WING_IN_X, *WING_IN_Y, *WING_IN_Z); - next.wing_in_l.ori = Quaternion::rotation_x(0.0); - next.wing_in_l.scale = Vec3::one() * 1.01; + next.tail_rear.offset = Vec3::new(0.0, skeleton_attr.tail_rear.0, skeleton_attr.tail_rear.1); + next.tail_rear.ori = Quaternion::rotation_x(wave_slow_cos * 0.03); + next.tail_rear.scale = Vec3::one(); - next.wing_in_r.offset = Vec3::new(-*WING_IN_X, *WING_IN_Y, *WING_IN_Z); - next.wing_in_r.ori = Quaternion::rotation_x(0.0); - next.wing_in_r.scale = Vec3::one() * 1.01; + next.wing_in_l.offset = Vec3::new( + -skeleton_attr.wing_in.0, + skeleton_attr.wing_in.1, + skeleton_attr.wing_in.2, + ); + next.wing_in_l.ori = Quaternion::rotation_z(0.0); + next.wing_in_l.scale = Vec3::one() * 1.05; - next.wing_out_l.offset = Vec3::new(*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z); - next.wing_out_l.ori = Quaternion::rotation_x(0.0); - next.wing_out_l.scale = Vec3::one() * 1.01; + next.wing_in_r.offset = Vec3::new( + skeleton_attr.wing_in.0, + skeleton_attr.wing_in.1, + skeleton_attr.wing_in.2, + ); + next.wing_in_r.ori = Quaternion::rotation_y(0.0); + next.wing_in_r.scale = Vec3::one() * 1.05; - next.wing_out_r.offset = Vec3::new(-*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z); - next.wing_out_r.ori = Quaternion::rotation_x(0.0); - next.wing_out_r.scale = Vec3::one() * 1.01; + next.wing_out_l.offset = Vec3::new( + -skeleton_attr.wing_out.0, + skeleton_attr.wing_out.1, + skeleton_attr.wing_out.2, + ); + next.wing_out_l.ori = Quaternion::rotation_z(0.0); + next.wing_out_l.scale = Vec3::one() * 1.05; - next.foot_fl.offset = Vec3::new(*FEET_F_X, *FEET_F_Y, *FEET_F_Z); + next.wing_in_r.offset = Vec3::new( + skeleton_attr.wing_out.0, + skeleton_attr.wing_out.1, + skeleton_attr.wing_out.2, + ); + next.wing_out_r.ori = Quaternion::rotation_y(0.0); + next.wing_out_r.scale = Vec3::one() * 1.05; + + next.foot_fl.offset = Vec3::new( + -skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2, + ) * 1.05; next.foot_fl.ori = Quaternion::rotation_x(0.0); - next.foot_fl.scale = Vec3::one() * 1.01; + next.foot_fl.scale = Vec3::one() * 1.05; - next.foot_fr.offset = Vec3::new(-*FEET_F_X, *FEET_F_Y, *FEET_F_Z); + next.foot_fr.offset = Vec3::new( + skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2, + ) * 1.05; next.foot_fr.ori = Quaternion::rotation_x(0.0); - next.foot_fr.scale = Vec3::one() * 1.01; + next.foot_fr.scale = Vec3::one() * 1.05; - next.foot_bl.offset = Vec3::new(*FEET_F_X, *FEET_B_Y, *FEET_B_Z); + next.foot_bl.offset = Vec3::new( + -skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2, + ) * 1.05; next.foot_bl.ori = Quaternion::rotation_x(0.0); - next.foot_bl.scale = Vec3::one() * 1.01; + next.foot_bl.scale = Vec3::one() * 1.05; - next.foot_br.offset = Vec3::new(-*FEET_F_X, *FEET_B_Y, *FEET_B_Z); + next.foot_br.offset = Vec3::new( + skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2, + ) * 1.05; next.foot_br.ori = Quaternion::rotation_x(0.0); - next.foot_br.scale = Vec3::one() * 1.01; + next.foot_br.scale = Vec3::one() * 1.05; + next } } diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index 4324d9053a..a491ad3b8f 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -10,6 +10,51 @@ use crate::render::FigureBoneData; use common::comp::{self}; use vek::Vec3; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const HEAD_X: f32 = 4.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const HEAD_Z: f32 = 11.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const CHEST_F_X: f32 = 0.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const CHEST_F_Z: f32 = 14.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const CHEST_R_X: f32 = -13.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const CHEST_R_Z: f32 = 0.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const TAIL_F_X: f32 = -11.5; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const TAIL_F_Z: f32 = 16.5; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const TAIL_R_X: f32 = -25.5; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const TAIL_R_Z: f32 = 0.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const WING_IN_X: f32 = 10.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const WING_IN_Y: f32 = -32.5; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const WING_IN_Z: f32 = -19.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const WING_OUT_X: f32 = 0.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const WING_OUT_Y: f32 = 1.5; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const WING_OUT_Z: f32 = -10.5; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const FEET_F_X: f32 = 4.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const FEET_F_Y: f32 = 0.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const FEET_F_Z: f32 = 1.5; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const FEET_B_X: f32 = 4.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const FEET_B_Y: f32 = -15.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const FEET_B_Z: f32 = 3.0; + #[derive(Clone, Default)] pub struct DragonSkeleton { head: Bone, @@ -148,31 +193,31 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { use comp::dragon::Species::*; Self { head: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0), + (Reddragon, _) => (*HEAD_X, *HEAD_Z), }, chest_front: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0), + (Reddragon, _) => (*CHEST_F_X, *CHEST_F_Z), }, chest_rear: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0), + (Reddragon, _) => (*CHEST_R_X, *CHEST_R_Z), }, tail_front: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0), + (Reddragon, _) => (*TAIL_F_X, *TAIL_F_Z), }, tail_rear: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0), + (Reddragon, _) => (*TAIL_R_X, *TAIL_R_Z), }, wing_in: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0, 0.0), + (Reddragon, _) => (*WING_IN_X, *WING_IN_Y, *WING_IN_Z), }, wing_out: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0, 0.0), + (Reddragon, _) => (*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z), }, feet_f: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0, 0.0), + (Reddragon, _) => (*FEET_F_X, *FEET_F_Y, *FEET_F_Z), }, feet_b: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0, 0.0), + (Reddragon, _) => (*FEET_B_X, *FEET_B_Y, *FEET_B_Z), }, } } diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 75b58a98e4..c9e529fdd2 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1052,7 +1052,7 @@ impl FigureMgr { is_player, ); }, - Body::Dragon(_) => { + Body::Dragon(dragon_body) => { let skeleton_attr = &self .dragon_model_cache .get_or_create_model( @@ -1064,6 +1064,7 @@ impl FigureMgr { None, ) .1; + let ref skeleton_attr = dragon_body.into(); let state = self .dragon_states From 9027967fb7bbf192c08c063e6fab54d376041ea9 Mon Sep 17 00:00:00 2001 From: Snowram Date: Sun, 3 May 2020 18:24:58 +0200 Subject: [PATCH 05/19] Initial run animation work --- .../voxygen/voxel/dragon_lateral_manifest.ron | 16 +- .../voxel/npc/reddragon/female/wing_in_l.vox | 2 +- .../voxel/npc/reddragon/female/wing_in_r.vox | 2 +- .../voxel/npc/reddragon/male/wing_in_l.vox | 2 +- .../voxel/npc/reddragon/male/wing_in_r.vox | 2 +- voxygen/src/anim/dragon/idle.rs | 2 +- voxygen/src/anim/dragon/mod.rs | 15 +- voxygen/src/anim/dragon/run.rs | 159 +++++++++++++----- 8 files changed, 141 insertions(+), 59 deletions(-) diff --git a/assets/voxygen/voxel/dragon_lateral_manifest.ron b/assets/voxygen/voxel/dragon_lateral_manifest.ron index 63aef007dd..2ffdad5a15 100644 --- a/assets/voxygen/voxel/dragon_lateral_manifest.ron +++ b/assets/voxygen/voxel/dragon_lateral_manifest.ron @@ -17,37 +17,37 @@ lateral: ("npc.reddragon.male.wing_out_r"), ), foot_fl: ( - offset: (-2.5, 0.0, -6.0), + offset: (-2.5, -4.0, -1.5), lateral: ("npc.reddragon.male.foot_fl"), ), foot_fr: ( - offset: (-2.5, 0.0, -6.0), + offset: (-2.5, -4.0, -1.5), lateral: ("npc.reddragon.male.foot_fr"), ), foot_bl: ( - offset: (-2.5, 0.0, -7.0), + offset: (-2.5, -4.0, -3.0), lateral: ("npc.reddragon.male.foot_bl"), ), foot_br: ( - offset: (-2.5, 0.0, -7.0), + offset: (-2.5, -4.0, -3.0), lateral: ("npc.reddragon.male.foot_br"), ) ), (Reddragon, Female): ( wing_in_l: ( - offset: (20.0, 20.0, 5.0), + offset: (-0.5, -3.5, -27.0), lateral: ("npc.reddragon.female.wing_in_l"), ), wing_in_r: ( - offset: (20.0, 20.0, 5.0), + offset: (-0.5, -3.5, -27.0), lateral: ("npc.reddragon.female.wing_in_r"), ), wing_out_l: ( - offset: (20.0, 20.0, 5.0), + offset: (-0.5, -3.5, -27.0), lateral: ("npc.reddragon.female.wing_out_l"), ), wing_out_r: ( - offset: (20.0, 20.0, 5.0), + offset: (-0.5, -3.5, -27.0), lateral: ("npc.reddragon.female.wing_out_r"), ), foot_fl: ( diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox index 848877f125..a5c3bff021 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ac7dcba1d88007c93479a6c88cc68ba52c963bfd1452790a6fdee5c4f84cfa7 +oid sha256:b295254070ce70aa2fc9c5b684f346081634c75e7f7757072e6c8e90cae0ba84 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox index 256e132edd..83679057f8 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fe7f85574d91447578169d60f60b71ab88f81aa45f6d5b3a39a01ce79b37c131 +oid sha256:c8634ecd37b4f175d0fda187aea8793781ee6e7454d1f62c9fd1204373a27f37 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox index 848877f125..a5c3bff021 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ac7dcba1d88007c93479a6c88cc68ba52c963bfd1452790a6fdee5c4f84cfa7 +oid sha256:b295254070ce70aa2fc9c5b684f346081634c75e7f7757072e6c8e90cae0ba84 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox index 256e132edd..83679057f8 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fe7f85574d91447578169d60f60b71ab88f81aa45f6d5b3a39a01ce79b37c131 +oid sha256:c8634ecd37b4f175d0fda187aea8793781ee6e7454d1f62c9fd1204373a27f37 size 57352 diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index fa0b5018f4..b827ca7ba0 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -86,7 +86,7 @@ impl Animation for IdleAnimation { next.wing_out_l.ori = Quaternion::rotation_z(0.0); next.wing_out_l.scale = Vec3::one() * 1.05; - next.wing_in_r.offset = Vec3::new( + next.wing_out_r.offset = Vec3::new( skeleton_attr.wing_out.0, skeleton_attr.wing_out.1, skeleton_attr.wing_out.2, diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index a491ad3b8f..fd915158ce 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -33,15 +33,15 @@ const TAIL_R_Z: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_IN_X: f32 = 10.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_IN_Y: f32 = -32.5; +const WING_IN_Y: f32 = -28.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_IN_Z: f32 = -19.0; +const WING_IN_Z: f32 = 6.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_OUT_X: f32 = 0.0; +const WING_OUT_X: f32 = 1.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_OUT_Y: f32 = 1.5; +const WING_OUT_Y: f32 = 2.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_OUT_Z: f32 = -10.5; +const WING_OUT_Z: f32 = 12.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_X: f32 = 4.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] @@ -159,6 +159,7 @@ pub struct SkeletonAttr { wing_out: (f32, f32, f32), feet_f: (f32, f32, f32), feet_b: (f32, f32, f32), + height: f32, } impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { @@ -184,6 +185,7 @@ impl Default for SkeletonAttr { wing_out: (0.0, 0.0, 0.0), feet_f: (0.0, 0.0, 0.0), feet_b: (0.0, 0.0, 0.0), + height: (0.0), } } } @@ -219,6 +221,9 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { feet_b: match (body.species, body.body_type) { (Reddragon, _) => (*FEET_B_X, *FEET_B_Y, *FEET_B_Z), }, + height: match (body.species, body.body_type) { + (Reddragon, _) => (1.0), + }, } } } \ No newline at end of file diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index 2165c07ddf..695a8407d7 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -1,5 +1,5 @@ use super::{super::Animation, DragonSkeleton, SkeletonAttr}; -//use std::{f32::consts::PI, ops::Mul}; +use std::{f32::consts::PI, ops::Mul}; use vek::*; pub struct RunAnimation; @@ -10,64 +10,141 @@ impl Animation for RunAnimation { fn update_skeleton( skeleton: &Self::Skeleton, - (_velocity, _global_time): Self::Dependency, - _anim_time: f64, + (_velocity, 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() * 1.01; + 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); + let vertrb = (anim_time as f32 * lab as f32 + PI).sin().max(0.15); - next.chest_front.offset = Vec3::new(0.0, 4.5, 2.0); - next.chest_front.ori = Quaternion::rotation_x(0.0); - next.chest_front.scale = Vec3::one() * 1.01; + let horilf = (anim_time as f32 * lab as f32 + PI * 1.2).sin(); + let horirfoffset = (anim_time as f32 * lab as f32 + PI * 0.20).sin(); + let horilboffset = (anim_time as f32 * lab as f32 + PI * 1.4).sin(); + let horirb = (anim_time as f32 * lab as f32 + PI * 0.4).sin(); - next.chest_rear.offset = Vec3::new(0.0, 4.5, 2.0); - next.chest_rear.ori = Quaternion::rotation_x(0.0); - next.chest_rear.scale = Vec3::one() * 1.01; + let vertchest = (anim_time as f32 * lab as f32 + PI * 0.3).sin().max(0.2); + let horichest = (anim_time as f32 * lab as f32 + PI * 0.8).sin(); + let verthead = (anim_time as f32 * lab as f32 + PI * 0.3).sin(); - next.tail_front.offset = Vec3::new(0.0, 4.5, 2.0); + let footl = (anim_time as f32 * lab as f32 + PI).sin(); + let footr = (anim_time as f32 * lab as f32).sin(); + + let wolf_look = Vec2::new( + ((global_time + anim_time) as f32 / 4.0) + .floor() + .mul(7331.0) + .sin() + * 0.25, + ((global_time + anim_time) as f32 / 4.0) + .floor() + .mul(1337.0) + .sin() + * 0.125, + ); + + next.head.offset = Vec3::new( + 0.0, + skeleton_attr.head.0 + horichest * 0.9, + skeleton_attr.head.1 + verthead * -0.9, + ) * 1.05; + next.head.ori = + Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x); + next.head.scale = Vec3::one() * 1.05; + + next.tail_front.offset = Vec3::new(0.0, skeleton_attr.tail_front.0, skeleton_attr.tail_front.1); next.tail_front.ori = Quaternion::rotation_x(0.0); - next.tail_front.scale = Vec3::one() * 1.01; + next.tail_front.scale = Vec3::one(); - next.tail_rear.offset = Vec3::new(0.0, 4.5, 2.0); + next.tail_rear.offset = Vec3::new(0.0, skeleton_attr.tail_rear.0, skeleton_attr.tail_rear.1); next.tail_rear.ori = Quaternion::rotation_x(0.0); - next.tail_rear.scale = Vec3::one() * 1.01; + next.tail_rear.scale = Vec3::one(); - next.wing_in_l.offset = Vec3::new(0.0, 4.5, 2.0); - next.wing_in_l.ori = Quaternion::rotation_x(0.0); - next.wing_in_l.scale = Vec3::one() * 1.01; + next.chest_front.offset = Vec3::new( + 0.0, + skeleton_attr.chest_front.0 + horichest * 1.25, + skeleton_attr.chest_front.1 + vertchest * -1.6 + 1.0, + ) * 1.05; + next.chest_front.ori = Quaternion::rotation_y(horichest * -0.09); + next.chest_front.scale = Vec3::one() * 0.98 * 1.05; - next.wing_in_r.offset = Vec3::new(0.0, 4.5, 2.0); - next.wing_in_r.ori = Quaternion::rotation_x(0.0); - next.wing_in_r.scale = Vec3::one() * 1.01; + next.chest_rear.offset = Vec3::new( + 0.0, + skeleton_attr.chest_rear.0 + horichest * 1.25, + skeleton_attr.chest_rear.1 + vertchest * -1.6 + 1.0, + ) * 1.05; + next.chest_rear.ori = Quaternion::rotation_y(horichest * -0.09); + next.chest_rear.scale = Vec3::one() * 0.98 * 1.05; - next.wing_out_l.offset = Vec3::new(0.0, 4.5, 2.0); - next.wing_out_l.ori = Quaternion::rotation_x(0.0); - next.wing_out_l.scale = Vec3::one() * 1.01; + next.foot_fl.offset = Vec3::new( + -skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1 + horilf * 2.5, + skeleton_attr.feet_f.2 + vertlf * 5.0 * skeleton_attr.height - 0.5, + ) * 1.05; + next.foot_fl.ori = Quaternion::rotation_x(horilf * 0.4); + next.foot_fl.scale = Vec3::one() * 1.05; - next.wing_out_r.offset = Vec3::new(0.0, 4.5, 2.0); - next.wing_out_r.ori = Quaternion::rotation_x(0.0); - next.wing_out_r.scale = Vec3::one() * 1.01; + next.foot_fr.offset = Vec3::new( + skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1 + horirfoffset * 2.5, + skeleton_attr.feet_f.2 + vertrfoffset * 5.0 * skeleton_attr.height - 0.5, + ) * 1.05; + next.foot_fr.ori = Quaternion::rotation_x(horirfoffset * 0.4); + next.foot_fr.scale = Vec3::one() * 1.05; - next.foot_fl.offset = Vec3::new(0.0, 4.5, 2.0); - next.foot_fl.ori = Quaternion::rotation_x(0.0); - next.foot_fl.scale = Vec3::one() * 1.01; + next.foot_bl.offset = Vec3::new( + -skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1 + horilboffset * 3.0, + skeleton_attr.feet_b.2 + vertlboffset * 5.0 * skeleton_attr.height - 0.5, + ) * 1.05; + next.foot_bl.ori = Quaternion::rotation_x(horilboffset * 0.35); + next.foot_bl.scale = Vec3::one() * 1.05; - next.foot_fr.offset = Vec3::new(0.0, 4.5, 2.0); - next.foot_fr.ori = Quaternion::rotation_x(0.0); - next.foot_fr.scale = Vec3::one() * 1.01; + next.foot_br.offset = Vec3::new( + skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1 + horirb * 3.0, + skeleton_attr.feet_b.2 + vertrb * 5.0 * skeleton_attr.height - 0.5, + ) * 1.05; + next.foot_br.ori = Quaternion::rotation_x(horirb * 0.35); + next.foot_br.scale = Vec3::one() * 1.05; - next.foot_bl.offset = Vec3::new(0.0, 4.5, 2.0); - next.foot_bl.ori = Quaternion::rotation_x(0.0); - next.foot_bl.scale = Vec3::one() * 1.01; + next.wing_in_l.offset = Vec3::new( + -skeleton_attr.wing_in.0, + skeleton_attr.wing_in.1, + skeleton_attr.wing_in.2, + ); + next.wing_in_l.ori = Quaternion::rotation_y((footl * 0.35).max(0.0)); + next.wing_in_l.scale = Vec3::one() * 1.05; + + next.wing_in_r.offset = Vec3::new( + skeleton_attr.wing_in.0, + skeleton_attr.wing_in.1, + skeleton_attr.wing_in.2, + ); + next.wing_in_r.ori = Quaternion::rotation_y((footr * 0.35).max(0.0)); + next.wing_in_r.scale = Vec3::one() * 1.05; + + next.wing_out_l.offset = Vec3::new( + -skeleton_attr.wing_out.0, + skeleton_attr.wing_out.1, + skeleton_attr.wing_out.2, + ); + next.wing_out_l.ori = Quaternion::rotation_y((footl * 0.35).max(0.0)); + next.wing_out_l.scale = Vec3::one() * 1.05; + + next.wing_out_r.offset = Vec3::new( + skeleton_attr.wing_out.0, + skeleton_attr.wing_out.1, + skeleton_attr.wing_out.2, + ); + next.wing_out_r.ori = Quaternion::rotation_y((footr * 0.35).max(0.0)); + next.wing_out_r.scale = Vec3::one() * 1.05; - next.foot_br.offset = Vec3::new(0.0, 4.5, 2.0); - next.foot_br.ori = Quaternion::rotation_x(0.0); - next.foot_br.scale = Vec3::one() * 1.01; next } } From 875838ecdf2ab6bba9860f5ec8c6a641a53694f2 Mon Sep 17 00:00:00 2001 From: Snowram Date: Tue, 5 May 2020 23:42:56 +0200 Subject: [PATCH 06/19] Initial fly animation work --- voxygen/src/anim/dragon/fly.rs | 161 ++++++++++++++++++++++++++++++++ voxygen/src/anim/dragon/mod.rs | 4 +- voxygen/src/anim/dragon/run.rs | 19 +++- voxygen/src/scene/figure/mod.rs | 2 +- 4 files changed, 179 insertions(+), 7 deletions(-) create mode 100644 voxygen/src/anim/dragon/fly.rs diff --git a/voxygen/src/anim/dragon/fly.rs b/voxygen/src/anim/dragon/fly.rs new file mode 100644 index 0000000000..09aaf27505 --- /dev/null +++ b/voxygen/src/anim/dragon/fly.rs @@ -0,0 +1,161 @@ +use super::{super::Animation, DragonSkeleton, SkeletonAttr}; +use std::{f32::consts::PI, ops::Mul}; +use vek::*; + +pub struct FlyAnimation; + +impl Animation for FlyAnimation { + type Dependency = (f32, f64); + type Skeleton = DragonSkeleton; + + fn update_skeleton( + skeleton: &Self::Skeleton, + (_velocity, global_time): Self::Dependency, + anim_time: f64, + _rate: &mut f32, + skeleton_attr: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let lab = 12.0; + + 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); + let vertrb = (anim_time as f32 * lab as f32 + PI).sin().max(0.15); + + let horilf = (anim_time as f32 * lab as f32 + PI * 1.2).sin(); + let horirfoffset = (anim_time as f32 * lab as f32 + PI * 0.20).sin(); + let horilboffset = (anim_time as f32 * lab as f32 + PI * 1.4).sin(); + let horirb = (anim_time as f32 * lab as f32 + PI * 0.4).sin(); + + let vertchest = (anim_time as f32 * lab as f32 + PI * 0.3).sin().max(0.2); + let horichest = (anim_time as f32 * lab as f32 + PI * 0.8).sin(); + let verthead = (anim_time as f32 * lab as f32 + PI * 0.3).sin(); + + 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(); + + let wolf_look = Vec2::new( + ((global_time + anim_time) as f32 / 4.0) + .floor() + .mul(7331.0) + .sin() + * 0.25, + ((global_time + anim_time) as f32 / 4.0) + .floor() + .mul(1337.0) + .sin() + * 0.125, + ); + + next.head.offset = Vec3::new( + 0.0, + skeleton_attr.head.0 + 0.5, + skeleton_attr.head.1 + center * 0.5 - 1.0, + ); + next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + center * 0.03); + next.head.scale = Vec3::one(); + + next.tail_front.offset = Vec3::new( + 0.0, + skeleton_attr.tail_front.0, + skeleton_attr.tail_front.1 + centeroffset * 0.6, + ); + next.tail_front.ori = Quaternion::rotation_x(center * 0.03); + next.tail_front.scale = Vec3::one(); + + next.tail_rear.offset = Vec3::new( + 0.0, + skeleton_attr.tail_rear.0, + skeleton_attr.tail_rear.1 + centeroffset * 0.6, + ); + next.tail_rear.ori = Quaternion::rotation_x(center * 0.03); + next.tail_rear.scale = Vec3::one(); + + next.chest_front.offset = Vec3::new( + 0.0, + skeleton_attr.chest_front.0, + skeleton_attr.chest_front.1, + ) * 1.05; + next.chest_front.ori = Quaternion::rotation_y(center * 0.05); + next.chest_front.scale = Vec3::one() * 1.05; + + next.chest_rear.offset = Vec3::new( + 0.0, + skeleton_attr.chest_rear.0, + skeleton_attr.chest_rear.1, + ) * 1.05; + next.chest_rear.ori = Quaternion::rotation_y(center * 0.05); + next.chest_rear.scale = Vec3::one() * 1.05; + + next.foot_fl.offset = Vec3::new( + -skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2, + ) * 1.05; + next.foot_fl.ori = Quaternion::rotation_x(-1.3 + footl * 0.06); + next.foot_fl.scale = Vec3::one() * 1.05; + + next.foot_fr.offset = Vec3::new( + skeleton_attr.feet_f.0, + skeleton_attr.feet_f.1, + skeleton_attr.feet_f.2, + ) * 1.05; + next.foot_fr.ori = Quaternion::rotation_x(-1.3 + footl * 0.06); + next.foot_fr.scale = Vec3::one() * 1.05; + + next.foot_bl.offset = Vec3::new( + -skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2, + ) * 1.05; + next.foot_bl.ori = Quaternion::rotation_x(-1.3 + footl * 0.06); + next.foot_bl.scale = Vec3::one() * 1.05; + + next.foot_br.offset = Vec3::new( + skeleton_attr.feet_b.0, + skeleton_attr.feet_b.1, + skeleton_attr.feet_b.2, + ) * 1.05; + next.foot_br.ori = Quaternion::rotation_x(-1.3 + footl * 0.06); + next.foot_br.scale = Vec3::one() * 1.05; + + next.wing_in_l.offset = Vec3::new( + -skeleton_attr.wing_in.0, + skeleton_attr.wing_in.1, + skeleton_attr.wing_in.2, + ); + next.wing_in_l.ori = Quaternion::rotation_y((0.57 + footl * 1.2).max(0.0)); + next.wing_in_l.scale = Vec3::one() * 1.05; + + next.wing_in_r.offset = Vec3::new( + skeleton_attr.wing_in.0, + skeleton_attr.wing_in.1, + skeleton_attr.wing_in.2, + ); + next.wing_in_r.ori = Quaternion::rotation_y((-0.57 + footr * 1.2).min(0.0)); + next.wing_in_r.scale = Vec3::one() * 1.05; + + next.wing_out_l.offset = Vec3::new( + -skeleton_attr.wing_out.0, + skeleton_attr.wing_out.1, + skeleton_attr.wing_out.2, + ); + next.wing_out_l.ori = Quaternion::rotation_y((0.57 + footl * 1.2).max(0.0)); + next.wing_out_l.scale = Vec3::one() * 1.05; + + next.wing_out_r.offset = Vec3::new( + skeleton_attr.wing_out.0, + skeleton_attr.wing_out.1, + skeleton_attr.wing_out.2, + ); + next.wing_out_r.ori = Quaternion::rotation_y((-0.57 + footr * 1.2).min(0.0)); + next.wing_out_r.scale = Vec3::one() * 1.05; + + next + } +} diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index fd915158ce..6f38213069 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -1,9 +1,9 @@ +pub mod fly; pub mod idle; -pub mod jump; pub mod run; // Reexports -pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; +pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; use super::{Bone, Skeleton}; use crate::render::FigureBoneData; diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index 695a8407d7..5264e33ed0 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -35,6 +35,9 @@ impl Animation for RunAnimation { 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(); + let wolf_look = Vec2::new( ((global_time + anim_time) as f32 / 4.0) .floor() @@ -57,12 +60,20 @@ impl Animation for RunAnimation { Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x); next.head.scale = Vec3::one() * 1.05; - next.tail_front.offset = Vec3::new(0.0, skeleton_attr.tail_front.0, skeleton_attr.tail_front.1); - next.tail_front.ori = Quaternion::rotation_x(0.0); + next.tail_front.offset = Vec3::new( + 0.0, + skeleton_attr.tail_front.0, + skeleton_attr.tail_front.1 + centeroffset * 0.6, + ); + next.tail_front.ori = Quaternion::rotation_x(center * 0.03); next.tail_front.scale = Vec3::one(); - next.tail_rear.offset = Vec3::new(0.0, skeleton_attr.tail_rear.0, skeleton_attr.tail_rear.1); - next.tail_rear.ori = Quaternion::rotation_x(0.0); + next.tail_rear.offset = Vec3::new( + 0.0, + skeleton_attr.tail_rear.0, + skeleton_attr.tail_rear.1 + centeroffset * 0.6, + ); + next.tail_rear.ori = Quaternion::rotation_x(center * 0.03); next.tail_rear.scale = Vec3::one(); next.chest_front.offset = Vec3::new( diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index c9e529fdd2..6edcb4b455 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1102,7 +1102,7 @@ impl FigureMgr { skeleton_attr, ), // In air - (false, _, false) => anim::dragon::JumpAnimation::update_skeleton( + (false, _, false) => anim::dragon::FlyAnimation::update_skeleton( &DragonSkeleton::new(), (vel.0.magnitude(), time), state.state_time, From cd452cc7152ea4ac9c9e0b5cfd0bae7b562da577 Mon Sep 17 00:00:00 2001 From: Snowram Date: Wed, 6 May 2020 02:04:56 +0200 Subject: [PATCH 07/19] New dragon model, added jaw, splitted head into upper/lower --- .../voxygen/voxel/dragon_center_manifest.ron | 44 ++++++++++----- .../voxygen/voxel/dragon_lateral_manifest.ron | 32 +++++------ .../npc/reddragon/female/6-tail_rear.vox | 3 ++ .../npc/reddragon/female/chest_front.vox | 4 +- .../voxel/npc/reddragon/female/chest_rear.vox | 4 +- .../voxel/npc/reddragon/female/foot_bl.vox | 4 +- .../voxel/npc/reddragon/female/foot_br.vox | 4 +- .../voxel/npc/reddragon/female/foot_fl.vox | 4 +- .../voxel/npc/reddragon/female/foot_fr.vox | 4 +- .../voxel/npc/reddragon/female/head_lower.vox | 3 ++ .../voxel/npc/reddragon/female/head_upper.vox | 3 ++ .../voxel/npc/reddragon/female/jaw.vox | 3 ++ .../npc/reddragon/female/old/chest_front.vox | 3 ++ .../npc/reddragon/female/old/chest_rear.vox | 3 ++ .../npc/reddragon/female/old/foot_bl.vox | 3 ++ .../npc/reddragon/female/old/foot_br.vox | 3 ++ .../npc/reddragon/female/old/foot_fl.vox | 3 ++ .../npc/reddragon/female/old/foot_fr.vox | 3 ++ .../npc/reddragon/female/{ => old}/head.vox | 0 .../npc/reddragon/female/old/tail_front.vox | 3 ++ .../npc/reddragon/female/old/tail_rear.vox | 3 ++ .../npc/reddragon/female/old/wing_in_l.vox | 3 ++ .../npc/reddragon/female/old/wing_in_r.vox | 3 ++ .../npc/reddragon/female/old/wing_out_l.vox | 3 ++ .../npc/reddragon/female/old/wing_out_r.vox | 3 ++ .../voxel/npc/reddragon/female/tail_front.vox | 4 +- .../voxel/npc/reddragon/female/tail_rear.vox | 4 +- .../voxel/npc/reddragon/female/wing_in_l.vox | 4 +- .../voxel/npc/reddragon/female/wing_in_r.vox | 4 +- .../voxel/npc/reddragon/female/wing_out_l.vox | 4 +- .../voxel/npc/reddragon/female/wing_out_r.vox | 4 +- .../voxel/npc/reddragon/male/chest_front.vox | 4 +- .../voxel/npc/reddragon/male/chest_rear.vox | 4 +- .../voxel/npc/reddragon/male/foot_bl.vox | 4 +- .../voxel/npc/reddragon/male/foot_br.vox | 4 +- .../voxel/npc/reddragon/male/foot_fl.vox | 4 +- .../voxel/npc/reddragon/male/foot_fr.vox | 4 +- .../voxel/npc/reddragon/male/head_lower.vox | 3 ++ .../voxel/npc/reddragon/male/head_upper.vox | 3 ++ .../voxygen/voxel/npc/reddragon/male/jaw.vox | 3 ++ .../npc/reddragon/male/old/chest_front.vox | 3 ++ .../npc/reddragon/male/old/chest_rear.vox | 3 ++ .../voxel/npc/reddragon/male/old/foot_bl.vox | 3 ++ .../voxel/npc/reddragon/male/old/foot_br.vox | 3 ++ .../voxel/npc/reddragon/male/old/foot_fl.vox | 3 ++ .../voxel/npc/reddragon/male/old/foot_fr.vox | 3 ++ .../npc/reddragon/male/{ => old}/head.vox | 0 .../npc/reddragon/male/old/tail_front.vox | 3 ++ .../npc/reddragon/male/old/tail_rear.vox | 3 ++ .../npc/reddragon/male/old/wing_in_l.vox | 3 ++ .../npc/reddragon/male/old/wing_in_r.vox | 3 ++ .../npc/reddragon/male/old/wing_out_l.vox | 3 ++ .../npc/reddragon/male/old/wing_out_r.vox | 3 ++ .../voxel/npc/reddragon/male/tail_front.vox | 4 +- .../voxel/npc/reddragon/male/tail_rear.vox | 4 +- .../voxel/npc/reddragon/male/wing_in_l.vox | 4 +- .../voxel/npc/reddragon/male/wing_in_r.vox | 4 +- .../voxel/npc/reddragon/male/wing_out_l.vox | 4 +- .../voxel/npc/reddragon/male/wing_out_r.vox | 4 +- voxygen/src/anim/bird_medium/fly.rs | 5 ++ voxygen/src/anim/dragon/fly.rs | 31 ++++++++--- voxygen/src/anim/dragon/idle.rs | 35 +++++++++--- voxygen/src/anim/dragon/mod.rs | 54 ++++++++++++++----- voxygen/src/anim/dragon/run.rs | 33 ++++++++++-- voxygen/src/scene/figure/cache.rs | 14 +++-- voxygen/src/scene/figure/load.rs | 54 +++++++++++++++++-- 66 files changed, 375 insertions(+), 116 deletions(-) create mode 100644 assets/voxygen/voxel/npc/reddragon/female/6-tail_rear.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/head_lower.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/head_upper.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/jaw.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/chest_front.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/chest_rear.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/foot_bl.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/foot_br.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/foot_fl.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/foot_fr.vox rename assets/voxygen/voxel/npc/reddragon/female/{ => old}/head.vox (100%) create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/tail_front.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/tail_rear.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/wing_in_l.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/wing_in_r.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/wing_out_l.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/wing_out_r.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/head_lower.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/head_upper.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/jaw.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/chest_front.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/chest_rear.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/foot_bl.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/foot_br.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/foot_fl.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/foot_fr.vox rename assets/voxygen/voxel/npc/reddragon/male/{ => old}/head.vox (100%) create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/tail_front.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/tail_rear.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/wing_in_l.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/wing_in_r.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/wing_out_l.vox create mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/wing_out_r.vox diff --git a/assets/voxygen/voxel/dragon_center_manifest.ron b/assets/voxygen/voxel/dragon_center_manifest.ron index bb906eeba8..af89c71348 100644 --- a/assets/voxygen/voxel/dragon_center_manifest.ron +++ b/assets/voxygen/voxel/dragon_center_manifest.ron @@ -1,45 +1,61 @@ ({ (Reddragon, Male): ( - head: ( - offset: (-4.5, -2.0, -7.5), - center: ("npc.reddragon.male.head"), + upper: ( + offset: (-6.5, -2.0, -6.0), + center: ("npc.reddragon.male.head_upper"), + ), + lower: ( + offset: (-2.5, -2.0, -5.0), + center: ("npc.reddragon.male.head_lower"), + ), + jaw: ( + offset: (-3.5, -2.0, -1.5), + center: ("npc.reddragon.male.jaw"), ), chest_front: ( - offset: (-6.5, -6.0, -6.0), + offset: (-6.5, -6.0, -7.5), center: ("npc.reddragon.male.chest_front"), ), chest_rear: ( - offset: (-6.5, -7.0, -6.0), + offset: (-6.5, -7.0, -7.0), center: ("npc.reddragon.male.chest_rear"), ), tail_front: ( - offset: (-2.5, -5.5, -3.0), + offset: (-2.5, -6.0, -3.5), center: ("npc.reddragon.male.tail_front"), ), tail_rear: ( - offset: (-1.5, -7.0, -2.5), + offset: (-3.5, -8.0, -3.0), center: ("npc.reddragon.male.tail_rear"), ) ), (Reddragon, Female): ( - head: ( - offset: (-4.5, -2.0, -7.5), - center: ("npc.reddragon.female.head"), + upper: ( + offset: (-6.5, -2.0, -6.0), + center: ("npc.reddragon.female.head_upper"), + ), + lower: ( + offset: (-2.5, -2.0, -5.0), + center: ("npc.reddragon.female.head_lower"), + ), + jaw: ( + offset: (-3.5, -2.0, -1.5), + center: ("npc.reddragon.female.jaw"), ), chest_front: ( - offset: (-6.5, -6.0, -6.0), + offset: (-6.5, -6.0, -7.5), center: ("npc.reddragon.female.chest_front"), ), chest_rear: ( - offset: (-6.5, -7.0, -6.0), + offset: (-6.5, -7.0, -7.0), center: ("npc.reddragon.female.chest_rear"), ), tail_front: ( - offset: (-2.5, -5.5, -3.0), + offset: (-2.5, -6.0, -3.5), center: ("npc.reddragon.female.tail_front"), ), tail_rear: ( - offset: (-1.5, -7.0, -2.5), + offset: (-3.5, -8.0, -3.0), center: ("npc.reddragon.female.tail_rear"), ) ), diff --git a/assets/voxygen/voxel/dragon_lateral_manifest.ron b/assets/voxygen/voxel/dragon_lateral_manifest.ron index 2ffdad5a15..4b606120fe 100644 --- a/assets/voxygen/voxel/dragon_lateral_manifest.ron +++ b/assets/voxygen/voxel/dragon_lateral_manifest.ron @@ -1,69 +1,69 @@ ({ (Reddragon, Male): ( wing_in_l: ( - offset: (-0.5, -3.5, -27.0), + offset: (-0.5, -3.5, -44.0), lateral: ("npc.reddragon.male.wing_in_l"), ), wing_in_r: ( - offset: (-0.5, -3.5, -27.0), + offset: (-0.5, -3.5, -44.0), lateral: ("npc.reddragon.male.wing_in_r"), ), wing_out_l: ( - offset: (-0.5, -3.5, -27.0), + offset: (-0.5, -3.5, -38.0), lateral: ("npc.reddragon.male.wing_out_l"), ), wing_out_r: ( - offset: (-0.5, -3.5, -27.0), + offset: (-0.5, -3.5, -38.0), lateral: ("npc.reddragon.male.wing_out_r"), ), foot_fl: ( - offset: (-2.5, -4.0, -1.5), + offset: (-6.5, -4.0, -1.5), lateral: ("npc.reddragon.male.foot_fl"), ), foot_fr: ( - offset: (-2.5, -4.0, -1.5), + offset: (-6.5, -4.0, -1.5), lateral: ("npc.reddragon.male.foot_fr"), ), foot_bl: ( - offset: (-2.5, -4.0, -3.0), + offset: (-6.5, -4.0, -3.0), lateral: ("npc.reddragon.male.foot_bl"), ), foot_br: ( - offset: (-2.5, -4.0, -3.0), + offset: (-6.5, -4.0, -3.0), lateral: ("npc.reddragon.male.foot_br"), ) ), (Reddragon, Female): ( wing_in_l: ( - offset: (-0.5, -3.5, -27.0), + offset: (-0.5, -3.5, -44.0), lateral: ("npc.reddragon.female.wing_in_l"), ), wing_in_r: ( - offset: (-0.5, -3.5, -27.0), + offset: (-0.5, -3.5, -44.0), lateral: ("npc.reddragon.female.wing_in_r"), ), wing_out_l: ( - offset: (-0.5, -3.5, -27.0), + offset: (-0.5, -3.5, -38.0), lateral: ("npc.reddragon.female.wing_out_l"), ), wing_out_r: ( - offset: (-0.5, -3.5, -27.0), + offset: (-0.5, -3.5, -38.0), lateral: ("npc.reddragon.female.wing_out_r"), ), foot_fl: ( - offset: (-2.5, -4.0, -1.5), + offset: (-6.5, -4.0, -1.5), lateral: ("npc.reddragon.female.foot_fl"), ), foot_fr: ( - offset: (-2.5, -4.0, -1.5), + offset: (-6.5, -4.0, -1.5), lateral: ("npc.reddragon.female.foot_fr"), ), foot_bl: ( - offset: (-2.5, -4.0, -3.0), + offset: (-6.5, -4.0, -3.0), lateral: ("npc.reddragon.female.foot_bl"), ), foot_br: ( - offset: (-2.5, -4.0, -3.0), + offset: (-6.5, -4.0, -3.0), lateral: ("npc.reddragon.female.foot_br"), ) ), diff --git a/assets/voxygen/voxel/npc/reddragon/female/6-tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/6-tail_rear.vox new file mode 100644 index 0000000000..2afaa138ed --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/6-tail_rear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:954ee5554aac7be7db12fd0392661c4e2a689b95ea195d19de2a02d099d60e7a +size 1484 diff --git a/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox index 549939b87c..725f03f4fe 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b -size 59039 +oid sha256:c25fc0b4ff28093af40ea8c24672de582fbbf7211c6bf666cbe407d1fd779f3c +size 5492 diff --git a/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox index 8db58555b4..27796daa2d 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 -size 60563 +oid sha256:da59d2e6378d64b0f3faff938ae19348b659eac44279cde802de31433dff7014 +size 5984 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox index fe31aadd1a..f37f75bf16 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a -size 55891 +oid sha256:996907317e7e3aa7d05c4032bd636ec84d366a8936854dab25cf4e52c1613adc +size 1660 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox index 08037dbe38..e1b40b2827 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd -size 55891 +oid sha256:8efb1eb765b547a3693aad2c1dbb74efda21642e58e88e2f21344ddce12f8a21 +size 1660 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox index e71b7a0694..0053d4f82c 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 -size 55891 +oid sha256:87b893f8082a268d5686946ee599222e9d906aff52579dba7d29b69f665e2a21 +size 1932 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox index 926f224e9a..a194ae6158 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 -size 55891 +oid sha256:e17d1e7be3fc8b303a6a960686e11394c571e4da9ea72b02e3c9e95380dd9942 +size 1932 diff --git a/assets/voxygen/voxel/npc/reddragon/female/head_lower.vox b/assets/voxygen/voxel/npc/reddragon/female/head_lower.vox new file mode 100644 index 0000000000..fdbcf126f6 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/head_lower.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5042f5557d11eda408d490ddf7d3c88819e8c482f5059dcbc06ba08533c4793f +size 56303 diff --git a/assets/voxygen/voxel/npc/reddragon/female/head_upper.vox b/assets/voxygen/voxel/npc/reddragon/female/head_upper.vox new file mode 100644 index 0000000000..8e81e96e4a --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/head_upper.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c3a9bed37327135da85b0fde3317211cf600b2e49d346c694b3f00c7d879487 +size 57067 diff --git a/assets/voxygen/voxel/npc/reddragon/female/jaw.vox b/assets/voxygen/voxel/npc/reddragon/female/jaw.vox new file mode 100644 index 0000000000..caaa978e02 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/jaw.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54a9f46ee38d8759d6a95dc99944cac48328ee8f592607aef1c9cd331bf81df9 +size 1456 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/female/old/chest_front.vox new file mode 100644 index 0000000000..549939b87c --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/chest_front.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b +size 59039 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/old/chest_rear.vox new file mode 100644 index 0000000000..8db58555b4 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/chest_rear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 +size 60563 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/female/old/foot_bl.vox new file mode 100644 index 0000000000..fe31aadd1a --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/foot_bl.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/female/old/foot_br.vox new file mode 100644 index 0000000000..08037dbe38 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/foot_br.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/female/old/foot_fl.vox new file mode 100644 index 0000000000..e71b7a0694 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/foot_fl.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/female/old/foot_fr.vox new file mode 100644 index 0000000000..926f224e9a --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/foot_fr.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/head.vox b/assets/voxygen/voxel/npc/reddragon/female/old/head.vox similarity index 100% rename from assets/voxygen/voxel/npc/reddragon/female/head.vox rename to assets/voxygen/voxel/npc/reddragon/female/old/head.vox diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/female/old/tail_front.vox new file mode 100644 index 0000000000..f60dc1b402 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/tail_front.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 +size 56267 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/old/tail_rear.vox new file mode 100644 index 0000000000..3bdb2326ff --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/tail_rear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f +size 55875 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_l.vox new file mode 100644 index 0000000000..a5c3bff021 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b295254070ce70aa2fc9c5b684f346081634c75e7f7757072e6c8e90cae0ba84 +size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_r.vox new file mode 100644 index 0000000000..83679057f8 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8634ecd37b4f175d0fda187aea8793781ee6e7454d1f62c9fd1204373a27f37 +size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_l.vox new file mode 100644 index 0000000000..1b25c929af --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 +size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_r.vox new file mode 100644 index 0000000000..020fd84512 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e +size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox index f60dc1b402..4e90ea3a3f 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 -size 56267 +oid sha256:f886242fe24d927830cf5c750966b759586ebdaedfe6cad60b3d8ff59b97b7ab +size 1892 diff --git a/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox index 3bdb2326ff..70303d30d9 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f -size 55875 +oid sha256:4fbe212043bf1b57e8fbbe18c4028172d0c25d202d535f5fcbefe8f184f897c4 +size 55967 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox index a5c3bff021..1d815a0682 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b295254070ce70aa2fc9c5b684f346081634c75e7f7757072e6c8e90cae0ba84 -size 57352 +oid sha256:06fbba3ccb7f3a91af2a818dcf4c52613dd6e4005a006f10e263c4fc2350ffba +size 56851 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox index 83679057f8..c3b506d7e8 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c8634ecd37b4f175d0fda187aea8793781ee6e7454d1f62c9fd1204373a27f37 -size 57352 +oid sha256:86eb04443ed2e86d96882cf78751c9a0a2443109e4dc0ca1054d570e81eab09d +size 56851 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox index 1b25c929af..9751b73c47 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 -size 58012 +oid sha256:c680d1a9b747801137cfa80666077c52440664e287c79669cfb529e057fa4371 +size 58063 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox index 020fd84512..42e4ad8c05 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e -size 58012 +oid sha256:940fb9b929165a015b99cd8111f9790cea865fa7ab7a89627f515b0681dd9cc6 +size 58063 diff --git a/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox index 549939b87c..725f03f4fe 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b -size 59039 +oid sha256:c25fc0b4ff28093af40ea8c24672de582fbbf7211c6bf666cbe407d1fd779f3c +size 5492 diff --git a/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox index 8db58555b4..27796daa2d 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 -size 60563 +oid sha256:da59d2e6378d64b0f3faff938ae19348b659eac44279cde802de31433dff7014 +size 5984 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox index fe31aadd1a..f37f75bf16 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a -size 55891 +oid sha256:996907317e7e3aa7d05c4032bd636ec84d366a8936854dab25cf4e52c1613adc +size 1660 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox index 08037dbe38..e1b40b2827 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd -size 55891 +oid sha256:8efb1eb765b547a3693aad2c1dbb74efda21642e58e88e2f21344ddce12f8a21 +size 1660 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox index e71b7a0694..0053d4f82c 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 -size 55891 +oid sha256:87b893f8082a268d5686946ee599222e9d906aff52579dba7d29b69f665e2a21 +size 1932 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox index 926f224e9a..a194ae6158 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 -size 55891 +oid sha256:e17d1e7be3fc8b303a6a960686e11394c571e4da9ea72b02e3c9e95380dd9942 +size 1932 diff --git a/assets/voxygen/voxel/npc/reddragon/male/head_lower.vox b/assets/voxygen/voxel/npc/reddragon/male/head_lower.vox new file mode 100644 index 0000000000..fdbcf126f6 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/head_lower.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5042f5557d11eda408d490ddf7d3c88819e8c482f5059dcbc06ba08533c4793f +size 56303 diff --git a/assets/voxygen/voxel/npc/reddragon/male/head_upper.vox b/assets/voxygen/voxel/npc/reddragon/male/head_upper.vox new file mode 100644 index 0000000000..8e81e96e4a --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/head_upper.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c3a9bed37327135da85b0fde3317211cf600b2e49d346c694b3f00c7d879487 +size 57067 diff --git a/assets/voxygen/voxel/npc/reddragon/male/jaw.vox b/assets/voxygen/voxel/npc/reddragon/male/jaw.vox new file mode 100644 index 0000000000..caaa978e02 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/jaw.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54a9f46ee38d8759d6a95dc99944cac48328ee8f592607aef1c9cd331bf81df9 +size 1456 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/male/old/chest_front.vox new file mode 100644 index 0000000000..549939b87c --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/chest_front.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b +size 59039 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/old/chest_rear.vox new file mode 100644 index 0000000000..8db58555b4 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/chest_rear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 +size 60563 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/male/old/foot_bl.vox new file mode 100644 index 0000000000..fe31aadd1a --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/foot_bl.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/male/old/foot_br.vox new file mode 100644 index 0000000000..08037dbe38 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/foot_br.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/male/old/foot_fl.vox new file mode 100644 index 0000000000..e71b7a0694 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/foot_fl.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/male/old/foot_fr.vox new file mode 100644 index 0000000000..926f224e9a --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/foot_fr.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/head.vox b/assets/voxygen/voxel/npc/reddragon/male/old/head.vox similarity index 100% rename from assets/voxygen/voxel/npc/reddragon/male/head.vox rename to assets/voxygen/voxel/npc/reddragon/male/old/head.vox diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/male/old/tail_front.vox new file mode 100644 index 0000000000..f60dc1b402 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/tail_front.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 +size 56267 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/old/tail_rear.vox new file mode 100644 index 0000000000..3bdb2326ff --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/tail_rear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f +size 55875 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_l.vox new file mode 100644 index 0000000000..a5c3bff021 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b295254070ce70aa2fc9c5b684f346081634c75e7f7757072e6c8e90cae0ba84 +size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_r.vox new file mode 100644 index 0000000000..83679057f8 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8634ecd37b4f175d0fda187aea8793781ee6e7454d1f62c9fd1204373a27f37 +size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_l.vox new file mode 100644 index 0000000000..1b25c929af --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 +size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_r.vox new file mode 100644 index 0000000000..020fd84512 --- /dev/null +++ b/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e +size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox index f60dc1b402..4e90ea3a3f 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 -size 56267 +oid sha256:f886242fe24d927830cf5c750966b759586ebdaedfe6cad60b3d8ff59b97b7ab +size 1892 diff --git a/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox index 3bdb2326ff..70303d30d9 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f -size 55875 +oid sha256:4fbe212043bf1b57e8fbbe18c4028172d0c25d202d535f5fcbefe8f184f897c4 +size 55967 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox index a5c3bff021..443133aa32 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b295254070ce70aa2fc9c5b684f346081634c75e7f7757072e6c8e90cae0ba84 -size 57352 +oid sha256:a33e5704cd5412d6751318ae12427d4639c51f5a5393710531011ed333a559db +size 2368 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox index 83679057f8..4b43911812 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c8634ecd37b4f175d0fda187aea8793781ee6e7454d1f62c9fd1204373a27f37 -size 57352 +oid sha256:666951b6c9aa455e690ba5722144211e3eab138f19081d143ac71c54a1dc76b9 +size 2368 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox index 1b25c929af..12a8f686a6 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 -size 58012 +oid sha256:231e64cd32252ae7bea1c26df85244ebf32e042f4a96a4116c7fff8cdfd4d823 +size 3580 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox index 020fd84512..222581da0d 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e -size 58012 +oid sha256:7f8dcd98614dcfeba2e5d16cb40e7577b2e1c84941fae6b53a3939ecef19a679 +size 3580 diff --git a/voxygen/src/anim/bird_medium/fly.rs b/voxygen/src/anim/bird_medium/fly.rs index 163a996109..8bfdf6c11c 100644 --- a/voxygen/src/anim/bird_medium/fly.rs +++ b/voxygen/src/anim/bird_medium/fly.rs @@ -17,6 +17,11 @@ impl Animation for FlyAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); + let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); + let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); + let wave_slow = (anim_time as f32 * 4.5).sin(); + let wave_slow_cos = (anim_time as f32 * 4.5).cos(); + let lab = 12.0; //14.0 let footl = (anim_time as f32 * lab as f32 + PI).sin(); diff --git a/voxygen/src/anim/dragon/fly.rs b/voxygen/src/anim/dragon/fly.rs index 09aaf27505..e830d836f0 100644 --- a/voxygen/src/anim/dragon/fly.rs +++ b/voxygen/src/anim/dragon/fly.rs @@ -18,7 +18,12 @@ impl Animation for FlyAnimation { let mut next = (*skeleton).clone(); let lab = 12.0; - + + let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); + let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); + let wave_slow = (anim_time as f32 * 4.5).sin(); + let wave_slow_cos = (anim_time as f32 * 4.5).cos(); + 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); @@ -52,13 +57,27 @@ impl Animation for FlyAnimation { * 0.125, ); - next.head.offset = Vec3::new( + let wave = (anim_time as f32 * 14.0).sin(); + let wave_slow = (anim_time as f32 * 3.5 + PI).sin(); + let wave_stop = (anim_time as f32 * 5.0).min(PI / 2.0).sin(); + + next.head_upper.offset = Vec3::new(0.0, 7.5, 15.0 + wave_stop * 4.8) * 1.05; + next.head_upper.ori = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_slow * -0.25); + next.head_upper.scale = Vec3::one() * 1.05; + + next.head_lower.offset = Vec3::new(0.0, 7.5, 15.0 + wave_stop * 4.8) * 1.05; + next.head_lower.ori = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_slow * -0.25); + next.head_lower.scale = Vec3::one() * 1.05; + + next.jaw.offset = Vec3::new( 0.0, - skeleton_attr.head.0 + 0.5, - skeleton_attr.head.1 + center * 0.5 - 1.0, + skeleton_attr.jaw.0 - wave_ultra_slow_cos * 0.12, + skeleton_attr.jaw.1 + wave_slow * 0.2, ); - next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + center * 0.03); - next.head.scale = Vec3::one(); + next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); + next.jaw.scale = Vec3::one() * 0.98; next.tail_front.offset = Vec3::new( 0.0, diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index b827ca7ba0..0557bef6ec 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -1,5 +1,5 @@ use super::{super::Animation, DragonSkeleton, SkeletonAttr}; -use std::ops::Mul; +use std::{f32::consts::PI, ops::Mul}; use vek::*; pub struct IdleAnimation; @@ -17,10 +17,12 @@ impl Animation for IdleAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); + let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); + let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).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( + let look = Vec2::new( ((global_time + anim_time) as f32 / 8.0) .floor() .mul(7331.0) @@ -33,10 +35,31 @@ impl Animation for IdleAnimation { * 0.25, ); - next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1); - next.head.ori = Quaternion::rotation_z(duck_head_look.x) - * Quaternion::rotation_x(-duck_head_look.y.abs() + wave_slow_cos * 0.03); - next.head.scale = Vec3::one(); + next.head_upper.offset = Vec3::new( + 0.0, + skeleton_attr.head_upper.0, + skeleton_attr.head_upper.1 + wave_ultra_slow * 0.4, + ) * 1.05; + next.head_upper.ori = + Quaternion::rotation_z(0.8 * look.x) * Quaternion::rotation_x(0.8 * look.y); + next.head_upper.scale = Vec3::one() * 1.05; + + next.head_lower.offset = Vec3::new( + 0.0, + skeleton_attr.head_lower.0, + skeleton_attr.head_lower.1 + wave_ultra_slow * 0.20, + ); + next.head_lower.ori = + Quaternion::rotation_z(-0.4 * look.x) * Quaternion::rotation_x(-0.4 * look.y); + next.head_lower.scale = Vec3::one() * 1.05; + + next.jaw.offset = Vec3::new( + 0.0, + skeleton_attr.jaw.0 - wave_ultra_slow_cos * 0.12, + skeleton_attr.jaw.1 + wave_slow * 0.2, + ); + next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); + next.jaw.scale = Vec3::one() * 0.98; next.chest_front.offset = Vec3::new( 0.0, diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index 6f38213069..63db3aaee8 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -11,9 +11,17 @@ use common::comp::{self}; use vek::Vec3; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_X: f32 = 4.0; +const HEAD_UPPER_X: f32 = 11.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_Z: f32 = 11.0; +const HEAD_UPPER_Z: f32 = 18.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const HEAD_LOWER_X: f32 = -4.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const HEAD_LOWER_Z: f32 = -2.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const JAW_X: f32 = 7.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] +const JAW_Z: f32 = -5.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_F_X: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] @@ -23,11 +31,11 @@ const CHEST_R_X: f32 = -13.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_R_Z: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_F_X: f32 = -11.5; +const TAIL_F_X: f32 = -13.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_F_Z: f32 = 16.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_R_X: f32 = -25.5; +const TAIL_R_X: f32 = -28.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_R_Z: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] @@ -57,7 +65,9 @@ const FEET_B_Z: f32 = 3.0; #[derive(Clone, Default)] pub struct DragonSkeleton { - head: Bone, + head_upper: Bone, + head_lower: Bone, + jaw: Bone, chest_front: Bone, chest_rear: Bone, tail_front: Bone, @@ -81,7 +91,13 @@ impl Skeleton for DragonSkeleton { fn bone_count(&self) -> usize { 13 } +<<<<<<< HEAD fn compute_matrices(&self) -> ([FigureBoneData; 16], Vec3) { +======= + fn compute_matrices(&self) -> [FigureBoneData; 16] { + let head_upper_mat = self.head_upper.compute_base_matrix(); + let head_lower_mat = self.head_lower.compute_base_matrix(); +>>>>>>> New dragon model, added jaw, splitted head into upper/lower let chest_front_mat = self.chest_front.compute_base_matrix(); let chest_rear_mat = self.chest_rear.compute_base_matrix(); let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); @@ -112,7 +128,9 @@ impl Skeleton for DragonSkeleton { ) ======= [ - FigureBoneData::new(self.head.compute_base_matrix() * chest_front_mat), + FigureBoneData::new(head_upper_mat), + FigureBoneData::new(head_upper_mat * head_lower_mat), + FigureBoneData::new(head_upper_mat * self.jaw.compute_base_matrix()), FigureBoneData::new(chest_front_mat), FigureBoneData::new(self.chest_rear.compute_base_matrix() * chest_front_mat), FigureBoneData::new(chest_rear_mat * self.tail_front.compute_base_matrix()), @@ -126,14 +144,14 @@ impl Skeleton for DragonSkeleton { FigureBoneData::new(self.foot_bl.compute_base_matrix()), FigureBoneData::new(self.foot_br.compute_base_matrix()), FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), ] >>>>>>> Symmetry of dragon skeleton } fn interpolate(&mut self, target: &Self, dt: f32) { - self.head.interpolate(&target.head, dt); + self.head_upper.interpolate(&target.head_upper, dt); + self.head_lower.interpolate(&target.head_lower, dt); + self.jaw.interpolate(&target.jaw, dt); self.chest_front.interpolate(&target.chest_front, dt); self.chest_rear.interpolate(&target.chest_rear, dt); self.tail_front.interpolate(&target.tail_front, dt); @@ -150,7 +168,9 @@ impl Skeleton for DragonSkeleton { } pub struct SkeletonAttr { - head: (f32, f32), + head_upper: (f32, f32), + head_lower: (f32, f32), + jaw: (f32, f32), chest_front: (f32, f32), chest_rear: (f32, f32), tail_front: (f32, f32), @@ -176,7 +196,9 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { impl Default for SkeletonAttr { fn default() -> Self { Self { - head: (0.0, 0.0), + head_upper: (0.0, 0.0), + head_lower: (0.0, 0.0), + jaw: (0.0, 0.0), chest_front: (0.0, 0.0), chest_rear: (0.0, 0.0), tail_front: (0.0, 0.0), @@ -194,8 +216,14 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { fn from(body: &'a comp::dragon::Body) -> Self { use comp::dragon::Species::*; Self { - head: match (body.species, body.body_type) { - (Reddragon, _) => (*HEAD_X, *HEAD_Z), + head_upper: match (body.species, body.body_type) { + (Reddragon, _) => (*HEAD_UPPER_X, *HEAD_UPPER_Z), + }, + head_lower: match (body.species, body.body_type) { + (Reddragon, _) => (*HEAD_LOWER_X, *HEAD_LOWER_Z), + }, + jaw: match (body.species, body.body_type) { + (Reddragon, _) => (*JAW_X, *JAW_Z), }, chest_front: match (body.species, body.body_type) { (Reddragon, _) => (*CHEST_F_X, *CHEST_F_Z), diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index 5264e33ed0..31ce82a4df 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -18,6 +18,12 @@ impl Animation for RunAnimation { let mut next = (*skeleton).clone(); let lab = 14; + + let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); + let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); + let wave_slow = (anim_time as f32 * 4.5).sin(); + let wave_slow_cos = (anim_time as f32 * 4.5).cos(); + 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); @@ -51,14 +57,31 @@ impl Animation for RunAnimation { * 0.125, ); - next.head.offset = Vec3::new( + next.head_upper.offset = Vec3::new( 0.0, - skeleton_attr.head.0 + horichest * 0.9, - skeleton_attr.head.1 + verthead * -0.9, + skeleton_attr.head_upper.0 + horichest * 1.8, + skeleton_attr.head_upper.1 + verthead * -1.8, ) * 1.05; - next.head.ori = + next.head_upper.ori = Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x); - next.head.scale = Vec3::one() * 1.05; + next.head_upper.scale = Vec3::one() * 1.05; + + next.head_lower.offset = Vec3::new( + 0.0, + skeleton_attr.head_lower.0 + horichest * 1.8, + skeleton_attr.head_lower.1 + verthead * -1.8, + ) * 1.05; + next.head_lower.ori = + Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x); + next.head_lower.scale = Vec3::one() * 1.05; + + next.jaw.offset = Vec3::new( + 0.0, + skeleton_attr.jaw.0 - wave_ultra_slow_cos * 0.12, + skeleton_attr.jaw.1 + wave_slow * 0.2, + ); + next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); + next.jaw.scale = Vec3::one() * 0.98; next.tail_front.offset = Vec3::new( 0.0, diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index 4ca5547771..d88d4f2fb2 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -417,7 +417,17 @@ impl FigureModelCache { DragonLateralSpec::load_watched(manifest_indicator); [ - Some(dragon_center_spec.mesh_head( + Some(dragon_center_spec.mesh_head_upper( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_center_spec.mesh_head_lower( + body.species, + body.body_type, + generate_mesh, + )), + Some(dragon_center_spec.mesh_jaw( body.species, body.body_type, generate_mesh, @@ -483,8 +493,6 @@ impl FigureModelCache { generate_mesh, )), None, - None, - None, ] }, Body::BirdSmall(body) => [ diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 1bfd77b30f..acceb10df0 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -1873,7 +1873,9 @@ pub struct DragonCenterSpec(HashMap<(DSpecies, DBodyType), SidedDCenterVoxSpec>) #[derive(Serialize, Deserialize)] struct SidedDCenterVoxSpec { - head: DragonCenterSubSpec, + upper: DragonCenterSubSpec, + lower: DragonCenterSubSpec, + jaw: DragonCenterSubSpec, chest_front: DragonCenterSubSpec, chest_rear: DragonCenterSubSpec, tail_front: DragonCenterSubSpec, @@ -1927,7 +1929,7 @@ impl DragonCenterSpec { .unwrap() } - pub fn mesh_head( + pub fn mesh_head_upper( &self, species: DSpecies, body_type: DBodyType, @@ -1937,15 +1939,57 @@ impl DragonCenterSpec { Some(spec) => spec, None => { error!( - "No head specification exists for the combination of {:?} and {:?}", + "No upper head specification exists for the combination of {:?} and {:?}", species, body_type ); return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); }, }; - let center = graceful_load_segment(&spec.head.center.0); + let central = graceful_load_segment(&spec.upper.center.0); - generate_mesh(¢er, Vec3::from(spec.head.offset)) + generate_mesh(¢ral, Vec3::from(spec.upper.offset)) + } + + pub fn mesh_head_lower( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No lower head specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let central = graceful_load_segment(&spec.lower.center.0); + + generate_mesh(¢ral, Vec3::from(spec.lower.offset)) + } + + pub fn mesh_jaw( + &self, + species: DSpecies, + body_type: DBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No jaw specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh); + }, + }; + let central = graceful_load_segment(&spec.jaw.center.0); + + generate_mesh(¢ral, Vec3::from(spec.jaw.offset)) } pub fn mesh_chest_front( From 5b518b137cc9de034a272a9eb4c0cffda7f902a7 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Fri, 8 May 2020 01:00:12 -0400 Subject: [PATCH 08/19] skeletal tweaks --- voxygen/src/anim/dragon/idle.rs | 8 +++--- voxygen/src/anim/dragon/mod.rs | 48 ++++++++++++++++----------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index 0557bef6ec..ecc2f29404 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -90,7 +90,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_l.ori = Quaternion::rotation_z(0.0); + next.wing_in_l.ori = Quaternion::rotation_y(wave_ultra_slow * -0.5); next.wing_in_l.scale = Vec3::one() * 1.05; next.wing_in_r.offset = Vec3::new( @@ -98,7 +98,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_r.ori = Quaternion::rotation_y(0.0); + next.wing_in_r.ori = Quaternion::rotation_y(wave_ultra_slow * 0.5); next.wing_in_r.scale = Vec3::one() * 1.05; next.wing_out_l.offset = Vec3::new( @@ -106,7 +106,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2, ); - next.wing_out_l.ori = Quaternion::rotation_z(0.0); + next.wing_out_l.ori = Quaternion::rotation_y(wave_ultra_slow * -0.5); next.wing_out_l.scale = Vec3::one() * 1.05; next.wing_out_r.offset = Vec3::new( @@ -114,7 +114,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2, ); - next.wing_out_r.ori = Quaternion::rotation_y(0.0); + next.wing_out_r.ori = Quaternion::rotation_y(wave_ultra_slow * 0.5); next.wing_out_r.scale = Vec3::one() * 1.05; next.foot_fl.offset = Vec3::new( diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index 63db3aaee8..393b85c9b2 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -11,13 +11,13 @@ use common::comp::{self}; use vek::Vec3; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_UPPER_X: f32 = 11.5; +const HEAD_UPPER_X: f32 = 2.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_UPPER_Z: f32 = 18.0; +const HEAD_UPPER_Z: f32 = 4.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_LOWER_X: f32 = -4.0; +const HEAD_LOWER_X: f32 = 8.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_LOWER_Z: f32 = -2.0; +const HEAD_LOWER_Z: f32 = 3.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const JAW_X: f32 = 7.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] @@ -31,25 +31,25 @@ const CHEST_R_X: f32 = -13.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_R_Z: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_F_X: f32 = -13.5; +const TAIL_F_X: f32 = -12.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_F_Z: f32 = 16.5; +const TAIL_F_Z: f32 = 1.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_R_X: f32 = -28.0; +const TAIL_R_X: f32 = -30.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_R_Z: f32 = 0.0; +const TAIL_R_Z: f32 = 14.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_IN_X: f32 = 10.0; +const WING_IN_X: f32 = 2.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_IN_Y: f32 = -28.5; +const WING_IN_Y: f32 = -16.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_IN_Z: f32 = 6.0; +const WING_IN_Z: f32 = 3.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_OUT_X: f32 = 1.0; +const WING_OUT_X: f32 = 23.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_OUT_Y: f32 = 2.0; +const WING_OUT_Y: f32 = 0.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_OUT_Z: f32 = 12.0; +const WING_OUT_Z: f32 = 4.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_X: f32 = 4.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] @@ -89,7 +89,7 @@ impl DragonSkeleton { impl Skeleton for DragonSkeleton { type Attr = SkeletonAttr; - fn bone_count(&self) -> usize { 13 } + fn bone_count(&self) -> usize { 15 } <<<<<<< HEAD fn compute_matrices(&self) -> ([FigureBoneData; 16], Vec3) { @@ -128,17 +128,17 @@ impl Skeleton for DragonSkeleton { ) ======= [ - FigureBoneData::new(head_upper_mat), - FigureBoneData::new(head_upper_mat * head_lower_mat), - FigureBoneData::new(head_upper_mat * self.jaw.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * head_lower_mat*head_upper_mat), + FigureBoneData::new(chest_front_mat * head_lower_mat), + FigureBoneData::new(chest_front_mat * head_lower_mat*head_upper_mat * self.jaw.compute_base_matrix()), FigureBoneData::new(chest_front_mat), - FigureBoneData::new(self.chest_rear.compute_base_matrix() * chest_front_mat), - FigureBoneData::new(chest_rear_mat * self.tail_front.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix() ), + FigureBoneData::new(chest_front_mat*chest_rear_mat * tail_front_mat), FigureBoneData::new(self.tail_rear.compute_base_matrix() * tail_front_mat), FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), - FigureBoneData::new(self.wing_out_l.compute_base_matrix() * wing_in_l_mat), - FigureBoneData::new(self.wing_out_r.compute_base_matrix() * wing_in_r_mat), + FigureBoneData::new(chest_front_mat*wing_in_l_mat*self.wing_out_l.compute_base_matrix()), + FigureBoneData::new(chest_front_mat*wing_in_r_mat*self.wing_out_r.compute_base_matrix()), FigureBoneData::new(self.foot_fl.compute_base_matrix()), FigureBoneData::new(self.foot_fr.compute_base_matrix()), FigureBoneData::new(self.foot_bl.compute_base_matrix()), @@ -244,10 +244,10 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { (Reddragon, _) => (*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z), }, feet_f: match (body.species, body.body_type) { - (Reddragon, _) => (*FEET_F_X, *FEET_F_Y, *FEET_F_Z), + (Reddragon, _) => (4.0, 0.0, 1.5), }, feet_b: match (body.species, body.body_type) { - (Reddragon, _) => (*FEET_B_X, *FEET_B_Y, *FEET_B_Z), + (Reddragon, _) => (4.0, -15.0, 3.0), }, height: match (body.species, body.body_type) { (Reddragon, _) => (1.0), From e5a7086502af85f3dc530ae6d77eb0774691b693 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Fri, 8 May 2020 01:01:50 -0400 Subject: [PATCH 09/19] asset and manifest tweaks --- assets/voxygen/voxel/dragon_lateral_manifest.ron | 16 ++++++++-------- .../voxel/npc/reddragon/female/6-tail_rear.vox | 3 --- .../voxel/npc/reddragon/female/wing_in_l.vox | 4 ++-- .../voxel/npc/reddragon/female/wing_in_r.vox | 4 ++-- .../voxel/npc/reddragon/female/wing_out_l.vox | 4 ++-- .../voxel/npc/reddragon/female/wing_out_r.vox | 4 ++-- 6 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/6-tail_rear.vox diff --git a/assets/voxygen/voxel/dragon_lateral_manifest.ron b/assets/voxygen/voxel/dragon_lateral_manifest.ron index 4b606120fe..f4194d97c3 100644 --- a/assets/voxygen/voxel/dragon_lateral_manifest.ron +++ b/assets/voxygen/voxel/dragon_lateral_manifest.ron @@ -1,19 +1,19 @@ ({ (Reddragon, Male): ( wing_in_l: ( - offset: (-0.5, -3.5, -44.0), + offset: (-24.0, -3.0, 0.0), lateral: ("npc.reddragon.male.wing_in_l"), ), wing_in_r: ( - offset: (-0.5, -3.5, -44.0), + offset: (0.0, -3.0, 0.0), lateral: ("npc.reddragon.male.wing_in_r"), ), wing_out_l: ( - offset: (-0.5, -3.5, -38.0), + offset: (-29.0, -3.0, -4.0), lateral: ("npc.reddragon.male.wing_out_l"), ), wing_out_r: ( - offset: (-0.5, -3.5, -38.0), + offset: (0.0, -3.0, -4.0), lateral: ("npc.reddragon.male.wing_out_r"), ), foot_fl: ( @@ -35,19 +35,19 @@ ), (Reddragon, Female): ( wing_in_l: ( - offset: (-0.5, -3.5, -44.0), + offset: (-24.0, -3.0, 0.0), lateral: ("npc.reddragon.female.wing_in_l"), ), wing_in_r: ( - offset: (-0.5, -3.5, -44.0), + offset: (0.0, -3.0, 0.0), lateral: ("npc.reddragon.female.wing_in_r"), ), wing_out_l: ( - offset: (-0.5, -3.5, -38.0), + offset: (-29.0, -3.0, -4.0), lateral: ("npc.reddragon.female.wing_out_l"), ), wing_out_r: ( - offset: (-0.5, -3.5, -38.0), + offset: (0.0, -3.0, -4.0), lateral: ("npc.reddragon.female.wing_out_r"), ), foot_fl: ( diff --git a/assets/voxygen/voxel/npc/reddragon/female/6-tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/6-tail_rear.vox deleted file mode 100644 index 2afaa138ed..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/6-tail_rear.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:954ee5554aac7be7db12fd0392661c4e2a689b95ea195d19de2a02d099d60e7a -size 1484 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox index 1d815a0682..443133aa32 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:06fbba3ccb7f3a91af2a818dcf4c52613dd6e4005a006f10e263c4fc2350ffba -size 56851 +oid sha256:a33e5704cd5412d6751318ae12427d4639c51f5a5393710531011ed333a559db +size 2368 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox index c3b506d7e8..4b43911812 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:86eb04443ed2e86d96882cf78751c9a0a2443109e4dc0ca1054d570e81eab09d -size 56851 +oid sha256:666951b6c9aa455e690ba5722144211e3eab138f19081d143ac71c54a1dc76b9 +size 2368 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox index 9751b73c47..12a8f686a6 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c680d1a9b747801137cfa80666077c52440664e287c79669cfb529e057fa4371 -size 58063 +oid sha256:231e64cd32252ae7bea1c26df85244ebf32e042f4a96a4116c7fff8cdfd4d823 +size 3580 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox index 42e4ad8c05..222581da0d 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:940fb9b929165a015b99cd8111f9790cea865fa7ab7a89627f515b0681dd9cc6 -size 58063 +oid sha256:7f8dcd98614dcfeba2e5d16cb40e7577b2e1c84941fae6b53a3939ecef19a679 +size 3580 From 9d2277ecd433db4db07e72f5d0f946da8af0c045 Mon Sep 17 00:00:00 2001 From: Snowram Date: Fri, 8 May 2020 22:51:27 +0200 Subject: [PATCH 10/19] Better animations --- .../voxel/npc/reddragon/female/jaw.vox | 4 +-- .../npc/reddragon/female/old/chest_front.vox | 3 -- .../npc/reddragon/female/old/chest_rear.vox | 3 -- .../npc/reddragon/female/old/foot_bl.vox | 3 -- .../npc/reddragon/female/old/foot_br.vox | 3 -- .../npc/reddragon/female/old/foot_fl.vox | 3 -- .../npc/reddragon/female/old/foot_fr.vox | 3 -- .../voxel/npc/reddragon/female/old/head.vox | 3 -- .../npc/reddragon/female/old/tail_front.vox | 3 -- .../npc/reddragon/female/old/tail_rear.vox | 3 -- .../npc/reddragon/female/old/wing_in_l.vox | 3 -- .../npc/reddragon/female/old/wing_in_r.vox | 3 -- .../npc/reddragon/female/old/wing_out_l.vox | 3 -- .../npc/reddragon/female/old/wing_out_r.vox | 3 -- .../voxygen/voxel/npc/reddragon/male/jaw.vox | 4 +-- .../npc/reddragon/male/old/chest_front.vox | 3 -- .../npc/reddragon/male/old/chest_rear.vox | 3 -- .../voxel/npc/reddragon/male/old/foot_bl.vox | 3 -- .../voxel/npc/reddragon/male/old/foot_br.vox | 3 -- .../voxel/npc/reddragon/male/old/foot_fl.vox | 3 -- .../voxel/npc/reddragon/male/old/foot_fr.vox | 3 -- .../voxel/npc/reddragon/male/old/head.vox | 3 -- .../npc/reddragon/male/old/tail_front.vox | 3 -- .../npc/reddragon/male/old/tail_rear.vox | 3 -- .../npc/reddragon/male/old/wing_in_l.vox | 3 -- .../npc/reddragon/male/old/wing_in_r.vox | 3 -- .../npc/reddragon/male/old/wing_out_l.vox | 3 -- .../npc/reddragon/male/old/wing_out_r.vox | 3 -- voxygen/src/anim/bird_medium/fly.rs | 5 --- voxygen/src/anim/dragon/fly.rs | 36 ++++++++++++++----- voxygen/src/anim/dragon/idle.rs | 29 +++++++++------ voxygen/src/anim/dragon/mod.rs | 28 +++++++-------- voxygen/src/anim/dragon/run.rs | 33 +++++++++-------- 33 files changed, 81 insertions(+), 136 deletions(-) delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/chest_front.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/chest_rear.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/foot_bl.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/foot_br.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/foot_fl.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/foot_fr.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/head.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/tail_front.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/tail_rear.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/wing_in_l.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/wing_in_r.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/wing_out_l.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/female/old/wing_out_r.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/chest_front.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/chest_rear.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/foot_bl.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/foot_br.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/foot_fl.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/foot_fr.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/head.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/tail_front.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/tail_rear.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/wing_in_l.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/wing_in_r.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/wing_out_l.vox delete mode 100644 assets/voxygen/voxel/npc/reddragon/male/old/wing_out_r.vox diff --git a/assets/voxygen/voxel/npc/reddragon/female/jaw.vox b/assets/voxygen/voxel/npc/reddragon/female/jaw.vox index caaa978e02..9f38e100f1 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/jaw.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/jaw.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:54a9f46ee38d8759d6a95dc99944cac48328ee8f592607aef1c9cd331bf81df9 -size 1456 +oid sha256:45506c26b9f83a6adf6505e13414fdd6c69746d0ae088916d54596a11c85ad96 +size 55939 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/female/old/chest_front.vox deleted file mode 100644 index 549939b87c..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/chest_front.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b -size 59039 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/old/chest_rear.vox deleted file mode 100644 index 8db58555b4..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/chest_rear.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 -size 60563 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/female/old/foot_bl.vox deleted file mode 100644 index fe31aadd1a..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/foot_bl.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a -size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/female/old/foot_br.vox deleted file mode 100644 index 08037dbe38..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/foot_br.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd -size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/female/old/foot_fl.vox deleted file mode 100644 index e71b7a0694..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/foot_fl.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 -size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/female/old/foot_fr.vox deleted file mode 100644 index 926f224e9a..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/foot_fr.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 -size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/head.vox b/assets/voxygen/voxel/npc/reddragon/female/old/head.vox deleted file mode 100644 index f20fcb90dd..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/head.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:64b03f5b6dc36ab671f1e22280950f71f2fbe7a66b28490226c649290e7310b3 -size 57523 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/female/old/tail_front.vox deleted file mode 100644 index f60dc1b402..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/tail_front.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 -size 56267 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/old/tail_rear.vox deleted file mode 100644 index 3bdb2326ff..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/tail_rear.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f -size 55875 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_l.vox deleted file mode 100644 index a5c3bff021..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b295254070ce70aa2fc9c5b684f346081634c75e7f7757072e6c8e90cae0ba84 -size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_r.vox deleted file mode 100644 index 83679057f8..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/wing_in_r.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c8634ecd37b4f175d0fda187aea8793781ee6e7454d1f62c9fd1204373a27f37 -size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_l.vox deleted file mode 100644 index 1b25c929af..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 -size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_r.vox deleted file mode 100644 index 020fd84512..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/female/old/wing_out_r.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e -size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/jaw.vox b/assets/voxygen/voxel/npc/reddragon/male/jaw.vox index caaa978e02..9f38e100f1 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/jaw.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/jaw.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:54a9f46ee38d8759d6a95dc99944cac48328ee8f592607aef1c9cd331bf81df9 -size 1456 +oid sha256:45506c26b9f83a6adf6505e13414fdd6c69746d0ae088916d54596a11c85ad96 +size 55939 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/male/old/chest_front.vox deleted file mode 100644 index 549939b87c..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/chest_front.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b -size 59039 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/old/chest_rear.vox deleted file mode 100644 index 8db58555b4..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/chest_rear.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 -size 60563 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/male/old/foot_bl.vox deleted file mode 100644 index fe31aadd1a..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/foot_bl.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a -size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/male/old/foot_br.vox deleted file mode 100644 index 08037dbe38..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/foot_br.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd -size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/male/old/foot_fl.vox deleted file mode 100644 index e71b7a0694..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/foot_fl.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 -size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/male/old/foot_fr.vox deleted file mode 100644 index 926f224e9a..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/foot_fr.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 -size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/head.vox b/assets/voxygen/voxel/npc/reddragon/male/old/head.vox deleted file mode 100644 index f20fcb90dd..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/head.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:64b03f5b6dc36ab671f1e22280950f71f2fbe7a66b28490226c649290e7310b3 -size 57523 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/male/old/tail_front.vox deleted file mode 100644 index f60dc1b402..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/tail_front.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 -size 56267 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/old/tail_rear.vox deleted file mode 100644 index 3bdb2326ff..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/tail_rear.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f -size 55875 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_l.vox deleted file mode 100644 index a5c3bff021..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b295254070ce70aa2fc9c5b684f346081634c75e7f7757072e6c8e90cae0ba84 -size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_r.vox deleted file mode 100644 index 83679057f8..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/wing_in_r.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c8634ecd37b4f175d0fda187aea8793781ee6e7454d1f62c9fd1204373a27f37 -size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_l.vox deleted file mode 100644 index 1b25c929af..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 -size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_r.vox deleted file mode 100644 index 020fd84512..0000000000 --- a/assets/voxygen/voxel/npc/reddragon/male/old/wing_out_r.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e -size 58012 diff --git a/voxygen/src/anim/bird_medium/fly.rs b/voxygen/src/anim/bird_medium/fly.rs index 8bfdf6c11c..163a996109 100644 --- a/voxygen/src/anim/bird_medium/fly.rs +++ b/voxygen/src/anim/bird_medium/fly.rs @@ -17,11 +17,6 @@ impl Animation for FlyAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); - let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); - let wave_slow = (anim_time as f32 * 4.5).sin(); - let wave_slow_cos = (anim_time as f32 * 4.5).cos(); - let lab = 12.0; //14.0 let footl = (anim_time as f32 * lab as f32 + PI).sin(); diff --git a/voxygen/src/anim/dragon/fly.rs b/voxygen/src/anim/dragon/fly.rs index e830d836f0..451f0033be 100644 --- a/voxygen/src/anim/dragon/fly.rs +++ b/voxygen/src/anim/dragon/fly.rs @@ -4,6 +4,15 @@ use vek::*; pub struct FlyAnimation; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] +const TEST_1: f32 = 0.0; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] +const TEST_2: f32 = 0.0; +#[const_tweaker::tweak(min = -1.0, max = 1.0, step = 0.01)] +const TEST_3: f32 = 0.0; +#[const_tweaker::tweak(min = -1.0, max = 1.0, step = 0.01)] +const TEST_4: f32 = 0.0; + impl Animation for FlyAnimation { type Dependency = (f32, f64); type Skeleton = DragonSkeleton; @@ -24,6 +33,9 @@ impl Animation for FlyAnimation { let wave_slow = (anim_time as f32 * 4.5).sin(); let wave_slow_cos = (anim_time as f32 * 4.5).cos(); + let wingl = (anim_time as f32 * 2.0 + PI).sin(); + let wingr = (anim_time as f32 * 2.0).sin(); + 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); @@ -61,14 +73,22 @@ impl Animation for FlyAnimation { let wave_slow = (anim_time as f32 * 3.5 + PI).sin(); let wave_stop = (anim_time as f32 * 5.0).min(PI / 2.0).sin(); - next.head_upper.offset = Vec3::new(0.0, 7.5, 15.0 + wave_stop * 4.8) * 1.05; + next.head_upper.offset = Vec3::new( + 0.0, + skeleton_attr.head_upper.0, + skeleton_attr.head_upper.1 + wave_ultra_slow * 0.20, + ) * 1.05; next.head_upper.ori = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_slow * -0.25); + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_ultra_slow * -0.10); next.head_upper.scale = Vec3::one() * 1.05; - next.head_lower.offset = Vec3::new(0.0, 7.5, 15.0 + wave_stop * 4.8) * 1.05; + next.head_lower.offset = Vec3::new( + 0.0, + skeleton_attr.head_lower.0, + skeleton_attr.head_lower.1 + wave_ultra_slow * 0.20, + ) * 1.05; next.head_lower.ori = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_slow * -0.25); + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_ultra_slow * -0.10); next.head_lower.scale = Vec3::one() * 1.05; next.jaw.offset = Vec3::new( @@ -148,7 +168,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_l.ori = Quaternion::rotation_y((0.57 + footl * 1.2).max(0.0)); + next.wing_in_l.ori = Quaternion::rotation_y((0.15 + wingl * 0.6).max(0.2)); next.wing_in_l.scale = Vec3::one() * 1.05; next.wing_in_r.offset = Vec3::new( @@ -156,7 +176,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_r.ori = Quaternion::rotation_y((-0.57 + footr * 1.2).min(0.0)); + next.wing_in_r.ori = Quaternion::rotation_y((-0.15 + wingr * 0.6).min(0.2)); next.wing_in_r.scale = Vec3::one() * 1.05; next.wing_out_l.offset = Vec3::new( @@ -164,7 +184,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2, ); - next.wing_out_l.ori = Quaternion::rotation_y((0.57 + footl * 1.2).max(0.0)); + next.wing_out_l.ori = Quaternion::rotation_y((0.35 + wingl * 0.6).max(0.0)); next.wing_out_l.scale = Vec3::one() * 1.05; next.wing_out_r.offset = Vec3::new( @@ -172,7 +192,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2, ); - next.wing_out_r.ori = Quaternion::rotation_y((-0.57 + footr * 1.2).min(0.0)); + next.wing_out_r.ori = Quaternion::rotation_y((-0.35 + wingr * 0.6).min(0.0)); next.wing_out_r.scale = Vec3::one() * 1.05; next diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index ecc2f29404..76089250cd 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -4,6 +4,15 @@ use vek::*; pub struct IdleAnimation; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] +const TEST_R: f32 = 2.5; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] +const TEST_L: f32 = -2.5; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] +const OFF1: f32 = -1.4; +#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] +const OFF2: f32 = -1.4; + impl Animation for IdleAnimation { type Dependency = f64; type Skeleton = DragonSkeleton; @@ -38,7 +47,7 @@ impl Animation for IdleAnimation { next.head_upper.offset = Vec3::new( 0.0, skeleton_attr.head_upper.0, - skeleton_attr.head_upper.1 + wave_ultra_slow * 0.4, + skeleton_attr.head_upper.1 + wave_ultra_slow * 0.20, ) * 1.05; next.head_upper.ori = Quaternion::rotation_z(0.8 * look.x) * Quaternion::rotation_x(0.8 * look.y); @@ -48,16 +57,16 @@ impl Animation for IdleAnimation { 0.0, skeleton_attr.head_lower.0, skeleton_attr.head_lower.1 + wave_ultra_slow * 0.20, - ); + ) * 1.05; next.head_lower.ori = - Quaternion::rotation_z(-0.4 * look.x) * Quaternion::rotation_x(-0.4 * look.y); + Quaternion::rotation_z(0.8 * look.x) * Quaternion::rotation_x(0.8 * look.y); next.head_lower.scale = Vec3::one() * 1.05; next.jaw.offset = Vec3::new( 0.0, skeleton_attr.jaw.0 - wave_ultra_slow_cos * 0.12, skeleton_attr.jaw.1 + wave_slow * 0.2, - ); + ) * 1.05; next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); next.jaw.scale = Vec3::one() * 0.98; @@ -90,7 +99,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_l.ori = Quaternion::rotation_y(wave_ultra_slow * -0.5); + next.wing_in_l.ori = Quaternion::rotation_y(1.3); next.wing_in_l.scale = Vec3::one() * 1.05; next.wing_in_r.offset = Vec3::new( @@ -98,23 +107,23 @@ impl Animation for IdleAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_r.ori = Quaternion::rotation_y(wave_ultra_slow * 0.5); + next.wing_in_r.ori = Quaternion::rotation_y(-1.3); next.wing_in_r.scale = Vec3::one() * 1.05; next.wing_out_l.offset = Vec3::new( -skeleton_attr.wing_out.0, skeleton_attr.wing_out.1, - skeleton_attr.wing_out.2, + skeleton_attr.wing_out.2 + *OFF1, ); - next.wing_out_l.ori = Quaternion::rotation_y(wave_ultra_slow * -0.5); + next.wing_out_l.ori = Quaternion::rotation_y(*TEST_L); next.wing_out_l.scale = Vec3::one() * 1.05; next.wing_out_r.offset = Vec3::new( skeleton_attr.wing_out.0, skeleton_attr.wing_out.1, - skeleton_attr.wing_out.2, + skeleton_attr.wing_out.2 + *OFF2, ); - next.wing_out_r.ori = Quaternion::rotation_y(wave_ultra_slow * 0.5); + next.wing_out_r.ori = Quaternion::rotation_y(*TEST_R); next.wing_out_r.scale = Vec3::one() * 1.05; next.foot_fl.offset = Vec3::new( diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index 393b85c9b2..28a84c377f 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -15,7 +15,7 @@ const HEAD_UPPER_X: f32 = 2.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const HEAD_UPPER_Z: f32 = 4.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_LOWER_X: f32 = 8.0; +const HEAD_LOWER_X: f32 = 7.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const HEAD_LOWER_Z: f32 = 3.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] @@ -27,7 +27,7 @@ const CHEST_F_X: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_F_Z: f32 = 14.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const CHEST_R_X: f32 = -13.0; +const CHEST_R_X: f32 = -12.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_R_Z: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] @@ -35,9 +35,9 @@ const TAIL_F_X: f32 = -12.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_F_Z: f32 = 1.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_R_X: f32 = -30.0; +const TAIL_R_X: f32 = -14.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_R_Z: f32 = 14.0; +const TAIL_R_Z: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_IN_X: f32 = 2.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] @@ -51,13 +51,13 @@ const WING_OUT_Y: f32 = 0.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_OUT_Z: f32 = 4.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const FEET_F_X: f32 = 4.0; +const FEET_F_X: f32 = 6.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_Y: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_Z: f32 = 1.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const FEET_B_X: f32 = 4.0; +const FEET_B_X: f32 = 6.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_B_Y: f32 = -15.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] @@ -128,17 +128,17 @@ impl Skeleton for DragonSkeleton { ) ======= [ - FigureBoneData::new(chest_front_mat * head_lower_mat*head_upper_mat), + FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat), FigureBoneData::new(chest_front_mat * head_lower_mat), - FigureBoneData::new(chest_front_mat * head_lower_mat*head_upper_mat * self.jaw.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat * self.jaw.compute_base_matrix()), FigureBoneData::new(chest_front_mat), FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix() ), - FigureBoneData::new(chest_front_mat*chest_rear_mat * tail_front_mat), - FigureBoneData::new(self.tail_rear.compute_base_matrix() * tail_front_mat), + FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat), + FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat * self.tail_rear.compute_base_matrix()), FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), - FigureBoneData::new(chest_front_mat*wing_in_l_mat*self.wing_out_l.compute_base_matrix()), - FigureBoneData::new(chest_front_mat*wing_in_r_mat*self.wing_out_r.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix()), FigureBoneData::new(self.foot_fl.compute_base_matrix()), FigureBoneData::new(self.foot_fr.compute_base_matrix()), FigureBoneData::new(self.foot_bl.compute_base_matrix()), @@ -244,10 +244,10 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { (Reddragon, _) => (*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z), }, feet_f: match (body.species, body.body_type) { - (Reddragon, _) => (4.0, 0.0, 1.5), + (Reddragon, _) => (*FEET_F_X, *FEET_F_Y, *FEET_F_Z), }, feet_b: match (body.species, body.body_type) { - (Reddragon, _) => (4.0, -15.0, 3.0), + (Reddragon, _) => (*FEET_B_X, *FEET_B_Y, *FEET_B_Z), }, height: match (body.species, body.body_type) { (Reddragon, _) => (1.0), diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index 31ce82a4df..8f24e75967 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -59,8 +59,8 @@ impl Animation for RunAnimation { next.head_upper.offset = Vec3::new( 0.0, - skeleton_attr.head_upper.0 + horichest * 1.8, - skeleton_attr.head_upper.1 + verthead * -1.8, + skeleton_attr.head_upper.0, + skeleton_attr.head_upper.1, ) * 1.05; next.head_upper.ori = Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x); @@ -68,11 +68,10 @@ impl Animation for RunAnimation { next.head_lower.offset = Vec3::new( 0.0, - skeleton_attr.head_lower.0 + horichest * 1.8, - skeleton_attr.head_lower.1 + verthead * -1.8, + skeleton_attr.head_lower.0, + skeleton_attr.head_lower.1, ) * 1.05; - next.head_lower.ori = - Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x); + next.head_lower.ori = Quaternion::rotation_x(wave_slow * 0.05); next.head_lower.scale = Vec3::one() * 1.05; next.jaw.offset = Vec3::new( @@ -81,7 +80,7 @@ impl Animation for RunAnimation { skeleton_attr.jaw.1 + wave_slow * 0.2, ); next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); - next.jaw.scale = Vec3::one() * 0.98; + next.jaw.scale = Vec3::one(); next.tail_front.offset = Vec3::new( 0.0, @@ -105,15 +104,15 @@ impl Animation for RunAnimation { skeleton_attr.chest_front.1 + vertchest * -1.6 + 1.0, ) * 1.05; next.chest_front.ori = Quaternion::rotation_y(horichest * -0.09); - next.chest_front.scale = Vec3::one() * 0.98 * 1.05; + next.chest_front.scale = Vec3::one() * 1.05; next.chest_rear.offset = Vec3::new( 0.0, - skeleton_attr.chest_rear.0 + horichest * 1.25, - skeleton_attr.chest_rear.1 + vertchest * -1.6 + 1.0, + skeleton_attr.chest_rear.0, + skeleton_attr.chest_rear.1, ) * 1.05; next.chest_rear.ori = Quaternion::rotation_y(horichest * -0.09); - next.chest_rear.scale = Vec3::one() * 0.98 * 1.05; + next.chest_rear.scale = Vec3::one() * 1.05; next.foot_fl.offset = Vec3::new( -skeleton_attr.feet_f.0, @@ -152,7 +151,7 @@ impl Animation for RunAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_l.ori = Quaternion::rotation_y((footl * 0.35).max(0.0)); + next.wing_in_l.ori = Quaternion::rotation_y(1.3); next.wing_in_l.scale = Vec3::one() * 1.05; next.wing_in_r.offset = Vec3::new( @@ -160,23 +159,23 @@ impl Animation for RunAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_r.ori = Quaternion::rotation_y((footr * 0.35).max(0.0)); + next.wing_in_r.ori = Quaternion::rotation_y(-1.3); next.wing_in_r.scale = Vec3::one() * 1.05; next.wing_out_l.offset = Vec3::new( -skeleton_attr.wing_out.0, skeleton_attr.wing_out.1, - skeleton_attr.wing_out.2, + skeleton_attr.wing_out.2 - 1.4, ); - next.wing_out_l.ori = Quaternion::rotation_y((footl * 0.35).max(0.0)); + next.wing_out_l.ori = Quaternion::rotation_y(-2.5); next.wing_out_l.scale = Vec3::one() * 1.05; next.wing_out_r.offset = Vec3::new( skeleton_attr.wing_out.0, skeleton_attr.wing_out.1, - skeleton_attr.wing_out.2, + skeleton_attr.wing_out.2 - 1.4, ); - next.wing_out_r.ori = Quaternion::rotation_y((footr * 0.35).max(0.0)); + next.wing_out_r.ori = Quaternion::rotation_y(2.5); next.wing_out_r.scale = Vec3::one() * 1.05; next From a6de8159f64452082b0949c188ed39d2f72a2aee Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sat, 9 May 2020 05:29:09 -0400 Subject: [PATCH 11/19] dragon adjustments. tweaks to humanoid run, fix for first person glide and other small fixes --- .../voxel/npc/reddragon/female/foot_bl.vox | 4 +-- .../voxel/npc/reddragon/female/foot_br.vox | 4 +-- .../voxel/npc/reddragon/male/foot_bl.vox | 4 +-- .../voxel/npc/reddragon/male/foot_br.vox | 4 +-- voxygen/src/anim/character/beta.rs | 2 +- voxygen/src/anim/character/climb.rs | 2 +- voxygen/src/anim/character/gliding.rs | 12 ++++----- voxygen/src/anim/character/mod.rs | 4 +-- voxygen/src/anim/character/run.rs | 18 ++++++------- voxygen/src/anim/character/swim.rs | 4 +-- voxygen/src/anim/dragon/idle.rs | 25 +++++++++---------- voxygen/src/anim/dragon/mod.rs | 2 +- voxygen/src/anim/dragon/run.rs | 8 +++--- 13 files changed, 46 insertions(+), 47 deletions(-) diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox index f37f75bf16..dade191de2 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:996907317e7e3aa7d05c4032bd636ec84d366a8936854dab25cf4e52c1613adc -size 1660 +oid sha256:fdc86307f4a66b8f1125fb0bc72487cefdc18f6d546a538c657ef85b66c3ad30 +size 1996 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox index e1b40b2827..6a79fbf92d 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8efb1eb765b547a3693aad2c1dbb74efda21642e58e88e2f21344ddce12f8a21 -size 1660 +oid sha256:03d49a29e96d553542593a431ee8c54cbcb3a11aef21b33a5831c28584bd1251 +size 1996 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox index f37f75bf16..dade191de2 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:996907317e7e3aa7d05c4032bd636ec84d366a8936854dab25cf4e52c1613adc -size 1660 +oid sha256:fdc86307f4a66b8f1125fb0bc72487cefdc18f6d546a538c657ef85b66c3ad30 +size 1996 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox index e1b40b2827..6a79fbf92d 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8efb1eb765b547a3693aad2c1dbb74efda21642e58e88e2f21344ddce12f8a21 -size 1660 +oid sha256:03d49a29e96d553542593a431ee8c54cbcb3a11aef21b33a5831c28584bd1251 +size 1996 diff --git a/voxygen/src/anim/character/beta.rs b/voxygen/src/anim/character/beta.rs index 687424a68f..4cd099e1cf 100644 --- a/voxygen/src/anim/character/beta.rs +++ b/voxygen/src/anim/character/beta.rs @@ -97,7 +97,7 @@ impl Animation for BetaAnimation { } next.l_shoulder.offset = Vec3::new( - skeleton_attr.shoulder.0, + -skeleton_attr.shoulder.0, skeleton_attr.shoulder.1, skeleton_attr.shoulder.2, ); diff --git a/voxygen/src/anim/character/climb.rs b/voxygen/src/anim/character/climb.rs index 23370b68f5..e4fa290ee1 100644 --- a/voxygen/src/anim/character/climb.rs +++ b/voxygen/src/anim/character/climb.rs @@ -72,7 +72,7 @@ impl Animation for ClimbAnimation { next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( - skeleton_attr.hand.0, + -skeleton_attr.hand.0, skeleton_attr.hand.1 + quicka * 1.5, skeleton_attr.hand.2 - quick * 4.0, ); diff --git a/voxygen/src/anim/character/gliding.rs b/voxygen/src/anim/character/gliding.rs index 88c3cb956f..ebc8fe13bb 100644 --- a/voxygen/src/anim/character/gliding.rs +++ b/voxygen/src/anim/character/gliding.rs @@ -58,7 +58,7 @@ impl Animation for GlidingAnimation { next.head.offset = Vec3::new( 0.0, -2.0 + skeleton_attr.head.0, - -2.0 + skeleton_attr.head.1, + skeleton_attr.head.1, ); next.head.ori = Quaternion::rotation_x(0.35 - slow * 0.10 + head_look.y) * Quaternion::rotation_z(head_look.x + slowa * 0.15); @@ -72,10 +72,10 @@ impl Animation for GlidingAnimation { next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0, skeleton_attr.shorts.1); next.shorts.ori = Quaternion::rotation_z(slowa * 0.35); - next.l_hand.offset = Vec3::new(-9.5 + slowa * -1.5, -3.0 + slowa * 1.5, 6.0); + next.l_hand.offset = Vec3::new(-9.5 + slowa * -1.5, -3.0 + slowa * 1.5, 8.0); next.l_hand.ori = Quaternion::rotation_x(-2.7 + slowa * -0.1); - next.r_hand.offset = Vec3::new(9.5 + slowa * -1.5, -3.0 + slowa * -1.5, 6.0); + next.r_hand.offset = Vec3::new(9.5 + slowa * -1.5, -3.0 + slowa * -1.5, 8.0); next.r_hand.ori = Quaternion::rotation_x(-2.7 + slowa * -0.10); next.l_foot.offset = Vec3::new( @@ -112,8 +112,8 @@ impl Animation for GlidingAnimation { ); next.r_shoulder.scale = Vec3::one() * 1.1; - next.glider.offset = Vec3::new(0.0, -13.0 + slow * 0.10, 6.0); - next.glider.ori = Quaternion::rotation_x(1.0) * Quaternion::rotation_y(slowa * 0.04); + next.glider.offset = Vec3::new(0.0, -13.0 + slow * 0.10, 8.0); + next.glider.ori = Quaternion::rotation_x(0.8) * Quaternion::rotation_y(slowa * 0.04); next.glider.scale = Vec3::one(); next.main.offset = Vec3::new(-7.0, -5.0, 15.0); @@ -130,7 +130,7 @@ impl Animation for GlidingAnimation { next.lantern.scale = Vec3::one() * 0.65; next.torso.offset = Vec3::new(0.0, 6.0, 15.0) / 11.0 * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_x(-0.05 * speed.max(12.0) + slow * 0.10) + next.torso.ori = Quaternion::rotation_x(-0.05 * speed.max(12.0) + slow * 0.06) * Quaternion::rotation_y(tilt * 16.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; diff --git a/voxygen/src/anim/character/mod.rs b/voxygen/src/anim/character/mod.rs index 5a9bff96af..c867a3d25e 100644 --- a/voxygen/src/anim/character/mod.rs +++ b/voxygen/src/anim/character/mod.rs @@ -220,8 +220,8 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr { (Orc, Female) => (0.0, 14.0), (Human, Male) => (0.3, 13.5), (Human, Female) => (0.0, 13.8), - (Elf, Male) => (0.0, 13.5), - (Elf, Female) => (0.0, 13.5), + (Elf, Male) => (0.5, 13.5), + (Elf, Female) => (1.0, 13.5), (Dwarf, Male) => (0.0, 14.5), (Dwarf, Female) => (0.0, 14.0), (Undead, Male) => (0.5, 13.6), diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index 4a7dd9a4f5..b2d8d9384a 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -92,9 +92,9 @@ impl Animation for RunAnimation { next.head.offset = Vec3::new( 0.0, -3.0 + skeleton_attr.head.0, - -1.0 + skeleton_attr.head.1 + short * 0.3, + -1.0 + skeleton_attr.head.1 + short * 0.1, ); - next.head.ori = Quaternion::rotation_z(head_look.x + long * -0.1 - short * 0.3) + next.head.ori = Quaternion::rotation_z(head_look.x + long * -0.1 - short * 0.1) * Quaternion::rotation_x(head_look.y + 0.35); next.head.scale = Vec3::one() * skeleton_attr.head_scale; @@ -103,11 +103,11 @@ impl Animation for RunAnimation { skeleton_attr.chest.0, skeleton_attr.chest.1 + 2.0 + short * 1.1 - lower, ); - next.chest.ori = Quaternion::rotation_z(short * 0.3 * walkintensity); + next.chest.ori = Quaternion::rotation_z(short * 0.15 * walkintensity); next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0, skeleton_attr.belt.1); - next.belt.ori = Quaternion::rotation_z(short * 0.25); + next.belt.ori = Quaternion::rotation_z(short * 0.1); next.belt.scale = Vec3::one(); next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); @@ -115,24 +115,24 @@ impl Animation for RunAnimation { next.back.scale = Vec3::one() * 1.02; next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0, skeleton_attr.shorts.1); - next.shorts.ori = Quaternion::rotation_z(short * 0.4); + next.shorts.ori = Quaternion::rotation_z(short * 0.2); next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( -skeleton_attr.hand.0 + wave_stop * 1.0 * walkintensity, skeleton_attr.hand.1 + short * 3.0 * walkintensity, - 1.0 + skeleton_attr.hand.2 + short * -1.5 * walkintensity, + 1.0 + skeleton_attr.hand.2 + short * -0.75 * walkintensity, ); - next.l_hand.ori = Quaternion::rotation_x(0.2 + short * 1.2 * walk) + next.l_hand.ori = Quaternion::rotation_x(0.2 + short * 1.5 * walk) * Quaternion::rotation_y(wave_stop * -0.1); next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( skeleton_attr.hand.0 + wave_stop * -1.0 * walkintensity, skeleton_attr.hand.1 + short * -3.0 * walkintensity, - 1.0 + skeleton_attr.hand.2 + short * 1.5 * walkintensity, + 1.0 + skeleton_attr.hand.2 + short * 0.75 * walkintensity, ); - next.r_hand.ori = Quaternion::rotation_x(0.2 + short * -1.2 * walk) + next.r_hand.ori = Quaternion::rotation_x(0.2 + short * -1.5 * walk) * Quaternion::rotation_y(wave_stop * 0.1); next.r_hand.scale = Vec3::one(); diff --git a/voxygen/src/anim/character/swim.rs b/voxygen/src/anim/character/swim.rs index 35787b7804..233bec9297 100644 --- a/voxygen/src/anim/character/swim.rs +++ b/voxygen/src/anim/character/swim.rs @@ -107,7 +107,7 @@ impl Animation for SwimAnimation { next.l_shoulder.offset = Vec3::new( -skeleton_attr.shoulder.0, - skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, skeleton_attr.shoulder.2, ); next.l_shoulder.ori = Quaternion::rotation_x(short * 0.15); @@ -115,7 +115,7 @@ impl Animation for SwimAnimation { next.r_shoulder.offset = Vec3::new( skeleton_attr.shoulder.0, - skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, skeleton_attr.shoulder.2, ); next.r_shoulder.ori = Quaternion::rotation_x(short * -0.15); diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index 76089250cd..2018abfd00 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -26,9 +26,8 @@ impl Animation for IdleAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); - let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); - let wave_slow = (anim_time as f32 * 4.5).sin(); + let ultra_slow = (anim_time as f32 * 1.0).sin(); + let wave_slow = (anim_time as f32 * 2.5).sin(); let wave_slow_cos = (anim_time as f32 * 4.5).cos(); let look = Vec2::new( @@ -47,7 +46,7 @@ impl Animation for IdleAnimation { next.head_upper.offset = Vec3::new( 0.0, skeleton_attr.head_upper.0, - skeleton_attr.head_upper.1 + wave_ultra_slow * 0.20, + skeleton_attr.head_upper.1 + ultra_slow * 0.20, ) * 1.05; next.head_upper.ori = Quaternion::rotation_z(0.8 * look.x) * Quaternion::rotation_x(0.8 * look.y); @@ -56,7 +55,7 @@ impl Animation for IdleAnimation { next.head_lower.offset = Vec3::new( 0.0, skeleton_attr.head_lower.0, - skeleton_attr.head_lower.1 + wave_ultra_slow * 0.20, + skeleton_attr.head_lower.1 + ultra_slow * 0.20, ) * 1.05; next.head_lower.ori = Quaternion::rotation_z(0.8 * look.x) * Quaternion::rotation_x(0.8 * look.y); @@ -64,8 +63,8 @@ impl Animation for IdleAnimation { next.jaw.offset = Vec3::new( 0.0, - skeleton_attr.jaw.0 - wave_ultra_slow_cos * 0.12, - skeleton_attr.jaw.1 + wave_slow * 0.2, + skeleton_attr.jaw.0, + skeleton_attr.jaw.1, ) * 1.05; next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); next.jaw.scale = Vec3::one() * 0.98; @@ -73,7 +72,7 @@ impl Animation for IdleAnimation { next.chest_front.offset = Vec3::new( 0.0, skeleton_attr.chest_front.0, - wave_slow * 0.3 + skeleton_attr.chest_front.1, + skeleton_attr.chest_front.1, ) * 1.05; next.chest_front.ori = Quaternion::rotation_y(wave_slow * 0.03); next.chest_front.scale = Vec3::one() * 1.05; @@ -81,7 +80,7 @@ impl Animation for IdleAnimation { next.chest_rear.offset = Vec3::new( 0.0, skeleton_attr.chest_rear.0, - wave_slow * 0.3 + skeleton_attr.chest_rear.1, + skeleton_attr.chest_rear.1, ) * 1.05; next.chest_rear.ori = Quaternion::rotation_y(wave_slow * 0.03); next.chest_rear.scale = Vec3::one() * 1.05; @@ -99,7 +98,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_l.ori = Quaternion::rotation_y(1.3); + next.wing_in_l.ori = Quaternion::rotation_y(0.2); next.wing_in_l.scale = Vec3::one() * 1.05; next.wing_in_r.offset = Vec3::new( @@ -107,7 +106,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_r.ori = Quaternion::rotation_y(-1.3); + next.wing_in_r.ori = Quaternion::rotation_y(-0.2);//.8 next.wing_in_r.scale = Vec3::one() * 1.05; next.wing_out_l.offset = Vec3::new( @@ -115,7 +114,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2 + *OFF1, ); - next.wing_out_l.ori = Quaternion::rotation_y(*TEST_L); + next.wing_out_l.ori = Quaternion::rotation_y(-0.3);//2.0 next.wing_out_l.scale = Vec3::one() * 1.05; next.wing_out_r.offset = Vec3::new( @@ -123,7 +122,7 @@ impl Animation for IdleAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2 + *OFF2, ); - next.wing_out_r.ori = Quaternion::rotation_y(*TEST_R); + next.wing_out_r.ori = Quaternion::rotation_y(0.3); next.wing_out_r.scale = Vec3::one() * 1.05; next.foot_fl.offset = Vec3::new( diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index 28a84c377f..8b8b3bce23 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -43,7 +43,7 @@ const WING_IN_X: f32 = 2.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_IN_Y: f32 = -16.5; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_IN_Z: f32 = 3.0; +const WING_IN_Z: f32 = 0.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_OUT_X: f32 = 23.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index 8f24e75967..14a343e94a 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -151,7 +151,7 @@ impl Animation for RunAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_l.ori = Quaternion::rotation_y(1.3); + next.wing_in_l.ori = Quaternion::rotation_y(0.8); next.wing_in_l.scale = Vec3::one() * 1.05; next.wing_in_r.offset = Vec3::new( @@ -159,7 +159,7 @@ impl Animation for RunAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_r.ori = Quaternion::rotation_y(-1.3); + next.wing_in_r.ori = Quaternion::rotation_y(-0.8); next.wing_in_r.scale = Vec3::one() * 1.05; next.wing_out_l.offset = Vec3::new( @@ -167,7 +167,7 @@ impl Animation for RunAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2 - 1.4, ); - next.wing_out_l.ori = Quaternion::rotation_y(-2.5); + next.wing_out_l.ori = Quaternion::rotation_y(-2.0); next.wing_out_l.scale = Vec3::one() * 1.05; next.wing_out_r.offset = Vec3::new( @@ -175,7 +175,7 @@ impl Animation for RunAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2 - 1.4, ); - next.wing_out_r.ori = Quaternion::rotation_y(2.5); + next.wing_out_r.ori = Quaternion::rotation_y(2.0); next.wing_out_r.scale = Vec3::one() * 1.05; next From 0248c6a44e1b7c44b7f83544b60efb5a30615a57 Mon Sep 17 00:00:00 2001 From: Snowram Date: Sat, 9 May 2020 17:22:08 +0200 Subject: [PATCH 12/19] Cleanup --- .../voxygen/voxel/dragon_lateral_manifest.ron | 16 ++--- .../voxel/npc/reddragon/female/head_lower.vox | 4 +- .../voxel/npc/reddragon/female/head_upper.vox | 4 +- .../voxel/npc/reddragon/female/jaw.vox | 4 +- .../voxel/npc/reddragon/female/tail_rear.vox | 4 +- .../voxel/npc/reddragon/male/head_lower.vox | 4 +- .../voxel/npc/reddragon/male/head_upper.vox | 4 +- .../voxygen/voxel/npc/reddragon/male/jaw.vox | 4 +- .../voxel/npc/reddragon/male/tail_rear.vox | 4 +- voxygen/src/anim/dragon/fly.rs | 60 ++++--------------- voxygen/src/anim/dragon/idle.rs | 21 ++----- voxygen/src/anim/dragon/mod.rs | 26 ++++---- voxygen/src/anim/dragon/run.rs | 10 +--- voxygen/src/scene/figure/mod.rs | 3 +- 14 files changed, 58 insertions(+), 110 deletions(-) diff --git a/assets/voxygen/voxel/dragon_lateral_manifest.ron b/assets/voxygen/voxel/dragon_lateral_manifest.ron index f4194d97c3..26a48652e1 100644 --- a/assets/voxygen/voxel/dragon_lateral_manifest.ron +++ b/assets/voxygen/voxel/dragon_lateral_manifest.ron @@ -17,19 +17,19 @@ lateral: ("npc.reddragon.male.wing_out_r"), ), foot_fl: ( - offset: (-6.5, -4.0, -1.5), + offset: (-5.5, -4.0, -1.5), lateral: ("npc.reddragon.male.foot_fl"), ), foot_fr: ( - offset: (-6.5, -4.0, -1.5), + offset: (-5.5, -4.0, -1.5), lateral: ("npc.reddragon.male.foot_fr"), ), foot_bl: ( - offset: (-6.5, -4.0, -3.0), + offset: (-5.5, -4.0, -3.0), lateral: ("npc.reddragon.male.foot_bl"), ), foot_br: ( - offset: (-6.5, -4.0, -3.0), + offset: (-5.5, -4.0, -3.0), lateral: ("npc.reddragon.male.foot_br"), ) ), @@ -51,19 +51,19 @@ lateral: ("npc.reddragon.female.wing_out_r"), ), foot_fl: ( - offset: (-6.5, -4.0, -1.5), + offset: (-5.5, -4.0, -1.5), lateral: ("npc.reddragon.female.foot_fl"), ), foot_fr: ( - offset: (-6.5, -4.0, -1.5), + offset: (-5.5, -4.0, -1.5), lateral: ("npc.reddragon.female.foot_fr"), ), foot_bl: ( - offset: (-6.5, -4.0, -3.0), + offset: (-5.5, -4.0, -3.0), lateral: ("npc.reddragon.female.foot_bl"), ), foot_br: ( - offset: (-6.5, -4.0, -3.0), + offset: (-5.5, -4.0, -3.0), lateral: ("npc.reddragon.female.foot_br"), ) ), diff --git a/assets/voxygen/voxel/npc/reddragon/female/head_lower.vox b/assets/voxygen/voxel/npc/reddragon/female/head_lower.vox index fdbcf126f6..1ce47773cf 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/head_lower.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/head_lower.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5042f5557d11eda408d490ddf7d3c88819e8c482f5059dcbc06ba08533c4793f -size 56303 +oid sha256:ef6c4e562646a30d91fc83f9cd0a0a4a78e9cbbc323dcaf45befc2b12f71ef4f +size 1820 diff --git a/assets/voxygen/voxel/npc/reddragon/female/head_upper.vox b/assets/voxygen/voxel/npc/reddragon/female/head_upper.vox index 8e81e96e4a..9158bcfbdd 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/head_upper.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/head_upper.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c3a9bed37327135da85b0fde3317211cf600b2e49d346c694b3f00c7d879487 -size 57067 +oid sha256:a875a8a52f642730f0cf7038a549fa279ed0b36a0d9b2a34b16d05a5ddc12a80 +size 2584 diff --git a/assets/voxygen/voxel/npc/reddragon/female/jaw.vox b/assets/voxygen/voxel/npc/reddragon/female/jaw.vox index 9f38e100f1..012efacc36 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/jaw.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/jaw.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:45506c26b9f83a6adf6505e13414fdd6c69746d0ae088916d54596a11c85ad96 -size 55939 +oid sha256:9d648b59b890e4d3cb7a6c52d65b8d5eb4f259c4584bf96ffe1b78e868f4ca91 +size 1456 diff --git a/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox index 70303d30d9..1e761f5121 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4fbe212043bf1b57e8fbbe18c4028172d0c25d202d535f5fcbefe8f184f897c4 -size 55967 +oid sha256:39d28316fb25b1add43ed0ad40c8a79d575dd42bba833a62ab77791885093382 +size 1484 diff --git a/assets/voxygen/voxel/npc/reddragon/male/head_lower.vox b/assets/voxygen/voxel/npc/reddragon/male/head_lower.vox index fdbcf126f6..1ce47773cf 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/head_lower.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/head_lower.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5042f5557d11eda408d490ddf7d3c88819e8c482f5059dcbc06ba08533c4793f -size 56303 +oid sha256:ef6c4e562646a30d91fc83f9cd0a0a4a78e9cbbc323dcaf45befc2b12f71ef4f +size 1820 diff --git a/assets/voxygen/voxel/npc/reddragon/male/head_upper.vox b/assets/voxygen/voxel/npc/reddragon/male/head_upper.vox index 8e81e96e4a..9158bcfbdd 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/head_upper.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/head_upper.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3c3a9bed37327135da85b0fde3317211cf600b2e49d346c694b3f00c7d879487 -size 57067 +oid sha256:a875a8a52f642730f0cf7038a549fa279ed0b36a0d9b2a34b16d05a5ddc12a80 +size 2584 diff --git a/assets/voxygen/voxel/npc/reddragon/male/jaw.vox b/assets/voxygen/voxel/npc/reddragon/male/jaw.vox index 9f38e100f1..012efacc36 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/jaw.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/jaw.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:45506c26b9f83a6adf6505e13414fdd6c69746d0ae088916d54596a11c85ad96 -size 55939 +oid sha256:9d648b59b890e4d3cb7a6c52d65b8d5eb4f259c4584bf96ffe1b78e868f4ca91 +size 1456 diff --git a/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox index 70303d30d9..1e761f5121 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4fbe212043bf1b57e8fbbe18c4028172d0c25d202d535f5fcbefe8f184f897c4 -size 55967 +oid sha256:39d28316fb25b1add43ed0ad40c8a79d575dd42bba833a62ab77791885093382 +size 1484 diff --git a/voxygen/src/anim/dragon/fly.rs b/voxygen/src/anim/dragon/fly.rs index 451f0033be..d6a5698bc7 100644 --- a/voxygen/src/anim/dragon/fly.rs +++ b/voxygen/src/anim/dragon/fly.rs @@ -1,25 +1,16 @@ use super::{super::Animation, DragonSkeleton, SkeletonAttr}; -use std::{f32::consts::PI, ops::Mul}; +use std::f32::consts::PI; use vek::*; pub struct FlyAnimation; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] -const TEST_1: f32 = 0.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] -const TEST_2: f32 = 0.0; -#[const_tweaker::tweak(min = -1.0, max = 1.0, step = 0.01)] -const TEST_3: f32 = 0.0; -#[const_tweaker::tweak(min = -1.0, max = 1.0, step = 0.01)] -const TEST_4: f32 = 0.0; - impl Animation for FlyAnimation { type Dependency = (f32, f64); type Skeleton = DragonSkeleton; fn update_skeleton( skeleton: &Self::Skeleton, - (_velocity, global_time): Self::Dependency, + _global_time: Self::Dependency, anim_time: f64, _rate: &mut f32, skeleton_attr: &SkeletonAttr, @@ -30,49 +21,18 @@ impl Animation for FlyAnimation { let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); - let wave_slow = (anim_time as f32 * 4.5).sin(); - let wave_slow_cos = (anim_time as f32 * 4.5).cos(); + //let wave_slow = (anim_time as f32 * 4.5).sin(); + let wave_slow = (anim_time as f32 * 3.5 + PI).sin(); let wingl = (anim_time as f32 * 2.0 + PI).sin(); let wingr = (anim_time as f32 * 2.0).sin(); - 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); - let vertrb = (anim_time as f32 * lab as f32 + PI).sin().max(0.15); - - let horilf = (anim_time as f32 * lab as f32 + PI * 1.2).sin(); - let horirfoffset = (anim_time as f32 * lab as f32 + PI * 0.20).sin(); - let horilboffset = (anim_time as f32 * lab as f32 + PI * 1.4).sin(); - let horirb = (anim_time as f32 * lab as f32 + PI * 0.4).sin(); - - let vertchest = (anim_time as f32 * lab as f32 + PI * 0.3).sin().max(0.2); - let horichest = (anim_time as f32 * lab as f32 + PI * 0.8).sin(); - let verthead = (anim_time as f32 * lab as f32 + PI * 0.3).sin(); - 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(); - let wolf_look = Vec2::new( - ((global_time + anim_time) as f32 / 4.0) - .floor() - .mul(7331.0) - .sin() - * 0.25, - ((global_time + anim_time) as f32 / 4.0) - .floor() - .mul(1337.0) - .sin() - * 0.125, - ); - - let wave = (anim_time as f32 * 14.0).sin(); - let wave_slow = (anim_time as f32 * 3.5 + PI).sin(); - let wave_stop = (anim_time as f32 * 5.0).min(PI / 2.0).sin(); - next.head_upper.offset = Vec3::new( 0.0, skeleton_attr.head_upper.0, @@ -144,7 +104,7 @@ impl Animation for FlyAnimation { skeleton_attr.feet_f.1, skeleton_attr.feet_f.2, ) * 1.05; - next.foot_fr.ori = Quaternion::rotation_x(-1.3 + footl * 0.06); + next.foot_fr.ori = Quaternion::rotation_x(-1.3 + footr * 0.06); next.foot_fr.scale = Vec3::one() * 1.05; next.foot_bl.offset = Vec3::new( @@ -160,7 +120,7 @@ impl Animation for FlyAnimation { skeleton_attr.feet_b.1, skeleton_attr.feet_b.2, ) * 1.05; - next.foot_br.ori = Quaternion::rotation_x(-1.3 + footl * 0.06); + next.foot_br.ori = Quaternion::rotation_x(-1.3 + footr * 0.06); next.foot_br.scale = Vec3::one() * 1.05; next.wing_in_l.offset = Vec3::new( @@ -168,7 +128,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_l.ori = Quaternion::rotation_y((0.15 + wingl * 0.6).max(0.2)); + next.wing_in_l.ori = Quaternion::rotation_y(0.4 + wingl * 0.6); next.wing_in_l.scale = Vec3::one() * 1.05; next.wing_in_r.offset = Vec3::new( @@ -176,7 +136,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_r.ori = Quaternion::rotation_y((-0.15 + wingr * 0.6).min(0.2)); + next.wing_in_r.ori = Quaternion::rotation_y(-0.4 + wingr * 0.6); next.wing_in_r.scale = Vec3::one() * 1.05; next.wing_out_l.offset = Vec3::new( @@ -184,7 +144,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2, ); - next.wing_out_l.ori = Quaternion::rotation_y((0.35 + wingl * 0.6).max(0.0)); + next.wing_out_l.ori = Quaternion::rotation_y((0.35 + wingl * 0.6).max(0.2)); next.wing_out_l.scale = Vec3::one() * 1.05; next.wing_out_r.offset = Vec3::new( @@ -192,7 +152,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_out.1, skeleton_attr.wing_out.2, ); - next.wing_out_r.ori = Quaternion::rotation_y((-0.35 + wingr * 0.6).min(0.0)); + next.wing_out_r.ori = Quaternion::rotation_y((-0.35 + wingr * 0.6).min(-0.2)); next.wing_out_r.scale = Vec3::one() * 1.05; next diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index 2018abfd00..e7ca885765 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -1,18 +1,9 @@ use super::{super::Animation, DragonSkeleton, SkeletonAttr}; -use std::{f32::consts::PI, ops::Mul}; +use std::ops::Mul; use vek::*; pub struct IdleAnimation; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] -const TEST_R: f32 = 2.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] -const TEST_L: f32 = -2.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] -const OFF1: f32 = -1.4; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.1)] -const OFF2: f32 = -1.4; - impl Animation for IdleAnimation { type Dependency = f64; type Skeleton = DragonSkeleton; @@ -30,7 +21,7 @@ impl Animation for IdleAnimation { let wave_slow = (anim_time as f32 * 2.5).sin(); let wave_slow_cos = (anim_time as f32 * 4.5).cos(); - let look = Vec2::new( + let dragon_look = Vec2::new( ((global_time + anim_time) as f32 / 8.0) .floor() .mul(7331.0) @@ -49,7 +40,7 @@ impl Animation for IdleAnimation { skeleton_attr.head_upper.1 + ultra_slow * 0.20, ) * 1.05; next.head_upper.ori = - Quaternion::rotation_z(0.8 * look.x) * Quaternion::rotation_x(0.8 * look.y); + Quaternion::rotation_z(0.8 * dragon_look.x) * Quaternion::rotation_x(0.8 * dragon_look.y); next.head_upper.scale = Vec3::one() * 1.05; next.head_lower.offset = Vec3::new( @@ -58,7 +49,7 @@ impl Animation for IdleAnimation { skeleton_attr.head_lower.1 + ultra_slow * 0.20, ) * 1.05; next.head_lower.ori = - Quaternion::rotation_z(0.8 * look.x) * Quaternion::rotation_x(0.8 * look.y); + Quaternion::rotation_z(0.8 * dragon_look.x) * Quaternion::rotation_x(0.8 * dragon_look.y); next.head_lower.scale = Vec3::one() * 1.05; next.jaw.offset = Vec3::new( @@ -112,7 +103,7 @@ impl Animation for IdleAnimation { next.wing_out_l.offset = Vec3::new( -skeleton_attr.wing_out.0, skeleton_attr.wing_out.1, - skeleton_attr.wing_out.2 + *OFF1, + skeleton_attr.wing_out.2 - 1.4, ); next.wing_out_l.ori = Quaternion::rotation_y(-0.3);//2.0 next.wing_out_l.scale = Vec3::one() * 1.05; @@ -120,7 +111,7 @@ impl Animation for IdleAnimation { next.wing_out_r.offset = Vec3::new( skeleton_attr.wing_out.0, skeleton_attr.wing_out.1, - skeleton_attr.wing_out.2 + *OFF2, + skeleton_attr.wing_out.2 - 1.4, ); next.wing_out_r.ori = Quaternion::rotation_y(0.3); next.wing_out_r.scale = Vec3::one() * 1.05; diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index 8b8b3bce23..0bfddf8f8d 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -7,6 +7,7 @@ pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; use super::{Bone, Skeleton}; use crate::render::FigureBoneData; +<<<<<<< HEAD use common::comp::{self}; use vek::Vec3; @@ -62,6 +63,9 @@ const FEET_B_X: f32 = 6.0; const FEET_B_Y: f32 = -15.0; #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_B_Z: f32 = 3.0; +======= +use common::comp::{self}; +>>>>>>> Cleanup #[derive(Clone, Default)] pub struct DragonSkeleton { @@ -217,37 +221,37 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { use comp::dragon::Species::*; Self { head_upper: match (body.species, body.body_type) { - (Reddragon, _) => (*HEAD_UPPER_X, *HEAD_UPPER_Z), + (Reddragon, _) => (2.5, 4.5), }, head_lower: match (body.species, body.body_type) { - (Reddragon, _) => (*HEAD_LOWER_X, *HEAD_LOWER_Z), + (Reddragon, _) => (7.5, 3.5), }, jaw: match (body.species, body.body_type) { - (Reddragon, _) => (*JAW_X, *JAW_Z), + (Reddragon, _) => (7.0, -5.0), }, chest_front: match (body.species, body.body_type) { - (Reddragon, _) => (*CHEST_F_X, *CHEST_F_Z), + (Reddragon, _) => (0.0, 14.0), }, chest_rear: match (body.species, body.body_type) { - (Reddragon, _) => (*CHEST_R_X, *CHEST_R_Z), + (Reddragon, _) => (-12.5, 0.0), }, tail_front: match (body.species, body.body_type) { - (Reddragon, _) => (*TAIL_F_X, *TAIL_F_Z), + (Reddragon, _) => (-12.5, 1.5), }, tail_rear: match (body.species, body.body_type) { - (Reddragon, _) => (*TAIL_R_X, *TAIL_R_Z), + (Reddragon, _) => (-14.0, 0.0), }, wing_in: match (body.species, body.body_type) { - (Reddragon, _) => (*WING_IN_X, *WING_IN_Y, *WING_IN_Z), + (Reddragon, _) => (2.5, -16.5, 0.0), }, wing_out: match (body.species, body.body_type) { - (Reddragon, _) => (*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z), + (Reddragon, _) => (23.0, 0.5, 4.0), }, feet_f: match (body.species, body.body_type) { - (Reddragon, _) => (*FEET_F_X, *FEET_F_Y, *FEET_F_Z), + (Reddragon, _) => (6.0, 0.0, 1.5), }, feet_b: match (body.species, body.body_type) { - (Reddragon, _) => (*FEET_B_X, *FEET_B_Y, *FEET_B_Z), + (Reddragon, _) => (6.0, -15.0, 3.0), }, height: match (body.species, body.body_type) { (Reddragon, _) => (1.0), diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index 14a343e94a..6dada1fd5a 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -19,10 +19,8 @@ impl Animation for RunAnimation { let lab = 14; - let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); let wave_slow = (anim_time as f32 * 4.5).sin(); - let wave_slow_cos = (anim_time as f32 * 4.5).cos(); 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); @@ -36,15 +34,11 @@ impl Animation for RunAnimation { let vertchest = (anim_time as f32 * lab as f32 + PI * 0.3).sin().max(0.2); let horichest = (anim_time as f32 * lab as f32 + PI * 0.8).sin(); - let verthead = (anim_time as f32 * lab as f32 + PI * 0.3).sin(); - - 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(); - let wolf_look = Vec2::new( + let dragon_look = Vec2::new( ((global_time + anim_time) as f32 / 4.0) .floor() .mul(7331.0) @@ -63,7 +57,7 @@ impl Animation for RunAnimation { skeleton_attr.head_upper.1, ) * 1.05; next.head_upper.ori = - Quaternion::rotation_x(wolf_look.y) * Quaternion::rotation_z(wolf_look.x); + Quaternion::rotation_x(dragon_look.y) * Quaternion::rotation_z(dragon_look.x); next.head_upper.scale = Vec3::one() * 1.05; next.head_lower.offset = Vec3::new( diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 6edcb4b455..5e3c1f16ea 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1052,7 +1052,7 @@ impl FigureMgr { is_player, ); }, - Body::Dragon(dragon_body) => { + Body::Dragon(_) => { let skeleton_attr = &self .dragon_model_cache .get_or_create_model( @@ -1064,7 +1064,6 @@ impl FigureMgr { None, ) .1; - let ref skeleton_attr = dragon_body.into(); let state = self .dragon_states From 5b77c7449714272fefdccfc9d1f411f6787ee7e4 Mon Sep 17 00:00:00 2001 From: Snowram Date: Sat, 9 May 2020 20:19:01 +0200 Subject: [PATCH 13/19] Add cockatrice --- assets/common/npc_names.json | 4 +++ .../voxel/bird_medium_center_manifest.ron | 28 +++++++++++++++ .../voxel/bird_medium_lateral_manifest.ron | 36 +++++++++++++++++++ .../voxel/npc/cockatrice/female/head.vox | 3 ++ .../voxel/npc/cockatrice/female/leg_l.vox | 3 ++ .../voxel/npc/cockatrice/female/leg_r.vox | 3 ++ .../voxel/npc/cockatrice/female/tail.vox | 3 ++ .../voxel/npc/cockatrice/female/torso.vox | 3 ++ .../voxel/npc/cockatrice/female/wing_l.vox | 3 ++ .../voxel/npc/cockatrice/female/wing_r.vox | 3 ++ .../voxel/npc/cockatrice/male/head.vox | 3 ++ .../voxel/npc/cockatrice/male/leg_l.vox | 3 ++ .../voxel/npc/cockatrice/male/leg_r.vox | 3 ++ .../voxel/npc/cockatrice/male/tail.vox | 3 ++ .../voxel/npc/cockatrice/male/torso.vox | 3 ++ .../voxel/npc/cockatrice/male/wing_l.vox | 3 ++ .../voxel/npc/cockatrice/male/wing_r.vox | 3 ++ common/src/comp/body/bird_medium.rs | 6 +++- voxygen/src/anim/bird_medium/mod.rs | 5 +++ 19 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 assets/voxygen/voxel/npc/cockatrice/female/head.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/female/leg_l.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/female/leg_r.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/female/tail.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/female/torso.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/female/wing_l.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/female/wing_r.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/male/head.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/male/leg_l.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/male/leg_r.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/male/tail.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/male/torso.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/male/wing_l.vox create mode 100644 assets/voxygen/voxel/npc/cockatrice/male/wing_r.vox diff --git a/assets/common/npc_names.json b/assets/common/npc_names.json index 88b237ac4d..8099a24adf 100644 --- a/assets/common/npc_names.json +++ b/assets/common/npc_names.json @@ -475,6 +475,10 @@ "parrot": { "keyword": "parrot", "generic": "Parrot" + }, + "cockatrice": { + "keyword": "cockatrice", + "generic": "Cockatrice" } } }, diff --git a/assets/voxygen/voxel/bird_medium_center_manifest.ron b/assets/voxygen/voxel/bird_medium_center_manifest.ron index d89959dc10..3669a810e7 100644 --- a/assets/voxygen/voxel/bird_medium_center_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_center_manifest.ron @@ -195,4 +195,32 @@ center: ("npc.parrot.female.tail"), ) ), + (Cockatrice, Male): ( + head: ( + offset: (-2.5, -3.5, -8.0), + center: ("npc.cockatrice.male.head"), + ), + torso: ( + offset: (-3.5, -6.5, -7.5), + center: ("npc.cockatrice.male.torso"), + ), + tail: ( + offset: (-1.5, -3.5, -4.0), + center: ("npc.cockatrice.male.tail"), + ) + ), + (Cockatrice, Female): ( + head: ( + offset: (-2.5, -3.5, -8.0), + center: ("npc.cockatrice.female.head"), + ), + torso: ( + offset: (-3.5, -6.5, -7.5), + center: ("npc.cockatrice.female.torso"), + ), + tail: ( + offset: (-1.5, -3.5, -4.0), + center: ("npc.cockatrice.female.tail"), + ) + ), }) \ No newline at end of file diff --git a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron index fcde79c0ca..a2ae6f8b6d 100644 --- a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron @@ -251,4 +251,40 @@ lateral: ("npc.parrot.female.leg_r"), ) ), + (Cockatrice, Male): ( + wing_l: ( + offset: (-2.0, -3.0, -9.0), + lateral: ("npc.cockatrice.male.wing_l"), + ), + wing_r: ( + offset: (-2.0, -3.0, -9.0), + lateral: ("npc.cockatrice.male.wing_r"), + ), + foot_l: ( + offset: (-2.5, 0.0, -12.0), + lateral: ("npc.cockatrice.male.leg_l"), + ), + foot_r: ( + offset: (-2.5, 0.0, -12.0), + lateral: ("npc.cockatrice.male.leg_r"), + ) + ), + (Cockatrice, Female): ( + wing_l: ( + offset: (-2.0, -3.0, -9.0), + lateral: ("npc.cockatrice.female.wing_l"), + ), + wing_r: ( + offset: (-2.0, -3.0, -9.0), + lateral: ("npc.cockatrice.female.wing_r"), + ), + foot_l: ( + offset: (-2.5, 0.0, -12.0), + lateral: ("npc.cockatrice.female.leg_l"), + ), + foot_r: ( + offset: (-2.5, 0.0, -12.0), + lateral: ("npc.cockatrice.female.leg_r"), + ) + ), }) \ No newline at end of file diff --git a/assets/voxygen/voxel/npc/cockatrice/female/head.vox b/assets/voxygen/voxel/npc/cockatrice/female/head.vox new file mode 100644 index 0000000000..4df45a0d07 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/female/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5103831b0b9c38ba8d8464266aa55da2b765cc5843a083cb8ce70f4cd9242c56 +size 1952 diff --git a/assets/voxygen/voxel/npc/cockatrice/female/leg_l.vox b/assets/voxygen/voxel/npc/cockatrice/female/leg_l.vox new file mode 100644 index 0000000000..359c82e0a5 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/female/leg_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:957eac8c94bb878c3f6cea3a199991b4997a8caacb407ba081da834150ef1d25 +size 1364 diff --git a/assets/voxygen/voxel/npc/cockatrice/female/leg_r.vox b/assets/voxygen/voxel/npc/cockatrice/female/leg_r.vox new file mode 100644 index 0000000000..e68e4781a1 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/female/leg_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b95667bdfa3818583fa968a101f4bf39219f0488d4f7cf05f05374b7251ef3f6 +size 1364 diff --git a/assets/voxygen/voxel/npc/cockatrice/female/tail.vox b/assets/voxygen/voxel/npc/cockatrice/female/tail.vox new file mode 100644 index 0000000000..dad94dedf5 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/female/tail.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0267a7da9724b1c8c6c7c2b7657d828897205af3c0c7b6d9a98861abf8f0baf8 +size 1216 diff --git a/assets/voxygen/voxel/npc/cockatrice/female/torso.vox b/assets/voxygen/voxel/npc/cockatrice/female/torso.vox new file mode 100644 index 0000000000..a4c118f9b3 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/female/torso.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fb4738f22d69176aea93efd95993f47e6a32cdd45c14435ef29bfd3f795fa46 +size 3048 diff --git a/assets/voxygen/voxel/npc/cockatrice/female/wing_l.vox b/assets/voxygen/voxel/npc/cockatrice/female/wing_l.vox new file mode 100644 index 0000000000..02ab02c2d1 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/female/wing_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9827918d715cbf23b4f3441905243ed196d917d83a92a6946d2100243e694d15 +size 1212 diff --git a/assets/voxygen/voxel/npc/cockatrice/female/wing_r.vox b/assets/voxygen/voxel/npc/cockatrice/female/wing_r.vox new file mode 100644 index 0000000000..8ea51d1c13 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/female/wing_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc0aed5d4195504288f7be8063bbb1e1058d7ae65bbd570ae97276b009c54318 +size 1212 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/head.vox b/assets/voxygen/voxel/npc/cockatrice/male/head.vox new file mode 100644 index 0000000000..4df45a0d07 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/male/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5103831b0b9c38ba8d8464266aa55da2b765cc5843a083cb8ce70f4cd9242c56 +size 1952 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/leg_l.vox b/assets/voxygen/voxel/npc/cockatrice/male/leg_l.vox new file mode 100644 index 0000000000..359c82e0a5 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/male/leg_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:957eac8c94bb878c3f6cea3a199991b4997a8caacb407ba081da834150ef1d25 +size 1364 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/leg_r.vox b/assets/voxygen/voxel/npc/cockatrice/male/leg_r.vox new file mode 100644 index 0000000000..e68e4781a1 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/male/leg_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b95667bdfa3818583fa968a101f4bf39219f0488d4f7cf05f05374b7251ef3f6 +size 1364 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/tail.vox b/assets/voxygen/voxel/npc/cockatrice/male/tail.vox new file mode 100644 index 0000000000..dad94dedf5 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/male/tail.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0267a7da9724b1c8c6c7c2b7657d828897205af3c0c7b6d9a98861abf8f0baf8 +size 1216 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/torso.vox b/assets/voxygen/voxel/npc/cockatrice/male/torso.vox new file mode 100644 index 0000000000..a4c118f9b3 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/male/torso.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8fb4738f22d69176aea93efd95993f47e6a32cdd45c14435ef29bfd3f795fa46 +size 3048 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/wing_l.vox b/assets/voxygen/voxel/npc/cockatrice/male/wing_l.vox new file mode 100644 index 0000000000..02ab02c2d1 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/male/wing_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9827918d715cbf23b4f3441905243ed196d917d83a92a6946d2100243e694d15 +size 1212 diff --git a/assets/voxygen/voxel/npc/cockatrice/male/wing_r.vox b/assets/voxygen/voxel/npc/cockatrice/male/wing_r.vox new file mode 100644 index 0000000000..8ea51d1c13 --- /dev/null +++ b/assets/voxygen/voxel/npc/cockatrice/male/wing_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bc0aed5d4195504288f7be8063bbb1e1058d7ae65bbd570ae97276b009c54318 +size 1212 diff --git a/common/src/comp/body/bird_medium.rs b/common/src/comp/body/bird_medium.rs index 363c6c1867..10c7e17966 100644 --- a/common/src/comp/body/bird_medium.rs +++ b/common/src/comp/body/bird_medium.rs @@ -34,6 +34,7 @@ pub enum Species { Eagle = 4, Snowyowl = 5, Parrot = 6, + Cockatrice = 7, } /// Data representing per-species generic data. @@ -48,6 +49,7 @@ pub struct AllSpecies { pub eagle: SpeciesMeta, pub snowyowl: SpeciesMeta, pub parrot: SpeciesMeta, + pub cockatrice: SpeciesMeta, } impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies { @@ -63,11 +65,12 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies Species::Eagle => &self.eagle, Species::Snowyowl => &self.snowyowl, Species::Parrot => &self.parrot, + Species::Cockatrice => &self.cockatrice, } } } -pub const ALL_SPECIES: [Species; 7] = [ +pub const ALL_SPECIES: [Species; 8] = [ Species::Duck, Species::Chicken, Species::Goose, @@ -75,6 +78,7 @@ pub const ALL_SPECIES: [Species; 7] = [ Species::Eagle, Species::Snowyowl, Species::Parrot, + Species::Cockatrice, ]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { diff --git a/voxygen/src/anim/bird_medium/mod.rs b/voxygen/src/anim/bird_medium/mod.rs index 576dd70c8f..9d561c477a 100644 --- a/voxygen/src/anim/bird_medium/mod.rs +++ b/voxygen/src/anim/bird_medium/mod.rs @@ -110,6 +110,7 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr { (Eagle, _) => (2.5, 5.0), (Snowyowl, _) => (2.5, 5.0), (Parrot, _) => (0.5, 4.5), + (Cockatrice, _) => (3.0, 4.0), }, chest: match (body.species, body.body_type) { (Duck, _) => (0.0, 5.0), @@ -119,6 +120,7 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr { (Eagle, _) => (0.0, 8.0), (Snowyowl, _) => (0.0, 4.5), (Parrot, _) => (0.0, 5.0), + (Cockatrice, _) => (0.0, 12.5), }, tail: match (body.species, body.body_type) { (Duck, _) => (-3.0, 1.5), @@ -128,6 +130,7 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr { (Eagle, _) => (-8.0, -4.0), (Snowyowl, _) => (-6.0, -2.0), (Parrot, _) => (-8.0, -2.0), + (Cockatrice, _) => (-10.0, -2.5), }, wing: match (body.species, body.body_type) { (Duck, _) => (2.75, 0.0, 1.0), @@ -137,6 +140,7 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr { (Eagle, _) => (3.0, -8.0, 4.0), (Snowyowl, _) => (3.5, -5.5, 4.0), (Parrot, _) => (2.0, -4.5, 3.0), + (Cockatrice, _) => (4.5, -2.5, 1.5), }, foot: match (body.species, body.body_type) { (Duck, _) => (2.0, -1.5, 4.0), @@ -146,6 +150,7 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr { (Eagle, _) => (2.0, -2.0, 8.0), (Snowyowl, _) => (1.5, -2.5, 7.0), (Parrot, _) => (1.5, -3.0, 3.0), + (Cockatrice, _) => (4.0, -3.5, 12.0), }, } } From 62bd79dba7817cb5ac4166c5b2e1b59f85cb11bf Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sat, 9 May 2020 18:01:49 -0400 Subject: [PATCH 14/19] dragon and general animation cleanup --- .../voxel/biped_large_lateral_manifest.ron | 8 +- .../voxygen/voxel/dragon_center_manifest.ron | 8 +- .../voxygen/voxel/npc/ogre/female/foot_l.vox | 4 +- .../voxygen/voxel/npc/ogre/female/foot_r.vox | 4 +- assets/voxygen/voxel/npc/ogre/male/foot_l.vox | 4 +- assets/voxygen/voxel/npc/ogre/male/foot_r.vox | 4 +- .../voxygen/voxel/sprite/lianas/liana-0.vox | 4 +- .../voxygen/voxel/sprite/lianas/liana-1.vox | 4 +- common/src/npc.rs | 2 +- voxygen/src/anim/biped_large/mod.rs | 226 ++++++++---------- voxygen/src/anim/biped_large/run.rs | 4 +- voxygen/src/anim/character/alpha.rs | 46 +--- voxygen/src/anim/character/beta.rs | 6 - voxygen/src/anim/character/charge.rs | 19 +- voxygen/src/anim/character/roll.rs | 29 +-- voxygen/src/anim/character/run.rs | 7 +- voxygen/src/anim/character/shoot.rs | 15 +- voxygen/src/anim/character/sit.rs | 2 - voxygen/src/anim/character/swim.rs | 9 +- voxygen/src/anim/character/wield.rs | 16 +- voxygen/src/anim/dragon/fly.rs | 43 ++-- voxygen/src/anim/dragon/idle.rs | 66 ++--- voxygen/src/anim/dragon/mod.rs | 4 +- voxygen/src/anim/dragon/run.rs | 44 ++-- 24 files changed, 231 insertions(+), 347 deletions(-) diff --git a/assets/voxygen/voxel/biped_large_lateral_manifest.ron b/assets/voxygen/voxel/biped_large_lateral_manifest.ron index c160ae3bea..0bae9fb070 100644 --- a/assets/voxygen/voxel/biped_large_lateral_manifest.ron +++ b/assets/voxygen/voxel/biped_large_lateral_manifest.ron @@ -25,11 +25,11 @@ lateral: ("npc.ogre.male.leg_r"), ), foot_l: ( - offset: (-3.0, -5.0, -3.0), + offset: (-3.0, -5.0, -2.5), lateral: ("npc.ogre.male.foot_l"), ), foot_r: ( - offset: (-3.0, -5.0, -3.0), + offset: (-3.0, -5.0, -2.5), lateral: ("npc.ogre.male.foot_r"), ) ), @@ -59,11 +59,11 @@ lateral: ("npc.ogre.female.leg_r"), ), foot_l: ( - offset: (-3.0, -5.0, -3.0), + offset: (-3.0, -5.0, -2.5), lateral: ("npc.ogre.female.foot_l"), ), foot_r: ( - offset: (-3.0, -5.0, -3.0), + offset: (-3.0, -5.0, -2.5), lateral: ("npc.ogre.female.foot_r"), ) ), diff --git a/assets/voxygen/voxel/dragon_center_manifest.ron b/assets/voxygen/voxel/dragon_center_manifest.ron index af89c71348..3414c90782 100644 --- a/assets/voxygen/voxel/dragon_center_manifest.ron +++ b/assets/voxygen/voxel/dragon_center_manifest.ron @@ -21,11 +21,11 @@ center: ("npc.reddragon.male.chest_rear"), ), tail_front: ( - offset: (-2.5, -6.0, -3.5), + offset: (-2.5, -12.0, -3.5), center: ("npc.reddragon.male.tail_front"), ), tail_rear: ( - offset: (-3.5, -8.0, -3.0), + offset: (-3.5, -16.0, -3.0), center: ("npc.reddragon.male.tail_rear"), ) ), @@ -51,11 +51,11 @@ center: ("npc.reddragon.female.chest_rear"), ), tail_front: ( - offset: (-2.5, -6.0, -3.5), + offset: (-2.5, -12.0, -3.5), center: ("npc.reddragon.female.tail_front"), ), tail_rear: ( - offset: (-3.5, -8.0, -3.0), + offset: (-3.5, -16.0, -3.0), center: ("npc.reddragon.female.tail_rear"), ) ), diff --git a/assets/voxygen/voxel/npc/ogre/female/foot_l.vox b/assets/voxygen/voxel/npc/ogre/female/foot_l.vox index 81805a5c5e..da08707ccf 100644 --- a/assets/voxygen/voxel/npc/ogre/female/foot_l.vox +++ b/assets/voxygen/voxel/npc/ogre/female/foot_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:49c49b6e8a68a9b0d5f5a0ed80d5fcfe34cbc8d86a720a138d516ca0719956d0 -size 2108 +oid sha256:90c4cefc79271e1b15fa674874109b06ee0379812cdb9a2f2864eab9b13a18d7 +size 1896 diff --git a/assets/voxygen/voxel/npc/ogre/female/foot_r.vox b/assets/voxygen/voxel/npc/ogre/female/foot_r.vox index f12850c7ff..5733f55e35 100644 --- a/assets/voxygen/voxel/npc/ogre/female/foot_r.vox +++ b/assets/voxygen/voxel/npc/ogre/female/foot_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9e0441d49a30592fe48044e83ac30e550848e5da1135a9a35dfe480bd4ba4b70 -size 2108 +oid sha256:1540d676c5a0be0b87079c5b95c9336dbfe938e66062e535437e69cff3669c47 +size 1896 diff --git a/assets/voxygen/voxel/npc/ogre/male/foot_l.vox b/assets/voxygen/voxel/npc/ogre/male/foot_l.vox index 81805a5c5e..da08707ccf 100644 --- a/assets/voxygen/voxel/npc/ogre/male/foot_l.vox +++ b/assets/voxygen/voxel/npc/ogre/male/foot_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:49c49b6e8a68a9b0d5f5a0ed80d5fcfe34cbc8d86a720a138d516ca0719956d0 -size 2108 +oid sha256:90c4cefc79271e1b15fa674874109b06ee0379812cdb9a2f2864eab9b13a18d7 +size 1896 diff --git a/assets/voxygen/voxel/npc/ogre/male/foot_r.vox b/assets/voxygen/voxel/npc/ogre/male/foot_r.vox index f12850c7ff..5733f55e35 100644 --- a/assets/voxygen/voxel/npc/ogre/male/foot_r.vox +++ b/assets/voxygen/voxel/npc/ogre/male/foot_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9e0441d49a30592fe48044e83ac30e550848e5da1135a9a35dfe480bd4ba4b70 -size 2108 +oid sha256:1540d676c5a0be0b87079c5b95c9336dbfe938e66062e535437e69cff3669c47 +size 1896 diff --git a/assets/voxygen/voxel/sprite/lianas/liana-0.vox b/assets/voxygen/voxel/sprite/lianas/liana-0.vox index 7c41f0ff64..dbd9c9c832 100644 --- a/assets/voxygen/voxel/sprite/lianas/liana-0.vox +++ b/assets/voxygen/voxel/sprite/lianas/liana-0.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a814d732fb05062d88a69ca031a44ca0a7602d8176c4c2f7bd2fa297b5b6983f -size 1504 +oid sha256:70b967bda0f650f6f9ed021e984bf84a8d5077a51444229c1860583de5b2853e +size 2308 diff --git a/assets/voxygen/voxel/sprite/lianas/liana-1.vox b/assets/voxygen/voxel/sprite/lianas/liana-1.vox index 91a84ddfcf..2a9cadfc36 100644 --- a/assets/voxygen/voxel/sprite/lianas/liana-1.vox +++ b/assets/voxygen/voxel/sprite/lianas/liana-1.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aba2b0f74360c68d55869aa119bc8d12be11b31f8e4d7841938e1b7f98ddd2b6 -size 1432 +oid sha256:6f02677ee40faa6ab0b9c1e57cb5e2d8170e1f47b96c24e7a31767f53d61e970 +size 1804 diff --git a/common/src/npc.rs b/common/src/npc.rs index 97d42e9b43..2d5d72b5fc 100644 --- a/common/src/npc.rs +++ b/common/src/npc.rs @@ -93,7 +93,7 @@ pub fn kind_to_body(kind: NpcKind) -> Body { NpcKind::Ogre => comp::biped_large::Body::random().into(), NpcKind::Rat => comp::critter::Body::random().into(), NpcKind::StoneGolem => comp::golem::Body::random().into(), - NpcKind::Reddragon => comp::critter::Body::random().into(), + NpcKind::Reddragon => comp::dragon::Body::random().into(), } } diff --git a/voxygen/src/anim/biped_large/mod.rs b/voxygen/src/anim/biped_large/mod.rs index 8438ef999a..e8cc220218 100644 --- a/voxygen/src/anim/biped_large/mod.rs +++ b/voxygen/src/anim/biped_large/mod.rs @@ -1,114 +1,108 @@ -pub mod fly; pub mod idle; +pub mod jump; pub mod run; // Reexports -pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; +pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; use super::{Bone, Skeleton}; use crate::render::FigureBoneData; use common::comp::{self}; -#[derive(Clone, Default)] -pub struct DragonSkeleton { - head_upper: Bone, - head_lower: Bone, - jaw: Bone, - chest_front: Bone, - chest_rear: Bone, - tail_front: Bone, - tail_rear: Bone, - wing_in_l: Bone, - wing_in_r: Bone, - wing_out_l: Bone, - wing_out_r: Bone, - foot_fl: Bone, - foot_fr: Bone, - foot_bl: Bone, - foot_br: Bone, +#[derive(Clone)] +pub struct BipedLargeSkeleton { + head: Bone, + upper_torso: Bone, + lower_torso: Bone, + shoulder_l: Bone, + shoulder_r: Bone, + hand_l: Bone, + hand_r: Bone, + leg_l: Bone, + leg_r: Bone, + foot_l: Bone, + foot_r: Bone, + torso: Bone, } -impl DragonSkeleton { - pub fn new() -> Self { Self::default() } +impl BipedLargeSkeleton { + pub fn new() -> Self { + Self { + head: Bone::default(), + upper_torso: Bone::default(), + lower_torso: Bone::default(), + shoulder_l: Bone::default(), + shoulder_r: Bone::default(), + hand_l: Bone::default(), + hand_r: Bone::default(), + leg_l: Bone::default(), + leg_r: Bone::default(), + foot_l: Bone::default(), + foot_r: Bone::default(), + torso: Bone::default(), + } + } } -impl Skeleton for DragonSkeleton { +impl Skeleton for BipedLargeSkeleton { type Attr = SkeletonAttr; - fn bone_count(&self) -> usize { 15 } + fn bone_count(&self) -> usize { 11 } fn compute_matrices(&self) -> [FigureBoneData; 16] { - let head_upper_mat = self.head_upper.compute_base_matrix(); - let head_lower_mat = self.head_lower.compute_base_matrix(); - let chest_front_mat = self.chest_front.compute_base_matrix(); - let chest_rear_mat = self.chest_rear.compute_base_matrix(); - let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); - let wing_in_r_mat = self.wing_in_r.compute_base_matrix(); - let tail_front_mat = self.tail_front.compute_base_matrix(); + let upper_torso_mat = self.upper_torso.compute_base_matrix(); + let shoulder_l_mat = self.shoulder_l.compute_base_matrix(); + 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(chest_front_mat * head_lower_mat * head_upper_mat), - FigureBoneData::new(chest_front_mat * head_lower_mat), + FigureBoneData::new(torso_mat * upper_torso_mat * self.head.compute_base_matrix()), + FigureBoneData::new(torso_mat * upper_torso_mat), FigureBoneData::new( - chest_front_mat * head_lower_mat * head_upper_mat * self.jaw.compute_base_matrix(), + torso_mat * upper_torso_mat * self.lower_torso.compute_base_matrix(), ), - FigureBoneData::new(chest_front_mat), - FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix()), - FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat), - FigureBoneData::new( - chest_front_mat - * chest_rear_mat - * tail_front_mat - * self.tail_rear.compute_base_matrix(), - ), - FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), - FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), - FigureBoneData::new( - chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix(), - ), - FigureBoneData::new( - chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix(), - ), - FigureBoneData::new(self.foot_fl.compute_base_matrix()), - FigureBoneData::new(self.foot_fr.compute_base_matrix()), - FigureBoneData::new(self.foot_bl.compute_base_matrix()), - FigureBoneData::new(self.foot_br.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 * self.hand_l.compute_base_matrix()), + FigureBoneData::new(torso_mat * upper_torso_mat * self.hand_r.compute_base_matrix()), + FigureBoneData::new(torso_mat * upper_torso_mat * leg_l_mat), + FigureBoneData::new(torso_mat * upper_torso_mat * leg_r_mat), + FigureBoneData::new(self.foot_l.compute_base_matrix()), + FigureBoneData::new(self.foot_r.compute_base_matrix()), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), FigureBoneData::default(), ] } fn interpolate(&mut self, target: &Self, dt: f32) { - self.head_upper.interpolate(&target.head_upper, dt); - self.head_lower.interpolate(&target.head_lower, dt); - self.jaw.interpolate(&target.jaw, dt); - self.chest_front.interpolate(&target.chest_front, dt); - self.chest_rear.interpolate(&target.chest_rear, dt); - self.tail_front.interpolate(&target.tail_front, dt); - self.tail_rear.interpolate(&target.tail_rear, dt); - self.wing_in_l.interpolate(&target.wing_in_l, dt); - self.wing_in_r.interpolate(&target.wing_in_r, dt); - self.wing_out_l.interpolate(&target.wing_out_l, dt); - self.wing_out_r.interpolate(&target.wing_out_r, dt); - self.foot_fl.interpolate(&target.foot_fl, dt); - self.foot_fr.interpolate(&target.foot_fr, dt); - self.foot_bl.interpolate(&target.foot_bl, dt); - self.foot_br.interpolate(&target.foot_br, dt); + self.head.interpolate(&target.head, dt); + self.upper_torso.interpolate(&target.upper_torso, dt); + self.lower_torso.interpolate(&target.lower_torso, dt); + self.shoulder_l.interpolate(&target.shoulder_l, dt); + self.shoulder_r.interpolate(&target.shoulder_r, dt); + self.hand_l.interpolate(&target.hand_l, dt); + self.hand_r.interpolate(&target.hand_r, dt); + self.leg_l.interpolate(&target.leg_l, dt); + 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 { - head_upper: (f32, f32), - head_lower: (f32, f32), - jaw: (f32, f32), - chest_front: (f32, f32), - chest_rear: (f32, f32), - tail_front: (f32, f32), - tail_rear: (f32, f32), - wing_in: (f32, f32, f32), - wing_out: (f32, f32, f32), - feet_f: (f32, f32, f32), - feet_b: (f32, f32, f32), - height: f32, + 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 { @@ -116,7 +110,7 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { fn try_from(body: &'a comp::Body) -> Result { match body { - comp::Body::Dragon(body) => Ok(SkeletonAttr::from(body)), + comp::Body::BipedLarge(body) => Ok(SkeletonAttr::from(body)), _ => Err(()), } } @@ -125,61 +119,41 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { impl Default for SkeletonAttr { fn default() -> Self { Self { - head_upper: (0.0, 0.0), - head_lower: (0.0, 0.0), - jaw: (0.0, 0.0), - chest_front: (0.0, 0.0), - chest_rear: (0.0, 0.0), - tail_front: (0.0, 0.0), - tail_rear: (0.0, 0.0), - wing_in: (0.0, 0.0, 0.0), - wing_out: (0.0, 0.0, 0.0), - feet_f: (0.0, 0.0, 0.0), - feet_b: (0.0, 0.0, 0.0), - height: (0.0), + 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::dragon::Body> for SkeletonAttr { - fn from(body: &'a comp::dragon::Body) -> Self { - use comp::dragon::Species::*; +impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr { + fn from(body: &'a comp::biped_large::Body) -> Self { + use comp::biped_large::Species::*; Self { - head_upper: match (body.species, body.body_type) { - (Reddragon, _) => (2.5, 4.5), + head: match (body.species, body.body_type) { + (Ogre, _) => (3.0, 6.0), }, - head_lower: match (body.species, body.body_type) { - (Reddragon, _) => (7.5, 3.5), + upper_torso: match (body.species, body.body_type) { + (Ogre, _) => (0.0, 19.0), }, - jaw: match (body.species, body.body_type) { - (Reddragon, _) => (7.0, -5.0), + lower_torso: match (body.species, body.body_type) { + (Ogre, _) => (1.0, -9.5), }, - chest_front: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 14.0), + shoulder: match (body.species, body.body_type) { + (Ogre, _) => (6.1, 0.5, 2.5), }, - chest_rear: match (body.species, body.body_type) { - (Reddragon, _) => (-12.5, 0.0), + hand: match (body.species, body.body_type) { + (Ogre, _) => (10.5, -1.0, -0.5), }, - tail_front: match (body.species, body.body_type) { - (Reddragon, _) => (-6.5, 1.5), + leg: match (body.species, body.body_type) { + (Ogre, _) => (0.0, 0.0, -6.0), }, - tail_rear: match (body.species, body.body_type) { - (Reddragon, _) => (-11.5, -1.0), - }, - wing_in: match (body.species, body.body_type) { - (Reddragon, _) => (2.5, -16.5, 0.0), - }, - wing_out: match (body.species, body.body_type) { - (Reddragon, _) => (23.0, 0.5, 4.0), - }, - feet_f: match (body.species, body.body_type) { - (Reddragon, _) => (6.0, 0.0, 1.5), - }, - feet_b: match (body.species, body.body_type) { - (Reddragon, _) => (6.0, -15.0, 3.0), - }, - height: match (body.species, body.body_type) { - (Reddragon, _) => (1.0), + foot: match (body.species, body.body_type) { + (Ogre, _) => (4.0, 0.5, 2.5), }, } } diff --git a/voxygen/src/anim/biped_large/run.rs b/voxygen/src/anim/biped_large/run.rs index 61a1596023..6927c85cbf 100644 --- a/voxygen/src/anim/biped_large/run.rs +++ b/voxygen/src/anim/biped_large/run.rs @@ -41,7 +41,7 @@ impl Animation for RunAnimation { * ((anim_time as f32 * lab as f32 + PI * 0.4).sin()); next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; - next.head.ori = Quaternion::rotation_z(belt * -0.3) * Quaternion::rotation_x(0.3); + next.head.ori = Quaternion::rotation_z(belt * -0.3) * Quaternion::rotation_x(0.1); next.head.scale = Vec3::one() * 1.02; next.upper_torso.offset = Vec3::new( @@ -132,7 +132,7 @@ impl Animation for RunAnimation { next.foot_r.scale = Vec3::one() / 8.0 * 0.98; next.torso.offset = Vec3::new(0.0, 0.0, beltsnap * 0.25); - next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2); + next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.13); next.torso.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/alpha.rs b/voxygen/src/anim/character/alpha.rs index 42adecb5e5..ccd2498d73 100644 --- a/voxygen/src/anim/character/alpha.rs +++ b/voxygen/src/anim/character/alpha.rs @@ -68,11 +68,9 @@ impl Animation for AlphaAnimation { next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0, skeleton_attr.belt.1); next.belt.ori = next.chest.ori * -0.3; - next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0, skeleton_attr.shorts.1); next.shorts.ori = next.chest.ori * -0.45; - next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new(-0.25, -5.0, 1.0); next.l_hand.ori = Quaternion::rotation_x(1.27); @@ -84,7 +82,6 @@ impl Animation for AlphaAnimation { next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-10.0 + push * 5.0, 6.0 + push * 5.0, 2.0); next.control.ori = Quaternion::rotation_x(-1.4 + slow * 0.4) @@ -130,11 +127,9 @@ impl Animation for AlphaAnimation { next.belt.offset = Vec3::new(0.0, 0.0, -2.0); next.belt.ori = next.chest.ori * -0.2; - next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); next.shorts.ori = next.chest.ori * -0.15; - next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new(-4.0, 3.0, 2.0); next.l_hand.ori = Quaternion::rotation_x(-0.3) @@ -150,7 +145,6 @@ impl Animation for AlphaAnimation { next.main.ori = Quaternion::rotation_x(1.27) * Quaternion::rotation_y(-0.3) * Quaternion::rotation_z(-0.8); - next.main.scale = Vec3::one(); next.lantern.ori = Quaternion::rotation_x(slowax * -0.7 + 0.4) * Quaternion::rotation_y(slowax * 0.4); @@ -174,10 +168,7 @@ impl Animation for AlphaAnimation { next.r_hand.ori = Quaternion::rotation_x(1.27); next.r_hand.scale = Vec3::one() * 1.05; next.main.offset = Vec3::new(0.0, 6.0, -1.0); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); + next.main.ori = Quaternion::rotation_x(-0.3); next.head.offset = Vec3::new(0.0, -2.0 + skeleton_attr.head.0, skeleton_attr.head.1); next.head.ori = Quaternion::rotation_z(slower * 0.05) @@ -189,23 +180,18 @@ impl Animation for AlphaAnimation { next.chest.ori = Quaternion::rotation_z(slower * 0.2) * Quaternion::rotation_x(0.0 + slower * 0.2) * Quaternion::rotation_y(slower * 0.2); - next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, 0.0, -2.0); next.belt.ori = next.chest.ori * -0.2; - next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); next.shorts.ori = next.chest.ori * -0.15; - next.shorts.scale = Vec3::one(); next.lantern.ori = Quaternion::rotation_x(slower * -0.7 + 0.4) * Quaternion::rotation_y(slower * 0.4); next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_z(0.0) - * Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0); + next.torso.ori = Quaternion::rotation_z(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; if velocity > 0.5 { @@ -232,9 +218,7 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_z((slower * 0.5).max(0.0)); next.r_foot.scale = Vec3::one(); next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_z(0.0) - * Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0); + next.torso.ori = Quaternion::rotation_z(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; } @@ -245,9 +229,7 @@ impl Animation for AlphaAnimation { next.control.scale = Vec3::one(); next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_z(0.0) - * Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0); + next.torso.ori = Quaternion::rotation_z(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; }, Some(ToolKind::Staff(_)) => { @@ -272,7 +254,6 @@ impl Animation for AlphaAnimation { next.shorts.ori = Quaternion::rotation_z(decel * -0.08) * Quaternion::rotation_x(0.0 + decel * -0.08) * Quaternion::rotation_y(decel * 0.08); - next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new(0.0, 1.0, 0.0); next.l_hand.ori = Quaternion::rotation_x(1.27); next.l_hand.scale = Vec3::one() * 1.05; @@ -281,7 +262,6 @@ impl Animation for AlphaAnimation { next.r_hand.scale = Vec3::one() * 1.05; next.main.offset = Vec3::new(0.0, 6.0, -4.0); next.main.ori = Quaternion::rotation_x(-0.3); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-8.0 - slow * 1.0, 3.0 - slow * 5.0, 0.0); next.control.ori = Quaternion::rotation_x(-1.2) @@ -306,19 +286,16 @@ impl Animation for AlphaAnimation { next.chest.ori = Quaternion::rotation_z(decel * -0.2) * Quaternion::rotation_x(0.0 + decel * -0.2) * Quaternion::rotation_y(decel * 0.2); - next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, 0.0, 5.0); next.belt.ori = Quaternion::rotation_z(decel * -0.1) * Quaternion::rotation_x(0.0 + decel * -0.1) * Quaternion::rotation_y(decel * 0.1); - next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, 0.0, 2.0); next.belt.ori = Quaternion::rotation_z(decel * -0.08) * Quaternion::rotation_x(0.0 + decel * -0.08) * Quaternion::rotation_y(decel * 0.08); - next.shorts.scale = Vec3::one(); 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) @@ -337,7 +314,6 @@ impl Animation for AlphaAnimation { 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.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; }, @@ -358,15 +334,15 @@ impl Animation for AlphaAnimation { 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); + * Quaternion::rotation_x(accel_med * -0.8) + * Quaternion::rotation_y(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); + * Quaternion::rotation_x(accel_med * -0.8) + * Quaternion::rotation_y(accel_med * -0.4); next.r_hand.scale = Vec3::one() * 1.01; next.main.offset = Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); @@ -386,17 +362,11 @@ impl Animation for AlphaAnimation { skeleton_attr.lantern.2, ); next.lantern.scale = Vec3::one() * 0.65; - next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.scale = Vec3::one() * 1.1; - next.glider.offset = Vec3::new(0.0, 0.0, 10.0); - next.glider.scale = Vec3::one() * 0.0; - next.l_control.scale = Vec3::one(); - next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/beta.rs b/voxygen/src/anim/character/beta.rs index 4cd099e1cf..edcc59f6f5 100644 --- a/voxygen/src/anim/character/beta.rs +++ b/voxygen/src/anim/character/beta.rs @@ -52,19 +52,16 @@ impl Animation for BetaAnimation { next.chest.ori = Quaternion::rotation_z(slow * 0.2) * Quaternion::rotation_x(slow * 0.2) * Quaternion::rotation_y(slow * -0.1); - next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, 0.0, -2.0); next.belt.ori = Quaternion::rotation_z(slow * 0.1) * Quaternion::rotation_x(slow * 0.1) * Quaternion::rotation_y(slow * -0.04); - next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); next.shorts.ori = Quaternion::rotation_z(slow * 0.1) * Quaternion::rotation_x(slow * 0.1) * Quaternion::rotation_y(slow * -0.05); - next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new(0.0, 1.0, 0.0); next.l_hand.ori = Quaternion::rotation_x(1.27); @@ -74,7 +71,6 @@ impl Animation for BetaAnimation { next.r_hand.scale = Vec3::one() * 1.05; next.main.offset = Vec3::new(0.0, 6.0, -1.0); next.main.ori = Quaternion::rotation_x(-0.3); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-8.0 + slow * 1.5, 1.5 + slow * 1.0, 0.0); next.control.ori = Quaternion::rotation_x(-1.4) @@ -84,12 +80,10 @@ impl Animation for BetaAnimation { next.l_foot.offset = Vec3::new(-3.4, footquick * -9.5, 8.0); next.l_foot.ori = Quaternion::rotation_x(footquick * 0.3) * Quaternion::rotation_y(footquick * -0.6); - next.l_foot.scale = Vec3::one(); next.r_foot.offset = Vec3::new(3.4, footquick * 9.5, 8.0); next.r_foot.ori = Quaternion::rotation_x(footquick * -0.3) * Quaternion::rotation_y(footquick * 0.2); - next.r_foot.scale = Vec3::one(); next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; }, diff --git a/voxygen/src/anim/character/charge.rs b/voxygen/src/anim/character/charge.rs index 9ad1c25605..8dc41c0189 100644 --- a/voxygen/src/anim/character/charge.rs +++ b/voxygen/src/anim/character/charge.rs @@ -58,18 +58,13 @@ impl Animation for ChargeAnimation { next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, skeleton_attr.chest.0, skeleton_attr.chest.1); - next.chest.ori = Quaternion::rotation_z(stop * 1.2 + stress * stop * 0.02) - * Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0); - next.chest.scale = Vec3::one(); + next.chest.ori = Quaternion::rotation_z(stop * 1.2 + stress * stop * 0.02); next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0, skeleton_attr.belt.1); next.belt.ori = Quaternion::rotation_z(stop * -0.5); - next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0, skeleton_attr.shorts.1); next.shorts.ori = Quaternion::rotation_z(stop * -0.7); - next.shorts.scale = Vec3::one(); match active_tool_kind { //TODO: Inventory @@ -86,7 +81,6 @@ impl Animation for ChargeAnimation { next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(3.14 + 0.3) * Quaternion::rotation_z(0.9); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new( -7.0 + quick * 3.5 * (1.0 / (stopa + 0.1)), @@ -112,7 +106,6 @@ impl Animation for ChargeAnimation { next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.3) * Quaternion::rotation_z(-0.6); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-9.0 + stop * 13.0, 6.0 + stop * 4.0, 8.0); next.control.ori = Quaternion::rotation_x(0.0) @@ -127,19 +120,15 @@ impl Animation for ChargeAnimation { next.l_foot.ori = Quaternion::rotation_x(foote * -0.1) * Quaternion::rotation_z(0.4) * Quaternion::rotation_y(0.15); - next.l_foot.scale = Vec3::one(); next.r_foot.offset = Vec3::new(3.4 + foot * 1.5, foote * -1.5, 8.0); next.r_foot.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_z(0.4) * Quaternion::rotation_y(0.0); - next.r_foot.scale = Vec3::one(); next.torso.offset = Vec3::new(0.0 + foot * 0.03, foote * 0.05, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_z(0.0) - * Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0); + next.torso.ori = Quaternion::rotation_z(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; } else { next.l_foot.offset = Vec3::new(-3.4, -2.5 + stop * -1.3, 8.0); @@ -153,9 +142,7 @@ impl Animation for ChargeAnimation { Quaternion::rotation_x(stop * 0.1) * Quaternion::rotation_z(stop * 0.1); next.r_foot.scale = Vec3::one(); next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_z(0.0) - * Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0); + next.torso.ori = Quaternion::rotation_z(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; } next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); diff --git a/voxygen/src/anim/character/roll.rs b/voxygen/src/anim/character/roll.rs index c37500335c..59fc5c6e2b 100644 --- a/voxygen/src/anim/character/roll.rs +++ b/voxygen/src/anim/character/roll.rs @@ -41,10 +41,10 @@ impl Animation for RollAnimation { next.head.offset = Vec3::new( 0.0, - -2.0 + skeleton_attr.head.0, - skeleton_attr.head.1 + wave_dub * -8.0, + -2.0 + skeleton_attr.head.0 + 3.0, + skeleton_attr.head.1 - 2.0, ); - next.head.ori = Quaternion::rotation_x(wave_dub * 0.4); + next.head.ori = Quaternion::rotation_x(wave_dub * -0.8); next.head.scale = Vec3::one(); next.chest.offset = Vec3::new( @@ -57,19 +57,17 @@ impl Animation for RollAnimation { next.belt.offset = Vec3::new( 0.0, - skeleton_attr.belt.0, - skeleton_attr.belt.0 + wave_dub * -3.0, + skeleton_attr.belt.0 + 2.0, + skeleton_attr.belt.1 + 2.0, ); - next.belt.ori = Quaternion::rotation_x(0.0 + wave_dub * 0.4); - next.belt.scale = Vec3::one(); + next.belt.ori = Quaternion::rotation_x(0.0 + wave_dub * 0.8); next.shorts.offset = Vec3::new( 0.0, - skeleton_attr.shorts.0, - skeleton_attr.shorts.0 + wave_dub * -2.0, + skeleton_attr.shorts.0 + 2.0, + skeleton_attr.shorts.1 + 3.0, ); - next.shorts.ori = Quaternion::rotation_x(0.0 + wave_dub * 0.4); - next.shorts.scale = Vec3::one(); + next.shorts.ori = Quaternion::rotation_x(0.0 + wave_dub * 0.8); next.l_hand.offset = Vec3::new( -skeleton_attr.chest.0 + wave * -0.5, @@ -88,23 +86,20 @@ impl Animation for RollAnimation { ); next.r_hand.ori = 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( -skeleton_attr.foot.0, skeleton_attr.foot.1, - skeleton_attr.foot.2 + wave_dub * -1.2 + wave_slow * 4.0, + skeleton_attr.foot.2 + wave_dub * -1.2, ); next.l_foot.ori = Quaternion::rotation_x(wave * 0.6); - next.l_foot.scale = Vec3::one(); next.r_foot.offset = Vec3::new( skeleton_attr.foot.0, skeleton_attr.foot.1, - skeleton_attr.foot.2 + wave_dub * -1.0 + wave_slow * 4.0, + skeleton_attr.foot.2 + wave_dub * -1.0, ); next.r_foot.ori = Quaternion::rotation_x(wave * -0.4); - next.r_foot.scale = Vec3::one(); next.l_shoulder.offset = Vec3::new( -skeleton_attr.shoulder.0, @@ -141,7 +136,7 @@ impl Animation for RollAnimation { next.lantern.scale = Vec3::one() * 0.65; next.torso.offset = - Vec3::new(0.0, 0.0, 0.1 + wave_dub * 16.0) / 11.0 * skeleton_attr.scaler; + Vec3::new(0.0, 0.0, 0.0 + 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; diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index b2d8d9384a..ecb067f751 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -26,11 +26,6 @@ impl Animation for RunAnimation { let lower = if speed > 5.0 { 0.0 } else { 1.0 }; let snapfoot = if speed > 5.0 { 1.1 } else { 2.0 }; let lab = 1.0; - let long = (((5.0) - / (1.5 + 3.5 * ((anim_time as f32 * lab as f32 * 8.0 * walk).sin()).powf(2.0 as f32))) - .sqrt()) - * ((anim_time as f32 * lab as f32 * 8.0 * walk).sin()); - let short = (((5.0) / (1.5 + 3.5 * ((anim_time as f32 * lab as f32 * 16.0 * walk).sin()).powf(2.0 as f32))) @@ -94,7 +89,7 @@ impl Animation for RunAnimation { -3.0 + skeleton_attr.head.0, -1.0 + skeleton_attr.head.1 + short * 0.1, ); - next.head.ori = Quaternion::rotation_z(head_look.x + long * -0.1 - short * 0.1) + next.head.ori = Quaternion::rotation_z(head_look.x - short * 0.1) * Quaternion::rotation_x(head_look.y + 0.35); next.head.scale = Vec3::one() * skeleton_attr.head_scale; diff --git a/voxygen/src/anim/character/shoot.rs b/voxygen/src/anim/character/shoot.rs index 8a59399797..e9b2a961a1 100644 --- a/voxygen/src/anim/character/shoot.rs +++ b/voxygen/src/anim/character/shoot.rs @@ -46,11 +46,9 @@ impl Animation for ShootAnimation { next.chest.ori = Quaternion::rotation_z(0.4 + exp * 1.0) * Quaternion::rotation_x(0.0 + exp * 0.2) * Quaternion::rotation_y(exp * -0.08); - next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0 + exp * 1.0, skeleton_attr.belt.1); next.belt.ori = next.chest.ori * -0.1; - next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new( 0.0, @@ -58,7 +56,6 @@ impl Animation for ShootAnimation { skeleton_attr.shorts.1, ); next.shorts.ori = next.chest.ori * -0.08; - next.shorts.scale = Vec3::one(); match active_tool_kind { //TODO: Inventory @@ -75,7 +72,6 @@ impl Animation for ShootAnimation { next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(3.14 + 0.3) * Quaternion::rotation_z(0.9); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-7.0, 6.0, 6.0 - exp * 5.0); next.control.ori = Quaternion::rotation_x(exp * 1.3) @@ -98,7 +94,6 @@ impl Animation for ShootAnimation { next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.3) * Quaternion::rotation_z(-0.6); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-9.0, 6.0, 8.0); next.control.ori = Quaternion::rotation_x(exp * 0.4) @@ -123,23 +118,17 @@ impl Animation for ShootAnimation { * Quaternion::rotation_y(0.0); next.r_foot.scale = Vec3::one(); next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_z(0.0) - * Quaternion::rotation_x(-0.15) - * Quaternion::rotation_y(0.0); + next.torso.ori = Quaternion::rotation_x(-0.15); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; } else { next.l_foot.offset = Vec3::new(-3.4, -2.5, 8.0 + exp * 2.5); next.l_foot.ori = Quaternion::rotation_x(exp * -0.2 - 0.2) * Quaternion::rotation_z(exp * 1.0); - next.l_foot.scale = Vec3::one(); next.r_foot.offset = Vec3::new(3.4, 3.5 - exp * 2.0, 8.0); next.r_foot.ori = Quaternion::rotation_x(exp * 0.1) * Quaternion::rotation_z(exp * 0.5); - next.r_foot.scale = Vec3::one(); next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_z(0.0) - * Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0); + next.torso.ori = Quaternion::rotation_z(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; } next.back.offset = Vec3::new(0.0, -2.8, 7.25); diff --git a/voxygen/src/anim/character/sit.rs b/voxygen/src/anim/character/sit.rs index ff02bc3a86..29c2a4d4c1 100644 --- a/voxygen/src/anim/character/sit.rs +++ b/voxygen/src/anim/character/sit.rs @@ -89,7 +89,6 @@ impl Animation for SitAnimation { skeleton_attr.foot.2, ); next.l_foot.ori = Quaternion::rotation_x(slow * 0.1 + stop * 1.2 + slow * 0.1); - next.l_foot.scale = Vec3::one(); next.r_foot.offset = Vec3::new( skeleton_attr.foot.0, @@ -97,7 +96,6 @@ impl Animation for SitAnimation { skeleton_attr.foot.2, ); next.r_foot.ori = Quaternion::rotation_x(slowa * 0.1 + stop * 1.2 + slowa * 0.1); - next.r_foot.scale = Vec3::one(); next.l_shoulder.offset = Vec3::new( -skeleton_attr.shoulder.0, diff --git a/voxygen/src/anim/character/swim.rs b/voxygen/src/anim/character/swim.rs index 233bec9297..76d283ba83 100644 --- a/voxygen/src/anim/character/swim.rs +++ b/voxygen/src/anim/character/swim.rs @@ -59,11 +59,9 @@ impl Animation for SwimAnimation { skeleton_attr.chest.1 + short * 1.3, ); next.chest.ori = Quaternion::rotation_z(short * 0.4); - next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0, skeleton_attr.belt.1); next.belt.ori = Quaternion::rotation_z(short * 0.30); - next.belt.scale = Vec3::one(); next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); next.back.ori = Quaternion::rotation_z(0.0); @@ -71,7 +69,6 @@ impl Animation for SwimAnimation { next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0, skeleton_attr.shorts.1); next.shorts.ori = Quaternion::rotation_z(short * 0.5); - next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( -skeleton_attr.hand.0, @@ -79,7 +76,6 @@ impl Animation for SwimAnimation { skeleton_attr.hand.2 + foot * -3.0, ); next.l_hand.ori = Quaternion::rotation_x(0.8 + foot * -0.6) * Quaternion::rotation_y(0.2); - next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( skeleton_attr.hand.0, @@ -87,7 +83,6 @@ impl Animation for SwimAnimation { skeleton_attr.hand.2 + foot * 3.0, ); next.r_hand.ori = Quaternion::rotation_x(0.8 + foot * 0.6) * Quaternion::rotation_y(-0.2); - next.r_hand.scale = Vec3::one(); next.l_foot.offset = Vec3::new( -skeleton_attr.foot.0, @@ -95,7 +90,6 @@ impl Animation for SwimAnimation { -5.0 + skeleton_attr.foot.2 + foot * 6.5, ); next.l_foot.ori = Quaternion::rotation_x(-1.40 + foot * 0.6); - next.l_foot.scale = Vec3::one(); next.r_foot.offset = Vec3::new( skeleton_attr.foot.0, @@ -103,7 +97,6 @@ impl Animation for SwimAnimation { -5.0 + skeleton_attr.foot.2 + foot * -6.5, ); next.r_foot.ori = Quaternion::rotation_x(-1.40 + foot * -0.6); - next.r_foot.scale = Vec3::one(); next.l_shoulder.offset = Vec3::new( -skeleton_attr.shoulder.0, @@ -140,7 +133,7 @@ impl Animation for SwimAnimation { next.torso.offset = Vec3::new(0.0, -0.3 + shortalt * -0.065, 0.4) * skeleton_attr.scaler; next.torso.ori = - Quaternion::rotation_x(speed * -0.190 * wave_stop * 1.05) * Quaternion::rotation_y(0.0); + Quaternion::rotation_x(speed * -0.190 * wave_stop * 1.05); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next.control.scale = Vec3::one(); diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index cd426e5b46..c9dbb59d3f 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -76,15 +76,12 @@ impl Animation for WieldAnimation { next.l_foot.offset = Vec3::new(-3.4, -2.5, 9.0); next.l_foot.ori = Quaternion::rotation_x(ultra_slow_cos * 0.035 - 0.2); - next.l_foot.scale = Vec3::one(); next.r_foot.offset = Vec3::new(3.4, 3.5, 9.0); next.r_foot.ori = Quaternion::rotation_x(ultra_slow * 0.035); - next.r_foot.scale = Vec3::one(); next.chest.ori = Quaternion::rotation_y(ultra_slow_cos * 0.04) * Quaternion::rotation_z(0.15); - next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0, skeleton_attr.belt.1); next.belt.ori = @@ -96,22 +93,20 @@ impl Animation for WieldAnimation { next.back.scale = Vec3::one() * 1.02; next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0, skeleton_attr.shorts.1); next.shorts.ori = Quaternion::rotation_z(0.3); - next.shorts.scale = Vec3::one(); } match active_tool_kind { //TODO: Inventory Some(ToolKind::Sword(_)) => { - next.l_hand.offset = Vec3::new(-0.25, -5.0, -5.0); + next.l_hand.offset = Vec3::new(-0.25, -5.0, -2.0); next.l_hand.ori = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.2); next.l_hand.scale = Vec3::one() * 1.04; - next.r_hand.offset = Vec3::new(1.25, -5.5, -8.0); + next.r_hand.offset = Vec3::new(1.25, -5.5, -5.0); next.r_hand.ori = Quaternion::rotation_x(1.47) * Quaternion::rotation_y(0.3); next.r_hand.scale = Vec3::one() * 1.05; - next.main.offset = Vec3::new(0.0, 0.0, -6.0); + next.main.offset = Vec3::new(0.0, 0.0, -3.0); next.main.ori = Quaternion::rotation_x(-0.1) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-7.0, 6.0, 6.0); next.control.ori = Quaternion::rotation_x(ultra_slow * 0.15) @@ -134,7 +129,6 @@ impl Animation for WieldAnimation { next.main.ori = Quaternion::rotation_x(1.27) * Quaternion::rotation_y(-0.3) * Quaternion::rotation_z(-0.8); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(0.0, 0.0, 0.0); next.control.ori = Quaternion::rotation_x(ultra_slow_cos * 0.1 + 0.2) @@ -153,7 +147,6 @@ impl Animation for WieldAnimation { next.main.ori = Quaternion::rotation_x(0.3) * Quaternion::rotation_y(-1.35) * Quaternion::rotation_z(1.57); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(0.0, 0.0, 0.0); next.control.ori = Quaternion::rotation_x(ultra_slow * 0.15) @@ -174,7 +167,6 @@ impl Animation for WieldAnimation { next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(3.14 + 0.3) * Quaternion::rotation_z(0.9); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-14.0, 1.8, 3.0); next.control.ori = Quaternion::rotation_x(ultra_slow * 0.2) @@ -210,7 +202,6 @@ impl Animation for WieldAnimation { next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.3) * Quaternion::rotation_z(-0.6); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-7.0, 6.0, 6.0); next.control.ori = Quaternion::rotation_x(ultra_slow * 0.2) @@ -252,7 +243,6 @@ impl Animation for WieldAnimation { next.main.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(3.14) * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-11.0 + slow * 2.0, 1.8, 4.0); next.control.ori = Quaternion::rotation_x(ultra_slow * 0.1) diff --git a/voxygen/src/anim/dragon/fly.rs b/voxygen/src/anim/dragon/fly.rs index d6a5698bc7..b79fb38697 100644 --- a/voxygen/src/anim/dragon/fly.rs +++ b/voxygen/src/anim/dragon/fly.rs @@ -21,7 +21,6 @@ impl Animation for FlyAnimation { let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); - //let wave_slow = (anim_time as f32 * 4.5).sin(); let wave_slow = (anim_time as f32 * 3.5 + PI).sin(); let wingl = (anim_time as f32 * 2.0 + PI).sin(); @@ -37,19 +36,19 @@ impl Animation for FlyAnimation { 0.0, skeleton_attr.head_upper.0, skeleton_attr.head_upper.1 + wave_ultra_slow * 0.20, - ) * 1.05; + ); next.head_upper.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_ultra_slow * -0.10); - next.head_upper.scale = Vec3::one() * 1.05; + next.head_upper.scale = Vec3::one(); next.head_lower.offset = Vec3::new( 0.0, skeleton_attr.head_lower.0, skeleton_attr.head_lower.1 + wave_ultra_slow * 0.20, - ) * 1.05; + ); next.head_lower.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_ultra_slow * -0.10); - next.head_lower.scale = Vec3::one() * 1.05; + next.head_lower.scale = Vec3::one(); next.jaw.offset = Vec3::new( 0.0, @@ -65,7 +64,7 @@ impl Animation for FlyAnimation { skeleton_attr.tail_front.1 + centeroffset * 0.6, ); next.tail_front.ori = Quaternion::rotation_x(center * 0.03); - next.tail_front.scale = Vec3::one(); + next.tail_front.scale = Vec3::one()*0.98; next.tail_rear.offset = Vec3::new( 0.0, @@ -73,55 +72,55 @@ impl Animation for FlyAnimation { skeleton_attr.tail_rear.1 + centeroffset * 0.6, ); next.tail_rear.ori = Quaternion::rotation_x(center * 0.03); - next.tail_rear.scale = Vec3::one(); + next.tail_rear.scale = Vec3::one()*0.98; next.chest_front.offset = Vec3::new( 0.0, skeleton_attr.chest_front.0, skeleton_attr.chest_front.1, - ) * 1.05; + ); next.chest_front.ori = Quaternion::rotation_y(center * 0.05); - next.chest_front.scale = Vec3::one() * 1.05; + next.chest_front.scale = Vec3::one(); next.chest_rear.offset = Vec3::new( 0.0, skeleton_attr.chest_rear.0, skeleton_attr.chest_rear.1, - ) * 1.05; + ); next.chest_rear.ori = Quaternion::rotation_y(center * 0.05); - next.chest_rear.scale = Vec3::one() * 1.05; + next.chest_rear.scale = Vec3::one(); next.foot_fl.offset = Vec3::new( -skeleton_attr.feet_f.0, skeleton_attr.feet_f.1, skeleton_attr.feet_f.2, - ) * 1.05; + ); next.foot_fl.ori = Quaternion::rotation_x(-1.3 + footl * 0.06); - next.foot_fl.scale = Vec3::one() * 1.05; + next.foot_fl.scale = Vec3::one(); next.foot_fr.offset = Vec3::new( skeleton_attr.feet_f.0, skeleton_attr.feet_f.1, skeleton_attr.feet_f.2, - ) * 1.05; + ); next.foot_fr.ori = Quaternion::rotation_x(-1.3 + footr * 0.06); - next.foot_fr.scale = Vec3::one() * 1.05; + next.foot_fr.scale = Vec3::one(); next.foot_bl.offset = Vec3::new( -skeleton_attr.feet_b.0, skeleton_attr.feet_b.1, skeleton_attr.feet_b.2, - ) * 1.05; + ); next.foot_bl.ori = Quaternion::rotation_x(-1.3 + footl * 0.06); - next.foot_bl.scale = Vec3::one() * 1.05; + next.foot_bl.scale = Vec3::one(); next.foot_br.offset = Vec3::new( skeleton_attr.feet_b.0, skeleton_attr.feet_b.1, skeleton_attr.feet_b.2, - ) * 1.05; + ); next.foot_br.ori = Quaternion::rotation_x(-1.3 + footr * 0.06); - next.foot_br.scale = Vec3::one() * 1.05; + next.foot_br.scale = Vec3::one(); next.wing_in_l.offset = Vec3::new( -skeleton_attr.wing_in.0, @@ -129,7 +128,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_in.2, ); next.wing_in_l.ori = Quaternion::rotation_y(0.4 + wingl * 0.6); - next.wing_in_l.scale = Vec3::one() * 1.05; + next.wing_in_l.scale = Vec3::one(); next.wing_in_r.offset = Vec3::new( skeleton_attr.wing_in.0, @@ -137,7 +136,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_in.2, ); next.wing_in_r.ori = Quaternion::rotation_y(-0.4 + wingr * 0.6); - next.wing_in_r.scale = Vec3::one() * 1.05; + next.wing_in_r.scale = Vec3::one(); next.wing_out_l.offset = Vec3::new( -skeleton_attr.wing_out.0, @@ -153,7 +152,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_out.2, ); next.wing_out_r.ori = Quaternion::rotation_y((-0.35 + wingr * 0.6).min(-0.2)); - next.wing_out_r.scale = Vec3::one() * 1.05; + next.wing_out_r.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index e7ca885765..fe4635b4c8 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -1,5 +1,5 @@ use super::{super::Animation, DragonSkeleton, SkeletonAttr}; -use std::ops::Mul; +use std::{f32::consts::PI, ops::Mul}; use vek::*; pub struct IdleAnimation; @@ -18,8 +18,8 @@ impl Animation for IdleAnimation { let mut next = (*skeleton).clone(); let ultra_slow = (anim_time as f32 * 1.0).sin(); - let wave_slow = (anim_time as f32 * 2.5).sin(); - let wave_slow_cos = (anim_time as f32 * 4.5).cos(); + let slow = (anim_time as f32 * 2.5).sin(); + let slowalt = (anim_time as f32 * 2.5+PI/2.0).sin(); let dragon_look = Vec2::new( ((global_time + anim_time) as f32 / 8.0) @@ -38,115 +38,115 @@ impl Animation for IdleAnimation { 0.0, skeleton_attr.head_upper.0, skeleton_attr.head_upper.1 + ultra_slow * 0.20, - ) * 1.05; + ); next.head_upper.ori = Quaternion::rotation_z(0.8 * dragon_look.x) * Quaternion::rotation_x(0.8 * dragon_look.y); - next.head_upper.scale = Vec3::one() * 1.05; + next.head_upper.scale = Vec3::one(); next.head_lower.offset = Vec3::new( 0.0, skeleton_attr.head_lower.0, skeleton_attr.head_lower.1 + ultra_slow * 0.20, - ) * 1.05; + ); next.head_lower.ori = - Quaternion::rotation_z(0.8 * dragon_look.x) * Quaternion::rotation_x(0.8 * dragon_look.y); + Quaternion::rotation_z(0.8 * dragon_look.x) * Quaternion::rotation_x(-0.2+0.8 * dragon_look.y); next.head_lower.scale = Vec3::one() * 1.05; next.jaw.offset = Vec3::new( 0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1, - ) * 1.05; - next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); + ); + next.jaw.ori = Quaternion::rotation_x(slow * 0.05); next.jaw.scale = Vec3::one() * 0.98; next.chest_front.offset = Vec3::new( 0.0, skeleton_attr.chest_front.0, skeleton_attr.chest_front.1, - ) * 1.05; - next.chest_front.ori = Quaternion::rotation_y(wave_slow * 0.03); + ); + next.chest_front.ori = Quaternion::rotation_y(slow * 0.01); next.chest_front.scale = Vec3::one() * 1.05; next.chest_rear.offset = Vec3::new( 0.0, skeleton_attr.chest_rear.0, skeleton_attr.chest_rear.1, - ) * 1.05; - next.chest_rear.ori = Quaternion::rotation_y(wave_slow * 0.03); + ); + next.chest_rear.ori = Quaternion::rotation_y(slow * 0.01); next.chest_rear.scale = Vec3::one() * 1.05; next.tail_front.offset = Vec3::new(0.0, skeleton_attr.tail_front.0, skeleton_attr.tail_front.1); - next.tail_front.ori = Quaternion::rotation_x(wave_slow_cos * 0.03); - next.tail_front.scale = Vec3::one(); + next.tail_front.ori = Quaternion::rotation_z(slowalt * 0.10)*Quaternion::rotation_x(0.1); + next.tail_front.scale = Vec3::one()*0.98; next.tail_rear.offset = Vec3::new(0.0, skeleton_attr.tail_rear.0, skeleton_attr.tail_rear.1); - next.tail_rear.ori = Quaternion::rotation_x(wave_slow_cos * 0.03); - next.tail_rear.scale = Vec3::one(); + next.tail_rear.ori = Quaternion::rotation_z(slowalt * 0.12)*Quaternion::rotation_x(0.05); + next.tail_rear.scale = Vec3::one()*0.98; next.wing_in_l.offset = Vec3::new( -skeleton_attr.wing_in.0, skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_l.ori = Quaternion::rotation_y(0.2); - next.wing_in_l.scale = Vec3::one() * 1.05; + next.wing_in_l.ori = Quaternion::rotation_y(0.8); + next.wing_in_l.scale = Vec3::one(); next.wing_in_r.offset = Vec3::new( skeleton_attr.wing_in.0, skeleton_attr.wing_in.1, skeleton_attr.wing_in.2, ); - next.wing_in_r.ori = Quaternion::rotation_y(-0.2);//.8 - next.wing_in_r.scale = Vec3::one() * 1.05; + next.wing_in_r.ori = Quaternion::rotation_y(-0.8); + next.wing_in_r.scale = Vec3::one(); next.wing_out_l.offset = Vec3::new( -skeleton_attr.wing_out.0, skeleton_attr.wing_out.1, skeleton_attr.wing_out.2 - 1.4, ); - next.wing_out_l.ori = Quaternion::rotation_y(-0.3);//2.0 - next.wing_out_l.scale = Vec3::one() * 1.05; + next.wing_out_l.ori = Quaternion::rotation_y(-2.0); + next.wing_out_l.scale = Vec3::one(); next.wing_out_r.offset = Vec3::new( skeleton_attr.wing_out.0, skeleton_attr.wing_out.1, skeleton_attr.wing_out.2 - 1.4, ); - next.wing_out_r.ori = Quaternion::rotation_y(0.3); - next.wing_out_r.scale = Vec3::one() * 1.05; + next.wing_out_r.ori = Quaternion::rotation_y(2.0); + next.wing_out_r.scale = Vec3::one(); next.foot_fl.offset = Vec3::new( -skeleton_attr.feet_f.0, skeleton_attr.feet_f.1, skeleton_attr.feet_f.2, - ) * 1.05; + ); next.foot_fl.ori = Quaternion::rotation_x(0.0); - next.foot_fl.scale = Vec3::one() * 1.05; + next.foot_fl.scale = Vec3::one(); next.foot_fr.offset = Vec3::new( skeleton_attr.feet_f.0, skeleton_attr.feet_f.1, skeleton_attr.feet_f.2, - ) * 1.05; + ); next.foot_fr.ori = Quaternion::rotation_x(0.0); - next.foot_fr.scale = Vec3::one() * 1.05; + next.foot_fr.scale = Vec3::one(); next.foot_bl.offset = Vec3::new( -skeleton_attr.feet_b.0, skeleton_attr.feet_b.1, skeleton_attr.feet_b.2, - ) * 1.05; + ); next.foot_bl.ori = Quaternion::rotation_x(0.0); - next.foot_bl.scale = Vec3::one() * 1.05; + next.foot_bl.scale = Vec3::one(); next.foot_br.offset = Vec3::new( skeleton_attr.feet_b.0, skeleton_attr.feet_b.1, skeleton_attr.feet_b.2, - ) * 1.05; + ); next.foot_br.ori = Quaternion::rotation_x(0.0); - next.foot_br.scale = Vec3::one() * 1.05; + next.foot_br.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index 0bfddf8f8d..d4a549c7d4 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -236,10 +236,10 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { (Reddragon, _) => (-12.5, 0.0), }, tail_front: match (body.species, body.body_type) { - (Reddragon, _) => (-12.5, 1.5), + (Reddragon, _) => (-6.5, 1.5), }, tail_rear: match (body.species, body.body_type) { - (Reddragon, _) => (-14.0, 0.0), + (Reddragon, _) => (-11.5, -1.0), }, wing_in: match (body.species, body.body_type) { (Reddragon, _) => (2.5, -16.5, 0.0), diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index 6dada1fd5a..e9b15e4eca 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -55,18 +55,18 @@ impl Animation for RunAnimation { 0.0, skeleton_attr.head_upper.0, skeleton_attr.head_upper.1, - ) * 1.05; + ); next.head_upper.ori = Quaternion::rotation_x(dragon_look.y) * Quaternion::rotation_z(dragon_look.x); - next.head_upper.scale = Vec3::one() * 1.05; + next.head_upper.scale = Vec3::one(); next.head_lower.offset = Vec3::new( 0.0, skeleton_attr.head_lower.0, skeleton_attr.head_lower.1, - ) * 1.05; + ); next.head_lower.ori = Quaternion::rotation_x(wave_slow * 0.05); - next.head_lower.scale = Vec3::one() * 1.05; + next.head_lower.scale = Vec3::one(); next.jaw.offset = Vec3::new( 0.0, @@ -74,7 +74,7 @@ impl Animation for RunAnimation { skeleton_attr.jaw.1 + wave_slow * 0.2, ); next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); - next.jaw.scale = Vec3::one(); + next.jaw.scale = Vec3::one()*0.98; next.tail_front.offset = Vec3::new( 0.0, @@ -82,7 +82,7 @@ impl Animation for RunAnimation { skeleton_attr.tail_front.1 + centeroffset * 0.6, ); next.tail_front.ori = Quaternion::rotation_x(center * 0.03); - next.tail_front.scale = Vec3::one(); + next.tail_front.scale = Vec3::one()*0.98; next.tail_rear.offset = Vec3::new( 0.0, @@ -90,55 +90,55 @@ impl Animation for RunAnimation { skeleton_attr.tail_rear.1 + centeroffset * 0.6, ); next.tail_rear.ori = Quaternion::rotation_x(center * 0.03); - next.tail_rear.scale = Vec3::one(); + next.tail_rear.scale = Vec3::one()*0.98; next.chest_front.offset = Vec3::new( 0.0, skeleton_attr.chest_front.0 + horichest * 1.25, skeleton_attr.chest_front.1 + vertchest * -1.6 + 1.0, - ) * 1.05; + ); next.chest_front.ori = Quaternion::rotation_y(horichest * -0.09); - next.chest_front.scale = Vec3::one() * 1.05; + next.chest_front.scale = Vec3::one(); next.chest_rear.offset = Vec3::new( 0.0, skeleton_attr.chest_rear.0, skeleton_attr.chest_rear.1, - ) * 1.05; + ); next.chest_rear.ori = Quaternion::rotation_y(horichest * -0.09); - next.chest_rear.scale = Vec3::one() * 1.05; + next.chest_rear.scale = Vec3::one(); next.foot_fl.offset = Vec3::new( -skeleton_attr.feet_f.0, skeleton_attr.feet_f.1 + horilf * 2.5, skeleton_attr.feet_f.2 + vertlf * 5.0 * skeleton_attr.height - 0.5, - ) * 1.05; + ); next.foot_fl.ori = Quaternion::rotation_x(horilf * 0.4); - next.foot_fl.scale = Vec3::one() * 1.05; + next.foot_fl.scale = Vec3::one(); next.foot_fr.offset = Vec3::new( skeleton_attr.feet_f.0, skeleton_attr.feet_f.1 + horirfoffset * 2.5, skeleton_attr.feet_f.2 + vertrfoffset * 5.0 * skeleton_attr.height - 0.5, - ) * 1.05; + ); next.foot_fr.ori = Quaternion::rotation_x(horirfoffset * 0.4); - next.foot_fr.scale = Vec3::one() * 1.05; + next.foot_fr.scale = Vec3::one(); next.foot_bl.offset = Vec3::new( -skeleton_attr.feet_b.0, skeleton_attr.feet_b.1 + horilboffset * 3.0, skeleton_attr.feet_b.2 + vertlboffset * 5.0 * skeleton_attr.height - 0.5, - ) * 1.05; + ); next.foot_bl.ori = Quaternion::rotation_x(horilboffset * 0.35); - next.foot_bl.scale = Vec3::one() * 1.05; + next.foot_bl.scale = Vec3::one(); next.foot_br.offset = Vec3::new( skeleton_attr.feet_b.0, skeleton_attr.feet_b.1 + horirb * 3.0, skeleton_attr.feet_b.2 + vertrb * 5.0 * skeleton_attr.height - 0.5, - ) * 1.05; + ); next.foot_br.ori = Quaternion::rotation_x(horirb * 0.35); - next.foot_br.scale = Vec3::one() * 1.05; + next.foot_br.scale = Vec3::one(); next.wing_in_l.offset = Vec3::new( -skeleton_attr.wing_in.0, @@ -154,7 +154,7 @@ impl Animation for RunAnimation { skeleton_attr.wing_in.2, ); next.wing_in_r.ori = Quaternion::rotation_y(-0.8); - next.wing_in_r.scale = Vec3::one() * 1.05; + next.wing_in_r.scale = Vec3::one(); next.wing_out_l.offset = Vec3::new( -skeleton_attr.wing_out.0, @@ -162,7 +162,7 @@ impl Animation for RunAnimation { skeleton_attr.wing_out.2 - 1.4, ); next.wing_out_l.ori = Quaternion::rotation_y(-2.0); - next.wing_out_l.scale = Vec3::one() * 1.05; + next.wing_out_l.scale = Vec3::one(); next.wing_out_r.offset = Vec3::new( skeleton_attr.wing_out.0, @@ -170,7 +170,7 @@ impl Animation for RunAnimation { skeleton_attr.wing_out.2 - 1.4, ); next.wing_out_r.ori = Quaternion::rotation_y(2.0); - next.wing_out_r.scale = Vec3::one() * 1.05; + next.wing_out_r.scale = Vec3::one(); next } From cf392b5a663b2884e8ee56b6ce97ed3187405f1f Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sat, 9 May 2020 18:02:27 -0400 Subject: [PATCH 15/19] fmt --- common/src/comp/body/dragon.rs | 4 +- common/src/generation.rs | 4 +- voxygen/src/anim/biped_large/mod.rs | 226 ++++++++++++++------------ voxygen/src/anim/character/gliding.rs | 6 +- voxygen/src/anim/character/roll.rs | 6 +- voxygen/src/anim/character/swim.rs | 3 +- voxygen/src/anim/dragon/fly.rs | 11 +- voxygen/src/anim/dragon/idle.rs | 37 ++--- voxygen/src/anim/dragon/mod.rs | 29 +++- voxygen/src/anim/dragon/run.rs | 29 ++-- voxygen/src/scene/figure/cache.rs | 12 +- voxygen/src/scene/figure/load.rs | 8 +- 12 files changed, 189 insertions(+), 186 deletions(-) diff --git a/common/src/comp/body/dragon.rs b/common/src/comp/body/dragon.rs index 8591ba74e1..3ccb3c6b65 100644 --- a/common/src/comp/body/dragon.rs +++ b/common/src/comp/body/dragon.rs @@ -49,9 +49,7 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies } } -pub const ALL_SPECIES: [Species; 1] = [ - Species::Reddragon, -]; +pub const ALL_SPECIES: [Species; 1] = [Species::Reddragon]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { type Item = Species; diff --git a/common/src/generation.rs b/common/src/generation.rs index 15850ebb64..65fc409020 100644 --- a/common/src/generation.rs +++ b/common/src/generation.rs @@ -79,9 +79,7 @@ impl EntityInfo { Body::QuadrupedSmall(body) => { Some(get_npc_name(&NPC_NAMES.quadruped_small, body.species)) }, - Body::Dragon(body) => { - Some(get_npc_name(&NPC_NAMES.dragon, body.species)) - }, + Body::Dragon(body) => Some(get_npc_name(&NPC_NAMES.dragon, body.species)), _ => None, } .map(|s| { diff --git a/voxygen/src/anim/biped_large/mod.rs b/voxygen/src/anim/biped_large/mod.rs index e8cc220218..8438ef999a 100644 --- a/voxygen/src/anim/biped_large/mod.rs +++ b/voxygen/src/anim/biped_large/mod.rs @@ -1,108 +1,114 @@ +pub mod fly; pub mod idle; -pub mod jump; pub mod run; // Reexports -pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; +pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; use super::{Bone, Skeleton}; use crate::render::FigureBoneData; use common::comp::{self}; -#[derive(Clone)] -pub struct BipedLargeSkeleton { - head: Bone, - upper_torso: Bone, - lower_torso: Bone, - shoulder_l: Bone, - shoulder_r: Bone, - hand_l: Bone, - hand_r: Bone, - leg_l: Bone, - leg_r: Bone, - foot_l: Bone, - foot_r: Bone, - torso: Bone, +#[derive(Clone, Default)] +pub struct DragonSkeleton { + head_upper: Bone, + head_lower: Bone, + jaw: Bone, + chest_front: Bone, + chest_rear: Bone, + tail_front: Bone, + tail_rear: Bone, + wing_in_l: Bone, + wing_in_r: Bone, + wing_out_l: Bone, + wing_out_r: Bone, + foot_fl: Bone, + foot_fr: Bone, + foot_bl: Bone, + foot_br: Bone, } -impl BipedLargeSkeleton { - pub fn new() -> Self { - Self { - head: Bone::default(), - upper_torso: Bone::default(), - lower_torso: Bone::default(), - shoulder_l: Bone::default(), - shoulder_r: Bone::default(), - hand_l: Bone::default(), - hand_r: Bone::default(), - leg_l: Bone::default(), - leg_r: Bone::default(), - foot_l: Bone::default(), - foot_r: Bone::default(), - torso: Bone::default(), - } - } +impl DragonSkeleton { + pub fn new() -> Self { Self::default() } } -impl Skeleton for BipedLargeSkeleton { +impl Skeleton for DragonSkeleton { type Attr = SkeletonAttr; - fn bone_count(&self) -> usize { 11 } + fn bone_count(&self) -> usize { 15 } fn compute_matrices(&self) -> [FigureBoneData; 16] { - let upper_torso_mat = self.upper_torso.compute_base_matrix(); - let shoulder_l_mat = self.shoulder_l.compute_base_matrix(); - 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(); + let head_upper_mat = self.head_upper.compute_base_matrix(); + let head_lower_mat = self.head_lower.compute_base_matrix(); + let chest_front_mat = self.chest_front.compute_base_matrix(); + let chest_rear_mat = self.chest_rear.compute_base_matrix(); + let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); + let wing_in_r_mat = self.wing_in_r.compute_base_matrix(); + let tail_front_mat = self.tail_front.compute_base_matrix(); [ - FigureBoneData::new(torso_mat * upper_torso_mat * self.head.compute_base_matrix()), - FigureBoneData::new(torso_mat * upper_torso_mat), + FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat), + FigureBoneData::new(chest_front_mat * head_lower_mat), FigureBoneData::new( - torso_mat * upper_torso_mat * self.lower_torso.compute_base_matrix(), + chest_front_mat * head_lower_mat * head_upper_mat * self.jaw.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 * self.hand_l.compute_base_matrix()), - FigureBoneData::new(torso_mat * upper_torso_mat * self.hand_r.compute_base_matrix()), - FigureBoneData::new(torso_mat * upper_torso_mat * leg_l_mat), - FigureBoneData::new(torso_mat * upper_torso_mat * leg_r_mat), - FigureBoneData::new(self.foot_l.compute_base_matrix()), - FigureBoneData::new(self.foot_r.compute_base_matrix()), - FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), + FigureBoneData::new(chest_front_mat), + FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat), + FigureBoneData::new( + chest_front_mat + * chest_rear_mat + * tail_front_mat + * self.tail_rear.compute_base_matrix(), + ), + FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), + FigureBoneData::new( + chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix(), + ), + FigureBoneData::new( + chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix(), + ), + FigureBoneData::new(self.foot_fl.compute_base_matrix()), + FigureBoneData::new(self.foot_fr.compute_base_matrix()), + FigureBoneData::new(self.foot_bl.compute_base_matrix()), + FigureBoneData::new(self.foot_br.compute_base_matrix()), FigureBoneData::default(), ] } fn interpolate(&mut self, target: &Self, dt: f32) { - self.head.interpolate(&target.head, dt); - self.upper_torso.interpolate(&target.upper_torso, dt); - self.lower_torso.interpolate(&target.lower_torso, dt); - self.shoulder_l.interpolate(&target.shoulder_l, dt); - self.shoulder_r.interpolate(&target.shoulder_r, dt); - self.hand_l.interpolate(&target.hand_l, dt); - self.hand_r.interpolate(&target.hand_r, dt); - self.leg_l.interpolate(&target.leg_l, dt); - 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); + self.head_upper.interpolate(&target.head_upper, dt); + self.head_lower.interpolate(&target.head_lower, dt); + self.jaw.interpolate(&target.jaw, dt); + self.chest_front.interpolate(&target.chest_front, dt); + self.chest_rear.interpolate(&target.chest_rear, dt); + self.tail_front.interpolate(&target.tail_front, dt); + self.tail_rear.interpolate(&target.tail_rear, dt); + self.wing_in_l.interpolate(&target.wing_in_l, dt); + self.wing_in_r.interpolate(&target.wing_in_r, dt); + self.wing_out_l.interpolate(&target.wing_out_l, dt); + self.wing_out_r.interpolate(&target.wing_out_r, dt); + self.foot_fl.interpolate(&target.foot_fl, dt); + self.foot_fr.interpolate(&target.foot_fr, dt); + self.foot_bl.interpolate(&target.foot_bl, dt); + self.foot_br.interpolate(&target.foot_br, dt); } } 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), + head_upper: (f32, f32), + head_lower: (f32, f32), + jaw: (f32, f32), + chest_front: (f32, f32), + chest_rear: (f32, f32), + tail_front: (f32, f32), + tail_rear: (f32, f32), + wing_in: (f32, f32, f32), + wing_out: (f32, f32, f32), + feet_f: (f32, f32, f32), + feet_b: (f32, f32, f32), + height: f32, } impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { @@ -110,7 +116,7 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { fn try_from(body: &'a comp::Body) -> Result { match body { - comp::Body::BipedLarge(body) => Ok(SkeletonAttr::from(body)), + comp::Body::Dragon(body) => Ok(SkeletonAttr::from(body)), _ => Err(()), } } @@ -119,41 +125,61 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { impl Default for SkeletonAttr { fn default() -> 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), + head_upper: (0.0, 0.0), + head_lower: (0.0, 0.0), + jaw: (0.0, 0.0), + chest_front: (0.0, 0.0), + chest_rear: (0.0, 0.0), + tail_front: (0.0, 0.0), + tail_rear: (0.0, 0.0), + wing_in: (0.0, 0.0, 0.0), + wing_out: (0.0, 0.0, 0.0), + feet_f: (0.0, 0.0, 0.0), + feet_b: (0.0, 0.0, 0.0), + height: (0.0), } } } -impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr { - fn from(body: &'a comp::biped_large::Body) -> Self { - use comp::biped_large::Species::*; +impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { + fn from(body: &'a comp::dragon::Body) -> Self { + use comp::dragon::Species::*; Self { - head: match (body.species, body.body_type) { - (Ogre, _) => (3.0, 6.0), + head_upper: match (body.species, body.body_type) { + (Reddragon, _) => (2.5, 4.5), }, - upper_torso: match (body.species, body.body_type) { - (Ogre, _) => (0.0, 19.0), + head_lower: match (body.species, body.body_type) { + (Reddragon, _) => (7.5, 3.5), }, - lower_torso: match (body.species, body.body_type) { - (Ogre, _) => (1.0, -9.5), + jaw: match (body.species, body.body_type) { + (Reddragon, _) => (7.0, -5.0), }, - shoulder: match (body.species, body.body_type) { - (Ogre, _) => (6.1, 0.5, 2.5), + chest_front: match (body.species, body.body_type) { + (Reddragon, _) => (0.0, 14.0), }, - hand: match (body.species, body.body_type) { - (Ogre, _) => (10.5, -1.0, -0.5), + chest_rear: match (body.species, body.body_type) { + (Reddragon, _) => (-12.5, 0.0), }, - leg: match (body.species, body.body_type) { - (Ogre, _) => (0.0, 0.0, -6.0), + tail_front: match (body.species, body.body_type) { + (Reddragon, _) => (-6.5, 1.5), }, - foot: match (body.species, body.body_type) { - (Ogre, _) => (4.0, 0.5, 2.5), + tail_rear: match (body.species, body.body_type) { + (Reddragon, _) => (-11.5, -1.0), + }, + wing_in: match (body.species, body.body_type) { + (Reddragon, _) => (2.5, -16.5, 0.0), + }, + wing_out: match (body.species, body.body_type) { + (Reddragon, _) => (23.0, 0.5, 4.0), + }, + feet_f: match (body.species, body.body_type) { + (Reddragon, _) => (6.0, 0.0, 1.5), + }, + feet_b: match (body.species, body.body_type) { + (Reddragon, _) => (6.0, -15.0, 3.0), + }, + height: match (body.species, body.body_type) { + (Reddragon, _) => (1.0), }, } } diff --git a/voxygen/src/anim/character/gliding.rs b/voxygen/src/anim/character/gliding.rs index ebc8fe13bb..4399ab003a 100644 --- a/voxygen/src/anim/character/gliding.rs +++ b/voxygen/src/anim/character/gliding.rs @@ -55,11 +55,7 @@ impl Animation for GlidingAnimation { 0.0 } * 0.8; - next.head.offset = Vec3::new( - 0.0, - -2.0 + skeleton_attr.head.0, - skeleton_attr.head.1, - ); + next.head.offset = Vec3::new(0.0, -2.0 + skeleton_attr.head.0, skeleton_attr.head.1); next.head.ori = Quaternion::rotation_x(0.35 - slow * 0.10 + head_look.y) * Quaternion::rotation_z(head_look.x + slowa * 0.15); diff --git a/voxygen/src/anim/character/roll.rs b/voxygen/src/anim/character/roll.rs index 59fc5c6e2b..6d0210a758 100644 --- a/voxygen/src/anim/character/roll.rs +++ b/voxygen/src/anim/character/roll.rs @@ -55,11 +55,7 @@ impl Animation for RollAnimation { next.chest.ori = Quaternion::rotation_x(wave_dub * 0.4); next.chest.scale = Vec3::one() * 1.01; - next.belt.offset = Vec3::new( - 0.0, - skeleton_attr.belt.0 + 2.0, - skeleton_attr.belt.1 + 2.0, - ); + next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0 + 2.0, skeleton_attr.belt.1 + 2.0); next.belt.ori = Quaternion::rotation_x(0.0 + wave_dub * 0.8); next.shorts.offset = Vec3::new( diff --git a/voxygen/src/anim/character/swim.rs b/voxygen/src/anim/character/swim.rs index 76d283ba83..60477596a9 100644 --- a/voxygen/src/anim/character/swim.rs +++ b/voxygen/src/anim/character/swim.rs @@ -132,8 +132,7 @@ impl Animation for SwimAnimation { next.lantern.scale = Vec3::one() * 0.65; next.torso.offset = Vec3::new(0.0, -0.3 + shortalt * -0.065, 0.4) * skeleton_attr.scaler; - next.torso.ori = - Quaternion::rotation_x(speed * -0.190 * wave_stop * 1.05); + next.torso.ori = Quaternion::rotation_x(speed * -0.190 * wave_stop * 1.05); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next.control.scale = Vec3::one(); diff --git a/voxygen/src/anim/dragon/fly.rs b/voxygen/src/anim/dragon/fly.rs index b79fb38697..53fcce8757 100644 --- a/voxygen/src/anim/dragon/fly.rs +++ b/voxygen/src/anim/dragon/fly.rs @@ -64,7 +64,7 @@ impl Animation for FlyAnimation { skeleton_attr.tail_front.1 + centeroffset * 0.6, ); next.tail_front.ori = Quaternion::rotation_x(center * 0.03); - next.tail_front.scale = Vec3::one()*0.98; + next.tail_front.scale = Vec3::one() * 0.98; next.tail_rear.offset = Vec3::new( 0.0, @@ -72,7 +72,7 @@ impl Animation for FlyAnimation { skeleton_attr.tail_rear.1 + centeroffset * 0.6, ); next.tail_rear.ori = Quaternion::rotation_x(center * 0.03); - next.tail_rear.scale = Vec3::one()*0.98; + next.tail_rear.scale = Vec3::one() * 0.98; next.chest_front.offset = Vec3::new( 0.0, @@ -82,11 +82,8 @@ impl Animation for FlyAnimation { next.chest_front.ori = Quaternion::rotation_y(center * 0.05); next.chest_front.scale = Vec3::one(); - next.chest_rear.offset = Vec3::new( - 0.0, - skeleton_attr.chest_rear.0, - skeleton_attr.chest_rear.1, - ); + next.chest_rear.offset = + Vec3::new(0.0, skeleton_attr.chest_rear.0, skeleton_attr.chest_rear.1); next.chest_rear.ori = Quaternion::rotation_y(center * 0.05); next.chest_rear.scale = Vec3::one(); diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index fe4635b4c8..afdd649907 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -19,7 +19,7 @@ impl Animation for IdleAnimation { let ultra_slow = (anim_time as f32 * 1.0).sin(); let slow = (anim_time as f32 * 2.5).sin(); - let slowalt = (anim_time as f32 * 2.5+PI/2.0).sin(); + let slowalt = (anim_time as f32 * 2.5 + PI / 2.0).sin(); let dragon_look = Vec2::new( ((global_time + anim_time) as f32 / 8.0) @@ -39,8 +39,8 @@ impl Animation for IdleAnimation { skeleton_attr.head_upper.0, skeleton_attr.head_upper.1 + ultra_slow * 0.20, ); - next.head_upper.ori = - Quaternion::rotation_z(0.8 * dragon_look.x) * Quaternion::rotation_x(0.8 * dragon_look.y); + next.head_upper.ori = Quaternion::rotation_z(0.8 * dragon_look.x) + * Quaternion::rotation_x(0.8 * dragon_look.y); next.head_upper.scale = Vec3::one(); next.head_lower.offset = Vec3::new( @@ -48,15 +48,11 @@ impl Animation for IdleAnimation { skeleton_attr.head_lower.0, skeleton_attr.head_lower.1 + ultra_slow * 0.20, ); - next.head_lower.ori = - Quaternion::rotation_z(0.8 * dragon_look.x) * Quaternion::rotation_x(-0.2+0.8 * dragon_look.y); + next.head_lower.ori = Quaternion::rotation_z(0.8 * dragon_look.x) + * Quaternion::rotation_x(-0.2 + 0.8 * dragon_look.y); next.head_lower.scale = Vec3::one() * 1.05; - next.jaw.offset = Vec3::new( - 0.0, - skeleton_attr.jaw.0, - skeleton_attr.jaw.1, - ); + next.jaw.offset = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1); next.jaw.ori = Quaternion::rotation_x(slow * 0.05); next.jaw.scale = Vec3::one() * 0.98; @@ -68,21 +64,20 @@ impl Animation for IdleAnimation { next.chest_front.ori = Quaternion::rotation_y(slow * 0.01); next.chest_front.scale = Vec3::one() * 1.05; - next.chest_rear.offset = Vec3::new( - 0.0, - skeleton_attr.chest_rear.0, - skeleton_attr.chest_rear.1, - ); + next.chest_rear.offset = + Vec3::new(0.0, skeleton_attr.chest_rear.0, skeleton_attr.chest_rear.1); next.chest_rear.ori = Quaternion::rotation_y(slow * 0.01); next.chest_rear.scale = Vec3::one() * 1.05; - next.tail_front.offset = Vec3::new(0.0, skeleton_attr.tail_front.0, skeleton_attr.tail_front.1); - next.tail_front.ori = Quaternion::rotation_z(slowalt * 0.10)*Quaternion::rotation_x(0.1); - next.tail_front.scale = Vec3::one()*0.98; + next.tail_front.offset = + Vec3::new(0.0, skeleton_attr.tail_front.0, skeleton_attr.tail_front.1); + next.tail_front.ori = Quaternion::rotation_z(slowalt * 0.10) * Quaternion::rotation_x(0.1); + next.tail_front.scale = Vec3::one() * 0.98; - next.tail_rear.offset = Vec3::new(0.0, skeleton_attr.tail_rear.0, skeleton_attr.tail_rear.1); - next.tail_rear.ori = Quaternion::rotation_z(slowalt * 0.12)*Quaternion::rotation_x(0.05); - next.tail_rear.scale = Vec3::one()*0.98; + next.tail_rear.offset = + Vec3::new(0.0, skeleton_attr.tail_rear.0, skeleton_attr.tail_rear.1); + next.tail_rear.ori = Quaternion::rotation_z(slowalt * 0.12) * Quaternion::rotation_x(0.05); + next.tail_rear.scale = Vec3::one() * 0.98; next.wing_in_l.offset = Vec3::new( -skeleton_attr.wing_in.0, diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index d4a549c7d4..ae870320c6 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -8,6 +8,7 @@ pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; use super::{Bone, Skeleton}; use crate::render::FigureBoneData; <<<<<<< HEAD +<<<<<<< HEAD use common::comp::{self}; use vek::Vec3; @@ -66,6 +67,9 @@ const FEET_B_Z: f32 = 3.0; ======= use common::comp::{self}; >>>>>>> Cleanup +======= +use common::comp::{self}; +>>>>>>> fmt #[derive(Clone, Default)] pub struct DragonSkeleton { @@ -134,15 +138,26 @@ impl Skeleton for DragonSkeleton { [ FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat), FigureBoneData::new(chest_front_mat * head_lower_mat), - FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat * self.jaw.compute_base_matrix()), + FigureBoneData::new( + chest_front_mat * head_lower_mat * head_upper_mat * self.jaw.compute_base_matrix(), + ), FigureBoneData::new(chest_front_mat), - FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix() ), + FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix()), FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat), - FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat * self.tail_rear.compute_base_matrix()), + FigureBoneData::new( + chest_front_mat + * chest_rear_mat + * tail_front_mat + * self.tail_rear.compute_base_matrix(), + ), FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), - FigureBoneData::new(chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix()), - FigureBoneData::new(chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix()), + FigureBoneData::new( + chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix(), + ), + FigureBoneData::new( + chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix(), + ), FigureBoneData::new(self.foot_fl.compute_base_matrix()), FigureBoneData::new(self.foot_fr.compute_base_matrix()), FigureBoneData::new(self.foot_bl.compute_base_matrix()), @@ -217,7 +232,7 @@ impl Default for SkeletonAttr { } impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { - fn from(body: &'a comp::dragon::Body) -> Self { + fn from(body: &'a comp::dragon::Body) -> Self { use comp::dragon::Species::*; Self { head_upper: match (body.species, body.body_type) { @@ -258,4 +273,4 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { }, } } -} \ No newline at end of file +} diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index e9b15e4eca..2619713d4c 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -21,7 +21,7 @@ impl Animation for RunAnimation { let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos(); let wave_slow = (anim_time as f32 * 4.5).sin(); - + 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); @@ -51,20 +51,14 @@ impl Animation for RunAnimation { * 0.125, ); - next.head_upper.offset = Vec3::new( - 0.0, - skeleton_attr.head_upper.0, - skeleton_attr.head_upper.1, - ); + next.head_upper.offset = + Vec3::new(0.0, skeleton_attr.head_upper.0, skeleton_attr.head_upper.1); next.head_upper.ori = Quaternion::rotation_x(dragon_look.y) * Quaternion::rotation_z(dragon_look.x); next.head_upper.scale = Vec3::one(); - next.head_lower.offset = Vec3::new( - 0.0, - skeleton_attr.head_lower.0, - skeleton_attr.head_lower.1, - ); + next.head_lower.offset = + Vec3::new(0.0, skeleton_attr.head_lower.0, skeleton_attr.head_lower.1); next.head_lower.ori = Quaternion::rotation_x(wave_slow * 0.05); next.head_lower.scale = Vec3::one(); @@ -74,7 +68,7 @@ impl Animation for RunAnimation { skeleton_attr.jaw.1 + wave_slow * 0.2, ); next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); - next.jaw.scale = Vec3::one()*0.98; + next.jaw.scale = Vec3::one() * 0.98; next.tail_front.offset = Vec3::new( 0.0, @@ -82,7 +76,7 @@ impl Animation for RunAnimation { skeleton_attr.tail_front.1 + centeroffset * 0.6, ); next.tail_front.ori = Quaternion::rotation_x(center * 0.03); - next.tail_front.scale = Vec3::one()*0.98; + next.tail_front.scale = Vec3::one() * 0.98; next.tail_rear.offset = Vec3::new( 0.0, @@ -90,7 +84,7 @@ impl Animation for RunAnimation { skeleton_attr.tail_rear.1 + centeroffset * 0.6, ); next.tail_rear.ori = Quaternion::rotation_x(center * 0.03); - next.tail_rear.scale = Vec3::one()*0.98; + next.tail_rear.scale = Vec3::one() * 0.98; next.chest_front.offset = Vec3::new( 0.0, @@ -100,11 +94,8 @@ impl Animation for RunAnimation { next.chest_front.ori = Quaternion::rotation_y(horichest * -0.09); next.chest_front.scale = Vec3::one(); - next.chest_rear.offset = Vec3::new( - 0.0, - skeleton_attr.chest_rear.0, - skeleton_attr.chest_rear.1, - ); + next.chest_rear.offset = + Vec3::new(0.0, skeleton_attr.chest_rear.0, skeleton_attr.chest_rear.1); next.chest_rear.ori = Quaternion::rotation_y(horichest * -0.09); next.chest_rear.scale = Vec3::one(); diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index d88d4f2fb2..c1628ffab0 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -411,10 +411,8 @@ impl FigureModelCache { None, ], Body::Dragon(body) => { - let dragon_center_spec = - DragonCenterSpec::load_watched(manifest_indicator); - let dragon_lateral_spec = - DragonLateralSpec::load_watched(manifest_indicator); + let dragon_center_spec = DragonCenterSpec::load_watched(manifest_indicator); + let dragon_lateral_spec = DragonLateralSpec::load_watched(manifest_indicator); [ Some(dragon_center_spec.mesh_head_upper( @@ -427,11 +425,7 @@ impl FigureModelCache { body.body_type, generate_mesh, )), - Some(dragon_center_spec.mesh_jaw( - body.species, - body.body_type, - generate_mesh, - )), + Some(dragon_center_spec.mesh_jaw(body.species, body.body_type, generate_mesh)), Some(dragon_center_spec.mesh_chest_front( body.species, body.body_type, diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index acceb10df0..e8960bdf54 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -1925,8 +1925,7 @@ impl Asset for DragonLateralSpec { impl DragonCenterSpec { pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc { - assets::load_watched::("voxygen.voxel.dragon_center_manifest", indicator) - .unwrap() + assets::load_watched::("voxygen.voxel.dragon_center_manifest", indicator).unwrap() } pub fn mesh_head_upper( @@ -2012,7 +2011,7 @@ impl DragonCenterSpec { generate_mesh(¢er, Vec3::from(spec.chest_front.offset)) } - + pub fn mesh_chest_rear( &self, species: DSpecies, @@ -2078,8 +2077,7 @@ impl DragonCenterSpec { } impl DragonLateralSpec { pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc { - assets::load_watched::("voxygen.voxel.dragon_lateral_manifest", indicator) - .unwrap() + assets::load_watched::("voxygen.voxel.dragon_lateral_manifest", indicator).unwrap() } pub fn mesh_wing_in_l( From 41ff0bde69ce5ee5b72c55610cb5976c83d0f5db Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sat, 9 May 2020 18:56:08 -0400 Subject: [PATCH 16/19] rebase --- voxygen/src/anim/biped_large/mod.rs | 228 ++++++++++++---------------- voxygen/src/anim/dragon/mod.rs | 132 +++------------- 2 files changed, 121 insertions(+), 239 deletions(-) diff --git a/voxygen/src/anim/biped_large/mod.rs b/voxygen/src/anim/biped_large/mod.rs index 8438ef999a..0bb0621bcb 100644 --- a/voxygen/src/anim/biped_large/mod.rs +++ b/voxygen/src/anim/biped_large/mod.rs @@ -1,114 +1,100 @@ -pub mod fly; pub mod idle; +pub mod jump; pub mod run; // Reexports -pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; +pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; use super::{Bone, Skeleton}; use crate::render::FigureBoneData; use common::comp::{self}; +use vek::Vec3; #[derive(Clone, Default)] -pub struct DragonSkeleton { - head_upper: Bone, - head_lower: Bone, - jaw: Bone, - chest_front: Bone, - chest_rear: Bone, - tail_front: Bone, - tail_rear: Bone, - wing_in_l: Bone, - wing_in_r: Bone, - wing_out_l: Bone, - wing_out_r: Bone, - foot_fl: Bone, - foot_fr: Bone, - foot_bl: Bone, - foot_br: Bone, +pub struct BipedLargeSkeleton { + head: Bone, + upper_torso: Bone, + lower_torso: Bone, + shoulder_l: Bone, + shoulder_r: Bone, + hand_l: Bone, + hand_r: Bone, + leg_l: Bone, + leg_r: Bone, + foot_l: Bone, + foot_r: Bone, + torso: Bone, } -impl DragonSkeleton { +impl BipedLargeSkeleton { pub fn new() -> Self { Self::default() } } -impl Skeleton for DragonSkeleton { +impl Skeleton for BipedLargeSkeleton { type Attr = SkeletonAttr; - fn bone_count(&self) -> usize { 15 } + fn bone_count(&self) -> usize { 11 } - fn compute_matrices(&self) -> [FigureBoneData; 16] { - let head_upper_mat = self.head_upper.compute_base_matrix(); - let head_lower_mat = self.head_lower.compute_base_matrix(); - let chest_front_mat = self.chest_front.compute_base_matrix(); - let chest_rear_mat = self.chest_rear.compute_base_matrix(); - let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); - let wing_in_r_mat = self.wing_in_r.compute_base_matrix(); - let tail_front_mat = self.tail_front.compute_base_matrix(); - - [ - FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat), - FigureBoneData::new(chest_front_mat * head_lower_mat), - FigureBoneData::new( - chest_front_mat * head_lower_mat * head_upper_mat * self.jaw.compute_base_matrix(), - ), - FigureBoneData::new(chest_front_mat), - FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix()), - FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat), - FigureBoneData::new( - chest_front_mat - * chest_rear_mat - * tail_front_mat - * self.tail_rear.compute_base_matrix(), - ), - FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), - FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), - FigureBoneData::new( - chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix(), - ), - FigureBoneData::new( - chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix(), - ), - FigureBoneData::new(self.foot_fl.compute_base_matrix()), - FigureBoneData::new(self.foot_fr.compute_base_matrix()), - FigureBoneData::new(self.foot_bl.compute_base_matrix()), - FigureBoneData::new(self.foot_br.compute_base_matrix()), - FigureBoneData::default(), - ] + fn compute_matrices(&self) -> ([FigureBoneData; 16], Vec3) { + let upper_torso_mat = self.upper_torso.compute_base_matrix(); + let shoulder_l_mat = self.shoulder_l.compute_base_matrix(); + 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(torso_mat * upper_torso_mat * self.head.compute_base_matrix()), + FigureBoneData::new(torso_mat * upper_torso_mat), + FigureBoneData::new( + 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 * self.hand_l.compute_base_matrix(), + ), + FigureBoneData::new( + torso_mat * upper_torso_mat * self.hand_r.compute_base_matrix(), + ), + FigureBoneData::new(torso_mat * upper_torso_mat * leg_l_mat), + FigureBoneData::new(torso_mat * upper_torso_mat * leg_r_mat), + FigureBoneData::new(self.foot_l.compute_base_matrix()), + FigureBoneData::new(self.foot_r.compute_base_matrix()), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), + ], + Vec3::default(), + ) } fn interpolate(&mut self, target: &Self, dt: f32) { - self.head_upper.interpolate(&target.head_upper, dt); - self.head_lower.interpolate(&target.head_lower, dt); - self.jaw.interpolate(&target.jaw, dt); - self.chest_front.interpolate(&target.chest_front, dt); - self.chest_rear.interpolate(&target.chest_rear, dt); - self.tail_front.interpolate(&target.tail_front, dt); - self.tail_rear.interpolate(&target.tail_rear, dt); - self.wing_in_l.interpolate(&target.wing_in_l, dt); - self.wing_in_r.interpolate(&target.wing_in_r, dt); - self.wing_out_l.interpolate(&target.wing_out_l, dt); - self.wing_out_r.interpolate(&target.wing_out_r, dt); - self.foot_fl.interpolate(&target.foot_fl, dt); - self.foot_fr.interpolate(&target.foot_fr, dt); - self.foot_bl.interpolate(&target.foot_bl, dt); - self.foot_br.interpolate(&target.foot_br, dt); + self.head.interpolate(&target.head, dt); + self.upper_torso.interpolate(&target.upper_torso, dt); + self.lower_torso.interpolate(&target.lower_torso, dt); + self.shoulder_l.interpolate(&target.shoulder_l, dt); + self.shoulder_r.interpolate(&target.shoulder_r, dt); + self.hand_l.interpolate(&target.hand_l, dt); + self.hand_r.interpolate(&target.hand_r, dt); + self.leg_l.interpolate(&target.leg_l, dt); + 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 { - head_upper: (f32, f32), - head_lower: (f32, f32), - jaw: (f32, f32), - chest_front: (f32, f32), - chest_rear: (f32, f32), - tail_front: (f32, f32), - tail_rear: (f32, f32), - wing_in: (f32, f32, f32), - wing_out: (f32, f32, f32), - feet_f: (f32, f32, f32), - feet_b: (f32, f32, f32), - height: f32, + 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 { @@ -116,7 +102,7 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { fn try_from(body: &'a comp::Body) -> Result { match body { - comp::Body::Dragon(body) => Ok(SkeletonAttr::from(body)), + comp::Body::BipedLarge(body) => Ok(SkeletonAttr::from(body)), _ => Err(()), } } @@ -125,61 +111,41 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { impl Default for SkeletonAttr { fn default() -> Self { Self { - head_upper: (0.0, 0.0), - head_lower: (0.0, 0.0), - jaw: (0.0, 0.0), - chest_front: (0.0, 0.0), - chest_rear: (0.0, 0.0), - tail_front: (0.0, 0.0), - tail_rear: (0.0, 0.0), - wing_in: (0.0, 0.0, 0.0), - wing_out: (0.0, 0.0, 0.0), - feet_f: (0.0, 0.0, 0.0), - feet_b: (0.0, 0.0, 0.0), - height: (0.0), + 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::dragon::Body> for SkeletonAttr { - fn from(body: &'a comp::dragon::Body) -> Self { - use comp::dragon::Species::*; +impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr { + fn from(body: &'a comp::biped_large::Body) -> Self { + use comp::biped_large::Species::*; Self { - head_upper: match (body.species, body.body_type) { - (Reddragon, _) => (2.5, 4.5), + head: match (body.species, body.body_type) { + (Ogre, _) => (3.0, 6.0), }, - head_lower: match (body.species, body.body_type) { - (Reddragon, _) => (7.5, 3.5), + upper_torso: match (body.species, body.body_type) { + (Ogre, _) => (0.0, 19.0), }, - jaw: match (body.species, body.body_type) { - (Reddragon, _) => (7.0, -5.0), + lower_torso: match (body.species, body.body_type) { + (Ogre, _) => (1.0, -9.5), }, - chest_front: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 14.0), + shoulder: match (body.species, body.body_type) { + (Ogre, _) => (6.1, 0.5, 2.5), }, - chest_rear: match (body.species, body.body_type) { - (Reddragon, _) => (-12.5, 0.0), + hand: match (body.species, body.body_type) { + (Ogre, _) => (10.5, -1.0, -0.5), }, - tail_front: match (body.species, body.body_type) { - (Reddragon, _) => (-6.5, 1.5), + leg: match (body.species, body.body_type) { + (Ogre, _) => (0.0, 0.0, -6.0), }, - tail_rear: match (body.species, body.body_type) { - (Reddragon, _) => (-11.5, -1.0), - }, - wing_in: match (body.species, body.body_type) { - (Reddragon, _) => (2.5, -16.5, 0.0), - }, - wing_out: match (body.species, body.body_type) { - (Reddragon, _) => (23.0, 0.5, 4.0), - }, - feet_f: match (body.species, body.body_type) { - (Reddragon, _) => (6.0, 0.0, 1.5), - }, - feet_b: match (body.species, body.body_type) { - (Reddragon, _) => (6.0, -15.0, 3.0), - }, - height: match (body.species, body.body_type) { - (Reddragon, _) => (1.0), + foot: match (body.species, body.body_type) { + (Ogre, _) => (4.0, 0.5, 2.5), }, } } diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index ae870320c6..db6bd23dbd 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -7,70 +7,9 @@ pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; use super::{Bone, Skeleton}; use crate::render::FigureBoneData; -<<<<<<< HEAD -<<<<<<< HEAD use common::comp::{self}; use vek::Vec3; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_UPPER_X: f32 = 2.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_UPPER_Z: f32 = 4.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_LOWER_X: f32 = 7.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const HEAD_LOWER_Z: f32 = 3.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const JAW_X: f32 = 7.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const JAW_Z: f32 = -5.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const CHEST_F_X: f32 = 0.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const CHEST_F_Z: f32 = 14.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const CHEST_R_X: f32 = -12.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const CHEST_R_Z: f32 = 0.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_F_X: f32 = -12.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_F_Z: f32 = 1.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_R_X: f32 = -14.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const TAIL_R_Z: f32 = 0.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_IN_X: f32 = 2.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_IN_Y: f32 = -16.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_IN_Z: f32 = 0.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_OUT_X: f32 = 23.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_OUT_Y: f32 = 0.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const WING_OUT_Z: f32 = 4.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const FEET_F_X: f32 = 6.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const FEET_F_Y: f32 = 0.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const FEET_F_Z: f32 = 1.5; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const FEET_B_X: f32 = 6.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const FEET_B_Y: f32 = -15.0; -#[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] -const FEET_B_Z: f32 = 3.0; -======= -use common::comp::{self}; ->>>>>>> Cleanup -======= -use common::comp::{self}; ->>>>>>> fmt - #[derive(Clone, Default)] pub struct DragonSkeleton { head_upper: Bone, @@ -99,72 +38,49 @@ impl Skeleton for DragonSkeleton { fn bone_count(&self) -> usize { 15 } -<<<<<<< HEAD fn compute_matrices(&self) -> ([FigureBoneData; 16], Vec3) { -======= - fn compute_matrices(&self) -> [FigureBoneData; 16] { let head_upper_mat = self.head_upper.compute_base_matrix(); let head_lower_mat = self.head_lower.compute_base_matrix(); ->>>>>>> New dragon model, added jaw, splitted head into upper/lower let chest_front_mat = self.chest_front.compute_base_matrix(); let chest_rear_mat = self.chest_rear.compute_base_matrix(); let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); let wing_in_r_mat = self.wing_in_r.compute_base_matrix(); let tail_front_mat = self.tail_front.compute_base_matrix(); - -<<<<<<< HEAD ( [ - FigureBoneData::new(self.head.compute_base_matrix() * chest_front_mat), + FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat), + FigureBoneData::new(chest_front_mat * head_lower_mat), + FigureBoneData::new( + chest_front_mat + * head_lower_mat + * head_upper_mat + * self.jaw.compute_base_matrix(), + ), FigureBoneData::new(chest_front_mat), - FigureBoneData::new(self.chest_rear.compute_base_matrix() * chest_front_mat), - FigureBoneData::new(tail_front_mat), - FigureBoneData::new(self.tail_rear.compute_base_matrix() * tail_front_mat), - FigureBoneData::new(wing_in_l_mat), - FigureBoneData::new(wing_in_r_mat), - FigureBoneData::new(self.wing_out_l.compute_base_matrix() * wing_in_l_mat), - FigureBoneData::new(self.wing_out_r.compute_base_matrix() * wing_in_r_mat), + FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat), + FigureBoneData::new( + chest_front_mat + * chest_rear_mat + * tail_front_mat + * self.tail_rear.compute_base_matrix(), + ), + FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), + FigureBoneData::new( + chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix(), + ), + FigureBoneData::new( + chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix(), + ), FigureBoneData::new(self.foot_fl.compute_base_matrix()), FigureBoneData::new(self.foot_fr.compute_base_matrix()), FigureBoneData::new(self.foot_bl.compute_base_matrix()), FigureBoneData::new(self.foot_br.compute_base_matrix()), FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), ], Vec3::default(), ) -======= - [ - FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat), - FigureBoneData::new(chest_front_mat * head_lower_mat), - FigureBoneData::new( - chest_front_mat * head_lower_mat * head_upper_mat * self.jaw.compute_base_matrix(), - ), - FigureBoneData::new(chest_front_mat), - FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix()), - FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat), - FigureBoneData::new( - chest_front_mat - * chest_rear_mat - * tail_front_mat - * self.tail_rear.compute_base_matrix(), - ), - FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), - FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), - FigureBoneData::new( - chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix(), - ), - FigureBoneData::new( - chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix(), - ), - FigureBoneData::new(self.foot_fl.compute_base_matrix()), - FigureBoneData::new(self.foot_fr.compute_base_matrix()), - FigureBoneData::new(self.foot_bl.compute_base_matrix()), - FigureBoneData::new(self.foot_br.compute_base_matrix()), - FigureBoneData::default(), - ] ->>>>>>> Symmetry of dragon skeleton } fn interpolate(&mut self, target: &Self, dt: f32) { From 4ba222abcda54adb537dd4b43277decf1a8e13ac Mon Sep 17 00:00:00 2001 From: Snowram Date: Sun, 10 May 2020 01:40:53 +0200 Subject: [PATCH 17/19] Fix dragon jaw Z fighting --- voxygen/src/anim/dragon/fly.rs | 10 +++++----- voxygen/src/anim/dragon/idle.rs | 4 ++-- voxygen/src/anim/dragon/mod.rs | 2 +- voxygen/src/anim/dragon/run.rs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/voxygen/src/anim/dragon/fly.rs b/voxygen/src/anim/dragon/fly.rs index 53fcce8757..a996e89775 100644 --- a/voxygen/src/anim/dragon/fly.rs +++ b/voxygen/src/anim/dragon/fly.rs @@ -39,7 +39,7 @@ impl Animation for FlyAnimation { ); next.head_upper.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_ultra_slow * -0.10); - next.head_upper.scale = Vec3::one(); + next.head_upper.scale = Vec3::one() * 1.05; next.head_lower.offset = Vec3::new( 0.0, @@ -48,15 +48,15 @@ impl Animation for FlyAnimation { ); next.head_lower.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(wave_ultra_slow * -0.10); - next.head_lower.scale = Vec3::one(); + next.head_lower.scale = Vec3::one() * 1.05; next.jaw.offset = Vec3::new( 0.0, skeleton_attr.jaw.0 - wave_ultra_slow_cos * 0.12, skeleton_attr.jaw.1 + wave_slow * 0.2, ); - next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); - next.jaw.scale = Vec3::one() * 0.98; + next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.03); + next.jaw.scale = Vec3::one() * 1.05; next.tail_front.offset = Vec3::new( 0.0, @@ -141,7 +141,7 @@ impl Animation for FlyAnimation { skeleton_attr.wing_out.2, ); next.wing_out_l.ori = Quaternion::rotation_y((0.35 + wingl * 0.6).max(0.2)); - next.wing_out_l.scale = Vec3::one() * 1.05; + next.wing_out_l.scale = Vec3::one(); next.wing_out_r.offset = Vec3::new( skeleton_attr.wing_out.0, diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index afdd649907..9e97adb4c3 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -53,8 +53,8 @@ impl Animation for IdleAnimation { next.head_lower.scale = Vec3::one() * 1.05; next.jaw.offset = Vec3::new(0.0, skeleton_attr.jaw.0, skeleton_attr.jaw.1); - next.jaw.ori = Quaternion::rotation_x(slow * 0.05); - next.jaw.scale = Vec3::one() * 0.98; + next.jaw.ori = Quaternion::rotation_x(slow * 0.04); + next.jaw.scale = Vec3::one() * 1.05; next.chest_front.offset = Vec3::new( 0.0, diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index db6bd23dbd..8e4ea6ff40 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -158,7 +158,7 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { (Reddragon, _) => (7.5, 3.5), }, jaw: match (body.species, body.body_type) { - (Reddragon, _) => (7.0, -5.0), + (Reddragon, _) => (6.5, -5.0), }, chest_front: match (body.species, body.body_type) { (Reddragon, _) => (0.0, 14.0), diff --git a/voxygen/src/anim/dragon/run.rs b/voxygen/src/anim/dragon/run.rs index 2619713d4c..6bb74df52c 100644 --- a/voxygen/src/anim/dragon/run.rs +++ b/voxygen/src/anim/dragon/run.rs @@ -67,8 +67,8 @@ impl Animation for RunAnimation { skeleton_attr.jaw.0 - wave_ultra_slow_cos * 0.12, skeleton_attr.jaw.1 + wave_slow * 0.2, ); - next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.05); - next.jaw.scale = Vec3::one() * 0.98; + next.jaw.ori = Quaternion::rotation_x(wave_slow * 0.03); + next.jaw.scale = Vec3::one() * 1.05; next.tail_front.offset = Vec3::new( 0.0, @@ -137,7 +137,7 @@ impl Animation for RunAnimation { skeleton_attr.wing_in.2, ); next.wing_in_l.ori = Quaternion::rotation_y(0.8); - next.wing_in_l.scale = Vec3::one() * 1.05; + next.wing_in_l.scale = Vec3::one(); next.wing_in_r.offset = Vec3::new( skeleton_attr.wing_in.0, From b8ed55113b8ffc6c066278f14aac4c90904eee48 Mon Sep 17 00:00:00 2001 From: Snowram Date: Sun, 10 May 2020 01:41:35 +0200 Subject: [PATCH 18/19] Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1978b3b1ed..182145af63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,7 +64,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added non-uniform block heights - Added `/sudo` command - Added a Level of Detail (LoD) system for terrain sprites and entities -- Added owl, hyena, parrot npcs +- Added owl, hyena, parrot, cockatrice, red dragon npcs - Added dungeon entrances - Villagers tools and clothing - Cultists clothing From 5b48fe566158726bfdff3373642e2d9fd21927ea Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sat, 9 May 2020 19:59:34 -0400 Subject: [PATCH 19/19] delete unused jump file --- voxygen/src/anim/dragon/jump.rs | 73 --------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 voxygen/src/anim/dragon/jump.rs diff --git a/voxygen/src/anim/dragon/jump.rs b/voxygen/src/anim/dragon/jump.rs deleted file mode 100644 index d699d23050..0000000000 --- a/voxygen/src/anim/dragon/jump.rs +++ /dev/null @@ -1,73 +0,0 @@ -use super::{super::Animation, DragonSkeleton, SkeletonAttr}; -//use std::f32::consts::PI; -use vek::*; - -pub struct JumpAnimation; - -impl Animation for JumpAnimation { - type Dependency = (f32, f64); - type Skeleton = DragonSkeleton; - - fn update_skeleton( - skeleton: &Self::Skeleton, - _global_time: Self::Dependency, - _anim_time: f64, - _rate: &mut f32, - _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() * 1.01; - - next.chest_front.offset = Vec3::new(0.0, 4.5, 2.0); - next.chest_front.ori = Quaternion::rotation_x(0.0); - next.chest_front.scale = Vec3::one() * 1.01; - - next.chest_rear.offset = Vec3::new(0.0, 4.5, 2.0); - next.chest_rear.ori = Quaternion::rotation_x(0.0); - next.chest_rear.scale = Vec3::one() * 1.01; - - next.tail_front.offset = Vec3::new(0.0, 4.5, 2.0); - next.tail_front.ori = Quaternion::rotation_x(0.0); - next.tail_front.scale = Vec3::one() * 1.01; - - next.tail_rear.offset = Vec3::new(0.0, 4.5, 2.0); - next.tail_rear.ori = Quaternion::rotation_x(0.0); - next.tail_rear.scale = Vec3::one() * 1.01; - - next.wing_in_l.offset = Vec3::new(0.0, 4.5, 2.0); - next.wing_in_l.ori = Quaternion::rotation_x(0.0); - next.wing_in_l.scale = Vec3::one() * 1.01; - - next.wing_in_r.offset = Vec3::new(0.0, 4.5, 2.0); - next.wing_in_r.ori = Quaternion::rotation_x(0.0); - next.wing_in_r.scale = Vec3::one() * 1.01; - - next.wing_out_l.offset = Vec3::new(0.0, 4.5, 2.0); - next.wing_out_l.ori = Quaternion::rotation_x(0.0); - next.wing_out_l.scale = Vec3::one() * 1.01; - - next.wing_out_r.offset = Vec3::new(0.0, 4.5, 2.0); - next.wing_out_r.ori = Quaternion::rotation_x(0.0); - next.wing_out_r.scale = Vec3::one() * 1.01; - - next.foot_fl.offset = Vec3::new(0.0, 4.5, 2.0); - next.foot_fl.ori = Quaternion::rotation_x(0.0); - next.foot_fl.scale = Vec3::one() * 1.01; - - next.foot_fr.offset = Vec3::new(0.0, 4.5, 2.0); - next.foot_fr.ori = Quaternion::rotation_x(0.0); - next.foot_fr.scale = Vec3::one() * 1.01; - - next.foot_bl.offset = Vec3::new(0.0, 4.5, 2.0); - next.foot_bl.ori = Quaternion::rotation_x(0.0); - next.foot_bl.scale = Vec3::one() * 1.01; - - next.foot_br.offset = Vec3::new(0.0, 4.5, 2.0); - next.foot_br.ori = Quaternion::rotation_x(0.0); - next.foot_br.scale = Vec3::one() * 1.01; - next - } -}