From 6fa13bcb7e67b48023e372807e7e01dc3760163a Mon Sep 17 00:00:00 2001 From: Justin Shipsey Date: Sun, 26 Apr 2020 01:09:03 +0000 Subject: [PATCH 01/10] body/anim tweaks --- assets/common/npc_names.json | 20 +- .../voxel/biped_large_center_manifest.ron | 20 +- .../voxel/biped_large_lateral_manifest.ron | 48 ++-- .../voxel/bird_medium_lateral_manifest.ron | 40 +-- .../voxygen/voxel/golem_center_manifest.ron | 22 ++ .../voxygen/voxel/golem_lateral_manifest.ron | 70 +++++ .../voxygen/voxel/npc/giant/female/foot_l.vox | 3 - .../voxygen/voxel/npc/giant/female/foot_r.vox | 3 - .../voxygen/voxel/npc/giant/female/head.vox | 3 - .../voxel/npc/giant/female/torso_upper.vox | 3 - .../voxygen/voxel/npc/giant/male/foot_l.vox | 3 - .../voxygen/voxel/npc/giant/male/foot_r.vox | 3 - assets/voxygen/voxel/npc/giant/male/head.vox | 3 - .../voxel/npc/giant/male/torso_upper.vox | 3 - assets/voxygen/voxel/npc/oger/belt.vox | 3 - assets/voxygen/voxel/npc/oger/chest.vox | 3 - assets/voxygen/voxel/npc/oger/foot.vox | 3 - assets/voxygen/voxel/npc/oger/hand-l.vox | 3 - assets/voxygen/voxel/npc/oger/hand-r.vox | 3 - assets/voxygen/voxel/npc/oger/head.vox | 3 - assets/voxygen/voxel/npc/oger/legs.vox | 3 - assets/voxygen/voxel/npc/oger/shoulder.vox | 3 - .../voxygen/voxel/npc/ogre/female/club_l.vox | 3 + .../voxygen/voxel/npc/ogre/female/club_r.vox | 3 + .../voxygen/voxel/npc/ogre/female/foot_l.vox | 3 + .../voxygen/voxel/npc/ogre/female/foot_r.vox | 3 + .../npc/{giant => ogre}/female/hand_l.vox | 0 .../npc/{giant => ogre}/female/hand_r.vox | 0 assets/voxygen/voxel/npc/ogre/female/head.vox | 3 + .../npc/{giant => ogre}/female/leg_l.vox | 0 .../npc/{giant => ogre}/female/leg_r.vox | 0 .../npc/{giant => ogre}/female/shoulder_l.vox | 0 .../npc/{giant => ogre}/female/shoulder_r.vox | 0 .../{giant => ogre}/female/torso_lower.vox | 0 .../voxel/npc/ogre/female/torso_upper.vox | 3 + assets/voxygen/voxel/npc/ogre/male/club_l.vox | 3 + assets/voxygen/voxel/npc/ogre/male/club_r.vox | 3 + assets/voxygen/voxel/npc/ogre/male/foot_l.vox | 3 + assets/voxygen/voxel/npc/ogre/male/foot_r.vox | 3 + .../voxel/npc/{giant => ogre}/male/hand_l.vox | 0 .../voxel/npc/{giant => ogre}/male/hand_r.vox | 0 assets/voxygen/voxel/npc/ogre/male/head.vox | 3 + .../voxel/npc/{giant => ogre}/male/leg_l.vox | 0 .../voxel/npc/{giant => ogre}/male/leg_r.vox | 0 .../npc/{giant => ogre}/male/shoulder_l.vox | 0 .../npc/{giant => ogre}/male/shoulder_r.vox | 0 .../npc/{giant => ogre}/male/torso_lower.vox | 0 .../voxel/npc/ogre/male/torso_upper.vox | 3 + .../voxel/npc/stonegolem/female/foot_l.vox | 3 + .../voxel/npc/stonegolem/female/foot_r.vox | 3 + .../voxel/npc/stonegolem/female/hand_l.vox | 3 + .../voxel/npc/stonegolem/female/hand_r.vox | 3 + .../voxel/npc/stonegolem/female/head.vox | 3 + .../voxel/npc/stonegolem/female/leg_l.vox | 3 + .../voxel/npc/stonegolem/female/leg_r.vox | 3 + .../npc/stonegolem/female/shoulder_l.vox | 3 + .../npc/stonegolem/female/shoulder_r.vox | 3 + .../npc/stonegolem/female/torso_upper.vox | 3 + .../voxel/npc/stonegolem/male/foot_l.vox | 3 + .../voxel/npc/stonegolem/male/foot_r.vox | 3 + .../voxel/npc/stonegolem/male/hand_l.vox | 3 + .../voxel/npc/stonegolem/male/hand_r.vox | 3 + .../voxel/npc/stonegolem/male/head.vox | 3 + .../voxel/npc/stonegolem/male/leg_l.vox | 3 + .../voxel/npc/stonegolem/male/leg_r.vox | 3 + .../voxel/npc/stonegolem/male/shoulder_l.vox | 3 + .../voxel/npc/stonegolem/male/shoulder_r.vox | 3 + .../voxel/npc/stonegolem/male/torso_upper.vox | 3 + common/src/comp/body.rs | 11 +- common/src/comp/body/biped_large.rs | 8 +- common/src/comp/body/golem.rs | 68 +++++ common/src/comp/mod.rs | 4 +- common/src/npc.rs | 21 +- common/src/states/utils.rs | 4 +- voxygen/src/anim/biped_large/jump.rs | 90 ++++-- voxygen/src/anim/biped_large/mod.rs | 14 +- voxygen/src/anim/biped_large/run.rs | 11 +- voxygen/src/anim/bird_medium/fly.rs | 84 ++++++ voxygen/src/anim/bird_medium/jump.rs | 49 ---- voxygen/src/anim/bird_medium/mod.rs | 14 +- voxygen/src/anim/bird_medium/run.rs | 4 +- voxygen/src/anim/character/swim.rs | 40 ++- voxygen/src/anim/golem/idle.rs | 121 ++++++++ voxygen/src/anim/golem/jump.rs | 101 +++++++ voxygen/src/anim/golem/mod.rs | 149 ++++++++++ voxygen/src/anim/golem/run.rs | 126 ++++++++ voxygen/src/anim/mod.rs | 1 + voxygen/src/scene/figure/cache.rs | 59 ++++ voxygen/src/scene/figure/load.rs | 271 ++++++++++++++++++ voxygen/src/scene/figure/mod.rs | 123 +++++++- 90 files changed, 1501 insertions(+), 236 deletions(-) create mode 100644 assets/voxygen/voxel/golem_center_manifest.ron create mode 100644 assets/voxygen/voxel/golem_lateral_manifest.ron delete mode 100644 assets/voxygen/voxel/npc/giant/female/foot_l.vox delete mode 100644 assets/voxygen/voxel/npc/giant/female/foot_r.vox delete mode 100644 assets/voxygen/voxel/npc/giant/female/head.vox delete mode 100644 assets/voxygen/voxel/npc/giant/female/torso_upper.vox delete mode 100644 assets/voxygen/voxel/npc/giant/male/foot_l.vox delete mode 100644 assets/voxygen/voxel/npc/giant/male/foot_r.vox delete mode 100644 assets/voxygen/voxel/npc/giant/male/head.vox delete mode 100644 assets/voxygen/voxel/npc/giant/male/torso_upper.vox delete mode 100644 assets/voxygen/voxel/npc/oger/belt.vox delete mode 100644 assets/voxygen/voxel/npc/oger/chest.vox delete mode 100644 assets/voxygen/voxel/npc/oger/foot.vox delete mode 100644 assets/voxygen/voxel/npc/oger/hand-l.vox delete mode 100644 assets/voxygen/voxel/npc/oger/hand-r.vox delete mode 100644 assets/voxygen/voxel/npc/oger/head.vox delete mode 100644 assets/voxygen/voxel/npc/oger/legs.vox delete mode 100644 assets/voxygen/voxel/npc/oger/shoulder.vox create mode 100644 assets/voxygen/voxel/npc/ogre/female/club_l.vox create mode 100644 assets/voxygen/voxel/npc/ogre/female/club_r.vox create mode 100644 assets/voxygen/voxel/npc/ogre/female/foot_l.vox create mode 100644 assets/voxygen/voxel/npc/ogre/female/foot_r.vox rename assets/voxygen/voxel/npc/{giant => ogre}/female/hand_l.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/female/hand_r.vox (100%) create mode 100644 assets/voxygen/voxel/npc/ogre/female/head.vox rename assets/voxygen/voxel/npc/{giant => ogre}/female/leg_l.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/female/leg_r.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/female/shoulder_l.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/female/shoulder_r.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/female/torso_lower.vox (100%) create mode 100644 assets/voxygen/voxel/npc/ogre/female/torso_upper.vox create mode 100644 assets/voxygen/voxel/npc/ogre/male/club_l.vox create mode 100644 assets/voxygen/voxel/npc/ogre/male/club_r.vox create mode 100644 assets/voxygen/voxel/npc/ogre/male/foot_l.vox create mode 100644 assets/voxygen/voxel/npc/ogre/male/foot_r.vox rename assets/voxygen/voxel/npc/{giant => ogre}/male/hand_l.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/male/hand_r.vox (100%) create mode 100644 assets/voxygen/voxel/npc/ogre/male/head.vox rename assets/voxygen/voxel/npc/{giant => ogre}/male/leg_l.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/male/leg_r.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/male/shoulder_l.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/male/shoulder_r.vox (100%) rename assets/voxygen/voxel/npc/{giant => ogre}/male/torso_lower.vox (100%) create mode 100644 assets/voxygen/voxel/npc/ogre/male/torso_upper.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/foot_l.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/foot_r.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/hand_l.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/hand_r.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/head.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/leg_l.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/leg_r.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/shoulder_l.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/shoulder_r.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/female/torso_upper.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/foot_l.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/foot_r.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/hand_l.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/hand_r.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/head.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/leg_l.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/leg_r.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/shoulder_l.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/shoulder_r.vox create mode 100644 assets/voxygen/voxel/npc/stonegolem/male/torso_upper.vox create mode 100644 common/src/comp/body/golem.rs create mode 100644 voxygen/src/anim/bird_medium/fly.rs delete mode 100644 voxygen/src/anim/bird_medium/jump.rs create mode 100644 voxygen/src/anim/golem/idle.rs create mode 100644 voxygen/src/anim/golem/jump.rs create mode 100644 voxygen/src/anim/golem/mod.rs create mode 100644 voxygen/src/anim/golem/run.rs diff --git a/assets/common/npc_names.json b/assets/common/npc_names.json index d8bb02f0a7..b7add4fb9d 100644 --- a/assets/common/npc_names.json +++ b/assets/common/npc_names.json @@ -474,9 +474,23 @@ ] }, "species": { - "giant": { - "keyword": "giant", - "generic": "Giant" + "ogre": { + "keyword": "ogre", + "generic": "Ogre" + } + } + }, + "golem": { + "body": { + "keyword": "golem", + "names": [ + "phil" + ] + }, + "species": { + "stonegolem": { + "keyword": "stonegolem", + "generic": "StoneGolem" } } }, diff --git a/assets/voxygen/voxel/biped_large_center_manifest.ron b/assets/voxygen/voxel/biped_large_center_manifest.ron index 880524ae39..8cdd961d0c 100644 --- a/assets/voxygen/voxel/biped_large_center_manifest.ron +++ b/assets/voxygen/voxel/biped_large_center_manifest.ron @@ -1,30 +1,30 @@ ({ - (Giant, Male): ( + (Ogre, Male): ( head: ( - offset: (-9.0, -6.0, -6.5), - center: ("npc.giant.male.head"), + offset: (-8.0, -5.0, -6.0), + center: ("npc.ogre.male.head"), ), torso_upper: ( offset: (-8.0, -4.5, -5.0), - center: ("npc.giant.male.torso_upper"), + center: ("npc.ogre.male.torso_upper"), ), torso_lower: ( offset: (-5.0, -4.5, -4.5), - center: ("npc.giant.male.torso_lower"), + center: ("npc.ogre.male.torso_lower"), ) ), - (Giant, Female): ( + (Ogre, Female): ( head: ( - offset: (-9.0, -6.0, -6.5), - center: ("npc.giant.female.head"), + offset: (-8.0, -5.0, -6.0), + center: ("npc.ogre.female.head"), ), torso_upper: ( offset: (-8.0, -4.5, -5.0), - center: ("npc.giant.female.torso_upper"), + center: ("npc.ogre.female.torso_upper"), ), torso_lower: ( offset: (-5.0, -4.5, -4.5), - center: ("npc.giant.female.torso_lower"), + center: ("npc.ogre.female.torso_lower"), ) ), }) diff --git a/assets/voxygen/voxel/biped_large_lateral_manifest.ron b/assets/voxygen/voxel/biped_large_lateral_manifest.ron index 31855a5fbd..c160ae3bea 100644 --- a/assets/voxygen/voxel/biped_large_lateral_manifest.ron +++ b/assets/voxygen/voxel/biped_large_lateral_manifest.ron @@ -1,70 +1,70 @@ ({ - (Giant, Male): ( + (Ogre, Male): ( shoulder_l: ( offset: (-4.0, -5.5, -4.0), lateral: ("armor.empty"), ), shoulder_r: ( offset: (-4.0, -5.5, -4.0), - lateral: ("npc.giant.male.shoulder_r"), + lateral: ("npc.ogre.male.shoulder_r"), ), hand_l: ( - offset: (-2.5, -2.5, -14.0), - lateral: ("npc.giant.male.hand_l"), + offset: (-2.5, -2.5, -11.0), + lateral: ("npc.ogre.male.hand_l"), ), hand_r: ( - offset: (-2.5, -2.5, -14.0), - lateral: ("npc.giant.male.hand_r"), + offset: (-2.5, -2.5, -11.0), + lateral: ("npc.ogre.male.hand_r"), ), leg_l: ( offset: (-6.0, -3.5, -7.0), - lateral: ("npc.giant.male.leg_l"), + lateral: ("npc.ogre.male.leg_l"), ), leg_r: ( offset: (0.0, -3.5, -7.0), - lateral: ("npc.giant.male.leg_r"), + lateral: ("npc.ogre.male.leg_r"), ), foot_l: ( - offset: (-3.0, -5.0, -2.5), - lateral: ("npc.giant.male.foot_l"), + offset: (-3.0, -5.0, -3.0), + lateral: ("npc.ogre.male.foot_l"), ), foot_r: ( - offset: (-3.0, -5.0, -2.5), - lateral: ("npc.giant.male.foot_r"), + offset: (-3.0, -5.0, -3.0), + lateral: ("npc.ogre.male.foot_r"), ) ), - (Giant, Female): ( + (Ogre, Female): ( shoulder_l: ( offset: (-4.0, -5.5, -4.0), lateral: ("armor.empty"), ), shoulder_r: ( offset: (-4.0, -5.5, -4.0), - lateral: ("npc.giant.female.shoulder_r"), + lateral: ("npc.ogre.female.shoulder_r"), ), hand_l: ( - offset: (-2.5, -2.5, -14.0), - lateral: ("npc.giant.female.hand_l"), + offset: (-2.5, -2.5, -11.0), + lateral: ("npc.ogre.female.hand_l"), ), hand_r: ( - offset: (-2.5, -2.5, -14.0), - lateral: ("npc.giant.female.hand_r"), + offset: (-2.5, -2.5, -11.0), + lateral: ("npc.ogre.female.hand_r"), ), leg_l: ( offset: (-6.0, -3.5, -7.0), - lateral: ("npc.giant.female.leg_l"), + lateral: ("npc.ogre.female.leg_l"), ), leg_r: ( offset: (0.0, -3.5, -7.0), - lateral: ("npc.giant.female.leg_r"), + lateral: ("npc.ogre.female.leg_r"), ), foot_l: ( - offset: (-3.0, -5.0, -2.5), - lateral: ("npc.giant.female.foot_l"), + offset: (-3.0, -5.0, -3.0), + lateral: ("npc.ogre.female.foot_l"), ), foot_r: ( - offset: (-3.0, -5.0, -2.5), - lateral: ("npc.giant.female.foot_r"), + offset: (-3.0, -5.0, -3.0), + lateral: ("npc.ogre.female.foot_r"), ) ), }) diff --git a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron index 26f5bdb9de..909c2fc823 100644 --- a/assets/voxygen/voxel/bird_medium_lateral_manifest.ron +++ b/assets/voxygen/voxel/bird_medium_lateral_manifest.ron @@ -1,11 +1,11 @@ ({ (Duck, Male): ( wing_l: ( - offset: (-0.5, -2.5, -8.0), + offset: (-0.5, -2.5, -3.0), lateral: ("npc.duck.male.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -8.0), + offset: (-0.5, -2.5, -3.0), lateral: ("npc.duck.male.wing"), ), foot_l: ( @@ -19,11 +19,11 @@ ), (Duck, Female): ( wing_l: ( - offset: (-0.5, -2.5, -8.0), + offset: (-0.5, -2.5, -3.0), lateral: ("npc.duck.female.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -8.0), + offset: (-0.5, -2.5, -3.0), lateral: ("npc.duck.female.wing"), ), foot_l: ( @@ -37,11 +37,11 @@ ), (Chicken, Male): ( wing_l: ( - offset: (-0.5, -2.5, -8.0), + offset: (-0.5, -2.5, -3.0), lateral: ("npc.chicken.male.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -8.0), + offset: (-0.5, -2.5, -3.0), lateral: ("npc.chicken.male.wing"), ), foot_l: ( @@ -55,11 +55,11 @@ ), (Chicken, Female): ( wing_l: ( - offset: (-0.5, -2.5, -8.0), + offset: (-0.5, -2.5, -3.0), lateral: ("npc.chicken.female.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -8.0), + offset: (-0.5, -2.5, -3.0), lateral: ("npc.chicken.female.wing"), ), foot_l: ( @@ -73,11 +73,11 @@ ), (Goose, Male): ( wing_l: ( - offset: (-0.5, -2.5, -11.0), + offset: (-0.5, -2.5, -4.0), lateral: ("npc.goose.male.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -11.0), + offset: (-0.5, -2.5, -4.0), lateral: ("npc.goose.male.wing"), ), foot_l: ( @@ -91,11 +91,11 @@ ), (Goose, Female): ( wing_l: ( - offset: (-0.5, -2.5, -11.0), + offset: (-0.5, -2.5, -4.0), lateral: ("npc.goose.female.wing"), ), wing_r: ( - offset: (-0.5, -2.5, -11.0), + offset: (-0.5, -2.5, -4.0), lateral: ("npc.goose.female.wing"), ), foot_l: ( @@ -109,11 +109,11 @@ ), (Peacock, Male): ( wing_l: ( - offset: (-1.0, -3.5, -13.0), + offset: (-1.0, -3.5, -5.0), lateral: ("npc.peacock.male.wing_l"), ), wing_r: ( - offset: (-1.0, -3.5, -13.0), + offset: (-1.0, -3.5, -5.0), lateral: ("npc.peacock.male.wing_r"), ), foot_l: ( @@ -127,11 +127,11 @@ ), (Peacock, Female): ( wing_l: ( - offset: (-1.0, -3.5, -13.0), + offset: (-1.0, -3.5, -5.0), lateral: ("npc.peacock.female.wing_l"), ), wing_r: ( - offset: (-1.0, -3.5, -13.0), + offset: (-1.0, -3.5, -5.0), lateral: ("npc.peacock.female.wing_r"), ), foot_l: ( @@ -145,11 +145,11 @@ ), (Eagle, Male): ( wing_l: ( - offset: (-1.0, -3.5, -13.0), + offset: (-1.0, -3.5, -12.0), lateral: ("npc.eagle.male.wing_l"), ), wing_r: ( - offset: (-1.0, -3.5, -13.0), + offset: (-1.0, -3.5, -12.0), lateral: ("npc.eagle.male.wing_r"), ), foot_l: ( @@ -163,11 +163,11 @@ ), (Eagle, Female): ( wing_l: ( - offset: (-1.0, -3.5, -13.0), + offset: (-1.0, -3.5, -12.0), lateral: ("npc.eagle.female.wing_l"), ), wing_r: ( - offset: (-1.0, -3.5, -13.0), + offset: (-1.0, -3.5, -12.0), lateral: ("npc.eagle.female.wing_r"), ), foot_l: ( diff --git a/assets/voxygen/voxel/golem_center_manifest.ron b/assets/voxygen/voxel/golem_center_manifest.ron new file mode 100644 index 0000000000..1a810d86d2 --- /dev/null +++ b/assets/voxygen/voxel/golem_center_manifest.ron @@ -0,0 +1,22 @@ +({ + (StoneGolem, Male): ( + head: ( + offset: (-5.0, -5.5, -7.5), + center: ("npc.stonegolem.male.head"), + ), + torso_upper: ( + offset: (-6.0, -3.5, -10.0), + center: ("npc.stonegolem.male.torso_upper"), + ), + ), + (StoneGolem, Female): ( + head: ( + offset: (-5.0, -5.5, -7.5), + center: ("npc.stonegolem.female.head"), + ), + torso_upper: ( + offset: (-6.0, -3.5, -10.0), + center: ("npc.stonegolem.female.torso_upper"), + ), + ), +}) diff --git a/assets/voxygen/voxel/golem_lateral_manifest.ron b/assets/voxygen/voxel/golem_lateral_manifest.ron new file mode 100644 index 0000000000..f0204e2d68 --- /dev/null +++ b/assets/voxygen/voxel/golem_lateral_manifest.ron @@ -0,0 +1,70 @@ +({ + (StoneGolem, Male): ( + shoulder_l: ( + offset: (-4.5, -4.0, -5.0), + lateral: ("npc.stonegolem.male.shoulder_l"), + ), + shoulder_r: ( + offset: (-4.5, -4.0, -5.0), + lateral: ("npc.stonegolem.male.shoulder_r"), + ), + hand_l: ( + offset: (-3.0, -3.5, -14.0), + lateral: ("npc.stonegolem.male.hand_l"), + ), + hand_r: ( + offset: (-3.0, -3.5, -14.0), + lateral: ("npc.stonegolem.male.hand_r"), + ), + leg_l: ( + offset: (-2.5, -2.5, -6.0), + lateral: ("npc.stonegolem.male.leg_l"), + ), + leg_r: ( + offset: (-2.5, -2.5, -6.0), + lateral: ("npc.stonegolem.male.leg_r"), + ), + foot_l: ( + offset: (-3.0, -3.5, -9.5), + lateral: ("npc.stonegolem.male.foot_l"), + ), + foot_r: ( + offset: (-3.0, -3.5, -9.5), + lateral: ("npc.stonegolem.male.foot_r"), + ) + ), + (StoneGolem, Female): ( + shoulder_l: ( + offset: (-4.5, -4.0, -5.0), + lateral: ("npc.stonegolem.male.shoulder_l"), + ), + shoulder_r: ( + offset: (-4.5, -4.0, -5.0), + lateral: ("npc.stonegolem.female.shoulder_r"), + ), + hand_l: ( + offset: (-3.0, -3.5, -14.0), + lateral: ("npc.stonegolem.female.hand_l"), + ), + hand_r: ( + offset: (-3.0, -3.5, -14.0), + lateral: ("npc.stonegolem.female.hand_r"), + ), + leg_l: ( + offset: (-2.5, -2.5, -6.0), + lateral: ("npc.stonegolem.female.leg_l"), + ), + leg_r: ( + offset: (-2.5, -2.5, -6.0), + lateral: ("npc.stonegolem.female.leg_r"), + ), + foot_l: ( + offset: (-3.0, -3.5, -10.5), + lateral: ("npc.stonegolem.female.foot_l"), + ), + foot_r: ( + offset: (-3.0, -3.5, -10.5), + lateral: ("npc.stonegolem.female.foot_r"), + ) + ), +}) diff --git a/assets/voxygen/voxel/npc/giant/female/foot_l.vox b/assets/voxygen/voxel/npc/giant/female/foot_l.vox deleted file mode 100644 index 6a6f33e1e8..0000000000 --- a/assets/voxygen/voxel/npc/giant/female/foot_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:28d297cc21308270571f67ffd2d89d9f2019e24577fea3f17bbe5f18d72f6dca -size 1920 diff --git a/assets/voxygen/voxel/npc/giant/female/foot_r.vox b/assets/voxygen/voxel/npc/giant/female/foot_r.vox deleted file mode 100644 index 08efe9ec67..0000000000 --- a/assets/voxygen/voxel/npc/giant/female/foot_r.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f399f33fd5f0f3abdb6b6466ee28fed54e323fe4dee2f2c5accc4fac375fa00f -size 1920 diff --git a/assets/voxygen/voxel/npc/giant/female/head.vox b/assets/voxygen/voxel/npc/giant/female/head.vox deleted file mode 100644 index 0ab6f106de..0000000000 --- a/assets/voxygen/voxel/npc/giant/female/head.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8ccc48349b2beb4a9c5a416e460bfe31ec0246c7aab0ad65b3c176eb27380c1d -size 5860 diff --git a/assets/voxygen/voxel/npc/giant/female/torso_upper.vox b/assets/voxygen/voxel/npc/giant/female/torso_upper.vox deleted file mode 100644 index 62c7c557a9..0000000000 --- a/assets/voxygen/voxel/npc/giant/female/torso_upper.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2f92b25d03056e0097910f0898e8f2cbaedf062aaeab60d5ba68a524976ec5ec -size 4980 diff --git a/assets/voxygen/voxel/npc/giant/male/foot_l.vox b/assets/voxygen/voxel/npc/giant/male/foot_l.vox deleted file mode 100644 index 6a6f33e1e8..0000000000 --- a/assets/voxygen/voxel/npc/giant/male/foot_l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:28d297cc21308270571f67ffd2d89d9f2019e24577fea3f17bbe5f18d72f6dca -size 1920 diff --git a/assets/voxygen/voxel/npc/giant/male/foot_r.vox b/assets/voxygen/voxel/npc/giant/male/foot_r.vox deleted file mode 100644 index 08efe9ec67..0000000000 --- a/assets/voxygen/voxel/npc/giant/male/foot_r.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f399f33fd5f0f3abdb6b6466ee28fed54e323fe4dee2f2c5accc4fac375fa00f -size 1920 diff --git a/assets/voxygen/voxel/npc/giant/male/head.vox b/assets/voxygen/voxel/npc/giant/male/head.vox deleted file mode 100644 index 0ab6f106de..0000000000 --- a/assets/voxygen/voxel/npc/giant/male/head.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8ccc48349b2beb4a9c5a416e460bfe31ec0246c7aab0ad65b3c176eb27380c1d -size 5860 diff --git a/assets/voxygen/voxel/npc/giant/male/torso_upper.vox b/assets/voxygen/voxel/npc/giant/male/torso_upper.vox deleted file mode 100644 index 62c7c557a9..0000000000 --- a/assets/voxygen/voxel/npc/giant/male/torso_upper.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2f92b25d03056e0097910f0898e8f2cbaedf062aaeab60d5ba68a524976ec5ec -size 4980 diff --git a/assets/voxygen/voxel/npc/oger/belt.vox b/assets/voxygen/voxel/npc/oger/belt.vox deleted file mode 100644 index 3be13b8607..0000000000 --- a/assets/voxygen/voxel/npc/oger/belt.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:640138a4516812405d5b7b8fe5e92652127e939cf09882ec2d40066995944aed -size 1736 diff --git a/assets/voxygen/voxel/npc/oger/chest.vox b/assets/voxygen/voxel/npc/oger/chest.vox deleted file mode 100644 index a7851d6b4f..0000000000 --- a/assets/voxygen/voxel/npc/oger/chest.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f1a313f34a4ac2da2e4622f0b3c641d6f3c22da12c08433eba641be35b20b4c7 -size 3124 diff --git a/assets/voxygen/voxel/npc/oger/foot.vox b/assets/voxygen/voxel/npc/oger/foot.vox deleted file mode 100644 index 5f93e9b833..0000000000 --- a/assets/voxygen/voxel/npc/oger/foot.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:922d8355b060ba8344793dafb3bf998198753d8b6bc528e125e11423ac15d149 -size 1508 diff --git a/assets/voxygen/voxel/npc/oger/hand-l.vox b/assets/voxygen/voxel/npc/oger/hand-l.vox deleted file mode 100644 index bdccb7e17c..0000000000 --- a/assets/voxygen/voxel/npc/oger/hand-l.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:08ccc11c9c68ab06d320a75f9e90edb9f969e31c3935c2effec650065642a6da -size 1332 diff --git a/assets/voxygen/voxel/npc/oger/hand-r.vox b/assets/voxygen/voxel/npc/oger/hand-r.vox deleted file mode 100644 index 09d273756c..0000000000 --- a/assets/voxygen/voxel/npc/oger/hand-r.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5367735a13345ea6d2cc64bdc99bb1153851553658ff6c1425874de6cf06b5b8 -size 1332 diff --git a/assets/voxygen/voxel/npc/oger/head.vox b/assets/voxygen/voxel/npc/oger/head.vox deleted file mode 100644 index ff1ff1f084..0000000000 --- a/assets/voxygen/voxel/npc/oger/head.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1bdee396a4bddcd426bde3bdf8fd06b2fb544a992398dd1f0a804a7149a35a4b -size 3784 diff --git a/assets/voxygen/voxel/npc/oger/legs.vox b/assets/voxygen/voxel/npc/oger/legs.vox deleted file mode 100644 index 68243de5b6..0000000000 --- a/assets/voxygen/voxel/npc/oger/legs.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cb8b4fdac51bc1a662ebb1cec3e5ef2c52167e0a021b603c9226e9afe2259ab8 -size 2428 diff --git a/assets/voxygen/voxel/npc/oger/shoulder.vox b/assets/voxygen/voxel/npc/oger/shoulder.vox deleted file mode 100644 index 93585a80e0..0000000000 --- a/assets/voxygen/voxel/npc/oger/shoulder.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:52a3f3b21c4994f1e610c1377587d0131b32b14b2ed07bcaaec2ddb88cbb2505 -size 1748 diff --git a/assets/voxygen/voxel/npc/ogre/female/club_l.vox b/assets/voxygen/voxel/npc/ogre/female/club_l.vox new file mode 100644 index 0000000000..2625afe818 --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/female/club_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:012f2dbf03877d2e8b47d770e85aa2d64123c0331dfe6eb6dafc45bcdd355dd6 +size 1784 diff --git a/assets/voxygen/voxel/npc/ogre/female/club_r.vox b/assets/voxygen/voxel/npc/ogre/female/club_r.vox new file mode 100644 index 0000000000..7121264992 --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/female/club_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8cafe8db5ffac25bd08a5b5755b79fc180a6bd0e061b8dd7c788b8c0634814a +size 1784 diff --git a/assets/voxygen/voxel/npc/ogre/female/foot_l.vox b/assets/voxygen/voxel/npc/ogre/female/foot_l.vox new file mode 100644 index 0000000000..81805a5c5e --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/female/foot_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49c49b6e8a68a9b0d5f5a0ed80d5fcfe34cbc8d86a720a138d516ca0719956d0 +size 2108 diff --git a/assets/voxygen/voxel/npc/ogre/female/foot_r.vox b/assets/voxygen/voxel/npc/ogre/female/foot_r.vox new file mode 100644 index 0000000000..f12850c7ff --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/female/foot_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e0441d49a30592fe48044e83ac30e550848e5da1135a9a35dfe480bd4ba4b70 +size 2108 diff --git a/assets/voxygen/voxel/npc/giant/female/hand_l.vox b/assets/voxygen/voxel/npc/ogre/female/hand_l.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/female/hand_l.vox rename to assets/voxygen/voxel/npc/ogre/female/hand_l.vox diff --git a/assets/voxygen/voxel/npc/giant/female/hand_r.vox b/assets/voxygen/voxel/npc/ogre/female/hand_r.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/female/hand_r.vox rename to assets/voxygen/voxel/npc/ogre/female/hand_r.vox diff --git a/assets/voxygen/voxel/npc/ogre/female/head.vox b/assets/voxygen/voxel/npc/ogre/female/head.vox new file mode 100644 index 0000000000..16b13831b3 --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/female/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e59c212b0bff023df92390c2fef0051bc99c8efd3a3397c8851d219e1dd3122 +size 4472 diff --git a/assets/voxygen/voxel/npc/giant/female/leg_l.vox b/assets/voxygen/voxel/npc/ogre/female/leg_l.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/female/leg_l.vox rename to assets/voxygen/voxel/npc/ogre/female/leg_l.vox diff --git a/assets/voxygen/voxel/npc/giant/female/leg_r.vox b/assets/voxygen/voxel/npc/ogre/female/leg_r.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/female/leg_r.vox rename to assets/voxygen/voxel/npc/ogre/female/leg_r.vox diff --git a/assets/voxygen/voxel/npc/giant/female/shoulder_l.vox b/assets/voxygen/voxel/npc/ogre/female/shoulder_l.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/female/shoulder_l.vox rename to assets/voxygen/voxel/npc/ogre/female/shoulder_l.vox diff --git a/assets/voxygen/voxel/npc/giant/female/shoulder_r.vox b/assets/voxygen/voxel/npc/ogre/female/shoulder_r.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/female/shoulder_r.vox rename to assets/voxygen/voxel/npc/ogre/female/shoulder_r.vox diff --git a/assets/voxygen/voxel/npc/giant/female/torso_lower.vox b/assets/voxygen/voxel/npc/ogre/female/torso_lower.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/female/torso_lower.vox rename to assets/voxygen/voxel/npc/ogre/female/torso_lower.vox diff --git a/assets/voxygen/voxel/npc/ogre/female/torso_upper.vox b/assets/voxygen/voxel/npc/ogre/female/torso_upper.vox new file mode 100644 index 0000000000..4e89371ef9 --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/female/torso_upper.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ff94ce3fb17681a3943c299bf39bdb0dd9c0f9cdad9421749886b64666acc2c +size 5108 diff --git a/assets/voxygen/voxel/npc/ogre/male/club_l.vox b/assets/voxygen/voxel/npc/ogre/male/club_l.vox new file mode 100644 index 0000000000..2625afe818 --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/male/club_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:012f2dbf03877d2e8b47d770e85aa2d64123c0331dfe6eb6dafc45bcdd355dd6 +size 1784 diff --git a/assets/voxygen/voxel/npc/ogre/male/club_r.vox b/assets/voxygen/voxel/npc/ogre/male/club_r.vox new file mode 100644 index 0000000000..7121264992 --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/male/club_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8cafe8db5ffac25bd08a5b5755b79fc180a6bd0e061b8dd7c788b8c0634814a +size 1784 diff --git a/assets/voxygen/voxel/npc/ogre/male/foot_l.vox b/assets/voxygen/voxel/npc/ogre/male/foot_l.vox new file mode 100644 index 0000000000..81805a5c5e --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/male/foot_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49c49b6e8a68a9b0d5f5a0ed80d5fcfe34cbc8d86a720a138d516ca0719956d0 +size 2108 diff --git a/assets/voxygen/voxel/npc/ogre/male/foot_r.vox b/assets/voxygen/voxel/npc/ogre/male/foot_r.vox new file mode 100644 index 0000000000..f12850c7ff --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/male/foot_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e0441d49a30592fe48044e83ac30e550848e5da1135a9a35dfe480bd4ba4b70 +size 2108 diff --git a/assets/voxygen/voxel/npc/giant/male/hand_l.vox b/assets/voxygen/voxel/npc/ogre/male/hand_l.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/male/hand_l.vox rename to assets/voxygen/voxel/npc/ogre/male/hand_l.vox diff --git a/assets/voxygen/voxel/npc/giant/male/hand_r.vox b/assets/voxygen/voxel/npc/ogre/male/hand_r.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/male/hand_r.vox rename to assets/voxygen/voxel/npc/ogre/male/hand_r.vox diff --git a/assets/voxygen/voxel/npc/ogre/male/head.vox b/assets/voxygen/voxel/npc/ogre/male/head.vox new file mode 100644 index 0000000000..16b13831b3 --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/male/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e59c212b0bff023df92390c2fef0051bc99c8efd3a3397c8851d219e1dd3122 +size 4472 diff --git a/assets/voxygen/voxel/npc/giant/male/leg_l.vox b/assets/voxygen/voxel/npc/ogre/male/leg_l.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/male/leg_l.vox rename to assets/voxygen/voxel/npc/ogre/male/leg_l.vox diff --git a/assets/voxygen/voxel/npc/giant/male/leg_r.vox b/assets/voxygen/voxel/npc/ogre/male/leg_r.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/male/leg_r.vox rename to assets/voxygen/voxel/npc/ogre/male/leg_r.vox diff --git a/assets/voxygen/voxel/npc/giant/male/shoulder_l.vox b/assets/voxygen/voxel/npc/ogre/male/shoulder_l.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/male/shoulder_l.vox rename to assets/voxygen/voxel/npc/ogre/male/shoulder_l.vox diff --git a/assets/voxygen/voxel/npc/giant/male/shoulder_r.vox b/assets/voxygen/voxel/npc/ogre/male/shoulder_r.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/male/shoulder_r.vox rename to assets/voxygen/voxel/npc/ogre/male/shoulder_r.vox diff --git a/assets/voxygen/voxel/npc/giant/male/torso_lower.vox b/assets/voxygen/voxel/npc/ogre/male/torso_lower.vox similarity index 100% rename from assets/voxygen/voxel/npc/giant/male/torso_lower.vox rename to assets/voxygen/voxel/npc/ogre/male/torso_lower.vox diff --git a/assets/voxygen/voxel/npc/ogre/male/torso_upper.vox b/assets/voxygen/voxel/npc/ogre/male/torso_upper.vox new file mode 100644 index 0000000000..4e89371ef9 --- /dev/null +++ b/assets/voxygen/voxel/npc/ogre/male/torso_upper.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ff94ce3fb17681a3943c299bf39bdb0dd9c0f9cdad9421749886b64666acc2c +size 5108 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/foot_l.vox b/assets/voxygen/voxel/npc/stonegolem/female/foot_l.vox new file mode 100644 index 0000000000..700a31c805 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/foot_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10db272e5f302fd26f51139dfdacd783c150eaccf8705370bd33f0b21f14008d +size 2404 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/foot_r.vox b/assets/voxygen/voxel/npc/stonegolem/female/foot_r.vox new file mode 100644 index 0000000000..5041daff8b --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/foot_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00e20e90eb259a284ad6bf91573028d6f8deab2dc086d38bef930117a3dc5109 +size 2404 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/hand_l.vox b/assets/voxygen/voxel/npc/stonegolem/female/hand_l.vox new file mode 100644 index 0000000000..7cb66e7158 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/hand_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c11a7d552ebe65c3a5d4b06d3f9cee9cbed7fdad12d82773a522878eda4df2b7 +size 2452 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/hand_r.vox b/assets/voxygen/voxel/npc/stonegolem/female/hand_r.vox new file mode 100644 index 0000000000..10221619db --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/hand_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dba068b223ccd71b4eb59b07febae18a20b86e134c15e952ab85018ee3ad70d3 +size 2452 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/head.vox b/assets/voxygen/voxel/npc/stonegolem/female/head.vox new file mode 100644 index 0000000000..5da9120aae --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18a0701635787abd3772651a64a3a9d722e6697a3fbf5f448f5d115d1adbe3aa +size 4360 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/leg_l.vox b/assets/voxygen/voxel/npc/stonegolem/female/leg_l.vox new file mode 100644 index 0000000000..446a1c62f6 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/leg_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ff971f0aedbccabcbac6007dd9314928d73afea519733bf00adecfabba309ed +size 1680 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/leg_r.vox b/assets/voxygen/voxel/npc/stonegolem/female/leg_r.vox new file mode 100644 index 0000000000..4ef5c9f6fd --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/leg_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd34a48b5d067a6d3e069ee12a75e38ab79db1a3030e2e8e3fff3732f87bbd46 +size 1680 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/shoulder_l.vox b/assets/voxygen/voxel/npc/stonegolem/female/shoulder_l.vox new file mode 100644 index 0000000000..0cf2050377 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/shoulder_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3e04c17d1baae98107f7bb92d9b2c1ffb384325ccabf9393571545128aa4508 +size 2344 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/shoulder_r.vox b/assets/voxygen/voxel/npc/stonegolem/female/shoulder_r.vox new file mode 100644 index 0000000000..2b3ce41ea8 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/shoulder_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d5b9f18d0e7c58f942998e6989ec933284232b90fd9a6c1ad888f1cad95c5d7 +size 2344 diff --git a/assets/voxygen/voxel/npc/stonegolem/female/torso_upper.vox b/assets/voxygen/voxel/npc/stonegolem/female/torso_upper.vox new file mode 100644 index 0000000000..b7afe03540 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/female/torso_upper.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd21aec7c477abe485d2c7e7d598747f6222af6ead01270c239623e7c6d2a4de +size 4832 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/foot_l.vox b/assets/voxygen/voxel/npc/stonegolem/male/foot_l.vox new file mode 100644 index 0000000000..700a31c805 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/foot_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10db272e5f302fd26f51139dfdacd783c150eaccf8705370bd33f0b21f14008d +size 2404 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/foot_r.vox b/assets/voxygen/voxel/npc/stonegolem/male/foot_r.vox new file mode 100644 index 0000000000..5041daff8b --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/foot_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00e20e90eb259a284ad6bf91573028d6f8deab2dc086d38bef930117a3dc5109 +size 2404 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/hand_l.vox b/assets/voxygen/voxel/npc/stonegolem/male/hand_l.vox new file mode 100644 index 0000000000..7cb66e7158 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/hand_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c11a7d552ebe65c3a5d4b06d3f9cee9cbed7fdad12d82773a522878eda4df2b7 +size 2452 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/hand_r.vox b/assets/voxygen/voxel/npc/stonegolem/male/hand_r.vox new file mode 100644 index 0000000000..10221619db --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/hand_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dba068b223ccd71b4eb59b07febae18a20b86e134c15e952ab85018ee3ad70d3 +size 2452 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/head.vox b/assets/voxygen/voxel/npc/stonegolem/male/head.vox new file mode 100644 index 0000000000..5da9120aae --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18a0701635787abd3772651a64a3a9d722e6697a3fbf5f448f5d115d1adbe3aa +size 4360 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/leg_l.vox b/assets/voxygen/voxel/npc/stonegolem/male/leg_l.vox new file mode 100644 index 0000000000..446a1c62f6 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/leg_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ff971f0aedbccabcbac6007dd9314928d73afea519733bf00adecfabba309ed +size 1680 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/leg_r.vox b/assets/voxygen/voxel/npc/stonegolem/male/leg_r.vox new file mode 100644 index 0000000000..4ef5c9f6fd --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/leg_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd34a48b5d067a6d3e069ee12a75e38ab79db1a3030e2e8e3fff3732f87bbd46 +size 1680 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/shoulder_l.vox b/assets/voxygen/voxel/npc/stonegolem/male/shoulder_l.vox new file mode 100644 index 0000000000..0cf2050377 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/shoulder_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3e04c17d1baae98107f7bb92d9b2c1ffb384325ccabf9393571545128aa4508 +size 2344 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/shoulder_r.vox b/assets/voxygen/voxel/npc/stonegolem/male/shoulder_r.vox new file mode 100644 index 0000000000..2b3ce41ea8 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/shoulder_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d5b9f18d0e7c58f942998e6989ec933284232b90fd9a6c1ad888f1cad95c5d7 +size 2344 diff --git a/assets/voxygen/voxel/npc/stonegolem/male/torso_upper.vox b/assets/voxygen/voxel/npc/stonegolem/male/torso_upper.vox new file mode 100644 index 0000000000..b7afe03540 --- /dev/null +++ b/assets/voxygen/voxel/npc/stonegolem/male/torso_upper.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd21aec7c477abe485d2c7e7d598747f6222af6ead01270c239623e7c6d2a4de +size 4832 diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index a777c4ace5..4545478126 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -5,6 +5,7 @@ pub mod critter; pub mod dragon; pub mod fish_medium; pub mod fish_small; +pub mod golem; pub mod humanoid; pub mod object; pub mod quadruped_medium; @@ -31,7 +32,8 @@ pub enum Body { FishSmall(fish_small::Body) = 7, BipedLarge(biped_large::Body) = 8, Object(object::Body) = 9, - Critter(critter::Body) = 10, + Golem(golem::Body) = 10, + Critter(critter::Body) = 11, } /// Data representing data generic to the body together with per-species data. @@ -56,6 +58,7 @@ pub struct AllBodies { pub quadruped_medium: BodyData>, pub bird_medium: BodyData>, pub biped_large: BodyData>, + pub golem: BodyData>, pub critter: BodyData>, } @@ -70,7 +73,8 @@ impl core::ops::Index for AllBodies &self.quadruped_small.body, NpcKind::Wolf => &self.quadruped_medium.body, NpcKind::Duck => &self.bird_medium.body, - NpcKind::Giant => &self.biped_large.body, + NpcKind::Ogre => &self.biped_large.body, + NpcKind::StoneGolem => &self.golem.body, NpcKind::Rat => &self.critter.body, } } @@ -110,7 +114,8 @@ impl Body { Body::Dragon(_) => 2.5, Body::BirdSmall(_) => 0.2, Body::FishSmall(_) => 0.2, - Body::BipedLarge(_) => 1.0, + Body::BipedLarge(_) => 2.0, + Body::Golem(_) => 2.5, Body::Object(_) => 0.3, } } diff --git a/common/src/comp/body/biped_large.rs b/common/src/comp/body/biped_large.rs index e32e647b04..3a1635279b 100644 --- a/common/src/comp/body/biped_large.rs +++ b/common/src/comp/body/biped_large.rs @@ -27,7 +27,7 @@ impl From for super::Body { #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[repr(u32)] pub enum Species { - Giant = 0, + Ogre = 0, } /// Data representing per-species generic data. @@ -35,7 +35,7 @@ pub enum Species { /// NOTE: Deliberately don't (yet?) implement serialize. #[derive(Clone, Debug, Deserialize)] pub struct AllSpecies { - pub giant: SpeciesMeta, + pub ogre: SpeciesMeta, } impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies { @@ -44,12 +44,12 @@ impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies #[inline] fn index(&self, &index: &'a Species) -> &Self::Output { match index { - Species::Giant => &self.giant, + Species::Ogre => &self.ogre, } } } -pub const ALL_SPECIES: [Species; 1] = [Species::Giant]; +pub const ALL_SPECIES: [Species; 1] = [Species::Ogre]; impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { type Item = Species; diff --git a/common/src/comp/body/golem.rs b/common/src/comp/body/golem.rs new file mode 100644 index 0000000000..136957aebf --- /dev/null +++ b/common/src/comp/body/golem.rs @@ -0,0 +1,68 @@ +use rand::{seq::SliceRandom, thread_rng}; + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct Body { + pub species: Species, + pub body_type: BodyType, +} + +impl Body { + pub fn random() -> Self { + let mut rng = thread_rng(); + 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::Golem(body) } +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[repr(u32)] +pub enum Species { + StoneGolem = 0, +} + +/// Data representing per-species generic data. +/// +/// NOTE: Deliberately don't (yet?) implement serialize. +#[derive(Clone, Debug, Deserialize)] +pub struct AllSpecies { + pub stonegolem: 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::StoneGolem => &self.stonegolem, + } + } +} + +pub const ALL_SPECIES: [Species; 1] = [Species::StoneGolem]; + +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() } +} + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[repr(u32)] +pub enum BodyType { + Female = 0, + Male = 1, +} +pub const ALL_BODY_TYPES: [BodyType; 2] = [BodyType::Female, BodyType::Male]; diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 09f88a6a08..7bc82719d9 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -20,8 +20,8 @@ pub use ability::{CharacterAbility, ItemConfig, Loadout}; pub use admin::Admin; pub use agent::{Agent, Alignment}; pub use body::{ - biped_large, bird_medium, bird_small, critter, dragon, fish_medium, fish_small, humanoid, - object, quadruped_medium, quadruped_small, AllBodies, Body, BodyData, + biped_large, bird_medium, bird_small, critter, dragon, fish_medium, fish_small, golem, + humanoid, object, quadruped_medium, quadruped_small, AllBodies, Body, BodyData, }; pub use character_state::{Attacking, CharacterState, StateUpdate}; pub use controller::{ diff --git a/common/src/npc.rs b/common/src/npc.rs index dd6f31dee9..fc08070dea 100644 --- a/common/src/npc.rs +++ b/common/src/npc.rs @@ -12,17 +12,19 @@ pub enum NpcKind { Wolf, Pig, Duck, - Giant, + Ogre, Rat, + StoneGolem, } -pub const ALL_NPCS: [NpcKind; 6] = [ +pub const ALL_NPCS: [NpcKind; 7] = [ NpcKind::Humanoid, NpcKind::Wolf, NpcKind::Pig, NpcKind::Duck, - NpcKind::Giant, + NpcKind::Ogre, NpcKind::Rat, + NpcKind::StoneGolem, ]; /// Body-specific NPC name metadata. @@ -86,8 +88,9 @@ pub fn kind_to_body(kind: NpcKind) -> Body { NpcKind::Pig => comp::quadruped_small::Body::random().into(), NpcKind::Wolf => comp::quadruped_medium::Body::random().into(), NpcKind::Duck => comp::bird_medium::Body::random().into(), - NpcKind::Giant => comp::biped_large::Body::random().into(), + NpcKind::Ogre => comp::biped_large::Body::random().into(), NpcKind::Rat => comp::critter::Body::random().into(), + NpcKind::StoneGolem => comp::golem::Body::random().into(), } } @@ -188,7 +191,7 @@ impl NpcBody { .or_else(|| { parse( s, - NpcKind::Giant, + NpcKind::Ogre, &npc_names.biped_large, comp::biped_large::Body::random_with, ) @@ -201,6 +204,14 @@ impl NpcBody { comp::critter::Body::random_with, ) }) + .or_else(|| { + parse( + s, + NpcKind::StoneGolem, + &npc_names.golem, + comp::golem::Body::random_with, + ) + }) .ok_or(()) } } diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index cf06820cf6..1c77a54033 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -15,8 +15,8 @@ const BASE_HUMANOID_ACCEL: f32 = 100.0; const BASE_HUMANOID_SPEED: f32 = 170.0; const BASE_HUMANOID_AIR_ACCEL: f32 = 15.0; const BASE_HUMANOID_AIR_SPEED: f32 = 8.0; -const BASE_HUMANOID_WATER_ACCEL: f32 = 70.0; -const BASE_HUMANOID_WATER_SPEED: f32 = 120.0; +const BASE_HUMANOID_WATER_ACCEL: f32 = 150.0; +const BASE_HUMANOID_WATER_SPEED: f32 = 180.0; // const BASE_HUMANOID_CLIMB_ACCEL: f32 = 10.0; // const ROLL_SPEED: f32 = 17.0; // const CHARGE_SPEED: f32 = 20.0; diff --git a/voxygen/src/anim/biped_large/jump.rs b/voxygen/src/anim/biped_large/jump.rs index a7799b872d..1c9d4c987c 100644 --- a/voxygen/src/anim/biped_large/jump.rs +++ b/voxygen/src/anim/biped_large/jump.rs @@ -13,53 +13,97 @@ impl Animation for JumpAnimation { _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.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; 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.02; - next.upper_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.upper_torso.offset = Vec3::new( + 0.0, + skeleton_attr.upper_torso.0, + skeleton_attr.upper_torso.1, + ) / 8.0; next.upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.upper_torso.scale = Vec3::one() / 10.88; + next.upper_torso.scale = Vec3::one() / 8.0; - next.lower_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.lower_torso.offset = Vec3::new( + 0.0, + skeleton_attr.lower_torso.0, + skeleton_attr.lower_torso.1, + ); next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.lower_torso.scale = Vec3::one() / 10.88; + next.lower_torso.scale = Vec3::one() * 1.02; - next.shoulder_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.shoulder_l.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.shoulder_l.scale = Vec3::one() / 10.88; + next.shoulder_l.scale = Vec3::one(); - next.shoulder_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.shoulder_r.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.shoulder_r.scale = Vec3::one() / 10.88; + next.shoulder_r.scale = Vec3::one(); - next.hand_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.hand_l.offset = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2, + ); next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.hand_l.scale = Vec3::one() / 10.88; + next.hand_l.scale = Vec3::one() * 1.02; - next.hand_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.hand_r.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2, + ); next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.hand_r.scale = Vec3::one() / 10.88; + next.hand_r.scale = Vec3::one() * 1.02; - next.leg_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.leg_l.offset = Vec3::new( + -skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 1.02; next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.leg_l.scale = Vec3::one() / 10.88; + next.leg_l.scale = Vec3::one() * 1.02; - next.leg_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.leg_r.offset = Vec3::new( + skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 1.02; next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.leg_r.scale = Vec3::one() / 10.88; + next.leg_r.scale = Vec3::one() * 1.02; - next.foot_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.foot_l.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 8.0; next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.foot_l.scale = Vec3::one() / 10.88; + next.foot_l.scale = Vec3::one() / 8.0; - next.foot_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; + next.foot_r.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 8.0; next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.foot_r.scale = Vec3::one() / 10.88; + next.foot_r.scale = Vec3::one() / 8.0; + + next.torso.offset = Vec3::new(0.0, 0.0, 0.0); + next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.torso.scale = Vec3::one(); next } } diff --git a/voxygen/src/anim/biped_large/mod.rs b/voxygen/src/anim/biped_large/mod.rs index 34768b1a66..c7b2888e83 100644 --- a/voxygen/src/anim/biped_large/mod.rs +++ b/voxygen/src/anim/biped_large/mod.rs @@ -135,25 +135,25 @@ impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr { use comp::biped_large::Species::*; Self { head: match (body.species, body.body_type) { - (Giant, _) => (0.0, 10.0), + (Ogre, _) => (3.0, 6.0), }, upper_torso: match (body.species, body.body_type) { - (Giant, _) => (0.0, 20.0), + (Ogre, _) => (0.0, 20.0), }, lower_torso: match (body.species, body.body_type) { - (Giant, _) => (1.0, -9.5), + (Ogre, _) => (1.0, -9.5), }, shoulder: match (body.species, body.body_type) { - (Giant, _) => (6.0, 0.5, 2.5), + (Ogre, _) => (6.1, 0.5, 2.5), }, hand: match (body.species, body.body_type) { - (Giant, _) => (10.5, -1.0, 3.5), + (Ogre, _) => (10.5, -1.0, 0.5), }, leg: match (body.species, body.body_type) { - (Giant, _) => (0.0, 0.0, -6.0), + (Ogre, _) => (0.0, 0.0, -6.0), }, foot: match (body.species, body.body_type) { - (Giant, _) => (4.0, 0.5, 2.5), + (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 e41f67a41e..61a1596023 100644 --- a/voxygen/src/anim/biped_large/run.rs +++ b/voxygen/src/anim/biped_large/run.rs @@ -20,7 +20,10 @@ impl Animation for RunAnimation { let lab = 10.0; let belt = (anim_time as f32 * lab as f32 + 1.5 * PI).sin(); - + let beltsnap = (((5.0) + / (1.0 + (4.0) * ((anim_time as f32 * lab as f32 + PI * 1.5).sin()).powf(2.0 as f32))) + .sqrt()) + * ((anim_time as f32 * lab as f32 + PI * 1.5).sin()); let foothoril = (anim_time as f32 * lab as f32 + PI * 1.4).sin(); let foothorir = (anim_time as f32 * lab as f32 + PI * 0.4).sin(); @@ -81,7 +84,7 @@ impl Animation for RunAnimation { skeleton_attr.hand.2, ); next.hand_l.ori = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 + footrotl * -0.8); + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 + foothoril * -0.6); next.hand_l.scale = Vec3::one() * 1.02; next.hand_r.offset = Vec3::new( @@ -90,7 +93,7 @@ impl Animation for RunAnimation { skeleton_attr.hand.2, ); next.hand_r.ori = - Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 + footrotr * -0.8); + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 + foothorir * -0.6); next.hand_r.scale = Vec3::one() * 1.02; next.leg_l.offset = Vec3::new( @@ -128,7 +131,7 @@ impl Animation for RunAnimation { next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(footrotr * 0.5); next.foot_r.scale = Vec3::one() / 8.0 * 0.98; - next.torso.offset = Vec3::new(0.0, 0.0, belt * 0.15); + 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.scale = Vec3::one(); next diff --git a/voxygen/src/anim/bird_medium/fly.rs b/voxygen/src/anim/bird_medium/fly.rs new file mode 100644 index 0000000000..163a996109 --- /dev/null +++ b/voxygen/src/anim/bird_medium/fly.rs @@ -0,0 +1,84 @@ +use super::{super::Animation, BirdMediumSkeleton, SkeletonAttr}; +use std::f32::consts::PI; +use vek::*; + +pub struct FlyAnimation; + +impl Animation for FlyAnimation { + type Dependency = (f32, f64); + type Skeleton = BirdMediumSkeleton; + + 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(); + + let lab = 12.0; //14.0 + + let footl = (anim_time as f32 * lab as f32 + PI).sin(); + let footr = (anim_time as f32 * lab as f32).sin(); + let center = (anim_time as f32 * lab as f32 + PI / 2.0).sin(); + let centeroffset = (anim_time as f32 * lab as f32 + PI * 1.5).sin(); + + next.head.offset = Vec3::new( + 0.0, + skeleton_attr.head.0 + 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.torso.offset = Vec3::new( + 0.0, + skeleton_attr.chest.0 + centeroffset * 0.6, + center * 0.6 + skeleton_attr.chest.1, + ) / 11.0; + next.torso.ori = Quaternion::rotation_y(center * 0.05); + next.torso.scale = Vec3::one() / 11.0; + + next.tail.offset = Vec3::new( + 0.0, + skeleton_attr.tail.0, + skeleton_attr.tail.1 + centeroffset * 0.6, + ); + next.tail.ori = Quaternion::rotation_x(center * 0.03); + next.tail.scale = Vec3::one(); + + next.wing_l.offset = Vec3::new( + -skeleton_attr.wing.0, + skeleton_attr.wing.1, + skeleton_attr.wing.2, + ); + next.wing_l.ori = Quaternion::rotation_y((0.57 + footl * 1.2).max(0.0)); + next.wing_l.scale = Vec3::one() * 1.05; + + next.wing_r.offset = Vec3::new( + skeleton_attr.wing.0, + skeleton_attr.wing.1, + skeleton_attr.wing.2, + ); + next.wing_r.ori = Quaternion::rotation_y((-0.57 + footr * 1.2).min(0.0)); + next.wing_r.scale = Vec3::one() * 1.05; + + next.leg_l.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 11.0; + next.leg_l.ori = Quaternion::rotation_x(-1.3 + footl * 0.06); + next.leg_l.scale = Vec3::one() / 11.0; + + next.leg_r.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 11.0; + next.leg_r.ori = Quaternion::rotation_x(-1.3 + footr * 0.06); + next.leg_r.scale = Vec3::one() / 11.0; + next + } +} diff --git a/voxygen/src/anim/bird_medium/jump.rs b/voxygen/src/anim/bird_medium/jump.rs deleted file mode 100644 index 747fadbf45..0000000000 --- a/voxygen/src/anim/bird_medium/jump.rs +++ /dev/null @@ -1,49 +0,0 @@ -use super::{super::Animation, BirdMediumSkeleton, SkeletonAttr}; -//use std::f32::consts::PI; -use vek::*; - -pub struct JumpAnimation; - -impl Animation for JumpAnimation { - type Dependency = (f32, f64); - type Skeleton = BirdMediumSkeleton; - - 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, 0.0, 0.0) / 11.0; - next.head.ori = Quaternion::rotation_z(0.0); - next.head.scale = Vec3::one(); - - next.torso.offset = Vec3::new(0.0, 0.0, 0.0); - next.torso.ori = Quaternion::rotation_x(0.0); - next.torso.scale = Vec3::one() / 11.0; - - next.tail.offset = Vec3::new(0.0, 0.0, 0.0); - next.tail.ori = Quaternion::rotation_z(0.0); - next.tail.scale = Vec3::one(); - - next.wing_l.offset = Vec3::new(0.0, 0.0, 0.0) / 11.0; - next.wing_l.ori = Quaternion::rotation_z(0.0); - next.wing_l.scale = Vec3::one(); - - next.wing_r.offset = Vec3::new(0.0, 0.0, 0.0) / 11.0; - next.wing_r.ori = Quaternion::rotation_y(0.0); - next.wing_r.scale = Vec3::one(); - - next.leg_l.offset = Vec3::new(0.0, 0.0, 0.0) / 11.0; - next.leg_l.ori = Quaternion::rotation_y(0.0); - next.leg_l.scale = Vec3::one() / 11.0; - - next.leg_r.offset = Vec3::new(0.0, 0.0, 0.0) / 11.0; - next.leg_r.ori = Quaternion::rotation_x(0.0); - next.leg_r.scale = Vec3::one() / 11.0; - next - } -} diff --git a/voxygen/src/anim/bird_medium/mod.rs b/voxygen/src/anim/bird_medium/mod.rs index 2e3d3350c9..78a9ed1217 100644 --- a/voxygen/src/anim/bird_medium/mod.rs +++ b/voxygen/src/anim/bird_medium/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; @@ -120,11 +120,11 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr { (Eagle, _) => (-8.0, -4.0), }, wing: match (body.species, body.body_type) { - (Duck, _) => (2.75, 0.0, 6.0), - (Chicken, _) => (2.75, 0.0, 6.0), - (Goose, _) => (3.75, -1.0, 9.0), - (Peacock, _) => (3.0, 0.0, 9.0), - (Eagle, _) => (3.0, -8.0, 5.0), + (Duck, _) => (2.75, 0.0, 1.0), + (Chicken, _) => (2.75, 0.0, 1.0), + (Goose, _) => (3.75, -1.0, 2.0), + (Peacock, _) => (3.0, 0.0, 1.0), + (Eagle, _) => (3.0, -8.0, 4.0), }, foot: match (body.species, body.body_type) { (Duck, _) => (2.0, -1.5, 4.0), diff --git a/voxygen/src/anim/bird_medium/run.rs b/voxygen/src/anim/bird_medium/run.rs index ea73668941..930f16a9ae 100644 --- a/voxygen/src/anim/bird_medium/run.rs +++ b/voxygen/src/anim/bird_medium/run.rs @@ -53,7 +53,7 @@ impl Animation for RunAnimation { skeleton_attr.wing.1, skeleton_attr.wing.2, ); - next.wing_l.ori = Quaternion::rotation_y(footl * 0.1); + next.wing_l.ori = Quaternion::rotation_y((footl * 0.35).max(0.0)); next.wing_l.scale = Vec3::one() * 1.05; next.wing_r.offset = Vec3::new( @@ -61,7 +61,7 @@ impl Animation for RunAnimation { skeleton_attr.wing.1, skeleton_attr.wing.2, ); - next.wing_r.ori = Quaternion::rotation_y(footr * 0.1); + next.wing_r.ori = Quaternion::rotation_y((footr * 0.35).min(0.0)); next.wing_r.scale = Vec3::one() * 1.05; next.leg_l.offset = Vec3::new( diff --git a/voxygen/src/anim/character/swim.rs b/voxygen/src/anim/character/swim.rs index 1fd23c4c8a..5836f7e23e 100644 --- a/voxygen/src/anim/character/swim.rs +++ b/voxygen/src/anim/character/swim.rs @@ -23,15 +23,13 @@ impl Animation for SwimAnimation { let lab = 1.0; - let short = (anim_time as f32 * lab as f32 * 2.0 * speed / 5.0).sin(); + let short = (anim_time as f32 * lab as f32 * 6.0).sin(); - let shortalt = (anim_time as f32 * lab as f32 * 2.0 * speed / 5.0 + PI / 2.0).sin(); + let shortalt = (anim_time as f32 * lab as f32 * 6.0 + PI / 2.0).sin(); - let foot = (anim_time as f32 * lab as f32 * 2.0 * speed / 5.0).sin(); + let foot = (anim_time as f32 * lab as f32 * 6.0).sin(); - let wave_stop = (anim_time as f32 * 3.0 * speed / 5.0) - .min(PI / 2.0 / 2.0) - .sin(); + let wave_stop = (anim_time as f32 * 9.0).min(PI / 2.0 / 2.0).sin(); let head_look = Vec2::new( ((global_time + anim_time) as f32 / 18.0) @@ -51,16 +49,16 @@ impl Animation for SwimAnimation { -3.0 + skeleton_attr.neck_forward, skeleton_attr.neck_height + 13.0 + short * 0.3, ); - next.head.ori = Quaternion::rotation_z(head_look.x - short * 0.3) - * Quaternion::rotation_x(head_look.y + 0.35); + next.head.ori = Quaternion::rotation_z(head_look.x - short * 0.4) + * Quaternion::rotation_x(head_look.y + 0.35 + speed * 0.045); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + short * 1.1); - next.chest.ori = Quaternion::rotation_z(short * 0.3); + next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + short * 1.3); + next.chest.ori = Quaternion::rotation_z(short * 0.4); next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, 0.0, -2.0); - next.belt.ori = Quaternion::rotation_z(short * 0.25); + next.belt.ori = Quaternion::rotation_z(short * 0.30); next.belt.scale = Vec3::one(); next.back.offset = Vec3::new(0.0, -2.8, 7.25); @@ -68,23 +66,23 @@ impl Animation for SwimAnimation { next.back.scale = Vec3::one() * 1.02; next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); - next.shorts.ori = Quaternion::rotation_z(short * 0.4); + next.shorts.ori = Quaternion::rotation_z(short * 0.5); next.shorts.scale = Vec3::one(); - next.l_hand.offset = Vec3::new(-6.0, -0.25 - foot * 1.0, 5.0 + foot * -2.5); - next.l_hand.ori = Quaternion::rotation_x(0.8 + foot * -0.5) * Quaternion::rotation_y(0.2); + next.l_hand.offset = Vec3::new(-6.0, -0.25 - foot * 1.2, 5.0 + 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(6.0, -0.25 + foot * 1.0, 5.0 + foot * 2.5); - next.r_hand.ori = Quaternion::rotation_x(0.8 + foot * 0.5) * Quaternion::rotation_y(-0.2); + next.r_hand.offset = Vec3::new(6.0, -0.25 + foot * 1.2, 5.0 + 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(-3.4, 6.0 + foot * 1.0, 0.0 + foot * 5.5); - next.l_foot.ori = Quaternion::rotation_x(-1.40 + foot * 0.5); + next.l_foot.offset = Vec3::new(-3.4, 6.0 + foot * 1.2, 0.0 + 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(3.4, 6.0 - foot * 1.0, 0.0 + foot * -5.5); - next.r_foot.ori = Quaternion::rotation_x(-1.40 + foot * -0.5); + next.r_foot.offset = Vec3::new(3.4, 6.0 - foot * 1.2, 0.0 + 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(-5.0, -1.0, 4.7); @@ -121,7 +119,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.6) * Quaternion::rotation_y(0.0); + Quaternion::rotation_x(speed * -0.190 * wave_stop * 1.05) * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next.control.offset = Vec3::new(0.0, 0.0, 0.0); diff --git a/voxygen/src/anim/golem/idle.rs b/voxygen/src/anim/golem/idle.rs new file mode 100644 index 0000000000..6df1b9c34a --- /dev/null +++ b/voxygen/src/anim/golem/idle.rs @@ -0,0 +1,121 @@ +use super::{super::Animation, GolemSkeleton, SkeletonAttr}; +use std::{f32::consts::PI, ops::Mul}; +use vek::*; + +pub struct IdleAnimation; + +impl Animation for IdleAnimation { + type Dependency = f64; + type Skeleton = GolemSkeleton; + + 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(); + + let lab = 1.0; + let torso = (anim_time as f32 * lab as f32 + 1.5 * PI).sin(); + + let look = Vec2::new( + ((global_time + anim_time) as f32 / 8.0) + .floor() + .mul(7331.0) + .sin() + * 0.5, + ((global_time + anim_time) as f32 / 8.0) + .floor() + .mul(1337.0) + .sin() + * 0.25, + ); + + next.head.offset = Vec3::new( + 0.0, + skeleton_attr.head.0, + skeleton_attr.head.1 + torso * 0.2, + ) * 1.02; + next.head.ori = Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6); + next.head.scale = Vec3::one() * 1.02; + + next.upper_torso.offset = Vec3::new( + 0.0, + skeleton_attr.upper_torso.0, + skeleton_attr.upper_torso.1 + torso * 0.5, + ) / 8.0; + next.upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.upper_torso.scale = Vec3::one() / 8.0; + + next.shoulder_l.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.shoulder_l.scale = Vec3::one(); + + next.shoulder_r.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.shoulder_r.scale = Vec3::one(); + + next.hand_l.offset = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2 + torso * 0.6, + ); + next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.hand_l.scale = Vec3::one() * 1.02; + + next.hand_r.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2 + torso * 0.6, + ); + next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.hand_r.scale = Vec3::one() * 1.02; + + next.leg_l.offset = Vec3::new( + -skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 1.02; + next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.leg_l.scale = Vec3::one() * 1.02; + + next.leg_r.offset = Vec3::new( + skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 1.02; + next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.leg_r.scale = Vec3::one() * 1.02; + + next.foot_l.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 8.0; + next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.foot_l.scale = Vec3::one() / 8.0; + + next.foot_r.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 8.0; + next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.foot_r.scale = Vec3::one() / 8.0; + + next.torso.offset = Vec3::new(0.0, 0.0, 0.0); + next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.torso.scale = Vec3::one(); + next + } +} diff --git a/voxygen/src/anim/golem/jump.rs b/voxygen/src/anim/golem/jump.rs new file mode 100644 index 0000000000..e7ba85f450 --- /dev/null +++ b/voxygen/src/anim/golem/jump.rs @@ -0,0 +1,101 @@ +use super::{super::Animation, GolemSkeleton, SkeletonAttr}; +//use std::f32::consts::PI; +use vek::*; + +pub struct JumpAnimation; + +impl Animation for JumpAnimation { + type Dependency = (f32, f64); + type Skeleton = GolemSkeleton; + + 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, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02; + next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.head.scale = Vec3::one() * 1.02; + + next.upper_torso.offset = Vec3::new( + 0.0, + skeleton_attr.upper_torso.0, + skeleton_attr.upper_torso.1, + ) / 8.0; + next.upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.upper_torso.scale = Vec3::one() / 8.0; + + next.shoulder_l.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.shoulder_l.scale = Vec3::one(); + + next.shoulder_r.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.shoulder_r.scale = Vec3::one(); + + next.hand_l.offset = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2, + ); + next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.hand_l.scale = Vec3::one() * 1.02; + + next.hand_r.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2, + ); + next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.hand_r.scale = Vec3::one() * 1.02; + + next.leg_l.offset = Vec3::new( + -skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 1.02; + next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.leg_l.scale = Vec3::one() * 1.02; + + next.leg_r.offset = Vec3::new( + skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 1.02; + next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.leg_r.scale = Vec3::one() * 1.02; + + next.foot_l.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 8.0; + next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.foot_l.scale = Vec3::one() / 8.0; + + next.foot_r.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ) / 8.0; + next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.foot_r.scale = Vec3::one() / 8.0; + + next.torso.offset = Vec3::new(0.0, 0.0, 0.0); + next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.torso.scale = Vec3::one(); + next + } +} diff --git a/voxygen/src/anim/golem/mod.rs b/voxygen/src/anim/golem/mod.rs new file mode 100644 index 0000000000..e493186a11 --- /dev/null +++ b/voxygen/src/anim/golem/mod.rs @@ -0,0 +1,149 @@ +pub mod idle; +pub mod jump; +pub mod run; + +// Reexports +pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; + +use super::{Bone, Skeleton}; +use crate::render::FigureBoneData; +use common::comp::{self}; + +#[derive(Clone)] +pub struct GolemSkeleton { + head: Bone, + upper_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 GolemSkeleton { + pub fn new() -> Self { + Self { + head: Bone::default(), + upper_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 GolemSkeleton { + type Attr = SkeletonAttr; + + 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 foot_l_mat = self.foot_l.compute_base_matrix(); + let foot_r_mat = self.foot_r.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 * 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(foot_l_mat * leg_l_mat), + FigureBoneData::new(foot_r_mat * leg_r_mat), + FigureBoneData::new(foot_l_mat), + FigureBoneData::new(foot_r_mat), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), + 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.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: (f32, f32), + upper_torso: (f32, f32), + shoulder: (f32, f32, f32), + hand: (f32, f32, f32), + leg: (f32, f32, f32), + foot: (f32, f32, f32), +} + +impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { + type Error = (); + + fn try_from(body: &'a comp::Body) -> Result { + match body { + comp::Body::Golem(body) => Ok(SkeletonAttr::from(body)), + _ => Err(()), + } + } +} + +impl Default for SkeletonAttr { + fn default() -> Self { + Self { + head: (0.0, 0.0), + upper_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::golem::Body> for SkeletonAttr { + fn from(body: &'a comp::golem::Body) -> Self { + use comp::golem::Species::*; + Self { + head: match (body.species, body.body_type) { + (StoneGolem, _) => (0.0, 16.0), + }, + upper_torso: match (body.species, body.body_type) { + (StoneGolem, _) => (0.0, 33.0), + }, + shoulder: match (body.species, body.body_type) { + (StoneGolem, _) => (8.0, -0.5, 7.5), + }, + hand: match (body.species, body.body_type) { + (StoneGolem, _) => (9.5, -1.0, 4.5), + }, + leg: match (body.species, body.body_type) { + (StoneGolem, _) => (-1.0, 0.0, 9.0), + }, + foot: match (body.species, body.body_type) { + (StoneGolem, _) => (4.0, 0.5, 11.0), + }, + } + } +} diff --git a/voxygen/src/anim/golem/run.rs b/voxygen/src/anim/golem/run.rs new file mode 100644 index 0000000000..9dc8bd71e7 --- /dev/null +++ b/voxygen/src/anim/golem/run.rs @@ -0,0 +1,126 @@ +use super::{super::Animation, GolemSkeleton, SkeletonAttr}; +use std::f32::consts::PI; +use vek::*; + +pub struct RunAnimation; + +impl Animation for RunAnimation { + type Dependency = (f32, f64); + type Skeleton = GolemSkeleton; + + 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 = 10.0; + + let belt = (anim_time as f32 * lab as f32 + 1.5 * PI).sin(); + + let foothoril = (anim_time as f32 * lab as f32 + PI * 1.4).sin(); + let foothorir = (anim_time as f32 * lab as f32 + PI * 0.4).sin(); + + let footvertl = (anim_time as f32 * lab as f32).sin().max(0.1); + let footvertr = (anim_time as f32 * lab as f32 + PI).sin().max(0.1); + + let footrotl = (((5.0) + / (1.0 + (4.0) * ((anim_time as f32 * lab as f32 + PI * 1.4).sin()).powf(2.0 as f32))) + .sqrt()) + * ((anim_time as f32 * lab as f32 + PI * 1.4).sin()); + + let footrotr = (((5.0) + / (1.0 + (4.0) * ((anim_time as f32 * lab as f32 + PI * 0.4).sin()).powf(2.0 as f32))) + .sqrt()) + * ((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.scale = Vec3::one() * 1.02; + + next.upper_torso.offset = Vec3::new( + 0.0, + skeleton_attr.upper_torso.0, + skeleton_attr.upper_torso.1 + belt * 1.0, + ) / 8.0; + next.upper_torso.ori = Quaternion::rotation_z(belt * 0.40) * Quaternion::rotation_x(0.0); + next.upper_torso.scale = Vec3::one() / 8.0; + + next.shoulder_l.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_l.ori = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(footrotl * -0.15); + next.shoulder_l.scale = Vec3::one(); + + next.shoulder_r.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); + next.shoulder_r.ori = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(footrotr * -0.15); + next.shoulder_r.scale = Vec3::one(); + + next.hand_l.offset = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2, + ); + next.hand_l.ori = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 + footrotl * -0.8); + next.hand_l.scale = Vec3::one() * 1.02; + + next.hand_r.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1, + skeleton_attr.hand.2, + ); + next.hand_r.ori = + Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 + footrotr * -0.8); + next.hand_r.scale = Vec3::one() * 1.02; + + next.leg_l.offset = Vec3::new( + -skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 1.02; + next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.leg_l.scale = Vec3::one() * 1.02; + + next.leg_r.offset = Vec3::new( + skeleton_attr.leg.0, + skeleton_attr.leg.1, + skeleton_attr.leg.2, + ) * 1.02; + + next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); + next.leg_r.scale = Vec3::one() * 1.02; + + next.foot_l.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1 + foothoril * 8.0 + 3.0, + skeleton_attr.foot.2 + footvertl * 4.0, + ) / 8.0; + next.foot_l.ori = Quaternion::rotation_x(footrotl * 0.7); + next.foot_l.scale = Vec3::one() / 8.0 * 0.98; + + next.foot_r.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1 + foothorir * 8.0 + 3.0, + skeleton_attr.foot.2 + footvertr * 4.0, + ) / 8.0; + next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(footrotr * 0.7); + next.foot_r.scale = Vec3::one() / 8.0 * 0.98; + + next.torso.offset = Vec3::new(0.0, 0.0, belt * 0.15); + next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.2); + next.torso.scale = Vec3::one(); + next + } +} diff --git a/voxygen/src/anim/mod.rs b/voxygen/src/anim/mod.rs index 1e556aac9f..834e021a27 100644 --- a/voxygen/src/anim/mod.rs +++ b/voxygen/src/anim/mod.rs @@ -7,6 +7,7 @@ pub mod dragon; pub mod fish_medium; pub mod fish_small; pub mod fixture; +pub mod golem; pub mod object; pub mod quadruped_medium; pub mod quadruped_small; diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index 67f4830554..d06f72cd1e 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -533,6 +533,65 @@ impl FigureModelCache { None, ] }, + Body::Golem(body) => { + let golem_center_spec = GolemCenterSpec::load_watched(manifest_indicator); + let golem_lateral_spec = GolemLateralSpec::load_watched(manifest_indicator); + + [ + Some(golem_center_spec.mesh_head(body.species, body.body_type, generate_mesh)), + Some(golem_center_spec.mesh_torso_upper( + body.species, + body.body_type, + generate_mesh, + )), + Some(golem_lateral_spec.mesh_shoulder_l( + body.species, + body.body_type, + generate_mesh, + )), + Some(golem_lateral_spec.mesh_shoulder_r( + body.species, + body.body_type, + generate_mesh, + )), + Some(golem_lateral_spec.mesh_hand_l( + body.species, + body.body_type, + generate_mesh, + )), + Some(golem_lateral_spec.mesh_hand_r( + body.species, + body.body_type, + generate_mesh, + )), + Some(golem_lateral_spec.mesh_leg_l( + body.species, + body.body_type, + generate_mesh, + )), + Some(golem_lateral_spec.mesh_leg_r( + body.species, + body.body_type, + generate_mesh, + )), + Some(golem_lateral_spec.mesh_foot_l( + body.species, + body.body_type, + generate_mesh, + )), + Some(golem_lateral_spec.mesh_foot_r( + body.species, + body.body_type, + generate_mesh, + )), + None, + None, + None, + None, + None, + None, + ] + }, Body::Critter(body) => { let critter_center_spec = CritterCenterSpec::load_watched(manifest_indicator); diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 904ccfbb43..5cd3bf01c2 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -7,6 +7,7 @@ use common::{ bird_small, critter::{BodyType as CBodyType, Species as CSpecies}, dragon, fish_medium, fish_small, + golem::{BodyType as GBodyType, Species as GSpecies}, humanoid::{Body, BodyType, EyeColor, Eyebrows, Race, Skin}, item::{ armor::{Armor, Back, Belt, Chest, Foot, Hand, Head, Pants, Shoulder, Tabard}, @@ -2367,6 +2368,276 @@ impl BipedLargeLateralSpec { } } //// +#[derive(Serialize, Deserialize)] +pub struct GolemCenterSpec(HashMap<(GSpecies, GBodyType), SidedGCenterVoxSpec>); + +#[derive(Serialize, Deserialize)] +struct SidedGCenterVoxSpec { + head: GolemCenterSubSpec, + torso_upper: GolemCenterSubSpec, +} +#[derive(Serialize, Deserialize)] +struct GolemCenterSubSpec { + offset: [f32; 3], // Should be relative to initial origin + center: VoxSimple, +} + +#[derive(Serialize, Deserialize)] +pub struct GolemLateralSpec(HashMap<(GSpecies, GBodyType), SidedGLateralVoxSpec>); + +#[derive(Serialize, Deserialize)] +struct SidedGLateralVoxSpec { + shoulder_l: GolemLateralSubSpec, + shoulder_r: GolemLateralSubSpec, + hand_l: GolemLateralSubSpec, + hand_r: GolemLateralSubSpec, + leg_l: GolemLateralSubSpec, + leg_r: GolemLateralSubSpec, + foot_l: GolemLateralSubSpec, + foot_r: GolemLateralSubSpec, +} +#[derive(Serialize, Deserialize)] +struct GolemLateralSubSpec { + offset: [f32; 3], // Should be relative to initial origin + lateral: VoxSimple, +} + +impl Asset for GolemCenterSpec { + const ENDINGS: &'static [&'static str] = &["ron"]; + + fn parse(buf_reader: BufReader) -> Result { + ron::de::from_reader(buf_reader).map_err(assets::Error::parse_error) + } +} + +impl Asset for GolemLateralSpec { + const ENDINGS: &'static [&'static str] = &["ron"]; + + fn parse(buf_reader: BufReader) -> Result { + ron::de::from_reader(buf_reader).map_err(assets::Error::parse_error) + } +} + +impl GolemCenterSpec { + pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc { + assets::load_watched::("voxygen.voxel.golem_center_manifest", indicator).unwrap() + } + + pub fn mesh_head( + &self, + species: GSpecies, + body_type: GBodyType, + 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); + + generate_mesh(¢er, Vec3::from(spec.head.offset)) + } + + pub fn mesh_torso_upper( + &self, + species: GSpecies, + body_type: GBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No torso upper 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.torso_upper.center.0); + + generate_mesh(¢er, Vec3::from(spec.torso_upper.offset)) + } +} +impl GolemLateralSpec { + pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc { + assets::load_watched::("voxygen.voxel.golem_lateral_manifest", indicator).unwrap() + } + + pub fn mesh_shoulder_l( + &self, + species: GSpecies, + body_type: GBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No shoulder 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.shoulder_l.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.shoulder_l.offset)) + } + + pub fn mesh_shoulder_r( + &self, + species: GSpecies, + body_type: GBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No shoulder 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.shoulder_r.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.shoulder_r.offset)) + } + + pub fn mesh_hand_l( + &self, + species: GSpecies, + body_type: GBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No hand 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.hand_l.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.hand_l.offset)) + } + + pub fn mesh_hand_r( + &self, + species: GSpecies, + body_type: GBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No hand 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.hand_r.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.hand_r.offset)) + } + + pub fn mesh_leg_l( + &self, + species: GSpecies, + body_type: GBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No leg 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.leg_l.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.leg_l.offset)) + } + + pub fn mesh_leg_r( + &self, + species: GSpecies, + body_type: GBodyType, + generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, + ) -> Mesh { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No leg 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.leg_r.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.leg_r.offset)) + } + + pub fn mesh_foot_l( + &self, + species: GSpecies, + body_type: GBodyType, + 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_l.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.foot_l.offset)) + } + + pub fn mesh_foot_r( + &self, + species: GSpecies, + body_type: GBodyType, + 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_r.lateral.0); + + generate_mesh(&lateral, Vec3::from(spec.foot_r.offset)) + } +} pub fn mesh_object( obj: object::Body, generate_mesh: impl FnOnce(&Segment, Vec3) -> Mesh, diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 5bee0eb0bb..ee9008e51a 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -9,7 +9,7 @@ use crate::{ self, biped_large::BipedLargeSkeleton, bird_medium::BirdMediumSkeleton, bird_small::BirdSmallSkeleton, character::CharacterSkeleton, critter::CritterSkeleton, dragon::DragonSkeleton, fish_medium::FishMediumSkeleton, fish_small::FishSmallSkeleton, - object::ObjectSkeleton, quadruped_medium::QuadrupedMediumSkeleton, + golem::GolemSkeleton, object::ObjectSkeleton, quadruped_medium::QuadrupedMediumSkeleton, quadruped_small::QuadrupedSmallSkeleton, Animation, Skeleton, }, ecs::comp::Interpolated, @@ -50,6 +50,7 @@ pub struct FigureMgr { fish_medium_model_cache: FigureModelCache, fish_small_model_cache: FigureModelCache, biped_large_model_cache: FigureModelCache, + golem_model_cache: FigureModelCache, character_states: HashMap>, quadruped_small_states: HashMap>, quadruped_medium_states: HashMap>, @@ -60,6 +61,7 @@ pub struct FigureMgr { bird_small_states: HashMap>, fish_small_states: HashMap>, biped_large_states: HashMap>, + golem_states: HashMap>, object_states: HashMap>, } @@ -76,6 +78,7 @@ impl FigureMgr { fish_medium_model_cache: FigureModelCache::new(), fish_small_model_cache: FigureModelCache::new(), biped_large_model_cache: FigureModelCache::new(), + golem_model_cache: FigureModelCache::new(), character_states: HashMap::new(), quadruped_small_states: HashMap::new(), quadruped_medium_states: HashMap::new(), @@ -86,6 +89,7 @@ impl FigureMgr { bird_small_states: HashMap::new(), fish_small_states: HashMap::new(), biped_large_states: HashMap::new(), + golem_states: HashMap::new(), object_states: HashMap::new(), } } @@ -101,6 +105,7 @@ impl FigureMgr { self.fish_medium_model_cache.clean(tick); self.fish_small_model_cache.clean(tick); self.biped_large_model_cache.clean(tick); + self.golem_model_cache.clean(tick); } pub fn maintain(&mut self, renderer: &mut Renderer, scene_data: &SceneData, camera: &Camera) { @@ -212,6 +217,9 @@ impl FigureMgr { Body::BipedLarge(_) => { self.biped_large_states.remove(&entity); }, + Body::Golem(_) => { + self.biped_large_states.remove(&entity); + }, Body::Object(_) => { self.object_states.remove(&entity); }, @@ -269,6 +277,11 @@ impl FigureMgr { .get_mut(&entity) .map(|state| state.visible = false); }, + Body::Golem(_) => { + self.golem_states + .get_mut(&entity) + .map(|state| state.visible = false); + }, Body::Object(_) => { self.object_states .get_mut(&entity) @@ -322,6 +335,9 @@ impl FigureMgr { .biped_large_states .get(&entity) .map(|state| state.lpindex), + Body::Golem(_) => { + self.golem_states.get(&entity).map(|state| state.lpindex) + }, Body::Object(_) => { self.object_states.get(&entity).map(|state| state.lpindex) }, @@ -391,6 +407,12 @@ impl FigureMgr { state.visible = false }); }, + Body::Golem(_) => { + self.golem_states.get_mut(&entity).map(|state| { + state.lpindex = lpindex; + state.visible = false + }); + }, Body::Object(_) => { self.object_states.get_mut(&entity).map(|state| { state.lpindex = lpindex; @@ -867,7 +889,7 @@ impl FigureMgr { skeleton_attr, ), // In air - (false, _, false) => anim::bird_medium::JumpAnimation::update_skeleton( + (false, _, false) => anim::bird_medium::FlyAnimation::update_skeleton( &BirdMediumSkeleton::new(), (vel.0.magnitude(), time), state.state_time, @@ -1343,6 +1365,81 @@ impl FigureMgr { is_player, ); }, + Body::Golem(_) => { + let skeleton_attr = &self + .golem_model_cache + .get_or_create_model( + renderer, + *body, + loadout, + tick, + CameraMode::default(), + None, + ) + .1; + + let state = self + .golem_states + .entry(entity) + .or_insert_with(|| FigureState::new(renderer, GolemSkeleton::new())); + + let (character, last_character) = match (character, last_character) { + (Some(c), Some(l)) => (c, l), + _ => continue, + }; + + if !character.same_variant(&last_character.0) { + state.state_time = 0.0; + } + + let target_base = match ( + physics.on_ground, + vel.0.magnitude_squared() > MOVING_THRESHOLD_SQR, // Moving + physics.in_fluid, // In water + ) { + // Standing + (true, false, false) => anim::golem::IdleAnimation::update_skeleton( + &GolemSkeleton::new(), + time, + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ), + // Running + (true, true, false) => anim::golem::RunAnimation::update_skeleton( + &GolemSkeleton::new(), + (vel.0.magnitude(), time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ), + // In air + (false, _, false) => anim::golem::JumpAnimation::update_skeleton( + &GolemSkeleton::new(), + (vel.0.magnitude(), time), + state.state_time, + &mut state_animation_rate, + skeleton_attr, + ), + + // TODO! + _ => state.skeleton_mut().clone(), + }; + + state.skeleton.interpolate(&target_base, dt); + state.update( + renderer, + pos.0, + ori, + scale, + col, + dt, + state_animation_rate, + lpindex, + true, + is_player, + ); + }, Body::Object(_) => { let state = self .object_states @@ -1387,6 +1484,8 @@ impl FigureMgr { .retain(|entity, _| ecs.entities().is_alive(*entity)); self.biped_large_states .retain(|entity, _| ecs.entities().is_alive(*entity)); + self.golem_states + .retain(|entity, _| ecs.entities().is_alive(*entity)); self.object_states .retain(|entity, _| ecs.entities().is_alive(*entity)); } @@ -1521,6 +1620,7 @@ impl FigureMgr { fish_medium_model_cache, fish_small_model_cache, biped_large_model_cache, + golem_model_cache, character_states, quadruped_small_states, quadruped_medium_states, @@ -1531,6 +1631,7 @@ impl FigureMgr { bird_small_states, fish_small_states, biped_large_states, + golem_states, object_states, } = self; if let Some((locals, bone_consts, model)) = match body { @@ -1697,6 +1798,22 @@ impl FigureMgr { .0, ) }), + Body::Golem(_) => golem_states.get(&entity).map(|state| { + ( + state.locals(), + state.bone_consts(), + &golem_model_cache + .get_or_create_model( + renderer, + *body, + loadout, + tick, + player_camera_mode, + character_state, + ) + .0, + ) + }), Body::Object(_) => object_states.get(&entity).map(|state| { ( state.locals(), @@ -1750,6 +1867,7 @@ impl FigureMgr { + self.bird_small_states.len() + self.fish_small_states.len() + self.biped_large_states.len() + + self.golem_states.len() + self.object_states.len() } @@ -1799,6 +1917,7 @@ impl FigureMgr { .iter() .filter(|(_, c)| c.visible) .count() + + self.golem_states.iter().filter(|(_, c)| c.visible).count() + self.object_states.iter().filter(|(_, c)| c.visible).count() } } From 45217915911ddf1b5ea6a8ff36c2394fd755fcc6 Mon Sep 17 00:00:00 2001 From: Monty Marz Date: Sun, 26 Apr 2020 01:44:56 +0000 Subject: [PATCH 02/10] UI Fixes --- assets/common/items/apple.ron | 4 +- assets/common/items/armor/back/admin.ron | 4 +- assets/common/items/armor/back/short_0.ron | 2 +- assets/common/items/armor/belt/assassin.ron | 2 +- .../common/items/armor/belt/cloth_blue_0.ron | 2 +- .../common/items/armor/belt/cloth_green_0.ron | 2 +- .../items/armor/belt/cloth_purple_0.ron | 2 +- assets/common/items/armor/belt/leather_0.ron | 2 +- assets/common/items/armor/belt/plate_0.ron | 2 +- assets/common/items/armor/chest/assassin.ron | 2 +- .../common/items/armor/chest/cloth_blue_0.ron | 2 +- .../items/armor/chest/cloth_green_0.ron | 2 +- .../items/armor/chest/cloth_purple_0.ron | 2 +- assets/common/items/armor/chest/leather_0.ron | 2 +- .../items/armor/chest/plate_green_0.ron | 2 +- assets/common/items/armor/foot/assassin.ron | 2 +- .../common/items/armor/foot/cloth_blue_0.ron | 2 +- .../common/items/armor/foot/cloth_green_0.ron | 2 +- .../items/armor/foot/cloth_purple_0.ron | 2 +- assets/common/items/armor/foot/leather_0.ron | 2 +- assets/common/items/armor/foot/plate_0.ron | 2 +- assets/common/items/armor/hand/assassin.ron | 2 +- .../common/items/armor/hand/cloth_blue_0.ron | 2 +- .../common/items/armor/hand/cloth_green_0.ron | 2 +- .../items/armor/hand/cloth_purple_0.ron | 2 +- assets/common/items/armor/hand/leather_0.ron | 2 +- assets/common/items/armor/hand/plate_0.ron | 2 +- .../common/items/armor/head/assa_mask_0.ron | 2 +- assets/common/items/armor/head/leather_0.ron | 2 +- assets/common/items/armor/neck/neck_0.ron | 2 +- assets/common/items/armor/pants/assassin.ron | 2 +- .../common/items/armor/pants/cloth_blue_0.ron | 2 +- .../items/armor/pants/cloth_green_0.ron | 2 +- .../items/armor/pants/cloth_purple_0.ron | 2 +- assets/common/items/armor/pants/green_0.ron | 2 +- assets/common/items/armor/pants/leather_0.ron | 2 +- .../items/armor/pants/plate_green_0.ron | 2 +- assets/common/items/armor/ring/ring_0.ron | 2 +- .../common/items/armor/shoulder/assassin.ron | 2 +- .../items/armor/shoulder/cloth_blue_0.ron | 2 +- .../items/armor/shoulder/cloth_green_0.ron | 2 +- .../items/armor/shoulder/cloth_purple_0.ron | 2 +- .../common/items/armor/shoulder/leather_0.ron | 2 +- .../common/items/armor/shoulder/leather_1.ron | 2 +- .../common/items/armor/shoulder/plate_0.ron | 2 +- .../items/armor/starter/rugged_chest.ron | 2 +- .../items/armor/starter/rugged_pants.ron | 2 +- .../common/items/armor/starter/sandals_0.ron | 2 +- assets/common/items/armor/tabard/admin.ron | 4 +- assets/common/items/cheese.ron | 4 +- assets/common/items/coconut.ron | 4 +- assets/common/items/collar.ron | 2 +- .../debug/{admin_tabard.ron => admin.ron} | 3 +- assets/common/items/debug/admin_back.ron | 3 +- assets/common/items/debug/green_0.ron | 5 - assets/common/items/debug/leather_0.ron | 8 - assets/common/items/debug/neck_0.ron | 8 - .../debug/{plate_belt.ron => plate_0.ron} | 2 +- assets/common/items/debug/plate_feet.ron | 2 +- .../{plate_chest.ron => plate_green_0.ron} | 2 +- .../{plate_legs.ron => plate_green_legs.ron} | 2 +- .../debug/{plate_hands.ron => plate_hand.ron} | 2 +- assets/common/items/debug/plate_shoulder.ron | 2 +- assets/common/items/debug/ring_0.ron | 8 - assets/common/items/mushroom.ron | 4 +- assets/common/items/potion_minor.ron | 4 +- assets/common/items/velorite.ron | 4 +- assets/common/items/veloritefrag.ron | 4 +- assets/common/items/weapons/hammer_1.ron | 4 +- assets/common/items/weapons/shield_1.ron | 2 +- assets/common/items/weapons/short_sword_0.ron | 3 +- assets/common/items/weapons/staff_1.ron | 4 +- assets/common/items/weapons/staff_nature.ron | 3 +- assets/common/items/weapons/starter_axe.ron | 4 +- assets/common/items/weapons/starter_bow.ron | 4 +- .../common/items/weapons/starter_dagger.ron | 4 +- .../common/items/weapons/starter_hammer.ron | 4 +- assets/common/items/weapons/starter_staff.ron | 4 +- assets/common/items/weapons/starter_sword.ron | 4 +- assets/common/items/weapons/wood_sword.ron | 3 +- .../items/weapons/zweihander_sword_0.ron | 3 +- assets/voxygen/element/buttons/bag/closed.vox | 3 - .../element/buttons/bag/closed_hover.vox | 3 - .../element/buttons/bag/closed_press.vox | 3 - assets/voxygen/element/buttons/bag/open.vox | 3 - .../element/buttons/bag/open_hover.vox | 3 - .../element/buttons/bag/open_press.vox | 3 - assets/voxygen/element/buttons/button.vox | 3 - .../voxygen/element/buttons/button_dark.vox | 3 - .../element/buttons/button_dark_hover.vox | 3 - .../element/buttons/button_dark_press.vox | 3 - .../voxygen/element/buttons/button_hover.vox | 3 - .../element/buttons/button_mmap_closed.vox | 3 - .../buttons/button_mmap_closed_hover.vox | 3 - .../buttons/button_mmap_closed_press.vox | 3 - .../element/buttons/button_mmap_open.vox | 3 - .../buttons/button_mmap_open_hover.vox | 3 - .../buttons/button_mmap_open_press.vox | 3 - .../voxygen/element/buttons/button_press.vox | 3 - assets/voxygen/element/buttons/button_red.vox | 3 - .../element/buttons/button_red_hover.vox | 3 - .../element/buttons/button_red_press.vox | 3 - assets/voxygen/element/buttons/grid_inv.vox | 3 - .../element/buttons/indicator_mmap.vox | 3 - .../element/buttons/indicator_mmap_2.vox | 3 - .../element/buttons/indicator_mmap_3.vox | 3 - .../element/buttons/indicator_mmap_small.vox | 3 - assets/voxygen/element/buttons/input.vox | 3 - assets/voxygen/element/buttons/inv_slot.vox | 3 - .../voxygen/element/buttons/inv_slot_sel.vox | 3 - assets/voxygen/element/buttons/map.png | 3 + assets/voxygen/element/buttons/map.vox | 3 - assets/voxygen/element/buttons/map_hover.png | 3 + assets/voxygen/element/buttons/map_hover.vox | 3 - assets/voxygen/element/buttons/map_press.png | 3 + assets/voxygen/element/buttons/map_press.vox | 3 - assets/voxygen/element/buttons/settings.png | 3 + assets/voxygen/element/buttons/settings.vox | 3 - .../element/buttons/settings_hover.png | 3 + .../element/buttons/settings_hover.vox | 3 - .../element/buttons/settings_press.png | 3 + .../element/buttons/settings_press.vox | 3 - assets/voxygen/element/buttons/social.png | 3 + assets/voxygen/element/buttons/social.vox | 3 - .../voxygen/element/buttons/social_hover.png | 3 + .../voxygen/element/buttons/social_hover.vox | 3 - .../voxygen/element/buttons/social_press.png | 3 + .../voxygen/element/buttons/social_press.vox | 3 - assets/voxygen/element/buttons/spellbook.png | 3 + assets/voxygen/element/buttons/spellbook.vox | 3 - .../element/buttons/spellbook_hover.png | 3 + .../element/buttons/spellbook_hover.vox | 3 - .../element/buttons/spellbook_press.png | 3 + .../element/buttons/spellbook_press.vox | 3 - assets/voxygen/element/buttons/x.vox | 3 - assets/voxygen/element/buttons/x_hover.vox | 3 - assets/voxygen/element/buttons/x_press.vox | 3 - assets/voxygen/element/frames/disclaimer.png | 3 + assets/voxygen/element/frames/disclaimer.vox | 3 - assets/voxygen/i18n/de_DE.ron | 12 +- assets/voxygen/i18n/en.ron | 11 +- voxygen/examples/character_renderer.rs | 1 + voxygen/src/hud/buttons.rs | 332 ++++++++++++------ voxygen/src/hud/img_ids.rs | 43 +-- voxygen/src/hud/mod.rs | 40 +-- voxygen/src/hud/settings_window.rs | 52 ++- voxygen/src/hud/skillbar.rs | 6 +- voxygen/src/menu/char_selection/mod.rs | 5 + voxygen/src/menu/main/ui.rs | 2 +- voxygen/src/scene/figure/mod.rs | 15 +- voxygen/src/scene/mod.rs | 3 + voxygen/src/scene/simple.rs | 1 + voxygen/src/session.rs | 10 + voxygen/src/settings.rs | 2 + voxygen/src/window.rs | 12 +- 155 files changed, 485 insertions(+), 459 deletions(-) rename assets/common/items/debug/{admin_tabard.ron => admin.ron} (59%) delete mode 100644 assets/common/items/debug/green_0.ron delete mode 100644 assets/common/items/debug/leather_0.ron delete mode 100644 assets/common/items/debug/neck_0.ron rename assets/common/items/debug/{plate_belt.ron => plate_0.ron} (71%) rename assets/common/items/debug/{plate_chest.ron => plate_green_0.ron} (64%) rename assets/common/items/debug/{plate_legs.ron => plate_green_legs.ron} (73%) rename assets/common/items/debug/{plate_hands.ron => plate_hand.ron} (72%) delete mode 100644 assets/common/items/debug/ring_0.ron delete mode 100644 assets/voxygen/element/buttons/bag/closed.vox delete mode 100644 assets/voxygen/element/buttons/bag/closed_hover.vox delete mode 100644 assets/voxygen/element/buttons/bag/closed_press.vox delete mode 100644 assets/voxygen/element/buttons/bag/open.vox delete mode 100644 assets/voxygen/element/buttons/bag/open_hover.vox delete mode 100644 assets/voxygen/element/buttons/bag/open_press.vox delete mode 100644 assets/voxygen/element/buttons/button.vox delete mode 100644 assets/voxygen/element/buttons/button_dark.vox delete mode 100644 assets/voxygen/element/buttons/button_dark_hover.vox delete mode 100644 assets/voxygen/element/buttons/button_dark_press.vox delete mode 100644 assets/voxygen/element/buttons/button_hover.vox delete mode 100644 assets/voxygen/element/buttons/button_mmap_closed.vox delete mode 100644 assets/voxygen/element/buttons/button_mmap_closed_hover.vox delete mode 100644 assets/voxygen/element/buttons/button_mmap_closed_press.vox delete mode 100644 assets/voxygen/element/buttons/button_mmap_open.vox delete mode 100644 assets/voxygen/element/buttons/button_mmap_open_hover.vox delete mode 100644 assets/voxygen/element/buttons/button_mmap_open_press.vox delete mode 100644 assets/voxygen/element/buttons/button_press.vox delete mode 100644 assets/voxygen/element/buttons/button_red.vox delete mode 100644 assets/voxygen/element/buttons/button_red_hover.vox delete mode 100644 assets/voxygen/element/buttons/button_red_press.vox delete mode 100644 assets/voxygen/element/buttons/grid_inv.vox delete mode 100644 assets/voxygen/element/buttons/indicator_mmap.vox delete mode 100644 assets/voxygen/element/buttons/indicator_mmap_2.vox delete mode 100644 assets/voxygen/element/buttons/indicator_mmap_3.vox delete mode 100644 assets/voxygen/element/buttons/indicator_mmap_small.vox delete mode 100644 assets/voxygen/element/buttons/input.vox delete mode 100644 assets/voxygen/element/buttons/inv_slot.vox delete mode 100644 assets/voxygen/element/buttons/inv_slot_sel.vox create mode 100644 assets/voxygen/element/buttons/map.png delete mode 100644 assets/voxygen/element/buttons/map.vox create mode 100644 assets/voxygen/element/buttons/map_hover.png delete mode 100644 assets/voxygen/element/buttons/map_hover.vox create mode 100644 assets/voxygen/element/buttons/map_press.png delete mode 100644 assets/voxygen/element/buttons/map_press.vox create mode 100644 assets/voxygen/element/buttons/settings.png delete mode 100644 assets/voxygen/element/buttons/settings.vox create mode 100644 assets/voxygen/element/buttons/settings_hover.png delete mode 100644 assets/voxygen/element/buttons/settings_hover.vox create mode 100644 assets/voxygen/element/buttons/settings_press.png delete mode 100644 assets/voxygen/element/buttons/settings_press.vox create mode 100644 assets/voxygen/element/buttons/social.png delete mode 100644 assets/voxygen/element/buttons/social.vox create mode 100644 assets/voxygen/element/buttons/social_hover.png delete mode 100644 assets/voxygen/element/buttons/social_hover.vox create mode 100644 assets/voxygen/element/buttons/social_press.png delete mode 100644 assets/voxygen/element/buttons/social_press.vox create mode 100644 assets/voxygen/element/buttons/spellbook.png delete mode 100644 assets/voxygen/element/buttons/spellbook.vox create mode 100644 assets/voxygen/element/buttons/spellbook_hover.png delete mode 100644 assets/voxygen/element/buttons/spellbook_hover.vox create mode 100644 assets/voxygen/element/buttons/spellbook_press.png delete mode 100644 assets/voxygen/element/buttons/spellbook_press.vox delete mode 100644 assets/voxygen/element/buttons/x.vox delete mode 100644 assets/voxygen/element/buttons/x_hover.vox delete mode 100644 assets/voxygen/element/buttons/x_press.vox create mode 100644 assets/voxygen/element/frames/disclaimer.png delete mode 100644 assets/voxygen/element/frames/disclaimer.vox diff --git a/assets/common/items/apple.ron b/assets/common/items/apple.ron index 7179502e22..f49626db5e 100644 --- a/assets/common/items/apple.ron +++ b/assets/common/items/apple.ron @@ -1,8 +1,6 @@ Item( name: "Apple", - description: "Red and juicy. - -Restores 20 Health.", + description: "Restores 20 Health\n\nRed and juicy\n\n", kind: Consumable( kind: Apple, effect: Health(( diff --git a/assets/common/items/armor/back/admin.ron b/assets/common/items/armor/back/admin.ron index 04b45466e3..f07273b7c6 100644 --- a/assets/common/items/armor/back/admin.ron +++ b/assets/common/items/armor/back/admin.ron @@ -1,8 +1,6 @@ Item( name: "Admin's Cape", - description: " - With great power comes - great responsibility. ", + description: "Back\n\nArmor: 0\n\nWith great power comes\ngreat responsibility.\n\n", kind: Armor( kind: Back(Admin), stats: (20), diff --git a/assets/common/items/armor/back/short_0.ron b/assets/common/items/armor/back/short_0.ron index 953cb40e13..f1759c553d 100644 --- a/assets/common/items/armor/back/short_0.ron +++ b/assets/common/items/armor/back/short_0.ron @@ -1,6 +1,6 @@ Item( name: "Short leather Cape", - description: "", + description: "Back\n\nArmor: 0\n\n", kind: Armor( kind: Back(Short0), stats: (20), diff --git a/assets/common/items/armor/belt/assassin.ron b/assets/common/items/armor/belt/assassin.ron index e6bb45044e..dc086baa18 100644 --- a/assets/common/items/armor/belt/assassin.ron +++ b/assets/common/items/armor/belt/assassin.ron @@ -1,6 +1,6 @@ Item( name: "Assassin Belt", - description: "Only the best for a member of the creed.", + description: "Belt\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", kind: Armor( kind: Belt(Assassin), stats: (20), diff --git a/assets/common/items/armor/belt/cloth_blue_0.ron b/assets/common/items/armor/belt/cloth_blue_0.ron index 8b62419ff7..1faaafb7f3 100644 --- a/assets/common/items/armor/belt/cloth_blue_0.ron +++ b/assets/common/items/armor/belt/cloth_blue_0.ron @@ -1,6 +1,6 @@ Item( name: "Blue Linen Belt", - description: "Soft and warm", + description: "Belt\n\nArmor: 0\n\nSoft and warm\n\n", kind: Armor( kind: Belt(ClothBlue0), stats: (20), diff --git a/assets/common/items/armor/belt/cloth_green_0.ron b/assets/common/items/armor/belt/cloth_green_0.ron index c3424f7817..15be2149ea 100644 --- a/assets/common/items/armor/belt/cloth_green_0.ron +++ b/assets/common/items/armor/belt/cloth_green_0.ron @@ -1,6 +1,6 @@ Item( name: "Green Linen Belt", - description: "Soft and warm", + description: "Belt\n\nArmor: 0\n\nSoft and warm\n\n", kind: Armor( kind: Belt(ClothGreen0), stats: (20), diff --git a/assets/common/items/armor/belt/cloth_purple_0.ron b/assets/common/items/armor/belt/cloth_purple_0.ron index 5f55a20c09..7060fd9c83 100644 --- a/assets/common/items/armor/belt/cloth_purple_0.ron +++ b/assets/common/items/armor/belt/cloth_purple_0.ron @@ -1,6 +1,6 @@ Item( name: "Purple Linen Belt", - description: "Soft and warm", + description: "Belt\n\nArmor: 0\n\nSoft and warm\n\n", kind: Armor( kind: Belt(ClothPurple0), stats: (20), diff --git a/assets/common/items/armor/belt/leather_0.ron b/assets/common/items/armor/belt/leather_0.ron index b3cf347584..6ca49af665 100644 --- a/assets/common/items/armor/belt/leather_0.ron +++ b/assets/common/items/armor/belt/leather_0.ron @@ -1,6 +1,6 @@ Item( name: "Swift Belt", - description: "Swift like the wind.", + description: "Belt\n\nArmor: 0\n\nSwift like the wind.\n\n", kind: Armor( kind: Belt(Leather0), stats: (20), diff --git a/assets/common/items/armor/belt/plate_0.ron b/assets/common/items/armor/belt/plate_0.ron index 2c18113d1a..f1269346f1 100644 --- a/assets/common/items/armor/belt/plate_0.ron +++ b/assets/common/items/armor/belt/plate_0.ron @@ -1,6 +1,6 @@ Item( name: "Iron Belt", - description: "WIP", + description: "Belt\n\nArmor: 0\n\n", kind: Armor( kind: Belt(Plate0), stats: (20), diff --git a/assets/common/items/armor/chest/assassin.ron b/assets/common/items/armor/chest/assassin.ron index 66fc865695..ba969ddd30 100644 --- a/assets/common/items/armor/chest/assassin.ron +++ b/assets/common/items/armor/chest/assassin.ron @@ -1,6 +1,6 @@ Item( name: "Assassin Chest", - description: "Only the best for a member of the creed.", + description: "Chest\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", kind: Armor( kind: Chest(Assassin), stats: (20), diff --git a/assets/common/items/armor/chest/cloth_blue_0.ron b/assets/common/items/armor/chest/cloth_blue_0.ron index 289bf4bdc5..a36d093faf 100644 --- a/assets/common/items/armor/chest/cloth_blue_0.ron +++ b/assets/common/items/armor/chest/cloth_blue_0.ron @@ -1,6 +1,6 @@ Item( name: "Blue Linen Chest", - description: "Soft and warm", + description: "Chest\n\nArmor: 0\n\nSoft and warm\n\n", kind: Armor( kind: Chest(ClothBlue0), stats: (20), diff --git a/assets/common/items/armor/chest/cloth_green_0.ron b/assets/common/items/armor/chest/cloth_green_0.ron index a52fc12a19..0098c1b869 100644 --- a/assets/common/items/armor/chest/cloth_green_0.ron +++ b/assets/common/items/armor/chest/cloth_green_0.ron @@ -1,6 +1,6 @@ Item( name: "Green Linen Chest", - description: "Soft and warm", + description: "Chest\n\nArmor: 0\n\nSoft and warm\n\n", kind: Armor( kind: Chest(ClothGreen0), stats: (20), diff --git a/assets/common/items/armor/chest/cloth_purple_0.ron b/assets/common/items/armor/chest/cloth_purple_0.ron index 728e5f5c85..fef6404226 100644 --- a/assets/common/items/armor/chest/cloth_purple_0.ron +++ b/assets/common/items/armor/chest/cloth_purple_0.ron @@ -1,6 +1,6 @@ Item( name: "Purple Linen Chest", - description: "Soft and warm", + description: "Chest\n\nArmor: 0\n\nSoft and warm\n\n", kind: Armor( kind: Chest(ClothPurple0), stats: (20), diff --git a/assets/common/items/armor/chest/leather_0.ron b/assets/common/items/armor/chest/leather_0.ron index 48408e3674..1135163213 100644 --- a/assets/common/items/armor/chest/leather_0.ron +++ b/assets/common/items/armor/chest/leather_0.ron @@ -1,6 +1,6 @@ Item( name: "Swift Chest", - description: "Swift like the wind.", + description: "Chest\n\nArmor: 0\n\nSwift like the wind.\n\n", kind: Armor( kind: Chest(Leather0), stats: (20), diff --git a/assets/common/items/armor/chest/plate_green_0.ron b/assets/common/items/armor/chest/plate_green_0.ron index 92bb5fb664..aabc7ab943 100644 --- a/assets/common/items/armor/chest/plate_green_0.ron +++ b/assets/common/items/armor/chest/plate_green_0.ron @@ -1,6 +1,6 @@ Item( name: "Iron Chestplate", - description: "Arrows to the stomach are soooo last update.", + description: "Chest\n\nArmor: 0\n\n", kind: Armor( kind: Chest(PlateGreen0), stats: (20), diff --git a/assets/common/items/armor/foot/assassin.ron b/assets/common/items/armor/foot/assassin.ron index 13b587a306..6fd150c332 100644 --- a/assets/common/items/armor/foot/assassin.ron +++ b/assets/common/items/armor/foot/assassin.ron @@ -1,6 +1,6 @@ Item( name: "Assassin Boots", - description: "Only the best for a member of the creed.", + description: "Feet\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", kind: Armor( kind: Foot(Assassin), stats: (20), diff --git a/assets/common/items/armor/foot/cloth_blue_0.ron b/assets/common/items/armor/foot/cloth_blue_0.ron index 31b70750f9..77c9b299db 100644 --- a/assets/common/items/armor/foot/cloth_blue_0.ron +++ b/assets/common/items/armor/foot/cloth_blue_0.ron @@ -1,6 +1,6 @@ Item( name: "Blue Linen Boots", - description: "Soft and warm", + description: "Feet\n\nArmor: 0\n\nSoft and warm\n\n", kind: Armor( kind: Foot(ClothBlue0), stats: (20), diff --git a/assets/common/items/armor/foot/cloth_green_0.ron b/assets/common/items/armor/foot/cloth_green_0.ron index 117b19aad9..b2eccab1f2 100644 --- a/assets/common/items/armor/foot/cloth_green_0.ron +++ b/assets/common/items/armor/foot/cloth_green_0.ron @@ -1,6 +1,6 @@ Item( name: "Green Linen Boots", - description: "Soft and warm", + description: "Feet\n\nArmor: 0\n\nSoft and warm\n\n", kind: Armor( kind: Foot(ClothGreen0), stats: (20), diff --git a/assets/common/items/armor/foot/cloth_purple_0.ron b/assets/common/items/armor/foot/cloth_purple_0.ron index a80c44de89..77db769d55 100644 --- a/assets/common/items/armor/foot/cloth_purple_0.ron +++ b/assets/common/items/armor/foot/cloth_purple_0.ron @@ -1,6 +1,6 @@ Item( name: "Purple Linen Boots", - description: "Soft and warm", + description: "Feet\n\nArmor: 0\n\nSoft and warm\n\n", kind: Armor( kind: Foot(ClothPurple0), stats: (20), diff --git a/assets/common/items/armor/foot/leather_0.ron b/assets/common/items/armor/foot/leather_0.ron index 6ca6a07fc7..7e811efc3a 100644 --- a/assets/common/items/armor/foot/leather_0.ron +++ b/assets/common/items/armor/foot/leather_0.ron @@ -1,6 +1,6 @@ Item( name: "Swift Boots", - description: "Swift like the wind.", + description: "Feet\n\nArmor: 0\n\nSwift like the wind.\nWon't make you run faster.\n\n", kind: Armor( kind: Foot(Leather0), stats: (20), diff --git a/assets/common/items/armor/foot/plate_0.ron b/assets/common/items/armor/foot/plate_0.ron index 12f95dcd4e..21dc0fe27c 100644 --- a/assets/common/items/armor/foot/plate_0.ron +++ b/assets/common/items/armor/foot/plate_0.ron @@ -1,6 +1,6 @@ Item( name: "Iron Feet", - description: "WIP", + description: "Feet\n\nArmor: 0\n\n", kind: Armor( kind: Foot(Plate0), stats: (20), diff --git a/assets/common/items/armor/hand/assassin.ron b/assets/common/items/armor/hand/assassin.ron index 19a09a3177..8e923a13d4 100644 --- a/assets/common/items/armor/hand/assassin.ron +++ b/assets/common/items/armor/hand/assassin.ron @@ -1,6 +1,6 @@ Item( name: "Assassin Gloves", - description: "Only the best for a member of the creed.", + description: "Hands\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", kind: Armor( kind: Hand(Assassin), stats: (20), diff --git a/assets/common/items/armor/hand/cloth_blue_0.ron b/assets/common/items/armor/hand/cloth_blue_0.ron index 88496cbce3..f692f8123f 100644 --- a/assets/common/items/armor/hand/cloth_blue_0.ron +++ b/assets/common/items/armor/hand/cloth_blue_0.ron @@ -1,6 +1,6 @@ Item( name: "Blue Linen Wrists", - description: "WIP", + description: "Hands\n\nArmor: 0\n\n", kind: Armor( kind: Hand(ClothBlue0), stats: (20), diff --git a/assets/common/items/armor/hand/cloth_green_0.ron b/assets/common/items/armor/hand/cloth_green_0.ron index a3452335c4..5a20af9f12 100644 --- a/assets/common/items/armor/hand/cloth_green_0.ron +++ b/assets/common/items/armor/hand/cloth_green_0.ron @@ -1,6 +1,6 @@ Item( name: "Green Linen Wrists", - description: "WIP", + description: "Hands\n\nArmor: 0\n\n", kind: Armor( kind: Hand(ClothGreen0), stats: (20), diff --git a/assets/common/items/armor/hand/cloth_purple_0.ron b/assets/common/items/armor/hand/cloth_purple_0.ron index 840694163c..f4c99713f6 100644 --- a/assets/common/items/armor/hand/cloth_purple_0.ron +++ b/assets/common/items/armor/hand/cloth_purple_0.ron @@ -1,6 +1,6 @@ Item( name: "Purple Silk Wrists", - description: "WIP", + description: "Hands\n\nArmor: 0\n\n", kind: Armor( kind: Hand(ClothPurple0), stats: (20), diff --git a/assets/common/items/armor/hand/leather_0.ron b/assets/common/items/armor/hand/leather_0.ron index e4b62e3a72..d19024f3e7 100644 --- a/assets/common/items/armor/hand/leather_0.ron +++ b/assets/common/items/armor/hand/leather_0.ron @@ -1,6 +1,6 @@ Item( name: "Swift Gloves", - description: "Swift like the wind.", + description: "Hands\n\nArmor: 0\n\nSwift like the wind.\n\n", kind: Armor( kind: Hand(Leather0), stats: (20), diff --git a/assets/common/items/armor/hand/plate_0.ron b/assets/common/items/armor/hand/plate_0.ron index 1fdbb6d6da..516aab8625 100644 --- a/assets/common/items/armor/hand/plate_0.ron +++ b/assets/common/items/armor/hand/plate_0.ron @@ -1,6 +1,6 @@ Item( name: "Iron Handguards", - description: "WIP", + description: "Hands\n\nArmor: 0\n\n", kind: Armor( kind: Hand(Plate0), stats: (20), diff --git a/assets/common/items/armor/head/assa_mask_0.ron b/assets/common/items/armor/head/assa_mask_0.ron index 34f242c778..236ea82ef3 100644 --- a/assets/common/items/armor/head/assa_mask_0.ron +++ b/assets/common/items/armor/head/assa_mask_0.ron @@ -1,6 +1,6 @@ Item( name: "Dark Assassin Mask", - description: "WIP", + description: "Head\n\nArmor: 0\n\n", kind: Armor( kind: Head(AssaMask0), stats: (20), diff --git a/assets/common/items/armor/head/leather_0.ron b/assets/common/items/armor/head/leather_0.ron index aa0ffd33d6..c568860917 100644 --- a/assets/common/items/armor/head/leather_0.ron +++ b/assets/common/items/armor/head/leather_0.ron @@ -1,6 +1,6 @@ Item( name: "Swift Leather Cap", - description: "WIP", + description: "Head\n\nArmor: 0\n\n", kind: Armor( kind: Head(Leather0), stats: (20), diff --git a/assets/common/items/armor/neck/neck_0.ron b/assets/common/items/armor/neck/neck_0.ron index 28125345bc..d170113336 100644 --- a/assets/common/items/armor/neck/neck_0.ron +++ b/assets/common/items/armor/neck/neck_0.ron @@ -1,6 +1,6 @@ Item( name: "Plain Necklace", - description: "", + description: "Neck\n\nArmor: 0\n\n", kind: Armor( kind: Neck(Neck0), stats: (20), diff --git a/assets/common/items/armor/pants/assassin.ron b/assets/common/items/armor/pants/assassin.ron index b5bb2c28ab..3fce548e9a 100644 --- a/assets/common/items/armor/pants/assassin.ron +++ b/assets/common/items/armor/pants/assassin.ron @@ -1,6 +1,6 @@ Item( name: "Assassin Pants", - description: "Only the best for a member of the creed.", + description: "Legs\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", kind: Armor( kind: Pants(Assassin), stats: (20), diff --git a/assets/common/items/armor/pants/cloth_blue_0.ron b/assets/common/items/armor/pants/cloth_blue_0.ron index 9ef245a09a..2b0dc7e163 100644 --- a/assets/common/items/armor/pants/cloth_blue_0.ron +++ b/assets/common/items/armor/pants/cloth_blue_0.ron @@ -1,6 +1,6 @@ Item( name: "Blue Linen Skirt", - description: "WIP", + description: "Legs\n\nArmor: 0\n\n", kind: Armor( kind: Pants(ClothBlue0), stats: (20), diff --git a/assets/common/items/armor/pants/cloth_green_0.ron b/assets/common/items/armor/pants/cloth_green_0.ron index 3782ac2617..b184717ccf 100644 --- a/assets/common/items/armor/pants/cloth_green_0.ron +++ b/assets/common/items/armor/pants/cloth_green_0.ron @@ -1,6 +1,6 @@ Item( name: "Green Linen Skirt", - description: "WIP", + description: "Legs\n\nArmor: 0\n\n", kind: Armor( kind: Pants(ClothGreen0), stats: (20), diff --git a/assets/common/items/armor/pants/cloth_purple_0.ron b/assets/common/items/armor/pants/cloth_purple_0.ron index 770961a1fe..f37662b7db 100644 --- a/assets/common/items/armor/pants/cloth_purple_0.ron +++ b/assets/common/items/armor/pants/cloth_purple_0.ron @@ -1,6 +1,6 @@ Item( name: "Purple Linen Skirt", - description: "WIP", + description: "Legs\n\nArmor: 0\n\n", kind: Armor( kind: Pants(ClothPurple0), stats: (20), diff --git a/assets/common/items/armor/pants/green_0.ron b/assets/common/items/armor/pants/green_0.ron index 5fee632d92..c08d850d75 100644 --- a/assets/common/items/armor/pants/green_0.ron +++ b/assets/common/items/armor/pants/green_0.ron @@ -1,6 +1,6 @@ Item( name: "Hunting Pants", - description: "", + description: "Legs\n\nArmor: 0\n\n", kind: Armor( kind: Pants(Green), stats: (20), diff --git a/assets/common/items/armor/pants/leather_0.ron b/assets/common/items/armor/pants/leather_0.ron index 507ab116c0..8eb99060d7 100644 --- a/assets/common/items/armor/pants/leather_0.ron +++ b/assets/common/items/armor/pants/leather_0.ron @@ -1,6 +1,6 @@ Item( name: "Swift Pants", - description: "", + description: "Legs\n\nArmor: 0\n\n", kind: Armor( kind: Pants(Leather0), stats: (20), diff --git a/assets/common/items/armor/pants/plate_green_0.ron b/assets/common/items/armor/pants/plate_green_0.ron index 51c3620338..3194cac534 100644 --- a/assets/common/items/armor/pants/plate_green_0.ron +++ b/assets/common/items/armor/pants/plate_green_0.ron @@ -1,6 +1,6 @@ Item( name: "Iron Legguards", - description: "WIP", + description: "Legs\n\nArmor: 0\n\n", kind: Armor( kind: Pants(PlateGreen0), stats: (20), diff --git a/assets/common/items/armor/ring/ring_0.ron b/assets/common/items/armor/ring/ring_0.ron index d094e21af8..d0448912f3 100644 --- a/assets/common/items/armor/ring/ring_0.ron +++ b/assets/common/items/armor/ring/ring_0.ron @@ -1,6 +1,6 @@ Item( name: "Scratched Ring", - description: "Barely fits your finger.", + description: "Ring\n\nBarely fits your finger.\n\n", kind: Armor( kind: Ring(Ring0), stats: (20), diff --git a/assets/common/items/armor/shoulder/assassin.ron b/assets/common/items/armor/shoulder/assassin.ron index ea92efbec5..bff3ac8131 100644 --- a/assets/common/items/armor/shoulder/assassin.ron +++ b/assets/common/items/armor/shoulder/assassin.ron @@ -1,6 +1,6 @@ Item( name: "Assassin Shoulder Guard", - description: "Only the best for a member of the creed.", + description: "Shoulders\n\nArmor: 0\n\nOnly the best for a member of the creed.\n\n", kind: Armor( kind: Shoulder(Assassin), stats: (20), diff --git a/assets/common/items/armor/shoulder/cloth_blue_0.ron b/assets/common/items/armor/shoulder/cloth_blue_0.ron index 2ec65be894..7c19790bd8 100644 --- a/assets/common/items/armor/shoulder/cloth_blue_0.ron +++ b/assets/common/items/armor/shoulder/cloth_blue_0.ron @@ -1,6 +1,6 @@ Item( name: "Blue Linen Coat", - description: "WIP", + description: "Shoulders\n\nArmor: 0\n\n", kind: Armor( kind: Shoulder(ClothBlue0), stats: (20), diff --git a/assets/common/items/armor/shoulder/cloth_green_0.ron b/assets/common/items/armor/shoulder/cloth_green_0.ron index 539b3a7063..b3362a8d82 100644 --- a/assets/common/items/armor/shoulder/cloth_green_0.ron +++ b/assets/common/items/armor/shoulder/cloth_green_0.ron @@ -1,6 +1,6 @@ Item( name: "Green Linen Coat", - description: "WIP", + description: "Shoulders\n\nArmor: 0\n\n", kind: Armor( kind: Shoulder(ClothGreen0), stats: (20), diff --git a/assets/common/items/armor/shoulder/cloth_purple_0.ron b/assets/common/items/armor/shoulder/cloth_purple_0.ron index 308759e2b8..ecf434a9b3 100644 --- a/assets/common/items/armor/shoulder/cloth_purple_0.ron +++ b/assets/common/items/armor/shoulder/cloth_purple_0.ron @@ -1,6 +1,6 @@ Item( name: "Purple Linen Coat", - description: "WIP", + description: "Shoulders\n\nArmor: 0\n\n", kind: Armor( kind: Shoulder(ClothPurple0), stats: (20), diff --git a/assets/common/items/armor/shoulder/leather_0.ron b/assets/common/items/armor/shoulder/leather_0.ron index a145debbeb..82e18d2d45 100644 --- a/assets/common/items/armor/shoulder/leather_0.ron +++ b/assets/common/items/armor/shoulder/leather_0.ron @@ -1,6 +1,6 @@ Item( name: "Leather Pauldrons", - description: "", + description: "Shoulders\n\nArmor: 0\n\n", kind: Armor( kind: Shoulder(Leather0), stats: (20), diff --git a/assets/common/items/armor/shoulder/leather_1.ron b/assets/common/items/armor/shoulder/leather_1.ron index ce066e63a0..1237ac242c 100644 --- a/assets/common/items/armor/shoulder/leather_1.ron +++ b/assets/common/items/armor/shoulder/leather_1.ron @@ -1,6 +1,6 @@ Item( name: "Swift Shoulderpads", - description: "Swift like the wind.", + description: "Shoulders\n\nArmor: 0\n\nSwift like the wind.\n\n", kind: Armor( kind: Shoulder(Leather1), stats: (20), diff --git a/assets/common/items/armor/shoulder/plate_0.ron b/assets/common/items/armor/shoulder/plate_0.ron index 3323278ecb..f6d3cc8590 100644 --- a/assets/common/items/armor/shoulder/plate_0.ron +++ b/assets/common/items/armor/shoulder/plate_0.ron @@ -1,6 +1,6 @@ Item( name: "Iron Shoulderguards", - description: "A strong shoulder to lean on.", + description: "Shoulders\n\nArmor: 0\n\nA strong shoulder to lean on.\n\n", kind: Armor( kind: Shoulder(Plate0), stats: (20), diff --git a/assets/common/items/armor/starter/rugged_chest.ron b/assets/common/items/armor/starter/rugged_chest.ron index 63ff3e0835..d559dd6dec 100644 --- a/assets/common/items/armor/starter/rugged_chest.ron +++ b/assets/common/items/armor/starter/rugged_chest.ron @@ -1,6 +1,6 @@ Item( name: "Rugged Shirt", - description: "Smells like Adventure.", + description: "Chest\n\nArmor: 0\n\nSmells like Adventure.\n\n", kind: Armor( kind: Chest(Rugged0), stats: (20), diff --git a/assets/common/items/armor/starter/rugged_pants.ron b/assets/common/items/armor/starter/rugged_pants.ron index 6212774135..0444aeb665 100644 --- a/assets/common/items/armor/starter/rugged_pants.ron +++ b/assets/common/items/armor/starter/rugged_pants.ron @@ -1,6 +1,6 @@ Item( name: "Rugged Commoner's Pants", - description: "They remind you of the old days.", + description: "Legs\n\nArmor: 0\n\nThey remind you of the old days.\n\n", kind: Armor( kind: Pants(Rugged0), stats: (20), diff --git a/assets/common/items/armor/starter/sandals_0.ron b/assets/common/items/armor/starter/sandals_0.ron index 6f4105fb26..3d2201aa19 100644 --- a/assets/common/items/armor/starter/sandals_0.ron +++ b/assets/common/items/armor/starter/sandals_0.ron @@ -1,6 +1,6 @@ Item( name: "Worn out Sandals", - description: "Loyal companions.", + description: "Feet\n\nArmor: 0\n\nLoyal companions.\n\n", kind: Armor( kind: Foot(Sandal0), stats: (20), diff --git a/assets/common/items/armor/tabard/admin.ron b/assets/common/items/armor/tabard/admin.ron index 5bb3fd22fb..4ad17edb50 100644 --- a/assets/common/items/armor/tabard/admin.ron +++ b/assets/common/items/armor/tabard/admin.ron @@ -1,8 +1,6 @@ Item( name: "Admin's Tabard", - description: " - With great power comes - great responsibility. ", + description: "Tabard\n\nWith great power comes\ngreat responsibility.\n\n", kind: Armor( kind: Tabard(Admin), stats: (20), diff --git a/assets/common/items/cheese.ron b/assets/common/items/cheese.ron index 9cb95fcbf8..e7a9fef76f 100644 --- a/assets/common/items/cheese.ron +++ b/assets/common/items/cheese.ron @@ -1,8 +1,6 @@ Item( name: "Dwarven Cheese", - description: "Aromatic and nutritious. - -Restores 15 Health.", + description: "Restores 15 Health\n\nAromatic and nutritious\n\n", kind: Consumable( kind: Cheese, effect: Health(( diff --git a/assets/common/items/coconut.ron b/assets/common/items/coconut.ron index 219af26991..3bd37115f9 100644 --- a/assets/common/items/coconut.ron +++ b/assets/common/items/coconut.ron @@ -1,8 +1,6 @@ Item( name: "Coconut", - description: "Reliable source of water and fat. - -Restores 30 health.", + description: "Restores 30 health\n\nReliable source of water and fat\n\n", kind: Consumable( kind: Coconut, effect: Health(( diff --git a/assets/common/items/collar.ron b/assets/common/items/collar.ron index 5226dd0c0a..378fe47d56 100644 --- a/assets/common/items/collar.ron +++ b/assets/common/items/collar.ron @@ -1,6 +1,6 @@ Item( name: "Collar", - description: "Tames wild animals within 5 blocks.", + description: "Tames wild animals within 5 blocks\n\n", kind: Utility( kind: Collar, ), diff --git a/assets/common/items/debug/admin_tabard.ron b/assets/common/items/debug/admin.ron similarity index 59% rename from assets/common/items/debug/admin_tabard.ron rename to assets/common/items/debug/admin.ron index 9ad427f3ed..d1741be6b5 100644 --- a/assets/common/items/debug/admin_tabard.ron +++ b/assets/common/items/debug/admin.ron @@ -1,7 +1,6 @@ Item( name: "Admin's Tabard", - description: "With great power comes - great responsibility. ", + description: "Tabard\n\nWith great power comes\ngreat responsibility. ", kind: Armor( kind: Tabard(Admin), stats: (20), diff --git a/assets/common/items/debug/admin_back.ron b/assets/common/items/debug/admin_back.ron index fc8f427533..dbdfed10f3 100644 --- a/assets/common/items/debug/admin_back.ron +++ b/assets/common/items/debug/admin_back.ron @@ -1,7 +1,6 @@ Item( name: "Admin's Cape", - description: "With great power comes - great responsibility. ", + description: "Back\n\nArmor: 0\n\nWith great power comes\ngreat responsibility. ", kind: Armor( kind: Back(Admin), stats: (20), diff --git a/assets/common/items/debug/green_0.ron b/assets/common/items/debug/green_0.ron deleted file mode 100644 index ea7d5cbcc7..0000000000 --- a/assets/common/items/debug/green_0.ron +++ /dev/null @@ -1,5 +0,0 @@ -Item( - name: "Lime Zest Lantern", - description: "It has an opening that could fit a ring...", - kind: Lantern(Green0), -) diff --git a/assets/common/items/debug/leather_0.ron b/assets/common/items/debug/leather_0.ron deleted file mode 100644 index aa0ffd33d6..0000000000 --- a/assets/common/items/debug/leather_0.ron +++ /dev/null @@ -1,8 +0,0 @@ -Item( - name: "Swift Leather Cap", - description: "WIP", - kind: Armor( - kind: Head(Leather0), - stats: (20), - ), -) diff --git a/assets/common/items/debug/neck_0.ron b/assets/common/items/debug/neck_0.ron deleted file mode 100644 index 4dbd32ae6f..0000000000 --- a/assets/common/items/debug/neck_0.ron +++ /dev/null @@ -1,8 +0,0 @@ -Item( - name: "Plain Necklace", - description: "WIP", - kind: Armor( - kind: Neck(Neck0), - stats: (20), - ), -) diff --git a/assets/common/items/debug/plate_belt.ron b/assets/common/items/debug/plate_0.ron similarity index 71% rename from assets/common/items/debug/plate_belt.ron rename to assets/common/items/debug/plate_0.ron index 2c18113d1a..c7195ae78f 100644 --- a/assets/common/items/debug/plate_belt.ron +++ b/assets/common/items/debug/plate_0.ron @@ -1,6 +1,6 @@ Item( name: "Iron Belt", - description: "WIP", + description: "Belt\n\nArmor: 0\n\n", kind: Armor( kind: Belt(Plate0), stats: (20), diff --git a/assets/common/items/debug/plate_feet.ron b/assets/common/items/debug/plate_feet.ron index 12f95dcd4e..9cb67b8a09 100644 --- a/assets/common/items/debug/plate_feet.ron +++ b/assets/common/items/debug/plate_feet.ron @@ -1,6 +1,6 @@ Item( name: "Iron Feet", - description: "WIP", + description: "Feet\n\nArmor: 0\n\n", kind: Armor( kind: Foot(Plate0), stats: (20), diff --git a/assets/common/items/debug/plate_chest.ron b/assets/common/items/debug/plate_green_0.ron similarity index 64% rename from assets/common/items/debug/plate_chest.ron rename to assets/common/items/debug/plate_green_0.ron index 92bb5fb664..23b22609a1 100644 --- a/assets/common/items/debug/plate_chest.ron +++ b/assets/common/items/debug/plate_green_0.ron @@ -1,6 +1,6 @@ Item( name: "Iron Chestplate", - description: "Arrows to the stomach are soooo last update.", + description: "Chest\n\nArmor: 0", kind: Armor( kind: Chest(PlateGreen0), stats: (20), diff --git a/assets/common/items/debug/plate_legs.ron b/assets/common/items/debug/plate_green_legs.ron similarity index 73% rename from assets/common/items/debug/plate_legs.ron rename to assets/common/items/debug/plate_green_legs.ron index 51c3620338..2502369711 100644 --- a/assets/common/items/debug/plate_legs.ron +++ b/assets/common/items/debug/plate_green_legs.ron @@ -1,6 +1,6 @@ Item( name: "Iron Legguards", - description: "WIP", + description: "Legs\n\nArmor: 0\n\n", kind: Armor( kind: Pants(PlateGreen0), stats: (20), diff --git a/assets/common/items/debug/plate_hands.ron b/assets/common/items/debug/plate_hand.ron similarity index 72% rename from assets/common/items/debug/plate_hands.ron rename to assets/common/items/debug/plate_hand.ron index 1fdbb6d6da..3f3e122290 100644 --- a/assets/common/items/debug/plate_hands.ron +++ b/assets/common/items/debug/plate_hand.ron @@ -1,6 +1,6 @@ Item( name: "Iron Handguards", - description: "WIP", + description: "Hands\n\nArmor: 0\n\n", kind: Armor( kind: Hand(Plate0), stats: (20), diff --git a/assets/common/items/debug/plate_shoulder.ron b/assets/common/items/debug/plate_shoulder.ron index 3323278ecb..75035d21ab 100644 --- a/assets/common/items/debug/plate_shoulder.ron +++ b/assets/common/items/debug/plate_shoulder.ron @@ -1,6 +1,6 @@ Item( name: "Iron Shoulderguards", - description: "A strong shoulder to lean on.", + description: "Shoulders\n\nArmor: 0\n\A strong shoulder to lean on.", kind: Armor( kind: Shoulder(Plate0), stats: (20), diff --git a/assets/common/items/debug/ring_0.ron b/assets/common/items/debug/ring_0.ron deleted file mode 100644 index 8544765246..0000000000 --- a/assets/common/items/debug/ring_0.ron +++ /dev/null @@ -1,8 +0,0 @@ -Item( - name: "Scratched Ring", - description: "WIP", - kind: Armor( - kind: Ring(Ring0), - stats: (20), - ), -) diff --git a/assets/common/items/mushroom.ron b/assets/common/items/mushroom.ron index 09702079e9..c5ed02c43a 100644 --- a/assets/common/items/mushroom.ron +++ b/assets/common/items/mushroom.ron @@ -1,8 +1,6 @@ Item( name: "Mushroom", - description: "Hopefully this one is not poisonous. - -Restores 10 Health.", + description: "Restores 10 Health\n\nHopefully this one is not poisonous\n\n", kind: Consumable( kind: Mushroom, effect: Health(( diff --git a/assets/common/items/potion_minor.ron b/assets/common/items/potion_minor.ron index aaf0b948c9..9d835fb242 100644 --- a/assets/common/items/potion_minor.ron +++ b/assets/common/items/potion_minor.ron @@ -1,8 +1,6 @@ Item( name: "Minor Potion", - description: "Restores a small amount of Health. - -Restores 50 Health.", + description: "Restores 50 Health\n\n", kind: Consumable( kind: PotionMinor, effect: Health(( diff --git a/assets/common/items/velorite.ron b/assets/common/items/velorite.ron index 2cefef40b0..88ff4392b6 100644 --- a/assets/common/items/velorite.ron +++ b/assets/common/items/velorite.ron @@ -1,8 +1,6 @@ Item( name: "Velorite", - description: "Just a slight touch makes you feel the knowledge of ancient times. - -Increases Exp by 20.", + description: "Increases Exp by 20\n\nJust a slight touch makes you feel the knowledge of ancient times\n\n", kind: Consumable( kind: Velorite, effect: Xp(20), diff --git a/assets/common/items/veloritefrag.ron b/assets/common/items/veloritefrag.ron index d29abf6a4f..31a2035bd2 100644 --- a/assets/common/items/veloritefrag.ron +++ b/assets/common/items/veloritefrag.ron @@ -1,8 +1,6 @@ Item( name: "Velorite Fragment", - description: "Small runes sparkle on its surface. - -Increases Exp by 10.", + description: "Increases Exp by 10\n\nSmall runes sparkle on its surface\n\n", kind: Consumable( kind: VeloriteFrag, effect: Xp(10), diff --git a/assets/common/items/weapons/hammer_1.ron b/assets/common/items/weapons/hammer_1.ron index 12573ab023..02ba5d1069 100644 --- a/assets/common/items/weapons/hammer_1.ron +++ b/assets/common/items/weapons/hammer_1.ron @@ -1,8 +1,6 @@ Item( name: "Crude Mallet", - description: "Breaks bones like sticks and stones. - \n - Power: 20", + description: "Two-Hand Hammer\n\nPower: 10-12\n\nBreaks bones like sticks and stones.\n\n", kind: Tool( ( kind: Hammer(BasicHammer), diff --git a/assets/common/items/weapons/shield_1.ron b/assets/common/items/weapons/shield_1.ron index 83a4157942..6b4014ce7a 100644 --- a/assets/common/items/weapons/shield_1.ron +++ b/assets/common/items/weapons/shield_1.ron @@ -1,6 +1,6 @@ Item( name: "A Shield", - description: "Legends tell this item is useless.", + description: "WIP", kind: Tool ( ( kind: Shield(BasicShield), diff --git a/assets/common/items/weapons/short_sword_0.ron b/assets/common/items/weapons/short_sword_0.ron index f6ac3ffa0e..cdec6c999e 100644 --- a/assets/common/items/weapons/short_sword_0.ron +++ b/assets/common/items/weapons/short_sword_0.ron @@ -1,7 +1,6 @@ Item( name: "Vicious Gladius", - description: " - Power: 15", + description: "Two-Hand Sword\n\nPower: 2-10\n\n", kind: Tool( ( kind: Sword(Short0), diff --git a/assets/common/items/weapons/staff_1.ron b/assets/common/items/weapons/staff_1.ron index 220497d481..5fb37f87b6 100644 --- a/assets/common/items/weapons/staff_1.ron +++ b/assets/common/items/weapons/staff_1.ron @@ -1,8 +1,6 @@ Item( name: "Humble Stick", - description: "Walking stick with a sharpened end. - - Power: 6", + description: "Two-Hand Staff\n\nPower: 2-10\n\nWalking stick with a sharpened end\n\n", kind: Tool( ( kind: Staff(BasicStaff), diff --git a/assets/common/items/weapons/staff_nature.ron b/assets/common/items/weapons/staff_nature.ron index d4c76c6b3a..11764ac526 100644 --- a/assets/common/items/weapons/staff_nature.ron +++ b/assets/common/items/weapons/staff_nature.ron @@ -1,7 +1,6 @@ Item( name: "Sceptre of Regeneration", - description: " Infused by the power of Nature. - Power: 25", + description: "Healing-Sceptre\n\nPower 15-18\n\nHeals your allies with the power of nature.\n\n", kind: Tool( ( kind: Staff(Sceptre), diff --git a/assets/common/items/weapons/starter_axe.ron b/assets/common/items/weapons/starter_axe.ron index 9c82e4901f..7f8fc50946 100644 --- a/assets/common/items/weapons/starter_axe.ron +++ b/assets/common/items/weapons/starter_axe.ron @@ -1,8 +1,6 @@ Item( name: "Notched Axe", - description: "Every dent tells the story of a chopped tree. - - Power: 15", + description: "Two-Hand Axe\n\nPower 3-14\n\nEvery dent tells the story of a chopped tree.\n\n", kind: Tool( ( kind: Axe(BasicAxe), diff --git a/assets/common/items/weapons/starter_bow.ron b/assets/common/items/weapons/starter_bow.ron index fb88134255..4dcc9ed424 100644 --- a/assets/common/items/weapons/starter_bow.ron +++ b/assets/common/items/weapons/starter_bow.ron @@ -1,8 +1,6 @@ Item( name: "Uneven Bow", - description: "Someone carved his initials into it... - - Power: 15", + description: "Bow\n\nPower: 5\n\nSomeone carved his initials into it...\n\n", kind: Tool( ( kind: Bow(BasicBow), diff --git a/assets/common/items/weapons/starter_dagger.ron b/assets/common/items/weapons/starter_dagger.ron index 6be38613bd..c4bd8891e6 100644 --- a/assets/common/items/weapons/starter_dagger.ron +++ b/assets/common/items/weapons/starter_dagger.ron @@ -1,8 +1,6 @@ Item( name: "Sharp Kitchen Knife", - description: "Great for cutting meat. - - Power: 15", + description: "WIP", kind: Tool( ( kind: Dagger(BasicDagger), diff --git a/assets/common/items/weapons/starter_hammer.ron b/assets/common/items/weapons/starter_hammer.ron index feb59a5da1..5e707614af 100644 --- a/assets/common/items/weapons/starter_hammer.ron +++ b/assets/common/items/weapons/starter_hammer.ron @@ -1,8 +1,6 @@ Item( name: "Sturdy Old Hammer", - description: "'Property of...' The rest is missing. - - Power: 15", + description: "Two-Hand Hammer\n\nPower: 10-12\n\n'Property of...' The rest is missing.\n\n", kind: Tool( ( kind: Hammer(BasicHammer), diff --git a/assets/common/items/weapons/starter_staff.ron b/assets/common/items/weapons/starter_staff.ron index 9f19fe2000..8b8e8d6f88 100644 --- a/assets/common/items/weapons/starter_staff.ron +++ b/assets/common/items/weapons/starter_staff.ron @@ -1,8 +1,6 @@ Item( name: "Gnarled Rod", - description: "Smells like resin and magic. - - Power: 20", + description: "Firestaff\n\nPower: 1-13\n\nSmells like resin and magic.\n\n", kind: Tool( ( kind: Staff(BasicStaff), diff --git a/assets/common/items/weapons/starter_sword.ron b/assets/common/items/weapons/starter_sword.ron index 4dab78f166..0348998a8e 100644 --- a/assets/common/items/weapons/starter_sword.ron +++ b/assets/common/items/weapons/starter_sword.ron @@ -1,8 +1,6 @@ Item( name: "Battered Sword", - description: "Held together by Rust and hope. - - Power: 15", + description: "Two-Hand Sword\n\nPower: 2-10\n\nHeld together by Rust and hope.\n\n", kind: Tool( ( kind: Sword(BasicSword), diff --git a/assets/common/items/weapons/wood_sword.ron b/assets/common/items/weapons/wood_sword.ron index a766b88c19..038468636c 100644 --- a/assets/common/items/weapons/wood_sword.ron +++ b/assets/common/items/weapons/wood_sword.ron @@ -1,7 +1,6 @@ Item( name: "Wooden Training Sword", - description: " - Power: 15", + description: "Two-Hand Sword\n\nPower: 2-10\n\n", kind: Tool( ( kind: Sword(WoodTraining), diff --git a/assets/common/items/weapons/zweihander_sword_0.ron b/assets/common/items/weapons/zweihander_sword_0.ron index 32f8e9ca1e..a3bc54faa4 100644 --- a/assets/common/items/weapons/zweihander_sword_0.ron +++ b/assets/common/items/weapons/zweihander_sword_0.ron @@ -1,7 +1,6 @@ Item( name: "Sturdy Bihander", - description: " - Power: 15", + description: "Two-Hand Sword\n\nPower: 2-10\n\n", kind: Tool( ( kind: Sword(Zweihander0), diff --git a/assets/voxygen/element/buttons/bag/closed.vox b/assets/voxygen/element/buttons/bag/closed.vox deleted file mode 100644 index 299670695d..0000000000 --- a/assets/voxygen/element/buttons/bag/closed.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9ea53827c28caf3bc7d841d6f56d9fe1dec4d1b29947c7cb75312d5b7e9e73ed -size 5204 diff --git a/assets/voxygen/element/buttons/bag/closed_hover.vox b/assets/voxygen/element/buttons/bag/closed_hover.vox deleted file mode 100644 index 63934430c9..0000000000 --- a/assets/voxygen/element/buttons/bag/closed_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a450efd67036668e7e0ef3bbe31d8e71bebf2eae8058410aa8486fb94b14a535 -size 48312 diff --git a/assets/voxygen/element/buttons/bag/closed_press.vox b/assets/voxygen/element/buttons/bag/closed_press.vox deleted file mode 100644 index c654b1394d..0000000000 --- a/assets/voxygen/element/buttons/bag/closed_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:736b5a06b771e14093fd97f826966b94ab5bc337708b995fd248ad7adc9caab4 -size 48436 diff --git a/assets/voxygen/element/buttons/bag/open.vox b/assets/voxygen/element/buttons/bag/open.vox deleted file mode 100644 index 84bc65d2c7..0000000000 --- a/assets/voxygen/element/buttons/bag/open.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a5835377b03f459163c14c6e0d5ef34f87b713cf1e5b8e019de67c2c15589949 -size 48436 diff --git a/assets/voxygen/element/buttons/bag/open_hover.vox b/assets/voxygen/element/buttons/bag/open_hover.vox deleted file mode 100644 index 4f8096042e..0000000000 --- a/assets/voxygen/element/buttons/bag/open_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:687e1dda41b48ea7c93acdf2befd575c33c848d41e7c0b67a75c53ec18f5b12e -size 5824 diff --git a/assets/voxygen/element/buttons/bag/open_press.vox b/assets/voxygen/element/buttons/bag/open_press.vox deleted file mode 100644 index fee2a07265..0000000000 --- a/assets/voxygen/element/buttons/bag/open_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c30b3698834867c1fd7be58dee17d36960a301109e28d1b1690ac44466337f06 -size 7200 diff --git a/assets/voxygen/element/buttons/button.vox b/assets/voxygen/element/buttons/button.vox deleted file mode 100644 index 9f6756bdfe..0000000000 --- a/assets/voxygen/element/buttons/button.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c389f374873606f85c68b326649996a6869f77ee1b47d10bd8bc76b80434b1bb -size 33040 diff --git a/assets/voxygen/element/buttons/button_dark.vox b/assets/voxygen/element/buttons/button_dark.vox deleted file mode 100644 index 71d180ea1e..0000000000 --- a/assets/voxygen/element/buttons/button_dark.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:26192224ff0ea57a404f27abf56b3ba83741b81cbd5c8cbadbd624cdab1aae7c -size 2464 diff --git a/assets/voxygen/element/buttons/button_dark_hover.vox b/assets/voxygen/element/buttons/button_dark_hover.vox deleted file mode 100644 index 058a9bec5a..0000000000 --- a/assets/voxygen/element/buttons/button_dark_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fac0deafddf1e96155b17e6db0eb827fe312feb17dfa3af872b598790bcd5e0b -size 45571 diff --git a/assets/voxygen/element/buttons/button_dark_press.vox b/assets/voxygen/element/buttons/button_dark_press.vox deleted file mode 100644 index c961fe8561..0000000000 --- a/assets/voxygen/element/buttons/button_dark_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba942fe7ab30c39a5b6ec98c13012bcb97602ab66ec9e71c2769baf8ced114be -size 45027 diff --git a/assets/voxygen/element/buttons/button_hover.vox b/assets/voxygen/element/buttons/button_hover.vox deleted file mode 100644 index e1b955adcc..0000000000 --- a/assets/voxygen/element/buttons/button_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:41e0097895b34a0c664c9318c04fb5c1f00e4c9319be69a90658f0386ed83316 -size 33040 diff --git a/assets/voxygen/element/buttons/button_mmap_closed.vox b/assets/voxygen/element/buttons/button_mmap_closed.vox deleted file mode 100644 index ef103bbc19..0000000000 --- a/assets/voxygen/element/buttons/button_mmap_closed.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:26bab9c8354e012f3975232e22cd949adbd0cc0198be45c83c2f7d3345cf79b3 -size 2156 diff --git a/assets/voxygen/element/buttons/button_mmap_closed_hover.vox b/assets/voxygen/element/buttons/button_mmap_closed_hover.vox deleted file mode 100644 index 67c7ff173a..0000000000 --- a/assets/voxygen/element/buttons/button_mmap_closed_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:50320cab07079b0af941b8b72ab48d60dfb7b62bc4939c6186ff2915cf27617c -size 56639 diff --git a/assets/voxygen/element/buttons/button_mmap_closed_press.vox b/assets/voxygen/element/buttons/button_mmap_closed_press.vox deleted file mode 100644 index ec5d0def60..0000000000 --- a/assets/voxygen/element/buttons/button_mmap_closed_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:aefe32fb5d1828435d5e01e1fad7ad55655bf06c45c8c3a3797a73e270d3c637 -size 56639 diff --git a/assets/voxygen/element/buttons/button_mmap_open.vox b/assets/voxygen/element/buttons/button_mmap_open.vox deleted file mode 100644 index f3fce68eae..0000000000 --- a/assets/voxygen/element/buttons/button_mmap_open.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:30edd32396c41aa161534d25331f8e66c9d3960ac7865b8847b4b089c0854d28 -size 56639 diff --git a/assets/voxygen/element/buttons/button_mmap_open_hover.vox b/assets/voxygen/element/buttons/button_mmap_open_hover.vox deleted file mode 100644 index 502b754f66..0000000000 --- a/assets/voxygen/element/buttons/button_mmap_open_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c5e0e535124dfea41c5fa3cbdb37e0b944bc09c4270357b276bced575342137e -size 56639 diff --git a/assets/voxygen/element/buttons/button_mmap_open_press.vox b/assets/voxygen/element/buttons/button_mmap_open_press.vox deleted file mode 100644 index ad745adb8e..0000000000 --- a/assets/voxygen/element/buttons/button_mmap_open_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cf079403a3062a5fa66fe31eaa651a65de88255c4778dc3f66c580051bcd27c7 -size 56639 diff --git a/assets/voxygen/element/buttons/button_press.vox b/assets/voxygen/element/buttons/button_press.vox deleted file mode 100644 index 1170e0c96e..0000000000 --- a/assets/voxygen/element/buttons/button_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4dc3bc940ed1766761e14a2f9e9ba4e728ab1e9c5d0a8015fca8c7b67c1d6563 -size 87924 diff --git a/assets/voxygen/element/buttons/button_red.vox b/assets/voxygen/element/buttons/button_red.vox deleted file mode 100644 index e2684157e4..0000000000 --- a/assets/voxygen/element/buttons/button_red.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:48b4e15bdd2d0260ac99e31991d535c18be134ff6458f829c2c3a20c5f3e6cca -size 2136 diff --git a/assets/voxygen/element/buttons/button_red_hover.vox b/assets/voxygen/element/buttons/button_red_hover.vox deleted file mode 100644 index 7afc7055cc..0000000000 --- a/assets/voxygen/element/buttons/button_red_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:895ae3f3d9c759d33df3d9e9bbf3776860c72265fe06ef2ebf75ea933d4d0cf4 -size 2136 diff --git a/assets/voxygen/element/buttons/button_red_press.vox b/assets/voxygen/element/buttons/button_red_press.vox deleted file mode 100644 index c96fc13391..0000000000 --- a/assets/voxygen/element/buttons/button_red_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5adc91b069ecaa603c73207affe3c08b5aa32bedf7b943c08f696ff7917c701a -size 1880 diff --git a/assets/voxygen/element/buttons/grid_inv.vox b/assets/voxygen/element/buttons/grid_inv.vox deleted file mode 100644 index 5f079abee8..0000000000 --- a/assets/voxygen/element/buttons/grid_inv.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f99d8145adc57abf88b2f14547c70f19c1271783e18c92151f7964e4014ca5ad -size 51813 diff --git a/assets/voxygen/element/buttons/indicator_mmap.vox b/assets/voxygen/element/buttons/indicator_mmap.vox deleted file mode 100644 index b1a6233f9b..0000000000 --- a/assets/voxygen/element/buttons/indicator_mmap.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5e647033fe3c7370a0dbf5b923c8efbe5839e4d485a12c5c3c21084936d34355 -size 56692 diff --git a/assets/voxygen/element/buttons/indicator_mmap_2.vox b/assets/voxygen/element/buttons/indicator_mmap_2.vox deleted file mode 100644 index 63da2b0477..0000000000 --- a/assets/voxygen/element/buttons/indicator_mmap_2.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c503390eed517f975dbc4e55b40cad10e4337a1b35b26e344d8fa5fe38a7813e -size 56772 diff --git a/assets/voxygen/element/buttons/indicator_mmap_3.vox b/assets/voxygen/element/buttons/indicator_mmap_3.vox deleted file mode 100644 index b0dd4025d8..0000000000 --- a/assets/voxygen/element/buttons/indicator_mmap_3.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:571d8fa25a8ad7e9cf02fcab951dd94cfae360b8ae480b0307aded8bcbc57949 -size 56772 diff --git a/assets/voxygen/element/buttons/indicator_mmap_small.vox b/assets/voxygen/element/buttons/indicator_mmap_small.vox deleted file mode 100644 index 0079616acd..0000000000 --- a/assets/voxygen/element/buttons/indicator_mmap_small.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:693433aa99787746d40b02be5996748f346434bbaf2fdab194e71be7d9cb5633 -size 60583 diff --git a/assets/voxygen/element/buttons/input.vox b/assets/voxygen/element/buttons/input.vox deleted file mode 100644 index 41e5b4c782..0000000000 --- a/assets/voxygen/element/buttons/input.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a670737646549a560b5011deefb02c295e1970eb2373b0adbef991451931f974 -size 69840 diff --git a/assets/voxygen/element/buttons/inv_slot.vox b/assets/voxygen/element/buttons/inv_slot.vox deleted file mode 100644 index dc60c1323b..0000000000 --- a/assets/voxygen/element/buttons/inv_slot.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ab46da914aa73fd0a7aff023883cd5392d01f0609383d4c143d5c3680b65250a -size 57195 diff --git a/assets/voxygen/element/buttons/inv_slot_sel.vox b/assets/voxygen/element/buttons/inv_slot_sel.vox deleted file mode 100644 index ebe08ff289..0000000000 --- a/assets/voxygen/element/buttons/inv_slot_sel.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8ddf8f91a8229e95b3de37f22435a8570f0f5992f9593815c6a1bd8d8320236a -size 57307 diff --git a/assets/voxygen/element/buttons/map.png b/assets/voxygen/element/buttons/map.png new file mode 100644 index 0000000000..c2d7b81d35 --- /dev/null +++ b/assets/voxygen/element/buttons/map.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0082f32cedc0faa653cc7136ee9aef787554debbfc35c9826dd7b1bbc1401395 +size 592 diff --git a/assets/voxygen/element/buttons/map.vox b/assets/voxygen/element/buttons/map.vox deleted file mode 100644 index c312afc426..0000000000 --- a/assets/voxygen/element/buttons/map.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b35f69ff8693e2377f803eee719fbe9098a4d435b73f4f8e6762561b9645605a -size 5032 diff --git a/assets/voxygen/element/buttons/map_hover.png b/assets/voxygen/element/buttons/map_hover.png new file mode 100644 index 0000000000..e91365ad80 --- /dev/null +++ b/assets/voxygen/element/buttons/map_hover.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5273856d9dc98f92ded7497872eb3a047df4ac28613be23f86b607baded7c126 +size 591 diff --git a/assets/voxygen/element/buttons/map_hover.vox b/assets/voxygen/element/buttons/map_hover.vox deleted file mode 100644 index 32176718c0..0000000000 --- a/assets/voxygen/element/buttons/map_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:70e4d08e01cc463a28df7f0ca26126ab0dd69fd9e7a0f3b8c4fca8bfe7e829cf -size 5032 diff --git a/assets/voxygen/element/buttons/map_press.png b/assets/voxygen/element/buttons/map_press.png new file mode 100644 index 0000000000..9402bc3d5d --- /dev/null +++ b/assets/voxygen/element/buttons/map_press.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5e3aa89297a9fc6b04bfa36d890f7bfa767854183615ccdbbd286e01fb202a8 +size 589 diff --git a/assets/voxygen/element/buttons/map_press.vox b/assets/voxygen/element/buttons/map_press.vox deleted file mode 100644 index e3272ca19d..0000000000 --- a/assets/voxygen/element/buttons/map_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d981354922d7a96ab9ac2445e70e69c028f828030e8ad8b8aa8d7ec26e2aab28 -size 5032 diff --git a/assets/voxygen/element/buttons/settings.png b/assets/voxygen/element/buttons/settings.png new file mode 100644 index 0000000000..ffc51c2934 --- /dev/null +++ b/assets/voxygen/element/buttons/settings.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b681c4f08958a62151e4f9453cd6f3cc0346c24b7a187671c3db365d6b9206e6 +size 751 diff --git a/assets/voxygen/element/buttons/settings.vox b/assets/voxygen/element/buttons/settings.vox deleted file mode 100644 index 72c4d84e5e..0000000000 --- a/assets/voxygen/element/buttons/settings.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:29812068f642f1cdb04d180a685ad8c4f871f22260a9a471d0621b3bbf992a33 -size 5968 diff --git a/assets/voxygen/element/buttons/settings_hover.png b/assets/voxygen/element/buttons/settings_hover.png new file mode 100644 index 0000000000..d0fbebc449 --- /dev/null +++ b/assets/voxygen/element/buttons/settings_hover.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c739332f7c10ddbbc7c539d4aed96d3b88e50894aa3e0ec20433c6439b5e5032 +size 698 diff --git a/assets/voxygen/element/buttons/settings_hover.vox b/assets/voxygen/element/buttons/settings_hover.vox deleted file mode 100644 index f33e352350..0000000000 --- a/assets/voxygen/element/buttons/settings_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:935c119010814abe54b247ef3c669b4c085bc5d78d98e98876c6115964b98402 -size 5980 diff --git a/assets/voxygen/element/buttons/settings_press.png b/assets/voxygen/element/buttons/settings_press.png new file mode 100644 index 0000000000..7a54ab6e36 --- /dev/null +++ b/assets/voxygen/element/buttons/settings_press.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18a888bfdde7251413a744f7cc110bee685d4b454bb23fdb9caee14d7eb36efd +size 682 diff --git a/assets/voxygen/element/buttons/settings_press.vox b/assets/voxygen/element/buttons/settings_press.vox deleted file mode 100644 index 90eaa41d78..0000000000 --- a/assets/voxygen/element/buttons/settings_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e371b2add365f33a55dc069e8d2161e3426c651664cab27dd9106d2d1e1678b3 -size 5980 diff --git a/assets/voxygen/element/buttons/social.png b/assets/voxygen/element/buttons/social.png new file mode 100644 index 0000000000..9463a36214 --- /dev/null +++ b/assets/voxygen/element/buttons/social.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:886c38c7c0a8f8e96f6d0332bc7572cd5df6f8175d1c901434e2712f9cac4419 +size 496 diff --git a/assets/voxygen/element/buttons/social.vox b/assets/voxygen/element/buttons/social.vox deleted file mode 100644 index b9e66c6ffc..0000000000 --- a/assets/voxygen/element/buttons/social.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a60016489728bc4e81e12f32af4dc4f040bedcd59a13c02893e2f039be028ec0 -size 2840 diff --git a/assets/voxygen/element/buttons/social_hover.png b/assets/voxygen/element/buttons/social_hover.png new file mode 100644 index 0000000000..864154d96f --- /dev/null +++ b/assets/voxygen/element/buttons/social_hover.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0587b272342b0af3344b3789e2297b109bbd1e53e2dfff6b83baacd8df386ee4 +size 464 diff --git a/assets/voxygen/element/buttons/social_hover.vox b/assets/voxygen/element/buttons/social_hover.vox deleted file mode 100644 index 71a98b552c..0000000000 --- a/assets/voxygen/element/buttons/social_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:8ead1f5d677cd81373473f7fdc99e536e7e3c42fe4e4e71ae82931b2e53c9c4b -size 2840 diff --git a/assets/voxygen/element/buttons/social_press.png b/assets/voxygen/element/buttons/social_press.png new file mode 100644 index 0000000000..ff15b328d1 --- /dev/null +++ b/assets/voxygen/element/buttons/social_press.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca47fb24d46831b28d1f62d36447ba76fcadd2ef2282e6114b2497c0869da357 +size 464 diff --git a/assets/voxygen/element/buttons/social_press.vox b/assets/voxygen/element/buttons/social_press.vox deleted file mode 100644 index 6450a0daff..0000000000 --- a/assets/voxygen/element/buttons/social_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:181bac69ce0a6b6fe0fe0a213d15059b6bd247854c41b38a41f309c447729a25 -size 2840 diff --git a/assets/voxygen/element/buttons/spellbook.png b/assets/voxygen/element/buttons/spellbook.png new file mode 100644 index 0000000000..420d16f860 --- /dev/null +++ b/assets/voxygen/element/buttons/spellbook.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00c0dfe80b6f452810125f741b7aadcb1f3ff1bf1ac2826cb2eebf72dd024180 +size 555 diff --git a/assets/voxygen/element/buttons/spellbook.vox b/assets/voxygen/element/buttons/spellbook.vox deleted file mode 100644 index 6776f5a3b8..0000000000 --- a/assets/voxygen/element/buttons/spellbook.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a4a91167ae5c4dc4ce1691fabb981b82be569c18ea2982e5c26f3516b5f0d645 -size 3732 diff --git a/assets/voxygen/element/buttons/spellbook_hover.png b/assets/voxygen/element/buttons/spellbook_hover.png new file mode 100644 index 0000000000..2405436633 --- /dev/null +++ b/assets/voxygen/element/buttons/spellbook_hover.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fefcc75f95e12cdb16841ac97d67290cad083cbf839efb892555dd08c0c0745f +size 547 diff --git a/assets/voxygen/element/buttons/spellbook_hover.vox b/assets/voxygen/element/buttons/spellbook_hover.vox deleted file mode 100644 index b7c85a2bba..0000000000 --- a/assets/voxygen/element/buttons/spellbook_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:db394d0eb8fc5b57275e2096f6b6095ec0084a46b52f3aaf1e1360797df6bc45 -size 3732 diff --git a/assets/voxygen/element/buttons/spellbook_press.png b/assets/voxygen/element/buttons/spellbook_press.png new file mode 100644 index 0000000000..b3a2c0e9c5 --- /dev/null +++ b/assets/voxygen/element/buttons/spellbook_press.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:022d3650d55eece9c4850dff0dddfde4e3e7f02484d16409df42a0146c1c3f25 +size 545 diff --git a/assets/voxygen/element/buttons/spellbook_press.vox b/assets/voxygen/element/buttons/spellbook_press.vox deleted file mode 100644 index 93017324a0..0000000000 --- a/assets/voxygen/element/buttons/spellbook_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:62a9c112ba24e4f4d1cad3fe485c5f3baf078db4df73861b986e9411f2dda2c5 -size 3732 diff --git a/assets/voxygen/element/buttons/x.vox b/assets/voxygen/element/buttons/x.vox deleted file mode 100644 index 9086a70699..0000000000 --- a/assets/voxygen/element/buttons/x.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5f604ac7fa307a80bed9dff02e5bb631d537e83e2081ff881bb0821a101dd4cd -size 237548 diff --git a/assets/voxygen/element/buttons/x_hover.vox b/assets/voxygen/element/buttons/x_hover.vox deleted file mode 100644 index 811fd46aba..0000000000 --- a/assets/voxygen/element/buttons/x_hover.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3cdfd73c7628c1411cb9f8f1db1f252df6bc0398a4b18307bb94df1d5909dce0 -size 237548 diff --git a/assets/voxygen/element/buttons/x_press.vox b/assets/voxygen/element/buttons/x_press.vox deleted file mode 100644 index d1fd6c1902..0000000000 --- a/assets/voxygen/element/buttons/x_press.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c90869707c6e86520957d5ee983b36090aa248b38493d222860c5edea078f6f6 -size 237548 diff --git a/assets/voxygen/element/frames/disclaimer.png b/assets/voxygen/element/frames/disclaimer.png new file mode 100644 index 0000000000..207351d44d --- /dev/null +++ b/assets/voxygen/element/frames/disclaimer.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:889361f3fba747de0cc10f0c0047f6a1609b3f8f1f5f43070d5e14ae946a6598 +size 246 diff --git a/assets/voxygen/element/frames/disclaimer.vox b/assets/voxygen/element/frames/disclaimer.vox deleted file mode 100644 index 8678b5038a..0000000000 --- a/assets/voxygen/element/frames/disclaimer.vox +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:92ec5235cd7687043b69cc545de939ba07d786f7822e4df4eec66a155fae734f -size 71908 diff --git a/assets/voxygen/i18n/de_DE.ron b/assets/voxygen/i18n/de_DE.ron index c2b672e579..01a9c63ecf 100644 --- a/assets/voxygen/i18n/de_DE.ron +++ b/assets/voxygen/i18n/de_DE.ron @@ -100,19 +100,17 @@ VoxygenLocalization( Bevor es losgeht noch einige Infos: -Dies ist eine frühe Alpha. Ihr werdet auf Bugs, unfertiges Gameplay und Mechaniken, sowie fehlende Features sto�en. +Dies ist eine frühe Alpha. Ihr werdet auf Bugs, unfertiges Gameplay und Mechaniken, sowie fehlende Features stoßen. Für konstruktives Feedback und Bug-Reports könnt ihr uns via Reddit, Gitlab oder unseren Discord Server kontaktieren. -Veloren hat die GPL 3 Open-Source Lizenz. Das heißt ihr könnt es kostenlos spielen, aber auch modifizieren (solange die Mods auch die selbe Lizenz tragen) und das Spiel an andere weiterschicken. +Veloren hat die GPL 3 Open-Source Lizenz. Das heißt ihr könnt es kostenlos spielen, +aber auch modifizieren (solange die Mods auch die selbe Lizenz tragen) und das Spiel an andere weiterschicken. Veloren ist ein Non-Profit Community Projekt und jeder Mitarbeiter entwickelt es als Hobby in seiner Freizeit. Wenn euch die Idee gefällt, dann schließt euch doch einfach unserem Dev- oder Art-Team an! -Voxel RPGs haben sich (Genau wie First Person Shooter, die lange nur Doom-Klone genannt wurden) zu einem eigenen Genre entwickelt. -Dieses Spiel ist alles andere, als ein Klon bereits vorhandener Spiele und wird sich in seine ganz eigene Richtung entwickeln. - Danke, dass ihr euch die Zeit genommen habt diese Zeilen zu lesen und wir hoffen, dass euch Veloren gefällt! ~ Die Entwickler"#, @@ -244,16 +242,18 @@ Viel Spaß in der Welt von Veloren, Abenteurer!"#, "hud.settings.values": "Werte", "hud.settings.percentages": "Prozent", "hud.settings.chat": "Chat", - "hud.settings.background_transparency": "Hintergrund Sichtbarkeit", + "hud.settings.background_transparency": "Hintergrund Kontrast", "hud.settings.pan_sensitivity": "Schwenk Sensibilität", "hud.settings.zoom_sensitivity": "Zoom Sensibilität", "hud.settings.invert_scroll_zoom": "Scroll-Zoom invertieren", "hud.settings.invert_mouse_y_axis": "Maus Y-Achse invertieren", + "hud.settings.enable_mouse_smoothing": "Kamera Glättung", "hud.settings.free_look_behavior": "Freies Umsehen", "hud.settings.view_distance": "Gelände Sichtweite", "hud.settings.sprites_view_distance": "Objekt Sichtweite", + "hud.settings.figures_view_distance": "Einheiten Sichtweite", "hud.settings.maximum_fps": "Maximale FPS", "hud.settings.fov": "Sichtfeld (Grad)", "hud.settings.gamma": "Gamma", diff --git a/assets/voxygen/i18n/en.ron b/assets/voxygen/i18n/en.ron index ef5b00b544..b846ba0039 100644 --- a/assets/voxygen/i18n/en.ron +++ b/assets/voxygen/i18n/en.ron @@ -54,7 +54,7 @@ VoxygenLocalization( "common.interface": "Interface", "common.gameplay": "Gameplay", "common.controls": "Controls", - "common.video": "Video", + "common.video": "Graphics", "common.sound": "Sound", "common.resume": "Resume", "common.characters": "Characters", @@ -102,14 +102,14 @@ Is the client up to date?"#, Before you dive into the fun, please keep a few things in mind: - This is a very early alpha. Expect bugs, extremely unfinished gameplay, unpolished mechanics, and missing features. + - If you have constructive feedback or bug reports, you can contact us via Reddit, GitLab, or our community Discord server. + - Veloren is licensed under the GPL 3 open-source licence. That means you're free to play, modify, and redistribute the game however you wish (provided derived work is also under GPL 3). + - Veloren is a non-profit community project, and everybody working on it is a volunteer. If you like what you see, you're welcome to join the development or art teams! -- 'Voxel RPG' is a genre in its own right. First-person shooters used to be called Doom clones. - -Like them, we're trying to build a niche. This game is not a clone, and its development will diverge from existing games in the future. Thanks for taking the time to read this notice, we hope you enjoy the game! @@ -251,6 +251,7 @@ Enjoy your stay in the World of Veloren."#, "hud.settings.view_distance": "View Distance", "hud.settings.sprites_view_distance": "Sprites View Distance", + "hud.settings.figures_view_distance": "Entities View Distance", "hud.settings.maximum_fps": "Maximum FPS", "hud.settings.fov": "Field of View (deg)", "hud.settings.gamma": "Gamma", @@ -276,7 +277,7 @@ Enjoy your stay in the World of Veloren."#, "hud.social.faction": "Faction", "hud.social.play_online_fmt": "{nb_player} player(s) online", - "hud.spell": "Spell", + "hud.spell": "Spells", "hud.free_look_indicator": "Free look active", diff --git a/voxygen/examples/character_renderer.rs b/voxygen/examples/character_renderer.rs index a26255d38d..72e26def69 100644 --- a/voxygen/examples/character_renderer.rs +++ b/voxygen/examples/character_renderer.rs @@ -54,6 +54,7 @@ fn main() { body: Some(body.clone()), gamma: 1.0, mouse_smoothing: true, + figure_lod_render_distance: 250.0, }; scene.camera_mut().set_focus_pos(Vec3::unit_z() * 0.8); scene.camera_mut().set_distance(1.5); diff --git a/voxygen/src/hud/buttons.rs b/voxygen/src/hud/buttons.rs index 926436bc68..a2b6921d32 100644 --- a/voxygen/src/hud/buttons.rs +++ b/voxygen/src/hud/buttons.rs @@ -1,57 +1,83 @@ -use super::{img_ids::Imgs, Windows, BLACK, CRITICAL_HP_COLOR, LOW_HP_COLOR, TEXT_COLOR}; -use crate::ui::{fonts::ConrodVoxygenFonts, ToggleButton}; +use super::{ + img_ids::{Imgs, ImgsRot}, + BLACK, CRITICAL_HP_COLOR, LOW_HP_COLOR, TEXT_COLOR, +}; +use crate::{ + i18n::VoxygenLocalization, + ui::{fonts::ConrodVoxygenFonts, ImageFrame, Tooltip, TooltipManager, Tooltipable}, + window::GameInput, + GlobalState, +}; use client::Client; +use common::comp::Stats; use conrod_core::{ - widget::{self, Button, Image, Text}, - widget_ids, Colorable, Labelable, Positionable, Sizeable, Widget, WidgetCommon, + widget::{self, Button, Text}, + widget_ids, Color, Colorable, Positionable, Sizeable, Widget, WidgetCommon, }; widget_ids! { struct Ids { bag, bag_text, - bag_space_bg, + bag_text_bg, bag_space, + bag_space_bg, bag_show_map, map_button, + map_text, + map_text_bg, settings_button, + settings_text, + settings_text_bg, social_button, social_button_bg, + social_text, + social_text_bg, spellbook_button, spellbook_button_bg, + spellbook_text, + spellbook_text_bg, } } - +const TOOLTIP_UPSHIFT: f64 = 40.0; #[derive(WidgetCommon)] pub struct Buttons<'a> { client: &'a Client, - open_windows: &'a Windows, - show_map: bool, show_bag: bool, - imgs: &'a Imgs, fonts: &'a ConrodVoxygenFonts, #[conrod(common_builder)] common: widget::CommonBuilder, + global_state: &'a GlobalState, + rot_imgs: &'a ImgsRot, + tooltip_manager: &'a mut TooltipManager, + localized_strings: &'a std::sync::Arc, + stats: &'a Stats, } impl<'a> Buttons<'a> { pub fn new( client: &'a Client, - open_windows: &'a Windows, - show_map: bool, show_bag: bool, imgs: &'a Imgs, fonts: &'a ConrodVoxygenFonts, + global_state: &'a GlobalState, + rot_imgs: &'a ImgsRot, + tooltip_manager: &'a mut TooltipManager, + localized_strings: &'a std::sync::Arc, + stats: &'a Stats, ) -> Self { Self { client, - open_windows, - show_map, show_bag, imgs, fonts, common: widget::CommonBuilder::default(), + global_state, + rot_imgs, + tooltip_manager, + localized_strings, + stats, } } } @@ -88,33 +114,71 @@ impl<'a> Widget for Buttons<'a> { Some(inv) => inv, None => return None, }; - + let localized_strings = self.localized_strings; + let button_tooltip = Tooltip::new({ + // Edge images [t, b, r, l] + // Corner images [tr, tl, br, bl] + let edge = &self.rot_imgs.tt_side; + let corner = &self.rot_imgs.tt_corner; + ImageFrame::new( + [edge.cw180, edge.none, edge.cw270, edge.cw90], + [corner.none, corner.cw270, corner.cw90, corner.cw180], + Color::Rgba(0.08, 0.07, 0.04, 1.0), + 5.0, + ) + }) + .title_font_size(self.fonts.cyri.scale(15)) + .parent(ui.window) + .desc_font_size(self.fonts.cyri.scale(12)) + .title_text_color(TEXT_COLOR) + .font_id(self.fonts.cyri.conrod_id) + .desc_text_color(TEXT_COLOR); // Bag - if !self.show_map { - if self.show_bag - != ToggleButton::new(self.show_bag, self.imgs.bag, self.imgs.bag_open) - .bottom_right_with_margins_on(ui.window, 5.0, 5.0) - .hover_images(self.imgs.bag_hover, self.imgs.bag_open_hover) - .press_images(self.imgs.bag_press, self.imgs.bag_open_press) - .w_h(420.0 / 10.0, 480.0 / 10.0) - .set(state.ids.bag, ui) - { - return Some(Event::ToggleBag); - } - - Text::new("B") + if Button::image(if !self.show_bag { + self.imgs.bag + } else { + self.imgs.bag_open + }) + .bottom_right_with_margins_on(ui.window, 5.0, 5.0) + .hover_image(if !self.show_bag { + self.imgs.bag_hover + } else { + self.imgs.bag_open_hover + }) + .press_image(if !self.show_bag { + self.imgs.bag_press + } else { + self.imgs.bag_open_press + }) + .w_h(420.0 / 10.0, 480.0 / 10.0) + .with_tooltip( + self.tooltip_manager, + &localized_strings + .get("hud.bag.inventory") + .replace("{playername}", &self.stats.name.to_string().as_str()), + "", + &button_tooltip, + ) + .bottom_offset(55.0) + .set(state.ids.bag, ui) + .was_clicked() + { + return Some(Event::ToggleBag); + }; + if let Some(bag) = &self + .global_state + .settings + .controls + .get_binding(GameInput::Bag) + { + Text::new(bag.to_string().as_str()) .bottom_right_with_margins_on(state.ids.bag, 0.0, 0.0) .font_size(10) .font_id(self.fonts.cyri.conrod_id) - .color(TEXT_COLOR) - .set(state.ids.bag_text, ui); - } else { - Image::new(self.imgs.bag) - .bottom_right_with_margins_on(ui.window, 5.0, 5.0) - .w_h(420.0 / 10.0, 480.0 / 10.0) - .set(state.ids.bag_show_map, ui); - Text::new("B") - .bottom_right_with_margins_on(state.ids.bag, 0.0, 0.0) + .color(BLACK) + .set(state.ids.bag_text_bg, ui); + Text::new(bag.to_string().as_str()) + .bottom_right_with_margins_on(state.ids.bag_text_bg, 1.0, 1.0) .font_size(10) .font_id(self.fonts.cyri.conrod_id) .color(TEXT_COLOR) @@ -144,100 +208,156 @@ impl<'a> Widget for Buttons<'a> { }) .set(state.ids.bag_space, ui); } - - // 0 Settings + // Settings if Button::image(self.imgs.settings) .w_h(29.0, 25.0) .bottom_right_with_margins_on(ui.window, 5.0, 57.0) .hover_image(self.imgs.settings_hover) .press_image(self.imgs.settings_press) - .label("N") - .label_font_id(self.fonts.cyri.conrod_id) - .label_font_size(10) - .label_color(TEXT_COLOR) - .label_y(conrod_core::position::Relative::Scalar(-7.0)) - .label_x(conrod_core::position::Relative::Scalar(10.0)) + .with_tooltip( + self.tooltip_manager, + &localized_strings.get("common.settings"), + "", + &button_tooltip, + ) + .bottom_offset(TOOLTIP_UPSHIFT) .set(state.ids.settings_button, ui) .was_clicked() { return Some(Event::ToggleSettings); }; + if let Some(settings) = &self + .global_state + .settings + .controls + .get_binding(GameInput::Settings) + { + Text::new(settings.to_string().as_str()) + .bottom_right_with_margins_on(state.ids.settings_button, 0.0, 0.0) + .font_size(10) + .font_id(self.fonts.cyri.conrod_id) + .color(BLACK) + .set(state.ids.settings_text_bg, ui); + Text::new(settings.to_string().as_str()) + .bottom_right_with_margins_on(state.ids.settings_text_bg, 1.0, 1.0) + .font_size(10) + .font_id(self.fonts.cyri.conrod_id) + .color(TEXT_COLOR) + .set(state.ids.settings_text, ui); + }; - Image::new(self.imgs.social_button) + // Social + if Button::image(self.imgs.social) .w_h(25.0, 25.0) .left_from(state.ids.settings_button, 10.0) - .set(state.ids.social_button_bg, ui); - - // 2 Map + .hover_image(self.imgs.social_hover) + .press_image(self.imgs.social_press) + .with_tooltip( + self.tooltip_manager, + &localized_strings.get("hud.social"), + "", + &button_tooltip, + ) + .bottom_offset(TOOLTIP_UPSHIFT) + .set(state.ids.social_button, ui) + .was_clicked() + { + return Some(Event::ToggleSocial); + } + if let Some(social) = &self + .global_state + .settings + .controls + .get_binding(GameInput::Social) + { + Text::new(social.to_string().as_str()) + .bottom_right_with_margins_on(state.ids.social_button, 0.0, 0.0) + .font_size(10) + .font_id(self.fonts.cyri.conrod_id) + .color(BLACK) + .set(state.ids.social_text_bg, ui); + Text::new(social.to_string().as_str()) + .bottom_right_with_margins_on(state.ids.social_text_bg, 1.0, 1.0) + .font_size(10) + .font_id(self.fonts.cyri.conrod_id) + .color(TEXT_COLOR) + .set(state.ids.social_text, ui); + }; + // Map if Button::image(self.imgs.map_button) .w_h(22.0, 25.0) - .left_from(state.ids.social_button_bg, 10.0) + .left_from(state.ids.social_button, 10.0) .hover_image(self.imgs.map_hover) .press_image(self.imgs.map_press) - .label("M") - .label_font_id(self.fonts.cyri.conrod_id) - .label_font_size(10) - .label_color(TEXT_COLOR) - .label_y(conrod_core::position::Relative::Scalar(-7.0)) - .label_x(conrod_core::position::Relative::Scalar(10.0)) + .with_tooltip( + self.tooltip_manager, + &localized_strings.get("hud.map.map_title"), + "", + &button_tooltip, + ) + .bottom_offset(TOOLTIP_UPSHIFT) .set(state.ids.map_button, ui) .was_clicked() { return Some(Event::ToggleMap); }; - - // Other Windows can only be accessed when `Settings` is closed. - // Opening `Settings` will close all other Windows, including the `Bag`. - // Opening the `Map` won't close the previously displayed windows. - Image::new(self.imgs.social) - .w_h(25.0, 25.0) - .left_from(state.ids.settings_button, 10.0) - .set(state.ids.social_button_bg, ui); - Image::new(self.imgs.spellbook_button) - .w_h(28.0, 25.0) - .left_from(state.ids.map_button, 10.0) - .set(state.ids.spellbook_button_bg, ui); - // Other Windows can only be accessed when `Settings` is closed. - // Opening `Settings` will close all other Windows, including the `Bag`. - // Opening the `Map` won't close the previously displayed windows. - if !(*self.open_windows == Windows::Settings) && self.show_map == false { - // 1 Social - if Button::image(self.imgs.social) - .w_h(25.0, 25.0) - .left_from(state.ids.settings_button, 10.0) - .hover_image(self.imgs.social_hover) - .press_image(self.imgs.social_press) - .label("O") - .label_font_id(self.fonts.cyri.conrod_id) - .label_font_size(10) - .label_color(TEXT_COLOR) - .label_y(conrod_core::position::Relative::Scalar(-7.0)) - .label_x(conrod_core::position::Relative::Scalar(10.0)) - .set(state.ids.social_button, ui) - .was_clicked() - { - return Some(Event::ToggleSocial); - } - - // 3 Spellbook - if Button::image(self.imgs.spellbook_button) - .w_h(28.0, 25.0) - .left_from(state.ids.map_button, 10.0) - .hover_image(self.imgs.spellbook_hover) - .press_image(self.imgs.spellbook_press) - .label("P") - .label_font_id(self.fonts.cyri.conrod_id) - .label_font_size(10) - .label_color(TEXT_COLOR) - .label_y(conrod_core::position::Relative::Scalar(-7.0)) - .label_x(conrod_core::position::Relative::Scalar(10.0)) - .set(state.ids.spellbook_button, ui) - .was_clicked() - { - return Some(Event::ToggleSpell); - } + if let Some(map) = &self + .global_state + .settings + .controls + .get_binding(GameInput::Map) + { + Text::new(map.to_string().as_str()) + .bottom_right_with_margins_on(state.ids.map_button, 0.0, 0.0) + .font_size(10) + .font_id(self.fonts.cyri.conrod_id) + .color(BLACK) + .set(state.ids.map_text_bg, ui); + Text::new(map.to_string().as_str()) + .bottom_right_with_margins_on(state.ids.map_text_bg, 1.0, 1.0) + .font_size(10) + .font_id(self.fonts.cyri.conrod_id) + .color(TEXT_COLOR) + .set(state.ids.map_text, ui); } + // Spellbook + if Button::image(self.imgs.spellbook_button) + .w_h(28.0, 25.0) + .left_from(state.ids.map_button, 10.0) + .hover_image(self.imgs.spellbook_hover) + .press_image(self.imgs.spellbook_press) + .with_tooltip( + self.tooltip_manager, + &localized_strings.get("hud.spell"), + "", + &button_tooltip, + ) + .bottom_offset(TOOLTIP_UPSHIFT) + .set(state.ids.spellbook_button, ui) + .was_clicked() + { + return Some(Event::ToggleSpell); + } + if let Some(spell) = &self + .global_state + .settings + .controls + .get_binding(GameInput::Spellbook) + { + Text::new(spell.to_string().as_str()) + .bottom_right_with_margins_on(state.ids.spellbook_button, 0.0, 0.0) + .font_size(10) + .font_id(self.fonts.cyri.conrod_id) + .color(BLACK) + .set(state.ids.spellbook_text_bg, ui); + Text::new(spell.to_string().as_str()) + .bottom_right_with_margins_on(state.ids.spellbook_text_bg, 1.0, 1.0) + .font_size(10) + .font_id(self.fonts.cyri.conrod_id) + .color(TEXT_COLOR) + .set(state.ids.spellbook_text, ui); + } None } } diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index 867202305e..11f8fcc76b 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -65,12 +65,6 @@ image_ids! { flower: "voxygen.element.icons.item_flower", grass: "voxygen.element.icons.item_grass", - // Minimap - - // Map - indicator_mmap_2: "voxygen.element.buttons.indicator_mmap_2", - indicator_mmap_3: "voxygen.element.buttons.indicator_mmap_3", - // Checkboxes and Radio buttons check: "voxygen.element.buttons.radio.inactive", check_mo: "voxygen.element.buttons.radio.inactive_hover", @@ -83,26 +77,6 @@ image_ids! { checkbox_checked: "voxygen.element.buttons.checkbox.active", checkbox_checked_mo: "voxygen.element.buttons.checkbox.hover", - // Grid - grid: "voxygen.element.buttons.grid", - grid_hover: "voxygen.element.buttons.grid", - grid_press: "voxygen.element.buttons.grid", - - settings: "voxygen.element.buttons.settings", - settings_hover: "voxygen.element.buttons.settings_hover", - settings_press: "voxygen.element.buttons.settings_press", - - social: "voxygen.element.buttons.social", - social_hover: "voxygen.element.buttons.social_hover", - social_press: "voxygen.element.buttons.social_press", - - map_button: "voxygen.element.buttons.map", - map_hover: "voxygen.element.buttons.map_hover", - map_press: "voxygen.element.buttons.map_press", - - spellbook_button: "voxygen.element.buttons.spellbook", - spellbook_hover: "voxygen.element.buttons.spellbook_hover", - spellbook_press: "voxygen.element.buttons.spellbook_press", // Charwindow xp_charwindow: "voxygen.element.frames.xp_charwindow", @@ -120,6 +94,23 @@ image_ids! { ////////////////////////////////////////////////////////////////////////////////////////////////////// + // Buttons + + settings: "voxygen.element.buttons.settings", + settings_hover: "voxygen.element.buttons.settings_hover", + settings_press: "voxygen.element.buttons.settings_press", + + social: "voxygen.element.buttons.social", + social_hover: "voxygen.element.buttons.social_hover", + social_press: "voxygen.element.buttons.social_press", + + map_button: "voxygen.element.buttons.map", + map_hover: "voxygen.element.buttons.map_hover", + map_press: "voxygen.element.buttons.map_press", + + spellbook_button: "voxygen.element.buttons.spellbook", + spellbook_hover: "voxygen.element.buttons.spellbook_hover", + spellbook_press: "voxygen.element.buttons.spellbook_press", // Skillbar level_up: "voxygen.element.misc_bg.level_up", diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 8f59fef80f..4b8f951c89 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -211,6 +211,7 @@ pub enum Event { ToggleSmoothPan(bool), AdjustViewDistance(u32), AdjustSpriteRenderDistance(u32), + AdjustFigureLoDRenderDistance(u32), AdjustMusicVolume(f32), AdjustSfxVolume(f32), ChangeAudioDevice(String), @@ -1580,24 +1581,6 @@ impl Hud { .middle_of(ui_widgets.window) .w_h(1260.0, 519.0) .set(self.ids.help, ui_widgets); - // Show tips - /*if Button::image(self.imgs.button) - .w_h(120.0, 50.0) - .hover_image(self.imgs.button_hover) - .press_image(self.imgs.button_press) - .label(&self.voxygen_i18n.get("common.close")) - .label_font_size(self.fonts.cyri.scale(20)) - .label_font_id(self.fonts.cyri.conrod_id) - .label_color(TEXT_COLOR) - .mid_bottom_with_margin_on(self.ids.help, 20.0) - .set(self.ids.button_help3, ui_widgets) - .was_clicked() - { - self.show.help = false; - self.show.intro = false; - self.intro = false; - self.intro_2 = true; - };*/ // X-button if Button::image(self.imgs.close_button) .w_h(40.0, 40.0) @@ -1613,13 +1596,22 @@ impl Hud { } // Bag button and nearby icons + let ecs = client.state().ecs(); + let stats = ecs.read_storage::(); + let player_stats = match stats.get(client.entity()) { + Some(stats) => stats, + None => return events, + }; match Buttons::new( client, - &self.show.open_windows, - self.show.map, self.show.bag, &self.imgs, &self.fonts, + global_state, + &self.rot_imgs, + tooltip_manager, + &self.voxygen_i18n, + &player_stats, ) .set(self.ids.buttons, ui_widgets) { @@ -1650,7 +1642,10 @@ impl Hud { if self.show.bag { let ecs = client.state().ecs(); let stats = ecs.read_storage::(); - let player_stats = stats.get(client.entity()).unwrap(); + let player_stats = match stats.get(client.entity()) { + Some(stats) => stats, + None => return events, + }; match Bag::new( client, &self.imgs, @@ -1805,6 +1800,9 @@ impl Hud { settings_window::Event::AdjustSpriteRenderDistance(view_distance) => { events.push(Event::AdjustSpriteRenderDistance(view_distance)); }, + settings_window::Event::AdjustFigureLoDRenderDistance(view_distance) => { + events.push(Event::AdjustFigureLoDRenderDistance(view_distance)); + }, settings_window::Event::CrosshairTransp(crosshair_transp) => { events.push(Event::CrosshairTransp(crosshair_transp)); }, diff --git a/voxygen/src/hud/settings_window.rs b/voxygen/src/hud/settings_window.rs index d37a053b7f..803cbd794d 100644 --- a/voxygen/src/hud/settings_window.rs +++ b/voxygen/src/hud/settings_window.rs @@ -92,6 +92,9 @@ widget_ids! { sprite_dist_slider, sprite_dist_text, sprite_dist_value, + figure_dist_slider, + figure_dist_text, + figure_dist_value, max_fps_slider, max_fps_text, max_fps_value, @@ -213,6 +216,7 @@ pub enum Event { ToggleSmoothPan(bool), AdjustViewDistance(u32), AdjustSpriteRenderDistance(u32), + AdjustFigureLoDRenderDistance(u32), AdjustFOV(u16), AdjustGamma(f32), AdjustWindowSize([u16; 2]), @@ -1246,7 +1250,7 @@ impl<'a> Widget for SettingsWindow<'a> { self.imgs.checkbox_checked, ) .w_h(18.0, 18.0) - .right_from(state.ids.mouse_zoom_invert_button, 175.0) + .right_from(state.ids.mouse_zoom_invert_label, 10.0) .hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo) .press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked) .set(state.ids.mouse_y_invert_button, ui); @@ -1276,7 +1280,7 @@ impl<'a> Widget for SettingsWindow<'a> { self.imgs.checkbox_checked, ) .w_h(18.0, 18.0) - .right_from(state.ids.mouse_y_invert_button, 175.0) + .right_from(state.ids.mouse_y_invert_label, 10.0) .hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo) .press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked) .set(state.ids.smooth_pan_toggle_button, ui); @@ -1653,6 +1657,50 @@ impl<'a> Widget for SettingsWindow<'a> { .font_id(self.fonts.cyri.conrod_id) .color(TEXT_COLOR) .set(state.ids.sprite_dist_value, ui); + // Figure VD + if let Some(new_val) = ImageSlider::discrete( + self.global_state + .settings + .graphics + .figure_lod_render_distance, + 50, + 500, + self.imgs.slider_indicator, + self.imgs.slider, + ) + .w_h(104.0, 22.0) + .right_from(state.ids.sprite_dist_slider, 50.0) + .track_breadth(12.0) + .slider_length(10.0) + .pad_track((5.0, 5.0)) + .set(state.ids.figure_dist_slider, ui) + { + events.push(Event::AdjustFigureLoDRenderDistance(new_val)); + } + Text::new( + &self + .localized_strings + .get("hud.settings.figures_view_distance"), + ) + .up_from(state.ids.figure_dist_slider, 8.0) + .font_size(self.fonts.cyri.scale(14)) + .font_id(self.fonts.cyri.conrod_id) + .color(TEXT_COLOR) + .set(state.ids.figure_dist_text, ui); + + Text::new(&format!( + "{}", + self.global_state + .settings + .graphics + .figure_lod_render_distance + )) + .right_from(state.ids.figure_dist_slider, 8.0) + .font_size(self.fonts.cyri.scale(14)) + .font_id(self.fonts.cyri.conrod_id) + .color(TEXT_COLOR) + .set(state.ids.figure_dist_value, ui); + // AaMode Text::new(&self.localized_strings.get("hud.settings.antialiasing_mode")) .down_from(state.ids.gamma_slider, 8.0) diff --git a/voxygen/src/hud/skillbar.rs b/voxygen/src/hud/skillbar.rs index c3a9ee7386..df9667409b 100644 --- a/voxygen/src/hud/skillbar.rs +++ b/voxygen/src/hud/skillbar.rs @@ -790,7 +790,11 @@ impl<'a> Widget for Skillbar<'a> { .1 .get(i) .map(|item| (item.name(), item.description())), - hotbar::SlotContents::Ability3 => Some(("Something something fireball", "")), + hotbar::SlotContents::Ability3 => Some(( + "Firebomb", + "\nWhirls a big fireball into the air. \nExplodes the ground and does\na \ + big amount of damage", + )), }) }; const SLOT_TOOLTIP_UPSHIFT: f64 = 70.0; diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index c05eca5ad3..558f5ff527 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -107,6 +107,11 @@ impl PlayState for CharSelectionState { body: humanoid_body.clone(), gamma: global_state.settings.graphics.gamma, mouse_smoothing: global_state.settings.gameplay.smooth_pan_enable, + figure_lod_render_distance: global_state + .settings + .graphics + .figure_lod_render_distance + as f32, }; self.scene .maintain(global_state.window.renderer_mut(), scene_data); diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index 10a9bc2117..69554960ed 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -83,7 +83,6 @@ image_ids! { v_logo: "voxygen.element.v_logo", - disclaimer: "voxygen.element.frames.disclaimer", info_frame: "voxygen.element.frames.info_frame_2", banner: "voxygen.element.frames.banner", @@ -98,6 +97,7 @@ image_ids! { input_bg_top: "voxygen.element.misc_bg.textbox_top", input_bg_mid: "voxygen.element.misc_bg.textbox_mid", input_bg_bot: "voxygen.element.misc_bg.textbox_bot", + disclaimer: "voxygen.element.frames.disclaimer", diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 5bee0eb0bb..16d46855de 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -1401,6 +1401,7 @@ impl FigureMgr { lights: &Consts, shadows: &Consts, camera: &Camera, + figure_lod_render_distance: f32, ) { let ecs = state.ecs(); @@ -1436,6 +1437,7 @@ impl FigureMgr { loadout, false, pos.0, + figure_lod_render_distance, ); } } @@ -1451,6 +1453,7 @@ impl FigureMgr { lights: &Consts, shadows: &Consts, camera: &Camera, + figure_lod_render_distance: f32, ) { let ecs = state.ecs(); @@ -1484,6 +1487,7 @@ impl FigureMgr { loadout, true, pos.0, + figure_lod_render_distance, ); } } @@ -1502,6 +1506,7 @@ impl FigureMgr { loadout: Option<&Loadout>, is_player: bool, pos: Vec3, + figure_lod_render_distance: f32, ) { let player_camera_mode = if is_player { camera.get_mode() @@ -1714,14 +1719,16 @@ impl FigureMgr { ) }), } { - const FIGURE_LOW_LOD_DIST: f32 = 150.0; - const FIGURE_MID_LOD_DIST: f32 = 85.0; + let figure_low_detail_distance = figure_lod_render_distance * 0.75; + let figure_mid_detail_distance = figure_lod_render_distance * 0.5; let model = if pos.distance_squared(camera.get_focus_pos()) - > FIGURE_LOW_LOD_DIST.powf(2.0) + > figure_low_detail_distance.powf(2.0) { &model[2] - } else if pos.distance_squared(camera.get_focus_pos()) > FIGURE_MID_LOD_DIST.powf(2.0) { + } else if pos.distance_squared(camera.get_focus_pos()) + > figure_mid_detail_distance.powf(2.0) + { &model[1] } else { &model[0] diff --git a/voxygen/src/scene/mod.rs b/voxygen/src/scene/mod.rs index 44c55e2617..8641f2127e 100644 --- a/voxygen/src/scene/mod.rs +++ b/voxygen/src/scene/mod.rs @@ -77,6 +77,7 @@ pub struct SceneData<'a> { pub gamma: f32, pub mouse_smoothing: bool, pub sprite_render_distance: f32, + pub figure_lod_render_distance: f32, } impl Scene { @@ -406,6 +407,7 @@ impl Scene { &self.lights, &self.shadows, &self.camera, + scene_data.figure_lod_render_distance, ); // Render the skybox. @@ -420,6 +422,7 @@ impl Scene { &self.lights, &self.shadows, &self.camera, + scene_data.figure_lod_render_distance, ); self.terrain.render_translucent( diff --git a/voxygen/src/scene/simple.rs b/voxygen/src/scene/simple.rs index 2f53408569..d400d69c53 100644 --- a/voxygen/src/scene/simple.rs +++ b/voxygen/src/scene/simple.rs @@ -79,6 +79,7 @@ pub struct SceneData { pub tick: u64, pub body: Option, pub gamma: f32, + pub figure_lod_render_distance: f32, pub mouse_smoothing: bool, } diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index c0e725a43e..eb04196759 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -573,6 +573,11 @@ impl PlayState for SessionState { sprite_render_distance; global_state.settings.save_to_file_warn(); }, + HudEvent::AdjustFigureLoDRenderDistance(figure_lod_render_distance) => { + global_state.settings.graphics.figure_lod_render_distance = + figure_lod_render_distance; + global_state.settings.save_to_file_warn(); + }, HudEvent::CrosshairTransp(crosshair_transp) => { global_state.settings.gameplay.crosshair_transp = crosshair_transp; global_state.settings.save_to_file_warn(); @@ -717,6 +722,11 @@ impl PlayState for SessionState { mouse_smoothing: global_state.settings.gameplay.smooth_pan_enable, sprite_render_distance: global_state.settings.graphics.sprite_render_distance as f32, + figure_lod_render_distance: global_state + .settings + .graphics + .figure_lod_render_distance + as f32, }; // Runs if either in a multiplayer server or the singleplayer server is unpaused diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 3c4f44c19a..cd55b2e556 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -549,6 +549,7 @@ impl Default for Log { pub struct GraphicsSettings { pub view_distance: u32, pub sprite_render_distance: u32, + pub figure_lod_render_distance: u32, pub max_fps: u32, pub fov: u16, pub gamma: f32, @@ -564,6 +565,7 @@ impl Default for GraphicsSettings { Self { view_distance: 10, sprite_render_distance: 250, + figure_lod_render_distance: 250, max_fps: 60, fov: 50, gamma: 1.0, diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 45ef3bc0e3..c43ab6a05f 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -323,10 +323,10 @@ impl fmt::Display for KeyMouse { Key(NavigateBackward) => "Navigate Backward", Key(NextTrack) => "Next Track", Key(NoConvert) => "Non Convert", - Key(NumpadComma) => "Numpad ,", - Key(NumpadEnter) => "Numpad Enter", - Key(NumpadEquals) => "Numpad =", - Key(OEM102) => "OEM 102", + Key(NumpadComma) => "Num ,", + Key(NumpadEnter) => "Num Enter", + Key(NumpadEquals) => "Num =", + Key(OEM102) => "<", Key(Period) => ".", Key(PlayPause) => "Play / Pause", Key(Power) => "Power", @@ -340,7 +340,7 @@ impl fmt::Display for KeyMouse { Key(Slash) => "/", Key(Sleep) => "Sleep", Key(Stop) => "Media Stop", - Key(Subtract) => "Numpad -", + Key(Subtract) => "Num -", Key(Sysrq) => "Sysrq", Key(Tab) => "Tab", Key(Underline) => "_", @@ -361,7 +361,7 @@ impl fmt::Display for KeyMouse { Key(Cut) => "Cut", Mouse(MouseButton::Left) => "Mouse Left", Mouse(MouseButton::Right) => "Mouse Right", - Mouse(MouseButton::Middle) => "Mouse Middle-Click", + Mouse(MouseButton::Middle) => "Middle-Click", Mouse(MouseButton::Other(button)) => return write!(f, "Unknown Mouse Button: {:?}", button), }) From eb23b0b2bd1c385eb94aa01a251ccd47610210f0 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 26 Apr 2020 15:37:13 +0100 Subject: [PATCH 03/10] Added Colliders, made projectiles point particles --- common/src/comp/mod.rs | 2 +- common/src/comp/phys.rs | 16 ++ common/src/msg/ecs_packet.rs | 5 + common/src/state.rs | 1 + common/src/sys/phys.rs | 470 +++++++++++++++++++---------------- server/src/state_ext.rs | 21 ++ server/src/sys/sentinel.rs | 12 +- 7 files changed, 311 insertions(+), 216 deletions(-) diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 7bc82719d9..ca209676f7 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -35,7 +35,7 @@ pub use inventory::{ }; pub use last::Last; pub use location::{Waypoint, WaypointArea}; -pub use phys::{ForceUpdate, Gravity, Mass, Ori, PhysicsState, Pos, Scale, Sticky, Vel}; +pub use phys::{ForceUpdate, Gravity, Mass, Collider, Ori, PhysicsState, Pos, Scale, Sticky, Vel}; pub use player::Player; pub use projectile::Projectile; pub use stats::{Exp, HealthChange, HealthSource, Level, Stats}; diff --git a/common/src/comp/phys.rs b/common/src/comp/phys.rs index 202eed9cf9..8cbf17a53c 100644 --- a/common/src/comp/phys.rs +++ b/common/src/comp/phys.rs @@ -43,6 +43,21 @@ impl Component for Mass { type Storage = FlaggedStorage>; } +// Mass +#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] +pub enum Collider { + Box { + radius: f32, + z_min: f32, + z_max: f32, + }, + Point, +} + +impl Component for Collider { + type Storage = FlaggedStorage>; +} + #[derive(Copy, Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Gravity(pub f32); @@ -61,6 +76,7 @@ impl Component for Sticky { #[derive(Copy, Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PhysicsState { pub on_ground: bool, + pub on_ceiling: bool, pub on_wall: Option>, pub touch_entity: Option, pub in_fluid: bool, diff --git a/common/src/msg/ecs_packet.rs b/common/src/msg/ecs_packet.rs index 7c6c29aa38..2e7ad564c5 100644 --- a/common/src/msg/ecs_packet.rs +++ b/common/src/msg/ecs_packet.rs @@ -19,6 +19,7 @@ sum_type! { MountState(comp::MountState), Mounting(comp::Mounting), Mass(comp::Mass), + Collider(comp::Collider), Gravity(comp::Gravity), Sticky(comp::Sticky), Loadout(comp::Loadout), @@ -44,6 +45,7 @@ sum_type! { MountState(PhantomData), Mounting(PhantomData), Mass(PhantomData), + Collider(PhantomData), Gravity(PhantomData), Sticky(PhantomData), Loadout(PhantomData), @@ -69,6 +71,7 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::MountState(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Mounting(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Mass(comp) => sync::handle_insert(comp, entity, world), + EcsCompPacket::Collider(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Gravity(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Sticky(comp) => sync::handle_insert(comp, entity, world), EcsCompPacket::Loadout(comp) => sync::handle_insert(comp, entity, world), @@ -92,6 +95,7 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPacket::MountState(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Mounting(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Mass(comp) => sync::handle_modify(comp, entity, world), + EcsCompPacket::Collider(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Gravity(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Sticky(comp) => sync::handle_modify(comp, entity, world), EcsCompPacket::Loadout(comp) => sync::handle_modify(comp, entity, world), @@ -117,6 +121,7 @@ impl sync::CompPacket for EcsCompPacket { EcsCompPhantom::MountState(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Mounting(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Mass(_) => sync::handle_remove::(entity, world), + EcsCompPhantom::Collider(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Gravity(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Sticky(_) => sync::handle_remove::(entity, world), EcsCompPhantom::Loadout(_) => sync::handle_remove::(entity, world), diff --git a/common/src/state.rs b/common/src/state.rs index 62f492e513..5812399cd7 100644 --- a/common/src/state.rs +++ b/common/src/state.rs @@ -118,6 +118,7 @@ impl State { ecs.register::(); ecs.register::(); ecs.register::(); + ecs.register::(); ecs.register::(); ecs.register::(); ecs.register::(); diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index 45cf64efdc..5421585430 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -1,5 +1,5 @@ use crate::{ - comp::{Body, Gravity, Mass, Mounting, Ori, PhysicsState, Pos, Scale, Sticky, Vel}, + comp::{Gravity, Mass, Collider, Mounting, Ori, PhysicsState, Pos, Scale, Sticky, Vel}, event::{EventBus, ServerEvent}, state::DeltaTime, sync::Uid, @@ -47,8 +47,8 @@ impl<'a> System<'a> for Sys { ReadStorage<'a, Scale>, ReadStorage<'a, Sticky>, ReadStorage<'a, Mass>, + ReadStorage<'a, Collider>, ReadStorage<'a, Gravity>, - ReadStorage<'a, Body>, WriteStorage<'a, PhysicsState>, WriteStorage<'a, Pos>, WriteStorage<'a, Vel>, @@ -67,8 +67,8 @@ impl<'a> System<'a> for Sys { scales, stickies, masses, + colliders, gravities, - bodies, mut physics_states, mut positions, mut velocities, @@ -79,11 +79,11 @@ impl<'a> System<'a> for Sys { let mut event_emitter = event_bus.emitter(); // Apply movement inputs - for (entity, scale, sticky, _b, mut pos, mut vel, _ori, _) in ( + for (entity, scale, sticky, collider, mut pos, mut vel, _ori, _) in ( &entities, scales.maybe(), stickies.maybe(), - &bodies, + &colliders, &mut positions, &mut velocities, &mut orientations, @@ -93,30 +93,12 @@ impl<'a> System<'a> for Sys { { let mut physics_state = physics_states.get(entity).cloned().unwrap_or_default(); - if sticky.is_some() && (physics_state.on_wall.is_some() || physics_state.on_ground) { + if sticky.is_some() && (physics_state.on_ground || physics_state.on_wall.is_some()) { continue; } let scale = scale.map(|s| s.0).unwrap_or(1.0); - // Basic collision with terrain - // TODO: rename this, not just the player entity - let player_rad = 0.3 * scale; // half-width of the player's AABB - let player_height = 1.5 * scale; - - // Probe distances - let hdist = player_rad.ceil() as i32; - let vdist = player_height.ceil() as i32; - // Neighbouring blocks iterator - let near_iter = (-hdist..hdist + 1) - .map(move |i| { - (-hdist..hdist + 1).map(move |j| { - (1 - BlockKind::MAX_HEIGHT.ceil() as i32..vdist + 1).map(move |k| (i, j, k)) - }) - }) - .flatten() - .flatten(); - let old_vel = *vel; // Integrate forces // Friction is assumed to be a constant dependent on location @@ -150,216 +132,276 @@ impl<'a> System<'a> for Sys { Vec3::zero() }; - // Function for determining whether the player at a specific position collides - // with the ground - let collision_with = |pos: Vec3, hit: &dyn Fn(&Block) -> bool, near_iter| { - for (i, j, k) in near_iter { - let block_pos = pos.map(|e| e.floor() as i32) + Vec3::new(i, j, k); + match collider { + Collider::Box { radius, z_min, z_max } => { + // Scale collider + let radius = *radius * scale; + let z_min = *z_min * scale; + let z_max = *z_max * scale; - if let Some(block) = terrain.get(block_pos).ok().copied().filter(hit) { - let player_aabb = Aabb { - min: pos + Vec3::new(-player_rad, -player_rad, 0.0), - max: pos + Vec3::new(player_rad, player_rad, player_height), - }; - let block_aabb = Aabb { - min: block_pos.map(|e| e as f32), - max: block_pos.map(|e| e as f32) - + Vec3::new(1.0, 1.0, block.get_height()), - }; + // Probe distances + let hdist = radius.ceil() as i32; + // Neighbouring blocks iterator + let near_iter = (-hdist..hdist + 1) + .map(move |i| { + (-hdist..hdist + 1).map(move |j| { + (1 - BlockKind::MAX_HEIGHT.ceil() as i32 + z_min.floor() as i32..z_max.ceil() as i32 + 1).map(move |k| (i, j, k)) + }) + }) + .flatten() + .flatten(); - if player_aabb.collides_with_aabb(block_aabb) { - return true; + // Function for determining whether the player at a specific position collides + // with the ground + let collision_with = |pos: Vec3, hit: &dyn Fn(&Block) -> bool, near_iter| { + for (i, j, k) in near_iter { + let block_pos = pos.map(|e| e.floor() as i32) + Vec3::new(i, j, k); + + if let Some(block) = terrain.get(block_pos).ok().copied().filter(hit) { + let player_aabb = Aabb { + min: pos + Vec3::new(-radius, -radius, z_min), + max: pos + Vec3::new(radius, radius, z_max), + }; + let block_aabb = Aabb { + min: block_pos.map(|e| e as f32), + max: block_pos.map(|e| e as f32) + + Vec3::new(1.0, 1.0, block.get_height()), + }; + + if player_aabb.collides_with_aabb(block_aabb) { + return true; + } + } } - } - } - false - }; - - let was_on_ground = physics_state.on_ground; - physics_state.on_ground = false; - - let mut on_ground = false; - let mut attempts = 0; // Don't loop infinitely here - - // Don't jump too far at once - let increments = (pos_delta.map(|e| e.abs()).reduce_partial_max() / 0.3) - .ceil() - .max(1.0); - let old_pos = pos.0; - for _ in 0..increments as usize { - pos.0 += pos_delta / increments; - - const MAX_ATTEMPTS: usize = 16; - - // While the player is colliding with the terrain... - while collision_with(pos.0, &|block| block.is_solid(), near_iter.clone()) - && attempts < MAX_ATTEMPTS - { - // Calculate the player's AABB - let player_aabb = Aabb { - min: pos.0 + Vec3::new(-player_rad, -player_rad, 0.0), - max: pos.0 + Vec3::new(player_rad, player_rad, player_height), + false }; - // Determine the block that we are colliding with most (based on minimum - // collision axis) - let (_block_pos, block_aabb, block_height) = near_iter - .clone() - // Calculate the block's position in world space - .map(|(i, j, k)| pos.0.map(|e| e.floor() as i32) + Vec3::new(i, j, k)) - // Make sure the block is actually solid - .filter_map(|block_pos| { - if let Some(block) = terrain - .get(block_pos) - .ok() - .filter(|block| block.is_solid()) - { - // Calculate block AABB - Some(( - block_pos, - Aabb { - min: block_pos.map(|e| e as f32), - max: block_pos.map(|e| e as f32) + Vec3::new(1.0, 1.0, block.get_height()), - }, - block.get_height(), - )) - } else { - None + let was_on_ground = physics_state.on_ground; + physics_state.on_ground = false; + + let mut on_ground = false; + let mut on_ceiling = false; + let mut attempts = 0; // Don't loop infinitely here + + // Don't jump too far at once + let increments = (pos_delta.map(|e| e.abs()).reduce_partial_max() / 0.3) + .ceil() + .max(1.0); + let old_pos = pos.0; + for _ in 0..increments as usize { + pos.0 += pos_delta / increments; + + const MAX_ATTEMPTS: usize = 16; + + // While the player is colliding with the terrain... + while collision_with(pos.0, &|block| block.is_solid(), near_iter.clone()) + && attempts < MAX_ATTEMPTS + { + // Calculate the player's AABB + let player_aabb = Aabb { + min: pos.0 + Vec3::new(-radius, -radius, z_min), + max: pos.0 + Vec3::new(radius, radius, z_max), + }; + + // Determine the block that we are colliding with most (based on minimum + // collision axis) + let (_block_pos, block_aabb, block_height) = near_iter + .clone() + // Calculate the block's position in world space + .map(|(i, j, k)| pos.0.map(|e| e.floor() as i32) + Vec3::new(i, j, k)) + // Make sure the block is actually solid + .filter_map(|block_pos| { + if let Some(block) = terrain + .get(block_pos) + .ok() + .filter(|block| block.is_solid()) + { + // Calculate block AABB + Some(( + block_pos, + Aabb { + min: block_pos.map(|e| e as f32), + max: block_pos.map(|e| e as f32) + Vec3::new(1.0, 1.0, block.get_height()), + }, + block.get_height(), + )) + } else { + None + } + }) + // Determine whether the block's AABB collides with the player's AABB + .filter(|(_, block_aabb, _)| block_aabb.collides_with_aabb(player_aabb)) + // Find the maximum of the minimum collision axes (this bit is weird, trust me that it works) + .min_by_key(|(_, block_aabb, _)| { + ((block_aabb.center() - player_aabb.center() - Vec3::unit_z() * 0.5) + .map(|e| e.abs()) + .sum() + * 1_000_000.0) as i32 + }) + .expect("Collision detected, but no colliding blocks found!"); + + // Find the intrusion vector of the collision + let dir = player_aabb.collision_vector_with_aabb(block_aabb); + + // Determine an appropriate resolution vector (i.e: the minimum distance needed + // to push out of the block) + let max_axis = dir.map(|e| e.abs()).reduce_partial_min(); + let resolve_dir = -dir.map(|e| { + if e.abs().to_bits() == max_axis.to_bits() { + e + } else { + 0.0 + } + }); + + // When the resolution direction is pointing upwards, we must be on the ground + if resolve_dir.z > 0.0 && vel.0.z <= 0.0 { + on_ground = true; + + if !was_on_ground { + event_emitter.emit(ServerEvent::LandOnGround { entity, vel: vel.0 }); + } + } else if resolve_dir.z < 0.0 && vel.0.z >= 0.0 { + on_ceiling = true; } - }) - // Determine whether the block's AABB collides with the player's AABB - .filter(|(_, block_aabb, _)| block_aabb.collides_with_aabb(player_aabb)) - // Find the maximum of the minimum collision axes (this bit is weird, trust me that it works) - .min_by_key(|(_, block_aabb, _)| { - ((block_aabb.center() - player_aabb.center() - Vec3::unit_z() * 0.5) - .map(|e| e.abs()) - .sum() - * 1_000_000.0) as i32 - }) - .expect("Collision detected, but no colliding blocks found!"); - // Find the intrusion vector of the collision - let dir = player_aabb.collision_vector_with_aabb(block_aabb); + // When the resolution direction is non-vertical, we must be colliding with a + // wall If the space above is free... + if !collision_with(Vec3::new(pos.0.x, pos.0.y, (pos.0.z + 0.1).ceil()), &|block| block.is_solid(), near_iter.clone()) + // ...and we're being pushed out horizontally... + && resolve_dir.z == 0.0 + // ...and the vertical resolution direction is sufficiently great... + && -dir.z > 0.1 + // ...and we're falling/standing OR there is a block *directly* beneath our current origin (note: not hitbox)... + && (vel.0.z <= 0.0 || terrain + .get((pos.0 - Vec3::unit_z() * 0.1).map(|e| e.floor() as i32)) + .map(|block| block.is_solid()) + .unwrap_or(false)) + // ...and there is a collision with a block beneath our current hitbox... + && collision_with( + old_pos + resolve_dir - Vec3::unit_z() * 1.05, + &|block| block.is_solid(), + near_iter.clone(), + ) + { + // ...block-hop! + pos.0.z = (pos.0.z + 0.1).floor() + block_height; + vel.0.z = 0.0; + on_ground = true; + break; + } else { + // Correct the velocity + vel.0 = vel.0.map2( + resolve_dir, + |e, d| if d * e.signum() < 0.0 { 0.0 } else { e }, + ); + } - // Determine an appropriate resolution vector (i.e: the minimum distance needed - // to push out of the block) - let max_axis = dir.map(|e| e.abs()).reduce_partial_min(); - let resolve_dir = -dir.map(|e| { - if e.abs().to_bits() == max_axis.to_bits() { - e - } else { - 0.0 + // Resolve the collision normally + pos.0 += resolve_dir; + + attempts += 1; } - }); - // When the resolution direction is pointing upwards, we must be on the ground - if resolve_dir.z > 0.0 && vel.0.z <= 0.0 { - on_ground = true; - - if !was_on_ground { - event_emitter.emit(ServerEvent::LandOnGround { entity, vel: vel.0 }); + if attempts == MAX_ATTEMPTS { + pos.0 = old_pos; + break; } } - // When the resolution direction is non-vertical, we must be colliding with a - // wall If the space above is free... - if !collision_with(Vec3::new(pos.0.x, pos.0.y, (pos.0.z + 0.1).ceil()), &|block| block.is_solid(), near_iter.clone()) - // ...and we're being pushed out horizontally... - && resolve_dir.z == 0.0 - // ...and the vertical resolution direction is sufficiently great... - && -dir.z > 0.1 - // ...and we're falling/standing OR there is a block *directly* beneath our current origin (note: not hitbox)... - && (vel.0.z <= 0.0 || terrain - .get((pos.0 - Vec3::unit_z() * 0.1).map(|e| e.floor() as i32)) - .map(|block| block.is_solid()) - .unwrap_or(false)) - // ...and there is a collision with a block beneath our current hitbox... - && collision_with( - old_pos + resolve_dir - Vec3::unit_z() * 1.05, - &|block| block.is_solid(), + if on_ceiling { + physics_state.on_ceiling = true; + } + + if on_ground { + physics_state.on_ground = true; + // If the space below us is free, then "snap" to the ground + } else if collision_with( + pos.0 - Vec3::unit_z() * 1.05, + &|block| block.is_solid(), + near_iter.clone(), + ) && vel.0.z < 0.0 + && vel.0.z > -1.5 + && was_on_ground + && !collision_with( + pos.0 - Vec3::unit_z() * 0.05, + &|block| { + block.is_solid() && block.get_height() >= (pos.0.z - 0.05).rem_euclid(1.0) + }, near_iter.clone(), ) { - // ...block-hop! - pos.0.z = (pos.0.z + 0.1).floor() + block_height; - vel.0.z = 0.0; - on_ground = true; - break; - } else { - // Correct the velocity - vel.0 = vel.0.map2( - resolve_dir, - |e, d| if d * e.signum() < 0.0 { 0.0 } else { e }, - ); + let snap_height = terrain + .get(Vec3::new(pos.0.x, pos.0.y, pos.0.z - 0.05).map(|e| e.floor() as i32)) + .ok() + .filter(|block| block.is_solid()) + .map(|block| block.get_height()) + .unwrap_or(0.0); + pos.0.z = (pos.0.z - 0.05).floor() + snap_height; + physics_state.on_ground = true; } - // Resolve the collision normally - pos.0 += resolve_dir; + let dirs = [ + Vec3::unit_x(), + Vec3::unit_y(), + -Vec3::unit_x(), + -Vec3::unit_y(), + ]; - attempts += 1; - } + if let (wall_dir, true) = dirs.iter().fold((Vec3::zero(), false), |(a, hit), dir| { + if collision_with( + pos.0 + *dir * 0.01, + &|block| block.is_solid(), + near_iter.clone(), + ) { + (a + dir, true) + } else { + (a, hit) + } + }) { + physics_state.on_wall = Some(wall_dir); + } else { + physics_state.on_wall = None; + } - if attempts == MAX_ATTEMPTS { - pos.0 = old_pos; - break; - } + // Figure out if we're in water + physics_state.in_fluid = + collision_with(pos.0, &|block| block.is_fluid(), near_iter.clone()); + }, + Collider::Point => { + let (dist, block) = terrain + .ray(pos.0, pos.0 + pos_delta) + .ignore_error() + .cast(); + + pos.0 += pos_delta.try_normalized().unwrap_or(Vec3::zero()) * dist; + + if block.unwrap().is_some() { // Can't fail + if sticky.is_some() { + vel.0 = Vec3::zero(); + + let block_center = pos.0.map(|e| e.floor()) + 0.5; + let block_rpos = (pos.0 - block_center).try_normalized().unwrap_or(Vec3::zero()); + + // See whether we're on the top/bottom of a block, or the side + if block_rpos.z.abs() > block_rpos.xy().map(|e| e.abs()).reduce_partial_max() { + if block_rpos.z > 0.0 { + physics_state.on_ground = true; + } else { + physics_state.on_ceiling = true; + } + } else { + physics_state.on_wall = Some(if block_rpos.x.abs() > block_rpos.y.abs() { + Vec3::unit_x() * -block_rpos.x.signum() + } else { + Vec3::unit_y() * -block_rpos.y.signum() + }); + } + } + } + }, } - if on_ground { - physics_state.on_ground = true; - // If the space below us is free, then "snap" to the ground - } else if collision_with( - pos.0 - Vec3::unit_z() * 1.05, - &|block| block.is_solid(), - near_iter.clone(), - ) && vel.0.z < 0.0 - && vel.0.z > -1.5 - && was_on_ground - && !collision_with( - pos.0 - Vec3::unit_z() * 0.05, - &|block| { - block.is_solid() && block.get_height() >= (pos.0.z - 0.05).rem_euclid(1.0) - }, - near_iter.clone(), - ) - { - let snap_height = terrain - .get(Vec3::new(pos.0.x, pos.0.y, pos.0.z - 0.05).map(|e| e.floor() as i32)) - .ok() - .filter(|block| block.is_solid()) - .map(|block| block.get_height()) - .unwrap_or(0.0); - pos.0.z = (pos.0.z - 0.05).floor() + snap_height; - physics_state.on_ground = true; - } - - let dirs = [ - Vec3::unit_x(), - Vec3::unit_y(), - -Vec3::unit_x(), - -Vec3::unit_y(), - ]; - - if let (wall_dir, true) = dirs.iter().fold((Vec3::zero(), false), |(a, hit), dir| { - if collision_with( - pos.0 + *dir * 0.01, - &|block| block.is_solid(), - near_iter.clone(), - ) { - (a + dir, true) - } else { - (a, hit) - } - }) { - physics_state.on_wall = Some(wall_dir); - } else { - physics_state.on_wall = None; - } - - // Figure out if we're in water - physics_state.in_fluid = - collision_with(pos.0, &|block| block.is_fluid(), near_iter.clone()); - let _ = physics_states.insert(entity, physics_state); } @@ -369,7 +411,7 @@ impl<'a> System<'a> for Sys { scales.maybe(), masses.maybe(), &mut velocities, - &bodies, + &colliders, !&mountings, stickies.maybe(), &mut physics_states, @@ -389,7 +431,7 @@ impl<'a> System<'a> for Sys { &positions, scales.maybe(), masses.maybe(), - &bodies, + &colliders, !&mountings, ) .join() diff --git a/server/src/state_ext.rs b/server/src/state_ext.rs index b5c178a23a..519fdcb44b 100644 --- a/server/src/state_ext.rs +++ b/server/src/state_ext.rs @@ -92,11 +92,21 @@ impl StateExt for State { .with(pos) .with(comp::Vel(Vec3::zero())) .with(comp::Ori::default()) + .with(comp::Collider::Box { + radius: 0.4, + z_min: 0.0, + z_max: 1.75, + }) .with(comp::Controller::default()) .with(body) .with(stats) .with(comp::Alignment::Npc) .with(comp::Energy::new(500)) + .with(comp::Collider::Box { + radius: 0.4, + z_min: 0.0, + z_max: 1.75, + }) .with(comp::Gravity(1.0)) .with(comp::CharacterState::default()) .with(loadout) @@ -111,6 +121,11 @@ impl StateExt for State { .with(comp::Ori::default()) .with(comp::Body::Object(object)) .with(comp::Mass(100.0)) + .with(comp::Collider::Box { + radius: 0.4, + z_min: 0.0, + z_max: 0.9, + }) .with(comp::Gravity(1.0)) //.with(comp::LightEmitter::default()) } @@ -129,6 +144,7 @@ impl StateExt for State { .with(vel) .with(comp::Ori(Dir::from_unnormalized(vel.0).unwrap_or_default())) .with(comp::Mass(0.0)) + .with(comp::Collider::Point) .with(body) .with(projectile) .with(comp::Sticky) @@ -154,6 +170,11 @@ impl StateExt for State { self.write_component(entity, comp::Pos(spawn_point)); self.write_component(entity, comp::Vel(Vec3::zero())); self.write_component(entity, comp::Ori::default()); + self.write_component(entity, comp::Collider::Box { + radius: 0.4, + z_min: 0.0, + z_max: 1.75, + }); self.write_component(entity, comp::Gravity(1.0)); self.write_component(entity, comp::CharacterState::default()); self.write_component(entity, comp::Alignment::Owned(entity)); diff --git a/server/src/sys/sentinel.rs b/server/src/sys/sentinel.rs index 9b388e61cd..4fab2e9381 100644 --- a/server/src/sys/sentinel.rs +++ b/server/src/sys/sentinel.rs @@ -1,7 +1,7 @@ use super::SysTimer; use common::{ comp::{ - Body, CanBuild, CharacterState, Energy, Gravity, Item, LightEmitter, Loadout, Mass, + Body, CanBuild, CharacterState, Energy, Gravity, Item, LightEmitter, Loadout, Mass, Collider, MountState, Mounting, Ori, Player, Pos, Scale, Stats, Sticky, Vel, }, msg::EcsCompPacket, @@ -49,6 +49,7 @@ pub struct TrackedComps<'a> { pub mounting: ReadStorage<'a, Mounting>, pub mount_state: ReadStorage<'a, MountState>, pub mass: ReadStorage<'a, Mass>, + pub collider: ReadStorage<'a, Collider>, pub sticky: ReadStorage<'a, Sticky>, pub gravity: ReadStorage<'a, Gravity>, pub loadout: ReadStorage<'a, Loadout>, @@ -104,6 +105,10 @@ impl<'a> TrackedComps<'a> { .cloned() .map(|c| comps.push(c.into())); self.mass.get(entity).copied().map(|c| comps.push(c.into())); + self.collider + .get(entity) + .copied() + .map(|c| comps.push(c.into())); self.sticky .get(entity) .copied() @@ -142,6 +147,7 @@ pub struct ReadTrackers<'a> { pub mounting: ReadExpect<'a, UpdateTracker>, pub mount_state: ReadExpect<'a, UpdateTracker>, pub mass: ReadExpect<'a, UpdateTracker>, + pub collider: ReadExpect<'a, UpdateTracker>, pub sticky: ReadExpect<'a, UpdateTracker>, pub gravity: ReadExpect<'a, UpdateTracker>, pub loadout: ReadExpect<'a, UpdateTracker>, @@ -173,6 +179,7 @@ impl<'a> ReadTrackers<'a> { .with_component(&comps.uid, &*self.mounting, &comps.mounting, filter) .with_component(&comps.uid, &*self.mount_state, &comps.mount_state, filter) .with_component(&comps.uid, &*self.mass, &comps.mass, filter) + .with_component(&comps.uid, &*self.collider, &comps.collider, filter) .with_component(&comps.uid, &*self.sticky, &comps.sticky, filter) .with_component(&comps.uid, &*self.gravity, &comps.gravity, filter) .with_component(&comps.uid, &*self.loadout, &comps.loadout, filter) @@ -201,6 +208,7 @@ pub struct WriteTrackers<'a> { mounting: WriteExpect<'a, UpdateTracker>, mount_state: WriteExpect<'a, UpdateTracker>, mass: WriteExpect<'a, UpdateTracker>, + collider: WriteExpect<'a, UpdateTracker>, sticky: WriteExpect<'a, UpdateTracker>, gravity: WriteExpect<'a, UpdateTracker>, loadout: WriteExpect<'a, UpdateTracker>, @@ -221,6 +229,7 @@ fn record_changes(comps: &TrackedComps, trackers: &mut WriteTrackers) { trackers.mounting.record_changes(&comps.mounting); trackers.mount_state.record_changes(&comps.mount_state); trackers.mass.record_changes(&comps.mass); + trackers.collider.record_changes(&comps.collider); trackers.sticky.record_changes(&comps.sticky); trackers.gravity.record_changes(&comps.gravity); trackers.loadout.record_changes(&comps.loadout); @@ -242,6 +251,7 @@ pub fn register_trackers(world: &mut World) { world.register_tracker::(); world.register_tracker::(); world.register_tracker::(); + world.register_tracker::(); world.register_tracker::(); world.register_tracker::(); world.register_tracker::(); From 8e0f40c71ed41cc77704757c065b693e91810f0c Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 26 Apr 2020 15:44:03 +0100 Subject: [PATCH 04/10] Added on_ceiling check for sticky entities --- common/src/comp/mod.rs | 2 +- common/src/comp/phys.rs | 6 +-- common/src/sys/phys.rs | 98 ++++++++++++++++++++++---------------- server/src/sys/sentinel.rs | 4 +- 4 files changed, 62 insertions(+), 48 deletions(-) diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index ca209676f7..8e721fed78 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -35,7 +35,7 @@ pub use inventory::{ }; pub use last::Last; pub use location::{Waypoint, WaypointArea}; -pub use phys::{ForceUpdate, Gravity, Mass, Collider, Ori, PhysicsState, Pos, Scale, Sticky, Vel}; +pub use phys::{Collider, ForceUpdate, Gravity, Mass, Ori, PhysicsState, Pos, Scale, Sticky, Vel}; pub use player::Player; pub use projectile::Projectile; pub use stats::{Exp, HealthChange, HealthSource, Level, Stats}; diff --git a/common/src/comp/phys.rs b/common/src/comp/phys.rs index 8cbf17a53c..01fe96dc46 100644 --- a/common/src/comp/phys.rs +++ b/common/src/comp/phys.rs @@ -46,11 +46,7 @@ impl Component for Mass { // Mass #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum Collider { - Box { - radius: f32, - z_min: f32, - z_max: f32, - }, + Box { radius: f32, z_min: f32, z_max: f32 }, Point, } diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index 5421585430..06289f1cc3 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -1,5 +1,5 @@ use crate::{ - comp::{Gravity, Mass, Collider, Mounting, Ori, PhysicsState, Pos, Scale, Sticky, Vel}, + comp::{Collider, Gravity, Mass, Mounting, Ori, PhysicsState, Pos, Scale, Sticky, Vel}, event::{EventBus, ServerEvent}, state::DeltaTime, sync::Uid, @@ -93,7 +93,7 @@ impl<'a> System<'a> for Sys { { let mut physics_state = physics_states.get(entity).cloned().unwrap_or_default(); - if sticky.is_some() && (physics_state.on_ground || physics_state.on_wall.is_some()) { + if sticky.is_some() && (physics_state.on_ground || physics_state.on_ceiling || physics_state.on_wall.is_some()) { continue; } @@ -133,7 +133,11 @@ impl<'a> System<'a> for Sys { }; match collider { - Collider::Box { radius, z_min, z_max } => { + Collider::Box { + radius, + z_min, + z_max, + } => { // Scale collider let radius = *radius * scale; let z_min = *z_min * scale; @@ -145,7 +149,9 @@ impl<'a> System<'a> for Sys { let near_iter = (-hdist..hdist + 1) .map(move |i| { (-hdist..hdist + 1).map(move |j| { - (1 - BlockKind::MAX_HEIGHT.ceil() as i32 + z_min.floor() as i32..z_max.ceil() as i32 + 1).map(move |k| (i, j, k)) + (1 - BlockKind::MAX_HEIGHT.ceil() as i32 + z_min.floor() as i32 + ..z_max.ceil() as i32 + 1) + .map(move |k| (i, j, k)) }) }) .flatten() @@ -153,7 +159,9 @@ impl<'a> System<'a> for Sys { // Function for determining whether the player at a specific position collides // with the ground - let collision_with = |pos: Vec3, hit: &dyn Fn(&Block) -> bool, near_iter| { + let collision_with = |pos: Vec3, + hit: &dyn Fn(&Block) -> bool, + near_iter| { for (i, j, k) in near_iter { let block_pos = pos.map(|e| e.floor() as i32) + Vec3::new(i, j, k); @@ -243,8 +251,8 @@ impl<'a> System<'a> for Sys { // Find the intrusion vector of the collision let dir = player_aabb.collision_vector_with_aabb(block_aabb); - // Determine an appropriate resolution vector (i.e: the minimum distance needed - // to push out of the block) + // Determine an appropriate resolution vector (i.e: the minimum distance + // needed to push out of the block) let max_axis = dir.map(|e| e.abs()).reduce_partial_min(); let resolve_dir = -dir.map(|e| { if e.abs().to_bits() == max_axis.to_bits() { @@ -254,19 +262,21 @@ impl<'a> System<'a> for Sys { } }); - // When the resolution direction is pointing upwards, we must be on the ground + // When the resolution direction is pointing upwards, we must be on the + // ground if resolve_dir.z > 0.0 && vel.0.z <= 0.0 { on_ground = true; if !was_on_ground { - event_emitter.emit(ServerEvent::LandOnGround { entity, vel: vel.0 }); + event_emitter + .emit(ServerEvent::LandOnGround { entity, vel: vel.0 }); } } else if resolve_dir.z < 0.0 && vel.0.z >= 0.0 { on_ceiling = true; } - // When the resolution direction is non-vertical, we must be colliding with a - // wall If the space above is free... + // When the resolution direction is non-vertical, we must be colliding + // with a wall If the space above is free... if !collision_with(Vec3::new(pos.0.x, pos.0.y, (pos.0.z + 0.1).ceil()), &|block| block.is_solid(), near_iter.clone()) // ...and we're being pushed out horizontally... && resolve_dir.z == 0.0 @@ -291,10 +301,9 @@ impl<'a> System<'a> for Sys { break; } else { // Correct the velocity - vel.0 = vel.0.map2( - resolve_dir, - |e, d| if d * e.signum() < 0.0 { 0.0 } else { e }, - ); + vel.0 = vel.0.map2(resolve_dir, |e, d| { + if d * e.signum() < 0.0 { 0.0 } else { e } + }); } // Resolve the collision normally @@ -326,13 +335,17 @@ impl<'a> System<'a> for Sys { && !collision_with( pos.0 - Vec3::unit_z() * 0.05, &|block| { - block.is_solid() && block.get_height() >= (pos.0.z - 0.05).rem_euclid(1.0) + block.is_solid() + && block.get_height() >= (pos.0.z - 0.05).rem_euclid(1.0) }, near_iter.clone(), ) { let snap_height = terrain - .get(Vec3::new(pos.0.x, pos.0.y, pos.0.z - 0.05).map(|e| e.floor() as i32)) + .get( + Vec3::new(pos.0.x, pos.0.y, pos.0.z - 0.05) + .map(|e| e.floor() as i32), + ) .ok() .filter(|block| block.is_solid()) .map(|block| block.get_height()) @@ -348,17 +361,19 @@ impl<'a> System<'a> for Sys { -Vec3::unit_y(), ]; - if let (wall_dir, true) = dirs.iter().fold((Vec3::zero(), false), |(a, hit), dir| { - if collision_with( - pos.0 + *dir * 0.01, - &|block| block.is_solid(), - near_iter.clone(), - ) { - (a + dir, true) - } else { - (a, hit) - } - }) { + if let (wall_dir, true) = + dirs.iter().fold((Vec3::zero(), false), |(a, hit), dir| { + if collision_with( + pos.0 + *dir * 0.01, + &|block| block.is_solid(), + near_iter.clone(), + ) { + (a + dir, true) + } else { + (a, hit) + } + }) + { physics_state.on_wall = Some(wall_dir); } else { physics_state.on_wall = None; @@ -369,33 +384,36 @@ impl<'a> System<'a> for Sys { collision_with(pos.0, &|block| block.is_fluid(), near_iter.clone()); }, Collider::Point => { - let (dist, block) = terrain - .ray(pos.0, pos.0 + pos_delta) - .ignore_error() - .cast(); + let (dist, block) = terrain.ray(pos.0, pos.0 + pos_delta).ignore_error().cast(); pos.0 += pos_delta.try_normalized().unwrap_or(Vec3::zero()) * dist; - if block.unwrap().is_some() { // Can't fail + if block.unwrap().is_some() { + // Can't fail if sticky.is_some() { vel.0 = Vec3::zero(); let block_center = pos.0.map(|e| e.floor()) + 0.5; - let block_rpos = (pos.0 - block_center).try_normalized().unwrap_or(Vec3::zero()); + let block_rpos = (pos.0 - block_center) + .try_normalized() + .unwrap_or(Vec3::zero()); // See whether we're on the top/bottom of a block, or the side - if block_rpos.z.abs() > block_rpos.xy().map(|e| e.abs()).reduce_partial_max() { + if block_rpos.z.abs() + > block_rpos.xy().map(|e| e.abs()).reduce_partial_max() + { if block_rpos.z > 0.0 { physics_state.on_ground = true; } else { physics_state.on_ceiling = true; } } else { - physics_state.on_wall = Some(if block_rpos.x.abs() > block_rpos.y.abs() { - Vec3::unit_x() * -block_rpos.x.signum() - } else { - Vec3::unit_y() * -block_rpos.y.signum() - }); + physics_state.on_wall = + Some(if block_rpos.x.abs() > block_rpos.y.abs() { + Vec3::unit_x() * -block_rpos.x.signum() + } else { + Vec3::unit_y() * -block_rpos.y.signum() + }); } } } diff --git a/server/src/sys/sentinel.rs b/server/src/sys/sentinel.rs index 4fab2e9381..3c90aec221 100644 --- a/server/src/sys/sentinel.rs +++ b/server/src/sys/sentinel.rs @@ -1,8 +1,8 @@ use super::SysTimer; use common::{ comp::{ - Body, CanBuild, CharacterState, Energy, Gravity, Item, LightEmitter, Loadout, Mass, Collider, - MountState, Mounting, Ori, Player, Pos, Scale, Stats, Sticky, Vel, + Body, CanBuild, CharacterState, Collider, Energy, Gravity, Item, LightEmitter, Loadout, + Mass, MountState, Mounting, Ori, Player, Pos, Scale, Stats, Sticky, Vel, }, msg::EcsCompPacket, sync::{CompSyncPackage, EntityPackage, EntitySyncPackage, Uid, UpdateTracker, WorldSyncExt}, From b750b2b00c7cee131f6e4af6b235435970eb2230 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 26 Apr 2020 15:51:08 +0100 Subject: [PATCH 05/10] Fixed logic issue with sticky objects --- common/src/sys/phys.rs | 49 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index 06289f1cc3..16c6c6f35f 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -93,7 +93,12 @@ impl<'a> System<'a> for Sys { { let mut physics_state = physics_states.get(entity).cloned().unwrap_or_default(); - if sticky.is_some() && (physics_state.on_ground || physics_state.on_ceiling || physics_state.on_wall.is_some()) { + if sticky.is_some() + && (physics_state.on_ground + || physics_state.on_ceiling + || physics_state.on_wall.is_some()) + { + vel.0 = Vec3::zero(); continue; } @@ -388,33 +393,29 @@ impl<'a> System<'a> for Sys { pos.0 += pos_delta.try_normalized().unwrap_or(Vec3::zero()) * dist; + // Can't fair since we do ignore_error above if block.unwrap().is_some() { - // Can't fail - if sticky.is_some() { - vel.0 = Vec3::zero(); + let block_center = pos.0.map(|e| e.floor()) + 0.5; + let block_rpos = (pos.0 - block_center) + .try_normalized() + .unwrap_or(Vec3::zero()); - let block_center = pos.0.map(|e| e.floor()) + 0.5; - let block_rpos = (pos.0 - block_center) - .try_normalized() - .unwrap_or(Vec3::zero()); - - // See whether we're on the top/bottom of a block, or the side - if block_rpos.z.abs() - > block_rpos.xy().map(|e| e.abs()).reduce_partial_max() - { - if block_rpos.z > 0.0 { - physics_state.on_ground = true; - } else { - physics_state.on_ceiling = true; - } + // See whether we're on the top/bottom of a block, or the side + if block_rpos.z.abs() + > block_rpos.xy().map(|e| e.abs()).reduce_partial_max() + { + if block_rpos.z > 0.0 { + physics_state.on_ground = true; } else { - physics_state.on_wall = - Some(if block_rpos.x.abs() > block_rpos.y.abs() { - Vec3::unit_x() * -block_rpos.x.signum() - } else { - Vec3::unit_y() * -block_rpos.y.signum() - }); + physics_state.on_ceiling = true; } + } else { + physics_state.on_wall = + Some(if block_rpos.x.abs() > block_rpos.y.abs() { + Vec3::unit_x() * -block_rpos.x.signum() + } else { + Vec3::unit_y() * -block_rpos.y.signum() + }); } } }, From 58b30c45180695142e5488713009da04c1e45f20 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 26 Apr 2020 15:52:45 +0100 Subject: [PATCH 06/10] Stopped velocity when point particles hit walls --- common/src/sys/phys.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index 16c6c6f35f..e5a737a82f 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -409,11 +409,14 @@ impl<'a> System<'a> for Sys { } else { physics_state.on_ceiling = true; } + vel.0.z = 0.0; } else { physics_state.on_wall = Some(if block_rpos.x.abs() > block_rpos.y.abs() { + vel.0.x = 0.0; Vec3::unit_x() * -block_rpos.x.signum() } else { + vel.0.y = 0.0; Vec3::unit_y() * -block_rpos.y.signum() }); } From bd2093c819d5cfa8782b387a30bdc5a5e5c4346f Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 26 Apr 2020 16:16:35 +0100 Subject: [PATCH 07/10] Fixed projectile solid collisions --- common/src/comp/inventory/item/tool.rs | 15 ++++----------- common/src/comp/projectile.rs | 6 ++---- common/src/sys/projectile.rs | 25 +++---------------------- 3 files changed, 9 insertions(+), 37 deletions(-) diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index a440eb9ca7..12fbd4b6f0 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -120,8 +120,7 @@ impl Tool { prepare_duration: Duration::from_millis(100), recover_duration: Duration::from_millis(500), projectile: Projectile { - hit_ground: vec![projectile::Effect::Stick], - hit_wall: vec![projectile::Effect::Stick], + hit_solid: vec![projectile::Effect::Stick], hit_entity: vec![ projectile::Effect::Damage(HealthChange { // TODO: This should not be fixed (?) @@ -162,8 +161,7 @@ impl Tool { prepare_duration: Duration::from_millis(0), recover_duration: Duration::from_millis(200), projectile: Projectile { - hit_ground: vec![projectile::Effect::Vanish], - hit_wall: vec![projectile::Effect::Vanish], + hit_solid: vec![projectile::Effect::Vanish], hit_entity: vec![ projectile::Effect::Damage(HealthChange { // TODO: This should not be fixed (?) @@ -190,11 +188,7 @@ impl Tool { prepare_duration: Duration::from_millis(800), recover_duration: Duration::from_millis(50), projectile: Projectile { - hit_ground: vec![ - projectile::Effect::Explode { power: 1.4 }, - projectile::Effect::Vanish, - ], - hit_wall: vec![ + hit_solid: vec![ projectile::Effect::Explode { power: 1.4 }, projectile::Effect::Vanish, ], @@ -250,8 +244,7 @@ impl Tool { prepare_duration: Duration::from_millis(0), recover_duration: Duration::from_millis(300), projectile: Projectile { - hit_ground: vec![projectile::Effect::Stick], - hit_wall: vec![projectile::Effect::Stick], + hit_solid: vec![projectile::Effect::Stick], hit_entity: vec![projectile::Effect::Stick, projectile::Effect::Possess], time_left: Duration::from_secs(10), owner: None, diff --git a/common/src/comp/projectile.rs b/common/src/comp/projectile.rs index 8ff384a87a..b1f9340a24 100644 --- a/common/src/comp/projectile.rs +++ b/common/src/comp/projectile.rs @@ -17,8 +17,7 @@ pub enum Effect { #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct Projectile { // TODO: use SmallVec for these effects - pub hit_ground: Vec, - pub hit_wall: Vec, + pub hit_solid: Vec, pub hit_entity: Vec, /// Time left until the projectile will despawn pub time_left: Duration, @@ -29,9 +28,8 @@ impl Projectile { pub fn set_owner(&mut self, new_owner: Uid) { self.owner = Some(new_owner); for e in self - .hit_ground + .hit_solid .iter_mut() - .chain(self.hit_wall.iter_mut()) .chain(self.hit_entity.iter_mut()) { if let Effect::Damage(comp::HealthChange { diff --git a/common/src/sys/projectile.rs b/common/src/sys/projectile.rs index bf39c3ed02..dc7c8212a6 100644 --- a/common/src/sys/projectile.rs +++ b/common/src/sys/projectile.rs @@ -57,28 +57,9 @@ impl<'a> System<'a> for Sys { ) .join() { - // Hit ground - if physics.on_ground { - for effect in projectile.hit_ground.drain(..) { - match effect { - projectile::Effect::Explode { power } => { - server_emitter.emit(ServerEvent::Explosion { - pos: pos.0, - power, - owner: projectile.owner, - }) - }, - projectile::Effect::Vanish => server_emitter.emit(ServerEvent::Destroy { - entity, - cause: HealthSource::World, - }), - _ => {}, - } - } - } - // Hit wall - else if physics.on_wall.is_some() { - for effect in projectile.hit_wall.drain(..) { + // Hit something solid + if physics.on_wall.is_some() || physics.on_ground || physics.on_ceiling { + for effect in projectile.hit_solid.drain(..) { match effect { projectile::Effect::Explode { power } => { server_emitter.emit(ServerEvent::Explosion { From bd58be9f58447c51ede18978e816a8215b63f166 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 26 Apr 2020 17:54:51 +0100 Subject: [PATCH 08/10] fmt --- common/src/comp/projectile.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/common/src/comp/projectile.rs b/common/src/comp/projectile.rs index b1f9340a24..741a6004a0 100644 --- a/common/src/comp/projectile.rs +++ b/common/src/comp/projectile.rs @@ -27,11 +27,7 @@ pub struct Projectile { impl Projectile { pub fn set_owner(&mut self, new_owner: Uid) { self.owner = Some(new_owner); - for e in self - .hit_solid - .iter_mut() - .chain(self.hit_entity.iter_mut()) - { + for e in self.hit_solid.iter_mut().chain(self.hit_entity.iter_mut()) { if let Effect::Damage(comp::HealthChange { cause: comp::HealthSource::Projectile { owner, .. }, .. From 390e46b752aa3126f30cdf0204578e3a4ca33b6d Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 26 Apr 2020 18:50:21 +0100 Subject: [PATCH 09/10] Fixed unit tests --- .../src/audio/sfx/event_mapper/movement/tests.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs index 6d7d8325ba..f8b6b91187 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs @@ -88,6 +88,7 @@ fn maps_idle() { &CharacterState::Idle {}, &PhysicsState { on_ground: true, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -111,6 +112,7 @@ fn maps_run_with_sufficient_velocity() { &CharacterState::Idle {}, &PhysicsState { on_ground: true, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -134,6 +136,7 @@ fn does_not_map_run_with_insufficient_velocity() { &CharacterState::Idle {}, &PhysicsState { on_ground: true, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -157,6 +160,7 @@ fn does_not_map_run_with_sufficient_velocity_but_not_on_ground() { &CharacterState::Idle {}, &PhysicsState { on_ground: false, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -183,6 +187,7 @@ fn maps_roll() { }), &PhysicsState { on_ground: true, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -206,6 +211,7 @@ fn maps_land_on_ground_to_run() { &CharacterState::Idle {}, &PhysicsState { on_ground: true, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -229,6 +235,7 @@ fn maps_glider_open() { &CharacterState::Glide {}, &PhysicsState { on_ground: false, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -252,6 +259,7 @@ fn maps_glide() { &CharacterState::Glide {}, &PhysicsState { on_ground: false, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -275,6 +283,7 @@ fn maps_glider_close_when_closing_mid_flight() { &CharacterState::Idle {}, &PhysicsState { on_ground: false, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -299,6 +308,7 @@ fn maps_glider_close_when_landing() { &CharacterState::Idle {}, &PhysicsState { on_ground: true, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -335,6 +345,7 @@ fn maps_wield_while_equipping() { }), &PhysicsState { on_ground: true, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -369,6 +380,7 @@ fn maps_unwield() { &CharacterState::default(), &PhysicsState { on_ground: true, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, @@ -391,6 +403,7 @@ fn maps_quadrupeds_running() { let result = MovementEventMapper::map_non_humanoid_movement_event( &PhysicsState { on_ground: true, + on_ceiling: false, on_wall: None, touch_entity: None, in_fluid: false, From b4af588a00d366dfebaa82a2b64efdc1e58ab633 Mon Sep 17 00:00:00 2001 From: Justin Shipsey Date: Mon, 27 Apr 2020 05:11:34 +0000 Subject: [PATCH 10/10] skel attribute transfer --- voxygen/src/anim/character/alpha.rs | 216 ++++-------------------- voxygen/src/anim/character/beta.rs | 45 +++-- voxygen/src/anim/character/block.rs | 124 +++----------- voxygen/src/anim/character/blockidle.rs | 124 +++----------- voxygen/src/anim/character/charge.rs | 46 ++--- voxygen/src/anim/character/climb.rs | 79 +++++---- voxygen/src/anim/character/dash.rs | 49 ++---- voxygen/src/anim/character/equip.rs | 83 +++------ voxygen/src/anim/character/gliding.rs | 68 ++++---- voxygen/src/anim/character/idle.rs | 84 +++++---- voxygen/src/anim/character/jump.rs | 69 ++++---- voxygen/src/anim/character/mod.rs | 163 ++++++++---------- voxygen/src/anim/character/roll.rs | 86 ++++++---- voxygen/src/anim/character/run.rs | 83 +++++---- voxygen/src/anim/character/shoot.rs | 26 ++- voxygen/src/anim/character/sit.rs | 95 ++++++----- voxygen/src/anim/character/spin.rs | 15 +- voxygen/src/anim/character/stand.rs | 89 +++++----- voxygen/src/anim/character/swim.rs | 79 +++++---- voxygen/src/anim/character/wield.rs | 55 ++---- voxygen/src/anim/mod.rs | 134 --------------- voxygen/src/scene/figure/load.rs | 5 +- 22 files changed, 706 insertions(+), 1111 deletions(-) diff --git a/voxygen/src/anim/character/alpha.rs b/voxygen/src/anim/character/alpha.rs index fc09deca0c..42adecb5e5 100644 --- a/voxygen/src/anim/character/alpha.rs +++ b/voxygen/src/anim/character/alpha.rs @@ -53,27 +53,24 @@ impl Animation for AlphaAnimation { match active_tool_kind { //TODO: Inventory Some(ToolKind::Sword(_)) => { - next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 14.0, - ); + next.head.offset = + Vec3::new(0.0, -2.0 + skeleton_attr.head.0, skeleton_attr.head.1); next.head.ori = Quaternion::rotation_z(slow * -0.25) * Quaternion::rotation_x(0.0 + slow * 0.15) * Quaternion::rotation_y(slow * -0.15); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0); + next.chest.offset = Vec3::new(0.0, skeleton_attr.chest.0, skeleton_attr.chest.1); next.chest.ori = Quaternion::rotation_z(slow * 0.4) * Quaternion::rotation_x(0.0 + slow * -0.2) * Quaternion::rotation_y(slow * 0.2); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(0.0, 0.0, -2.0); + 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, 0.0, -5.0); + 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(); @@ -116,9 +113,9 @@ impl Animation for AlphaAnimation { }, Some(ToolKind::Axe(_)) => { next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right + slowax * 2.0, - 0.0 + skeleton_attr.neck_forward + slowax * -2.0, - skeleton_attr.neck_height + 13.0, + 0.0 + slowax * 2.0, + 0.0 + skeleton_attr.head.0 + slowax * -2.0, + skeleton_attr.head.1, ); next.head.ori = Quaternion::rotation_z(slowax * 0.25) * Quaternion::rotation_x(0.0 + slowax * 0.2) @@ -181,11 +178,8 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); - next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 12.0, - ); + 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) * Quaternion::rotation_x(0.0 + slower * 0.05) * Quaternion::rotation_y(slower * 0.05); @@ -258,29 +252,24 @@ impl Animation for AlphaAnimation { }, Some(ToolKind::Staff(_)) => { next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - 0.0 + skeleton_attr.neck_forward + decel * 0.8, - skeleton_attr.neck_height + 14.0, + 0.0, + 0.0 + skeleton_attr.head.0 + decel * 0.8, + skeleton_attr.head.1, ); next.head.ori = Quaternion::rotation_z(decel * 0.25) * Quaternion::rotation_x(0.0 + decel * 0.1) * Quaternion::rotation_y(decel * -0.1); - next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0); 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, -2.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, -5.0); - next.belt.ori = Quaternion::rotation_z(decel * -0.08) + 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(); @@ -291,9 +280,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, -4.0); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.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); @@ -302,16 +289,13 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_z(1.4 + slow * 0.5); 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.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; }, Some(ToolKind::Shield(_)) => { next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - 0.0 + skeleton_attr.neck_forward + decel * 0.8, - skeleton_attr.neck_height + 21.0, + 0.0, + 0.0 + skeleton_attr.head.0 + decel * 0.8, + skeleton_attr.head.1, ); next.head.ori = Quaternion::rotation_z(decel * 0.25) * Quaternion::rotation_x(0.0 + decel * 0.1) @@ -349,138 +333,19 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_y(0.0 + accel_med * -0.4); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, - 8.0 + accel_fast * 3.0, - 0.0, - ); + next.main.offset = Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); next.main.ori = Quaternion::rotation_z(-0.8) * Quaternion::rotation_x(0.0 + accel_med * -0.8) * Quaternion::rotation_y(0.0 + accel_med * -0.4); next.main.scale = Vec3::one(); next.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.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - }, - Some(ToolKind::Bow(_)) => { - next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - 0.0 + skeleton_attr.neck_forward + decel * 0.8, - skeleton_attr.neck_height + 21.0, - ); - next.head.ori = Quaternion::rotation_z(decel * -0.25) - * Quaternion::rotation_x(0.0 + decel * -0.1) - * Quaternion::rotation_y(decel * -0.1); - next.head.scale = Vec3::one() * skeleton_attr.head_scale; - - next.chest.offset = Vec3::new(0.0, 0.0, 7.0); - 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(1.0, -4.0, -1.0); - next.l_hand.ori = Quaternion::rotation_x(1.27) - * Quaternion::rotation_y(-0.6) - * Quaternion::rotation_z(-0.3); - next.l_hand.scale = Vec3::one() * 1.05; - next.r_hand.offset = Vec3::new(3.0, -1.0, -6.0); - next.r_hand.ori = Quaternion::rotation_x(1.27) - * Quaternion::rotation_y(-0.6) - * Quaternion::rotation_z(-0.3); - next.r_hand.scale = Vec3::one() * 1.05; - next.main.offset = Vec3::new(3.0, 2.0, -13.0); - 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(0.0) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - 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.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - }, - Some(ToolKind::Dagger(_)) => { - next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward + decel * 0.8, - skeleton_attr.neck_height + 21.0, - ); - next.head.ori = Quaternion::rotation_z(decel * 0.25) - * Quaternion::rotation_x(0.0 + decel * 0.1) - * Quaternion::rotation_y(decel * -0.1); - next.head.scale = Vec3::one() * skeleton_attr.head_scale; - - next.chest.offset = Vec3::new(0.0, 0.0, 7.0); - 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) - * Quaternion::rotation_x(0.0 + accel_med * -0.8) - * Quaternion::rotation_y(0.0 + accel_med * -0.4); - next.l_hand.scale = Vec3::one() * 1.01; - - next.r_hand.offset = - Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_z(-0.8) - * Quaternion::rotation_x(0.0 + accel_med * -0.8) - * Quaternion::rotation_y(0.0 + accel_med * -0.4); - next.r_hand.scale = Vec3::one() * 1.01; - - next.main.offset = Vec3::new( - -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, - 8.0 + accel_fast * 3.0, - 0.0, - ); - next.main.ori = Quaternion::rotation_z(-0.8) - * Quaternion::rotation_x(0.0 + accel_med * -0.8) - * Quaternion::rotation_y(0.0 + accel_med * -0.4); - next.main.scale = Vec3::one(); - next.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.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; }, Some(ToolKind::Debug(_)) => { next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward + decel * 0.8, - skeleton_attr.neck_height + 14.0, + 0.0, + -2.0 + skeleton_attr.head.0 + decel * 0.8, + skeleton_attr.head.1, ); next.head.ori = Quaternion::rotation_x(0.0); next.head.scale = Vec3::one() * skeleton_attr.head_scale; @@ -489,15 +354,6 @@ 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, -2.0); - next.belt.ori = Quaternion::rotation_x(0.0); - next.belt.scale = Vec3::one(); - - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); - next.belt.ori = Quaternion::rotation_x(0.0); - 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); @@ -513,44 +369,34 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_y(0.0 + accel_med * -0.4); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x, - 8.0 + accel_fast * 3.0, - 0.0, - ); + next.main.offset = Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0); next.main.ori = Quaternion::rotation_z(-0.8) * Quaternion::rotation_x(0.0 + accel_med * -0.8) * Quaternion::rotation_y(0.0 + accel_med * -0.4); next.main.scale = Vec3::one(); next.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_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; }, _ => {}, } - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.scale = Vec3::one() * 0.65; - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); - next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); - next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = Vec3::one() * 1.1; - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); + next.glider.offset = Vec3::new(0.0, 0.0, 10.0); + next.glider.scale = Vec3::one() * 0.0; - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/beta.rs b/voxygen/src/anim/character/beta.rs index 5b0b87e28b..687424a68f 100644 --- a/voxygen/src/anim/character/beta.rs +++ b/voxygen/src/anim/character/beta.rs @@ -41,11 +41,8 @@ impl Animation for BetaAnimation { //TODO: Inventory Some(ToolKind::Axe(_)) | Some(ToolKind::Hammer(_)) | Some(ToolKind::Sword(_)) => { //INTENTION: SWORD - next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 14.0, - ); + next.head.offset = + Vec3::new(0.0, -2.0 + skeleton_attr.head.0, skeleton_attr.head.1); next.head.ori = Quaternion::rotation_z(slow * -0.18) * Quaternion::rotation_x(-0.1 + slow * -0.28) * Quaternion::rotation_y(0.2 + slow * 0.18); @@ -53,19 +50,19 @@ impl Animation for BetaAnimation { next.chest.offset = Vec3::new(0.0 + foot * 2.0, 0.0, 7.0); next.chest.ori = Quaternion::rotation_z(slow * 0.2) - * Quaternion::rotation_x(0.0 + 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(0.0 + 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(0.0 + slow * 0.1) + * Quaternion::rotation_x(slow * 0.1) * Quaternion::rotation_y(slow * -0.05); next.shorts.scale = Vec3::one(); @@ -76,9 +73,7 @@ impl Animation for BetaAnimation { 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.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); @@ -96,37 +91,41 @@ impl Animation for BetaAnimation { * 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.ori = Quaternion::rotation_z(0.0) - * Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; }, _ => {}, } - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); + next.l_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = Vec3::one() * 1.1; - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); + next.glider.offset = Vec3::new(0.0, 0.0, 10.0); next.glider.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(slow * -0.7 + 0.4) * Quaternion::rotation_y(slow * 0.4); next.lantern.scale = Vec3::one() * 0.65; - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/block.rs b/voxygen/src/anim/character/block.rs index a9e58b8756..54b5b57c12 100644 --- a/voxygen/src/anim/character/block.rs +++ b/voxygen/src/anim/character/block.rs @@ -39,9 +39,9 @@ impl Animation for BlockAnimation { * 0.15, ); next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right + wave_slow_cos * 0.2, - -1.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 19.5 + wave_ultra_slow * 0.2, + 0.0 + wave_slow_cos * 0.2, + -1.0 + skeleton_attr.head.0, + skeleton_attr.head.1 + 19.5 + wave_ultra_slow * 0.2, ); next.head.ori = Quaternion::rotation_x(-0.25); next.head.scale = Vec3::one() * 1.01 * skeleton_attr.head_scale; @@ -96,11 +96,7 @@ impl Animation for BlockAnimation { ); next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0 + wave_ultra_slow * 1.0, - ); + next.main.offset = Vec3::new(-6.0, 4.5, 0.0 + wave_ultra_slow * 1.0); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); @@ -117,11 +113,7 @@ impl Animation for BlockAnimation { * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(-0.2); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - 5.0 + skeleton_attr.weapon_x, - 8.75 + skeleton_attr.weapon_y, - 5.5, - ); + next.main.offset = Vec3::new(5.0, 8.75, 5.5); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(-1.35) * Quaternion::rotation_z(-0.85); @@ -143,8 +135,8 @@ impl Animation for BlockAnimation { next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.scale = Vec3::one() * 1.01; next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, + -6.0 + wave_ultra_slow_cos * 1.0, + 4.5 + wave_ultra_slow_cos * 0.5, 0.0 + wave_ultra_slow * 1.0, ); next.main.ori = Quaternion::rotation_x(-0.3) @@ -168,8 +160,8 @@ impl Animation for BlockAnimation { next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.scale = Vec3::one() * 1.01; next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, + -6.0 + wave_ultra_slow_cos * 1.0, + 4.5 + wave_ultra_slow_cos * 0.5, 0.0 + wave_ultra_slow * 1.0, ); next.main.ori = Quaternion::rotation_x(-0.3) @@ -177,96 +169,32 @@ impl Animation for BlockAnimation { * Quaternion::rotation_z(0.0); next.main.scale = Vec3::one(); }, - Some(ToolKind::Bow(_)) => { - next.l_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - 3.5 + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, - ); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - 3.0 + wave_ultra_slow_cos * 0.5, - -2.0 + wave_ultra_slow * 1.0, - ); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); - }, - Some(ToolKind::Dagger(_)) => { - next.l_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - 3.5 + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, - ); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); - }, - Some(ToolKind::Debug(_)) => { - next.l_hand.offset = Vec3::new(-7.0, 3.5, 6.5); - next.l_hand.ori = Quaternion::rotation_x(2.07) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(-0.2); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(7.0, 2.5, 3.75); - next.r_hand.ori = Quaternion::rotation_x(2.07) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(-0.2); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - 5.0 + skeleton_attr.weapon_x, - 8.75 + skeleton_attr.weapon_y, - 5.5, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(-1.35) - * Quaternion::rotation_z(-0.85); - next.main.scale = Vec3::one(); - }, _ => {}, } - //next.l_foot.offset = Vec3::new(-3.4, 0.3, 8.0 + wave_ultra_slow_cos * 0.1); - //next.l_foot.ori = Quaternion::rotation_x(-0.3); - //next.l_foot.scale = Vec3::one(); - //next.r_foot.offset = Vec3::new(3.4, 1.2, 8.0 + wave_ultra_slow * 0.1); - //next.r_foot.ori = Quaternion::rotation_x(0.3); - //next.r_foot.scale = Vec3::one(); - - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 5.0); - next.l_shoulder.ori = Quaternion::rotation_x(0.0); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 5.0); - next.r_shoulder.ori = Quaternion::rotation_x(0.0); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.r_shoulder.scale = Vec3::one() * 1.1; next.glider.offset = Vec3::new(0.0, 5.0, 0.0); next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -274,12 +202,8 @@ impl Animation for BlockAnimation { next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/blockidle.rs b/voxygen/src/anim/character/blockidle.rs index 0c7551b71b..b29f4ff2df 100644 --- a/voxygen/src/anim/character/blockidle.rs +++ b/voxygen/src/anim/character/blockidle.rs @@ -38,9 +38,9 @@ impl Animation for BlockIdleAnimation { * 0.15, ); next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right + wave_slow_cos * 0.2, - -1.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 19.5 + wave_ultra_slow * 0.2, + 0.0 + wave_slow_cos * 0.2, + -1.0 + skeleton_attr.head.0, + skeleton_attr.head.1 + 19.5 + wave_ultra_slow * 0.2, ); next.head.ori = Quaternion::rotation_x(-0.25); next.head.scale = Vec3::one() * 1.01 * skeleton_attr.head_scale; @@ -95,11 +95,7 @@ impl Animation for BlockIdleAnimation { ); next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0 + wave_ultra_slow * 1.0, - ); + next.main.offset = Vec3::new(-6.0, 4.5, 0.0 + wave_ultra_slow * 1.0); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); @@ -116,41 +112,12 @@ impl Animation for BlockIdleAnimation { * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(-0.2); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - 5.0 + skeleton_attr.weapon_x, - 8.75 + wave_ultra_slow * 2.0 + skeleton_attr.weapon_y, - 5.5, - ); + next.main.offset = Vec3::new(5.0, 8.75 + wave_ultra_slow * 2.0, 5.5); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(-1.35) * Quaternion::rotation_z(-0.85); next.main.scale = Vec3::one(); }, - Some(ToolKind::Staff(_)) => { - next.l_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - 3.5 + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, - ); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - 3.0 + wave_ultra_slow_cos * 0.5, - -2.0 + wave_ultra_slow * 1.0, - ); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); - }, Some(ToolKind::Shield(_)) => { next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, @@ -167,56 +134,10 @@ impl Animation for BlockIdleAnimation { next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.scale = Vec3::one() * 1.01; next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); - }, - Some(ToolKind::Bow(_)) => { - next.l_hand.offset = Vec3::new( -6.0 + wave_ultra_slow_cos * 1.0, - 3.5 + wave_ultra_slow_cos * 0.5, + 4.5 + wave_ultra_slow_cos * 0.5, 0.0 + wave_ultra_slow * 1.0, ); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - 3.0 + wave_ultra_slow_cos * 0.5, - -2.0 + wave_ultra_slow * 1.0, - ); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, - 4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); - }, - Some(ToolKind::Dagger(_)) => { - next.l_hand.offset = Vec3::new( - -6.0 + wave_ultra_slow_cos * 1.0, - 3.5 + wave_ultra_slow_cos * 0.5, - 0.0 + wave_ultra_slow * 1.0, - ); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, - ); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); @@ -233,11 +154,7 @@ impl Animation for BlockIdleAnimation { * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(-0.2); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - 5.0 + skeleton_attr.weapon_x, - 8.75 + wave_ultra_slow * 2.0 + skeleton_attr.weapon_y, - 5.5, - ); + next.main.offset = Vec3::new(5.0, 8.75 + wave_ultra_slow * 2.0, 5.5); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(-1.35) * Quaternion::rotation_z(-0.85); @@ -253,19 +170,28 @@ impl Animation for BlockIdleAnimation { next.r_foot.ori = Quaternion::rotation_x(0.3); next.r_foot.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 5.0); - next.l_shoulder.ori = Quaternion::rotation_x(0.0); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 5.0); - next.r_shoulder.ori = Quaternion::rotation_x(0.0); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.r_shoulder.scale = Vec3::one() * 1.1; - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); + next.glider.offset = Vec3::new(0.0, 0.0, 10.0); next.glider.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; @@ -273,12 +199,8 @@ impl Animation for BlockIdleAnimation { next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/charge.rs b/voxygen/src/anim/character/charge.rs index ea016471d8..9ad1c25605 100644 --- a/voxygen/src/anim/character/charge.rs +++ b/voxygen/src/anim/character/charge.rs @@ -48,26 +48,26 @@ impl Animation for ChargeAnimation { let stopa = ((anim_time as f32).powf(0.9 as f32)).min(5.0); next.head.offset = Vec3::new( - 0.0 + stop * -2.0 + skeleton_attr.neck_right, - -2.0 + stop * 2.5 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 14.0, + 0.0 + stop * -2.0, + -2.0 + stop * 2.5 + skeleton_attr.head.0, + skeleton_attr.head.1, ); next.head.ori = Quaternion::rotation_z(stop * -1.0) * Quaternion::rotation_x(0.0) * Quaternion::rotation_y(stop * -0.3); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0); + 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.belt.offset = Vec3::new(0.0, 0.0, -2.0); + 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, 0.0, -5.0); + 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(); @@ -93,9 +93,8 @@ impl Animation for ChargeAnimation { 6.0 + quicka * 3.5 * (1.0 / (stopa + 0.1)), 6.0 - stop * 3.0, ); - next.control.ori = Quaternion::rotation_x(stop * -0.2) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(stop * 0.2); + next.control.ori = + Quaternion::rotation_x(stop * -0.2) * Quaternion::rotation_z(stop * 0.2); next.control.scale = Vec3::one(); }, Some(ToolKind::Bow(_)) => { @@ -159,32 +158,37 @@ impl Animation for ChargeAnimation { * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; } - next.back.offset = Vec3::new(0.0, -2.8, 7.25); + next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); next.back.ori = Quaternion::rotation_x(-0.3); next.back.scale = Vec3::one() * 1.02; - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); - next.l_shoulder.ori = Quaternion::rotation_x(0.0); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); - next.r_shoulder.ori = Quaternion::rotation_x(0.0); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.r_shoulder.scale = Vec3::one() * 1.1; - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); + next.glider.offset = Vec3::new(0.0, 0.0, 10.0); next.glider.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(0.1) * Quaternion::rotation_y(0.1); next.lantern.scale = Vec3::one() * 0.65; - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/climb.rs b/voxygen/src/anim/character/climb.rs index 5787dd4fc3..23370b68f5 100644 --- a/voxygen/src/anim/character/climb.rs +++ b/voxygen/src/anim/character/climb.rs @@ -39,79 +39,102 @@ impl Animation for ClimbAnimation { next.head.offset = Vec3::new( 0.0, - -4.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 13.50 + smootha * 0.2, + -4.0 + skeleton_attr.head.0, + skeleton_attr.head.1 + smootha * 0.2, ); next.head.ori = Quaternion::rotation_z(smooth * 0.1) * Quaternion::rotation_x(0.6) * Quaternion::rotation_y(quick * 0.1); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 1.0, 5.0 + smootha * 1.1); + next.chest.offset = Vec3::new( + 0.0, + skeleton_attr.chest.0 + 1.0, + skeleton_attr.chest.1 + smootha * 1.1, + ); next.chest.ori = Quaternion::rotation_z(quick * 0.25) * Quaternion::rotation_x(-0.15) * Quaternion::rotation_y(quick * -0.12); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(0.0, 1.0, -2.0); + next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0 + 1.0, skeleton_attr.belt.1); next.belt.ori = Quaternion::rotation_z(quick * 0.0) * Quaternion::rotation_x(0.0); next.belt.scale = Vec3::one(); - next.back.offset = Vec3::new(0.0, -2.8, 7.25); + next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); next.back.ori = Quaternion::rotation_x(-0.2); next.back.scale = Vec3::one() * 1.02; - next.shorts.offset = Vec3::new(0.0, 1.0, -5.0); + next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0 + 1.0, skeleton_attr.shorts.1); next.shorts.ori = Quaternion::rotation_z(quick * 0.0) * Quaternion::rotation_x(0.1) * Quaternion::rotation_y(quick * 0.10); next.shorts.scale = Vec3::one(); - next.l_hand.offset = Vec3::new(-6.0, -0.25 + quicka * 1.5, 6.0 - quick * 4.0); + next.l_hand.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1 + quicka * 1.5, + skeleton_attr.hand.2 - quick * 4.0, + ); next.l_hand.ori = Quaternion::rotation_x(2.2 + quicka * 0.5); next.l_hand.scale = Vec3::one(); - next.r_hand.offset = Vec3::new(6.0, -0.25 - quicka * 1.5, 6.0 + quick * 4.0); + next.r_hand.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1 - quicka * 1.5, + skeleton_attr.hand.2 + quick * 4.0, + ); next.r_hand.ori = Quaternion::rotation_x(2.2 - quicka * 0.5); next.r_hand.scale = Vec3::one(); - next.l_foot.offset = Vec3::new(-3.4, 1.0, 6.0 + quick * 2.5); + next.l_foot.offset = Vec3::new( + -skeleton_attr.foot.0, + 1.0 + skeleton_attr.foot.1, + skeleton_attr.foot.2 + quick * 2.5, + ); next.l_foot.ori = Quaternion::rotation_x(0.2 - quicka * 0.5); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, 1.0, 6.0 - quick * 2.5); + next.r_foot.offset = Vec3::new( + skeleton_attr.foot.0, + 1.0 + skeleton_attr.foot.1, + skeleton_attr.foot.2 - quick * 2.5, + ); next.r_foot.ori = Quaternion::rotation_x(0.2 + quicka * 0.5); next.r_foot.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.ori = Quaternion::rotation_x(smootha * 0.15); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.r_shoulder.ori = Quaternion::rotation_x(smooth * 0.15); next.r_shoulder.scale = Vec3::one() * 1.1; - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); + next.glider.offset = Vec3::new(0.0, 0.0, 10.0); next.glider.scale = Vec3::one() * 0.0; - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 18.0, - ); + next.main.offset = Vec3::new(-7.0, -5.0, 18.0); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + smootha * 0.25); next.main.scale = Vec3::one(); - next.second.offset = Vec3::new( - 0.0 + skeleton_attr.weapon_x, - 0.0 + skeleton_attr.weapon_y, - 0.0, - ); + next.second.offset = Vec3::new(0.0, 0.0, 0.0); next.second.ori = Quaternion::rotation_y(0.0); next.second.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(smooth * -0.3) * Quaternion::rotation_y(smooth * -0.3); next.lantern.scale = Vec3::one() * 0.65; @@ -120,16 +143,10 @@ impl Animation for ClimbAnimation { next.torso.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.control.offset = Vec3::new(0.0, 0.0, 0.0); - next.control.ori = Quaternion::rotation_x(0.0); next.control.scale = Vec3::one(); - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/dash.rs b/voxygen/src/anim/character/dash.rs index 9be8006f0b..4993b8f703 100644 --- a/voxygen/src/anim/character/dash.rs +++ b/voxygen/src/anim/character/dash.rs @@ -36,9 +36,9 @@ impl Animation for DashAnimation { //TODO: Inventory Some(ToolKind::Sword(_)) => { next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 12.0, + 0.0, + -2.0 + skeleton_attr.head.0, + -2.0 + skeleton_attr.head.1, ); next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0) @@ -47,15 +47,12 @@ impl Animation for DashAnimation { next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + slow * 2.0); next.chest.ori = Quaternion::rotation_x(-0.5) * Quaternion::rotation_z(-0.7); - next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, 1.0, -1.0); next.belt.ori = Quaternion::rotation_x(0.2) * Quaternion::rotation_z(0.2); - next.belt.scale = Vec3::one(); next.shorts.offset = Vec3::new(0.0, 3.0, -3.0); next.shorts.ori = Quaternion::rotation_x(0.4) * Quaternion::rotation_z(0.3); - 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); @@ -64,61 +61,43 @@ impl Animation for DashAnimation { 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.ori = Quaternion::rotation_x(-0.3); next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-8.0 - slow * 0.5, 3.0 - foot * 0.6, 3.0); - next.control.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(1.1 + slow * 0.2); + next.control.ori = + Quaternion::rotation_x(-0.3) * Quaternion::rotation_z(1.1 + slow * 0.2); next.control.scale = Vec3::one(); next.l_foot.offset = Vec3::new(-1.4, foot * 3.0 + 2.0, 8.0); next.l_foot.ori = Quaternion::rotation_x(foot * -0.4 - 0.8); - next.l_foot.scale = Vec3::one(); next.r_foot.offset = Vec3::new(5.4, foot * -3.0 - 1.0, 8.0); next.r_foot.ori = Quaternion::rotation_x(foot * 0.4 - 0.8); - next.r_foot.scale = Vec3::one(); }, _ => {}, } next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 12.0, + 0.0, + -2.0 + skeleton_attr.head.0, + skeleton_attr.head.1 + 12.0, ); next.head.ori = Quaternion::rotation_x(0.5); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); - next.l_shoulder.ori = Quaternion::rotation_x(0.0); - next.l_shoulder.scale = Vec3::one() * 1.1; - - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); - next.r_shoulder.ori = Quaternion::rotation_x(0.0); - next.r_shoulder.scale = Vec3::one() * 1.1; - - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); - next.glider.scale = Vec3::one() * 0.0; - - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(slow * -0.7 + 0.4) * Quaternion::rotation_y(slow * 0.4); - next.lantern.scale = Vec3::one() * 0.65; 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.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/equip.rs b/voxygen/src/anim/character/equip.rs index d7c1f2d764..449204f36f 100644 --- a/voxygen/src/anim/character/equip.rs +++ b/voxygen/src/anim/character/equip.rs @@ -51,9 +51,7 @@ impl Animation for EquipAnimation { next.control.offset = Vec3::new(-3.0 + equip_slowa * -1.5, -5.0, 12.0 + equip_slow * 1.5); - next.control.ori = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(2.5) - * Quaternion::rotation_z(1.57); + next.control.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.control.scale = Vec3::one(); }, Some(ToolKind::Axe(_)) => { @@ -74,9 +72,7 @@ impl Animation for EquipAnimation { next.main.scale = Vec3::one(); next.control.offset = Vec3::new(0.0, 0.0, 0.0); - next.control.ori = Quaternion::rotation_x(0.2) - * Quaternion::rotation_y(-0.3) - * Quaternion::rotation_z(0.0); + next.control.ori = Quaternion::rotation_x(0.2) * Quaternion::rotation_y(-0.3); next.control.scale = Vec3::one(); }, Some(ToolKind::Hammer(_)) => { @@ -87,16 +83,12 @@ impl Animation for EquipAnimation { next.r_hand.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.22); next.r_hand.scale = Vec3::one() * 1.06; next.main.offset = Vec3::new(6.0, 7.0, 0.0); - next.main.ori = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(-1.35) - * Quaternion::rotation_z(1.57); + next.main.ori = Quaternion::rotation_y(-1.35) * Quaternion::rotation_z(1.57); next.main.scale = Vec3::one(); next.control.offset = Vec3::new(-3.0 + equip_slowa * -1.5, -12.0, 12.0 + equip_slow * 1.5); - next.control.ori = Quaternion::rotation_x(0.0) - * Quaternion::rotation_y(1.35 + 2.5) - * Quaternion::rotation_z(0.0); + next.control.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(1.35 + 2.5); next.control.scale = Vec3::one(); }, Some(ToolKind::Staff(_)) => { @@ -127,14 +119,8 @@ impl Animation for EquipAnimation { next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); + next.main.offset = Vec3::new(-6.0, 4.5, 0.0); + next.main.ori = Quaternion::rotation_x(-0.3); next.main.scale = Vec3::one(); }, Some(ToolKind::Bow(_)) => { @@ -167,14 +153,8 @@ impl Animation for EquipAnimation { next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); + next.main.offset = Vec3::new(-6.0, 4.5, 0.0); + next.main.ori = Quaternion::rotation_x(-0.3); next.main.scale = Vec3::one(); }, Some(ToolKind::Debug(_)) => { @@ -184,15 +164,10 @@ impl Animation for EquipAnimation { * Quaternion::rotation_z(0.0); next.l_hand.scale = Vec3::one() * 1.01; next.r_hand.offset = Vec3::new(7.0, 2.5, -1.25); - next.r_hand.ori = Quaternion::rotation_x(1.27 + wave * 0.25) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(-0.3); + next.r_hand.ori = + Quaternion::rotation_x(1.27 + wave * 0.25) * Quaternion::rotation_z(-0.3); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - 5.0 + skeleton_attr.weapon_x, - 8.75 + skeleton_attr.weapon_y, - -2.0, - ); + next.main.offset = Vec3::new(5.0, 8.75, -2.0); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(-1.27) * Quaternion::rotation_z(wave * -0.25); @@ -216,38 +191,36 @@ impl Animation for EquipAnimation { if velocity > 0.5 { next.torso.offset = Vec3::new(0.0, 0.0, 0.0) * skeleton_attr.scaler; next.torso.ori = Quaternion::rotation_x(-0.2); - next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; } else { next.head.offset = Vec3::new( 0.0, - -3.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 13.0 + short * 0.2, + -3.0 + skeleton_attr.head.0, + -1.0 + skeleton_attr.head.1 + short * 0.2, ); next.head.ori = Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y); - next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.l_foot.offset = Vec3::new(-3.4, -2.5, 8.0); + + next.l_foot.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); next.l_foot.ori = Quaternion::rotation_x(wave_ultra_slow_cos * 0.035 - 0.2); - next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, 3.5, 8.0); + next.r_foot.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); next.r_foot.ori = Quaternion::rotation_x(wave_ultra_slow * 0.035); - next.r_foot.scale = Vec3::one(); - next.chest.offset = Vec3::new(0.0, 0.0, 7.0); - next.chest.ori = Quaternion::rotation_z(0.0); - next.chest.scale = Vec3::one(); + next.chest.offset = Vec3::new(0.0, skeleton_attr.chest.0, skeleton_attr.chest.1); - next.belt.offset = Vec3::new(0.0, 0.0, -2.0); - next.belt.ori = Quaternion::rotation_z(0.0); - next.belt.scale = Vec3::one(); + next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0, skeleton_attr.belt.1); + + next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0, skeleton_attr.shorts.1); - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); - next.shorts.ori = Quaternion::rotation_z(0.0); - next.shorts.scale = Vec3::one(); next.torso.offset = Vec3::new(0.0, 0.0, 0.1) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_x(0.0); - next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; } next } diff --git a/voxygen/src/anim/character/gliding.rs b/voxygen/src/anim/character/gliding.rs index 50df85942c..88c3cb956f 100644 --- a/voxygen/src/anim/character/gliding.rs +++ b/voxygen/src/anim/character/gliding.rs @@ -56,94 +56,88 @@ impl Animation for GlidingAnimation { } * 0.8; next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 12.0, + 0.0, + -2.0 + skeleton_attr.head.0, + -2.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); - next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.chest.offset = Vec3::new(0.0, 0.0, -2.0); next.chest.ori = Quaternion::rotation_z(slowa * 0.2); - next.chest.scale = Vec3::one(); next.belt.offset = Vec3::new(0.0, 0.0, -2.0); next.belt.ori = Quaternion::rotation_z(slowa * 0.25); - next.belt.scale = Vec3::one(); - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); + 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.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new(-9.5 + slowa * -1.5, -3.0 + slowa * 1.5, 6.0); next.l_hand.ori = Quaternion::rotation_x(-2.7 + slowa * -0.1); - next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new(9.5 + slowa * -1.5, -3.0 + slowa * -1.5, 6.0); next.r_hand.ori = Quaternion::rotation_x(-2.7 + slowa * -0.10); - next.r_hand.scale = Vec3::one(); - next.l_foot.offset = Vec3::new(-3.4, 1.0, -2.0); + next.l_foot.offset = Vec3::new( + -skeleton_attr.foot.0, + 2.0 + skeleton_attr.foot.1, + -9.0 + skeleton_attr.foot.2, + ); next.l_foot.ori = Quaternion::rotation_x( (wave_stop * -0.7 - quicka * -0.21 + slow * 0.19) * speed * 0.04, ); - next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, 1.0, -2.0); + next.r_foot.offset = Vec3::new( + skeleton_attr.foot.0, + 2.0 + skeleton_attr.foot.1, + -9.0 + skeleton_attr.foot.2, + ); next.r_foot.ori = Quaternion::rotation_x( (wave_stop * -0.8 + quick * -0.25 + slowb * 0.13) * speed * 0.04, ); next.r_foot.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); - next.l_shoulder.ori = Quaternion::rotation_x(0.0); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); - next.r_shoulder.ori = Quaternion::rotation_x(0.0); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); 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.scale = Vec3::one(); - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); + next.main.offset = Vec3::new(-7.0, -5.0, 15.0); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.main.scale = Vec3::one(); - next.second.offset = Vec3::new( - 0.0 + skeleton_attr.weapon_x, - 0.0 + skeleton_attr.weapon_y, - 0.0, - ); - next.second.ori = Quaternion::rotation_y(0.0); next.second.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); - next.lantern.ori = Quaternion::rotation_x(0.0); - next.lantern.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); + 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) * Quaternion::rotation_y(tilt * 16.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.control.offset = Vec3::new(0.0, 0.0, 0.0); - next.control.ori = Quaternion::rotation_x(0.0); next.control.scale = Vec3::one(); - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/idle.rs b/voxygen/src/anim/character/idle.rs index 4ef9a75a3e..3275047a27 100644 --- a/voxygen/src/anim/character/idle.rs +++ b/voxygen/src/anim/character/idle.rs @@ -22,79 +22,97 @@ impl Animation for IdleAnimation { let head_abs = ((anim_time as f32 * 0.5 + PI).sin()) + 1.0; next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 14.0 + wave_ultra_slow * 0.1 + head_abs * -0.5, + 0.0, + -2.0 + skeleton_attr.head.0, + skeleton_attr.head.1 + wave_ultra_slow * 0.1 + head_abs * -0.5, ); next.head.scale = Vec3::one() * skeleton_attr.head_scale - head_abs * 0.05; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_ultra_slow * 0.1); - next.chest.ori = Quaternion::rotation_x(0.0); + next.chest.offset = Vec3::new( + 0.0, + skeleton_attr.chest.0, + skeleton_attr.chest.1 + wave_ultra_slow * 0.1, + ); next.chest.scale = Vec3::one() + head_abs * 0.05; - next.belt.offset = Vec3::new(0.0, 0.0, -2.0 + wave_ultra_slow * 0.1); + next.belt.offset = Vec3::new( + 0.0, + skeleton_attr.belt.0, + skeleton_attr.belt.1 + wave_ultra_slow * 0.1, + ); next.belt.ori = Quaternion::rotation_x(0.0); next.belt.scale = Vec3::one() - head_abs * 0.05; - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0 + wave_ultra_slow * 0.1); + next.shorts.offset = Vec3::new( + 0.0, + skeleton_attr.shorts.0, + skeleton_attr.shorts.1 + wave_ultra_slow * 0.1, + ); next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( - -7.0, - -0.25 + wave_ultra_slow_cos * 0.15, - 5.0 + wave_ultra_slow * 0.5, + -skeleton_attr.hand.0, + skeleton_attr.hand.1 + wave_ultra_slow_cos * 0.15, + skeleton_attr.hand.2 + wave_ultra_slow * 0.5, ); next.l_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * -0.06); next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( - 7.0, - -0.25 + wave_ultra_slow_cos * 0.15, - 5.0 + wave_ultra_slow * 0.5 + head_abs * -0.05, + skeleton_attr.hand.0, + skeleton_attr.hand.1 + wave_ultra_slow_cos * 0.15, + skeleton_attr.hand.2 + wave_ultra_slow * 0.5 + head_abs * -0.05, ); next.r_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * -0.06); next.r_hand.scale = Vec3::one() + head_abs * -0.05; - next.l_foot.offset = Vec3::new(-3.4, -0.1, 8.0); - next.l_foot.ori = Quaternion::identity(); + next.l_foot.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, -0.1, 8.0); - next.r_foot.ori = Quaternion::identity(); + next.r_foot.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); next.r_foot.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 5.0); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.2, + ); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = (Vec3::one() + head_abs * -0.05) * 1.15; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 5.0); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.2, + ); next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = (Vec3::one() + head_abs * -0.05) * 1.15; - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 18.0, - ); + next.main.offset = Vec3::new(-7.0, -5.0, 18.0); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.main.scale = Vec3::one() + head_abs * -0.05; - next.second.offset = Vec3::new( - 0.0 + skeleton_attr.weapon_x, - 0.0 + skeleton_attr.weapon_y, - 0.0, - ); - next.second.ori = Quaternion::rotation_y(0.0); + next.second.offset = Vec3::new(0.0, 0.0, 0.0); next.second.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(0.0); next.lantern.scale = Vec3::one() * 0.0; diff --git a/voxygen/src/anim/character/jump.rs b/voxygen/src/anim/character/jump.rs index 9961a6e356..cf9f8453cc 100644 --- a/voxygen/src/anim/character/jump.rs +++ b/voxygen/src/anim/character/jump.rs @@ -21,84 +21,95 @@ impl Animation for JumpAnimation { let stop = (anim_time as f32 * 1.5).min(PI / 2.0).sin(); next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -3.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 13.0, + 0.0, + -3.0 + skeleton_attr.head.0, + -1.0 + skeleton_attr.head.1, ); next.head.ori = Quaternion::rotation_x(0.25 + stop * 0.1 + slow * 0.04); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 8.0); + next.chest.offset = Vec3::new(0.0, skeleton_attr.chest.0, skeleton_attr.chest.1 + 1.0); next.chest.ori = Quaternion::rotation_z(0.0); next.chest.scale = Vec3::one() * 1.01; - next.belt.offset = Vec3::new(0.0, 0.0, -2.0); + next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0, skeleton_attr.belt.1); next.belt.ori = Quaternion::rotation_z(0.0); next.belt.scale = Vec3::one(); - next.back.offset = Vec3::new(0.0, -2.8, 7.25); + next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); next.back.ori = Quaternion::rotation_z(0.0); next.back.scale = Vec3::one() * 1.02; - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); + next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0, skeleton_attr.shorts.1); next.shorts.ori = Quaternion::rotation_z(0.0); next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( - -6.0 + stop * -1.8, - -0.25 + stop * 2.0, - 2.0 + stop * 3.2 - quick * 0.4, + -skeleton_attr.hand.0 + stop * -1.8, + skeleton_attr.hand.1 + stop * 2.0, + -2.0 + skeleton_attr.hand.2 + stop * 3.2 - quick * 0.4, ); next.l_hand.ori = Quaternion::rotation_x(stop * 1.2 + slow * 0.3) * Quaternion::rotation_y(stop * 0.2); next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( - 6.0 + stop * 1.8, - -0.25 + stop * -2.0, - 2.0 + stop * 3.2 - quick * 0.4, + skeleton_attr.hand.0 + stop * 1.8, + skeleton_attr.hand.1 + stop * -2.0, + -2.0 + skeleton_attr.hand.2 + stop * 3.2 - quick * 0.4, ); next.r_hand.ori = Quaternion::rotation_x(-stop * 1.2 + slow * -0.3) * Quaternion::rotation_y(stop * -0.2); next.r_hand.scale = Vec3::one(); - next.l_foot.offset = Vec3::new(-3.4, 1.0, 6.0); + next.l_foot.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); next.l_foot.ori = Quaternion::rotation_x(stop * -1.2 + slow * -0.3); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, -1.0, 6.0); + next.r_foot.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); next.r_foot.ori = Quaternion::rotation_x(stop * 1.2 + slow * 0.3); next.r_foot.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.ori = Quaternion::rotation_x(stop * 0.3); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.r_shoulder.ori = Quaternion::rotation_x(-stop * 0.3); next.r_shoulder.scale = Vec3::one() * 1.1; next.glider.offset = Vec3::new(0.0, 0.0, 10.0); - next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); + next.main.offset = Vec3::new(-7.0, -5.0, 15.0); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.main.scale = Vec3::one(); - next.second.offset = Vec3::new( - 0.0 + skeleton_attr.weapon_x, - 0.0 + skeleton_attr.weapon_y, - 0.0, - ); + next.second.offset = Vec3::new(0.0, 0.0, 0.0); next.second.ori = Quaternion::rotation_y(0.0); next.second.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(stop * 1.2 + slow * 0.3) * Quaternion::rotation_y(stop * 0.4 + slow * 0.3); next.lantern.scale = Vec3::one() * 0.65; diff --git a/voxygen/src/anim/character/mod.rs b/voxygen/src/anim/character/mod.rs index db01ba11ad..743fc40798 100644 --- a/voxygen/src/anim/character/mod.rs +++ b/voxygen/src/anim/character/mod.rs @@ -30,7 +30,7 @@ pub use self::{ use super::{Bone, Skeleton}; use crate::render::FigureBoneData; -use common::comp::{self, item::ToolKind}; +use common::comp; #[derive(Clone, Default)] pub struct CharacterSkeleton { @@ -124,12 +124,46 @@ impl Skeleton for CharacterSkeleton { pub struct SkeletonAttr { scaler: f32, head_scale: f32, - neck_height: f32, - neck_forward: f32, - neck_right: f32, - weapon_x: f32, - weapon_y: f32, + head: (f32, f32), + chest: (f32, f32), + belt: (f32, f32), + back: (f32, f32), + shorts: (f32, f32), + hand: (f32, f32, f32), + foot: (f32, f32, f32), + shoulder: (f32, f32, f32), + lantern: (f32, f32, f32), } + +impl Default for SkeletonAttr { + fn default() -> Self { + Self { + scaler: 0.0, + head_scale: 0.0, + head: (0.0, 0.0), + chest: (0.0, 0.0), + belt: (0.0, 0.0), + back: (0.0, 0.0), + shorts: (0.0, 0.0), + hand: (0.0, 0.0, 0.0), + foot: (0.0, 0.0, 0.0), + shoulder: (0.0, 0.0, 0.0), + lantern: (0.0, 0.0, 0.0), + } + } +} + +impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { + type Error = (); + + fn try_from(body: &'a comp::Body) -> Result { + match body { + comp::Body::Humanoid(body) => Ok(SkeletonAttr::from(body)), + _ => Err(()), + } + } +} + impl SkeletonAttr { pub fn calculate_scale(body: &comp::humanoid::Body) -> f32 { use comp::humanoid::{BodyType::*, Race::*}; @@ -150,31 +184,6 @@ impl SkeletonAttr { } } -impl Default for SkeletonAttr { - fn default() -> Self { - Self { - scaler: 1.0, - head_scale: 1.0, - neck_height: 1.0, - neck_forward: 1.0, - neck_right: 1.0, - weapon_x: 1.0, - weapon_y: 1.0, - } - } -} - -impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { - type Error = (); - - fn try_from(body: &'a comp::Body) -> Result { - match body { - comp::Body::Humanoid(body) => Ok(SkeletonAttr::from(body)), - _ => Err(()), - } - } -} - impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr { fn from(body: &'a comp::humanoid::Body) -> Self { use comp::humanoid::{BodyType::*, Race::*}; @@ -194,69 +203,43 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr { (Danari, Male) => 1.15, (Danari, Female) => 1.15, }, - neck_height: match (body.race, body.body_type) { - (Orc, Male) => 0.0, - (Orc, Female) => 0.0, - (Human, Male) => 0.0, - (Human, Female) => 0.0, - (Elf, Male) => 0.0, - (Elf, Female) => 0.0, - (Dwarf, Male) => 0.0, - (Dwarf, Female) => 0.0, - (Undead, Male) => 0.5, - (Undead, Female) => 0.5, - (Danari, Male) => 0.5, - (Danari, Female) => 0.5, + head: match (body.race, body.body_type) { + (Orc, Male) => (0.0, 14.0), + (Orc, Female) => (0.0, 14.0), + (Human, Male) => (0.0, 14.5), + (Human, Female) => (0.0, 14.0), + (Elf, Male) => (0.0, 14.5), + (Elf, Female) => (0.0, 14.5), + (Dwarf, Male) => (0.0, 14.5), + (Dwarf, Female) => (0.0, 14.0), + (Undead, Male) => (0.5, 14.5), + (Undead, Female) => (0.5, 14.5), + (Danari, Male) => (0.5, 14.0), + (Danari, Female) => (0.5, 14.0), }, - neck_forward: match (body.race, body.body_type) { - (Orc, Male) => 0.0, - (Orc, Female) => 0.0, - (Human, Male) => 0.5, - (Human, Female) => 0.0, - (Elf, Male) => 0.5, - (Elf, Female) => 0.5, - (Dwarf, Male) => 0.5, - (Dwarf, Female) => 0.0, - (Undead, Male) => 0.5, - (Undead, Female) => 0.5, - (Danari, Male) => 0.0, - (Danari, Female) => 0.0, + chest: match (body.race, body.body_type) { + (_, _) => (0.0, 7.0), }, - neck_right: match (body.race, body.body_type) { - (Orc, Male) => 0.0, - (Orc, Female) => 0.0, - (Human, Male) => 0.0, - (Human, Female) => 0.0, - (Elf, Male) => 0.0, - (Elf, Female) => 0.0, - (Dwarf, Male) => 0.0, - (Dwarf, Female) => 0.0, - (Undead, Male) => 0.0, - (Undead, Female) => 0.0, - (Danari, Male) => 0.0, - (Danari, Female) => 0.0, + belt: match (body.race, body.body_type) { + (_, _) => (0.0, -2.0), }, - weapon_x: match ToolKind::Empty { - ToolKind::Sword(_) => 0.0, - ToolKind::Axe(_) => 3.0, - ToolKind::Hammer(_) => 0.0, - ToolKind::Shield(_) => 3.0, - ToolKind::Staff(_) => 3.0, - ToolKind::Bow(_) => 0.0, - ToolKind::Dagger(_) => 0.0, - ToolKind::Debug(_) => 0.0, - ToolKind::Empty => 0.0, + back: match (body.race, body.body_type) { + (_, _) => (-3.1, 7.25), }, - weapon_y: match ToolKind::Empty { - ToolKind::Sword(_) => -1.25, - ToolKind::Axe(_) => 0.0, - ToolKind::Hammer(_) => -2.0, - ToolKind::Shield(_) => 0.0, - ToolKind::Staff(_) => 0.0, - ToolKind::Bow(_) => -2.0, - ToolKind::Dagger(_) => -2.0, - ToolKind::Debug(_) => 0.0, - ToolKind::Empty => 0.0, + shorts: match (body.race, body.body_type) { + (_, _) => (0.0, -5.0), + }, + hand: match (body.race, body.body_type) { + (_, _) => (7.0, -0.25, 5.0), + }, + foot: match (body.race, body.body_type) { + (_, _) => (3.4, -0.1, 8.0), + }, + shoulder: match (body.race, body.body_type) { + (_, _) => (5.0, 0.0, 5.0), + }, + lantern: match (body.race, body.body_type) { + (_, _) => (5.0, 2.5, 5.5), }, } } diff --git a/voxygen/src/anim/character/roll.rs b/voxygen/src/anim/character/roll.rs index e7fde1f91c..c37500335c 100644 --- a/voxygen/src/anim/character/roll.rs +++ b/voxygen/src/anim/character/roll.rs @@ -40,29 +40,41 @@ impl Animation for RollAnimation { } * 1.3; next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 12.0 + wave_dub * -8.0, + 0.0, + -2.0 + skeleton_attr.head.0, + skeleton_attr.head.1 + wave_dub * -8.0, ); next.head.ori = Quaternion::rotation_x(wave_dub * 0.4); next.head.scale = Vec3::one(); - next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_dub * -5.0); + next.chest.offset = Vec3::new( + 0.0, + skeleton_attr.chest.0, + skeleton_attr.chest.1 + wave_dub * -5.0, + ); next.chest.ori = Quaternion::rotation_x(wave_dub * 0.4); next.chest.scale = Vec3::one() * 1.01; - next.belt.offset = Vec3::new(0.0, 0.0, -2.0 + wave_dub * -3.0); + next.belt.offset = Vec3::new( + 0.0, + skeleton_attr.belt.0, + skeleton_attr.belt.0 + wave_dub * -3.0, + ); next.belt.ori = Quaternion::rotation_x(0.0 + wave_dub * 0.4); next.belt.scale = Vec3::one(); - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0 + wave_dub * -2.0); + next.shorts.offset = Vec3::new( + 0.0, + skeleton_attr.shorts.0, + skeleton_attr.shorts.0 + wave_dub * -2.0, + ); next.shorts.ori = Quaternion::rotation_x(0.0 + wave_dub * 0.4); next.shorts.scale = Vec3::one(); next.l_hand.offset = Vec3::new( - -5.5 + wave * -0.5, - -2.0 + wave_quick_cos * -5.5, - 1.0 + wave_quick * 0.5, + -skeleton_attr.chest.0 + wave * -0.5, + skeleton_attr.hand.1 + wave_quick_cos * -5.5, + skeleton_attr.hand.2 + wave_quick * 0.5, ); next.l_hand.ori = @@ -70,53 +82,61 @@ impl Animation for RollAnimation { next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( - 5.5 + wave * 0.5, - -2.0 + wave_quick_cos * 2.5, - 1.0 + wave_quick * 3.0, + skeleton_attr.hand.0 + wave * 0.5, + skeleton_attr.hand.1 + wave_quick_cos * 2.5, + skeleton_attr.hand.2 + wave_quick * 3.0, ); 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(-3.4, -0.1, 10.0 - 0.0 + wave_dub * -1.2 + wave_slow * 4.0); + 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, + ); next.l_foot.ori = Quaternion::rotation_x(wave * 0.6); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, -0.1, 10.0 - 0.0 + wave_dub * -1.0 + wave_slow * 4.0); + 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, + ); next.r_foot.ori = Quaternion::rotation_x(wave * -0.4); next.r_foot.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.2, + ); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.2, + ); next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = Vec3::one() * 1.1; - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); + next.glider.offset = Vec3::new(0.0, 0.0, 10.0); next.glider.scale = Vec3::one() * 0.0; - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); - next.main.ori = Quaternion::rotation_y(2.5) - * Quaternion::rotation_z(1.57) - * Quaternion::rotation_x(0.0); + next.main.offset = Vec3::new(-7.0, -5.0, 15.0); + next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.main.scale = Vec3::one(); - next.second.offset = Vec3::new( - 0.0 + skeleton_attr.weapon_x, - 0.0 + skeleton_attr.weapon_y, - 0.0, - ); - next.second.ori = Quaternion::rotation_y(0.0); + next.second.offset = Vec3::new(0.0, 0.0, 0.0); next.second.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(0.1) * Quaternion::rotation_y(0.1); next.lantern.scale = Vec3::one() * 0.65; diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index 64d41f5e67..0e2ad0ef0f 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -91,84 +91,97 @@ impl Animation for RunAnimation { next.head.offset = Vec3::new( 0.0, - -3.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 13.0 + short * 0.3, + -3.0 + skeleton_attr.head.0, + -1.0 + skeleton_attr.head.1 + short * 0.3, ); next.head.ori = Quaternion::rotation_z(head_look.x + long * -0.1 - short * 0.3) * Quaternion::rotation_x(head_look.y + 0.35); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 10.5 + short * 1.1 - lower); + next.chest.offset = Vec3::new( + 0.0, + skeleton_attr.chest.0, + skeleton_attr.chest.1 + 1.0 + short * 1.1 - lower, + ); next.chest.ori = Quaternion::rotation_z(short * 0.3 * walkintensity); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(0.0, 0.0, -2.0); + 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.scale = Vec3::one(); - next.back.offset = Vec3::new(0.0, -2.8, 7.25); + next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); next.back.ori = Quaternion::rotation_x(-0.25 + short * 0.1 + noisea * 0.1 + noiseb * 0.1); next.back.scale = Vec3::one() * 1.02; - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); + 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.scale = Vec3::one(); next.l_hand.offset = Vec3::new( - -6.0 + wave_stop * -1.0 * walkintensity, - -0.25 + short * 3.0 * walkintensity, - 5.0 + short * -1.5 * walkintensity, + -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, ); - next.l_hand.ori = Quaternion::rotation_x(0.8 + short * 1.2 * walk) - * Quaternion::rotation_y(wave_stop * 0.1); + next.l_hand.ori = Quaternion::rotation_x(0.2 + short * 1.2 * walk) + * Quaternion::rotation_y(wave_stop * -0.1); next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( - 6.0 + wave_stop * 1.0 * walkintensity, - -0.25 + short * -3.0 * walkintensity, - 5.0 + short * 1.5 * walkintensity, + 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, ); - next.r_hand.ori = Quaternion::rotation_x(0.8 + short * -1.2 * walk) - * Quaternion::rotation_y(wave_stop * -0.1); + next.r_hand.ori = Quaternion::rotation_x(0.2 + short * -1.2 * walk) + * Quaternion::rotation_y(wave_stop * 0.1); next.r_hand.scale = Vec3::one(); - next.l_foot.offset = Vec3::new(-3.4, foot * 1.0, 9.5); + next.l_foot.offset = Vec3::new( + -skeleton_attr.foot.0, + -skeleton_attr.foot.1 + foot * 1.0, + skeleton_attr.foot.2 + 1.0, + ); next.l_foot.ori = Quaternion::rotation_x(foot * -1.2 * walkintensity); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, foot * -1.0, 9.5); + next.r_foot.offset = Vec3::new( + skeleton_attr.foot.0, + -skeleton_attr.foot.1 + foot * -1.0, + skeleton_attr.foot.2 + 1.0, + ); next.r_foot.ori = Quaternion::rotation_x(foot * 1.2 * walkintensity); next.r_foot.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, -1.0, 4.7); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.ori = Quaternion::rotation_x(short * 0.15 * walkintensity); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, -1.0, 4.7); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.r_shoulder.ori = Quaternion::rotation_x(short * -0.15 * walkintensity); next.r_shoulder.scale = Vec3::one() * 1.1; next.glider.offset = Vec3::new(0.0, 0.0, 10.0); - next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -6.5 + skeleton_attr.weapon_y, - 15.0, - ); + next.main.offset = Vec3::new(-7.0, -6.5, 15.0); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + short * 0.25); next.main.scale = Vec3::one(); - next.second.offset = Vec3::new( - 0.0 + skeleton_attr.weapon_x, - 0.0 + skeleton_attr.weapon_y, - 0.0, - ); - next.second.ori = Quaternion::rotation_y(0.0); next.second.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(shorte * -0.7 + 0.4) * Quaternion::rotation_y(shorte * 0.4); next.lantern.scale = Vec3::one() * 0.65; @@ -183,12 +196,8 @@ impl Animation for RunAnimation { next.control.ori = Quaternion::rotation_x(0.0); next.control.scale = Vec3::one(); - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next diff --git a/voxygen/src/anim/character/shoot.rs b/voxygen/src/anim/character/shoot.rs index 50525f6a49..8a59399797 100644 --- a/voxygen/src/anim/character/shoot.rs +++ b/voxygen/src/anim/character/shoot.rs @@ -32,27 +32,31 @@ impl Animation for ShootAnimation { let exp = ((anim_time as f32).powf(0.3 as f32)).min(1.2); - next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 14.0, - ); + next.head.offset = Vec3::new(0.0, -2.0 + skeleton_attr.head.0, skeleton_attr.head.1); next.head.ori = Quaternion::rotation_z(exp * -0.4) * Quaternion::rotation_x(0.0) * Quaternion::rotation_y(exp * 0.1); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0 - exp * 1.5, 7.0); + next.chest.offset = Vec3::new( + 0.0, + skeleton_attr.chest.0 - exp * 1.5, + skeleton_attr.chest.1, + ); 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, 0.0 + exp * 1.0, -2.0); + 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, exp * 1.0, -5.0); + next.shorts.offset = Vec3::new( + 0.0, + skeleton_attr.shorts.0 + exp * 1.0, + skeleton_attr.shorts.1, + ); next.shorts.ori = next.chest.ori * -0.08; next.shorts.scale = Vec3::one(); @@ -154,7 +158,11 @@ impl Animation for ShootAnimation { next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(exp * -0.7 + 0.4) * Quaternion::rotation_y(exp * 0.4); next.lantern.scale = Vec3::one() * 0.65; diff --git a/voxygen/src/anim/character/sit.rs b/voxygen/src/anim/character/sit.rs index e9eea8063b..ff02bc3a86 100644 --- a/voxygen/src/anim/character/sit.rs +++ b/voxygen/src/anim/character/sit.rs @@ -36,93 +36,110 @@ impl Animation for SitAnimation { * 0.125, ); next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -3.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 14.0 + slow * 0.1 + stop * -0.8, + 0.0, + -3.0 + skeleton_attr.head.0, + skeleton_attr.head.1 + slow * 0.1 + stop * -0.8, ); next.head.ori = Quaternion::rotation_z(head_look.x + slow * 0.2 - slow * 0.1) * Quaternion::rotation_x((slowa * -0.1 + slow * 0.1 + head_look.y).abs()); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, stop * -0.4, 7.0 + slow * 0.1 + stop * -0.8); + next.chest.offset = Vec3::new( + 0.0, + skeleton_attr.chest.0 + stop * -0.4, + skeleton_attr.chest.1 + slow * 0.1 + stop * -0.8, + ); next.chest.ori = Quaternion::rotation_x(stop * 0.15); next.chest.scale = Vec3::one() + slow_abs * 0.05; - next.belt.offset = Vec3::new(0.0, stop * 1.2, -2.0); + next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0 + stop * 1.2, skeleton_attr.belt.1); next.belt.ori = Quaternion::rotation_x(stop * 0.3); next.belt.scale = (Vec3::one() + slow_abs * 0.05) * 1.02; - next.back.offset = Vec3::new(0.0, -2.8, 7.25); - next.back.ori = Quaternion::rotation_z(0.0); + next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); next.back.scale = Vec3::one() * 1.02; - next.shorts.offset = Vec3::new(0.0, stop * 2.5, -5.0 + stop * 0.6); + next.shorts.offset = Vec3::new( + 0.0, + skeleton_attr.shorts.0 + stop * 2.5, + skeleton_attr.shorts.1 + stop * 0.6, + ); next.shorts.ori = Quaternion::rotation_x(stop * 0.6); next.shorts.scale = Vec3::one(); - next.l_hand.offset = Vec3::new(-6.0, -0.25 + slowa * 0.15, 6.0 + slow * 0.7 + stop * -2.0); - - next.l_hand.ori = Quaternion::rotation_x(0.0 + slowa * -0.1 + slow * 0.1); + next.l_hand.offset = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1 + slowa * 0.15, + skeleton_attr.hand.2 + slow * 0.7 + stop * -2.0, + ); + next.l_hand.ori = Quaternion::rotation_x(slowa * -0.1 + slow * 0.1); next.l_hand.scale = Vec3::one() + slow_abs * -0.05; - next.r_hand.offset = Vec3::new(6.0, -0.25 + slowa * 0.15, 6.0 + slow * 0.7 + stop * -2.0); - next.r_hand.ori = Quaternion::rotation_x(0.0 + slow * -0.1 + slowa * 0.1); + next.r_hand.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1 + slowa * 0.15, + skeleton_attr.hand.2 + slow * 0.7 + stop * -2.0, + ); + next.r_hand.ori = Quaternion::rotation_x(slow * -0.1 + slowa * 0.1); next.r_hand.scale = Vec3::one() + slow_abs * -0.05; - next.l_foot.offset = Vec3::new(-3.4, -0.1, 8.0); + next.l_foot.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + 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(3.4, -0.1, 8.0); + next.r_foot.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + 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(-5.0, 0.0, 4.7); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = (Vec3::one() + slow_abs * -0.05) * 1.15; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = (Vec3::one() + slow_abs * -0.05) * 1.15; - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); + next.glider.offset = Vec3::new(0.0, 0.0, 10.0); next.glider.scale = Vec3::one() * 0.0; - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); + next.main.offset = Vec3::new(-7.0, -5.0, 15.0); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.main.scale = Vec3::one() + slow_abs * -0.05; - next.second.offset = Vec3::new( - 0.0 + skeleton_attr.weapon_x, - 0.0 + skeleton_attr.weapon_y, - 0.0, - ); + next.second.offset = Vec3::new(0.0, 0.0, 0.0); next.second.ori = Quaternion::rotation_y(0.0); next.second.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(0.0, 0.0, 0.0); - next.lantern.ori = Quaternion::rotation_x(0.0); - next.lantern.scale = Vec3::one() * 0.0; + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); + next.lantern.scale = Vec3::one() * 0.65; next.torso.offset = Vec3::new(0.0, -0.2, stop * -0.16) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.control.offset = Vec3::new(0.0, 0.0, 0.0); - next.control.ori = Quaternion::rotation_x(0.0); next.control.scale = Vec3::one(); - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/spin.rs b/voxygen/src/anim/character/spin.rs index b82ae289b5..6d59184618 100644 --- a/voxygen/src/anim/character/spin.rs +++ b/voxygen/src/anim/character/spin.rs @@ -56,15 +56,14 @@ impl Animation for SpinAnimation { * Quaternion::rotation_z(1.4 + spin * 0.1); next.control.scale = Vec3::one(); next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward + spin * -0.8, - skeleton_attr.neck_height + 14.0, + 0.0, + -2.0 + skeleton_attr.head.0 + spin * -0.8, + skeleton_attr.head.1, ); next.head.ori = Quaternion::rotation_z(spin * -0.25) * Quaternion::rotation_x(0.0 + spin * -0.1) * Quaternion::rotation_y(spin * -0.2); - next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0); + next.chest.offset = Vec3::new(0.0, skeleton_attr.chest.0, skeleton_attr.chest.1); next.chest.ori = Quaternion::rotation_z(spin * 0.1) * Quaternion::rotation_x(0.0 + spin * 0.1) * Quaternion::rotation_y(decel * -0.2); @@ -106,7 +105,11 @@ impl Animation for SpinAnimation { next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(spin * -0.7 + 0.4) * Quaternion::rotation_y(spin * 0.4); next.lantern.scale = Vec3::one() * 0.65; diff --git a/voxygen/src/anim/character/stand.rs b/voxygen/src/anim/character/stand.rs index 486d350313..9baadafbf7 100644 --- a/voxygen/src/anim/character/stand.rs +++ b/voxygen/src/anim/character/stand.rs @@ -34,76 +34,93 @@ impl Animation for StandAnimation { * 0.15, ); next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -3.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 14.0 + slow * 0.3 + breathe * -0.05, + 0.0, + -3.0 + skeleton_attr.head.0, + skeleton_attr.head.1 + slow * 0.3 + breathe * -0.05, ); next.head.ori = Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y.abs()); next.head.scale = Vec3::one() * skeleton_attr.head_scale + breathe * -0.05; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + slow * 0.3); + next.chest.offset = Vec3::new( + 0.0, + skeleton_attr.chest.0, + skeleton_attr.chest.1 + slow * 0.3, + ); next.chest.ori = Quaternion::rotation_z(head_look.x * 0.6); next.chest.scale = Vec3::one() * 1.01 + breathe * 0.03; - next.belt.offset = Vec3::new(0.0, 0.0, -2.0); + next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0, skeleton_attr.belt.1); next.belt.ori = Quaternion::rotation_z(head_look.x * -0.1); next.belt.scale = Vec3::one() + breathe * -0.03; - next.back.offset = Vec3::new(0.0, -2.8, 7.25); - next.back.ori = Quaternion::rotation_z(0.0); + next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); next.back.scale = Vec3::one() * 1.02; - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); + next.shorts.offset = Vec3::new(0.0, skeleton_attr.shorts.0, skeleton_attr.shorts.1); next.shorts.ori = Quaternion::rotation_z(head_look.x * -0.2); next.shorts.scale = Vec3::one() + breathe * -0.03; - next.l_hand.offset = Vec3::new(-7.0, -0.25 + slow * 0.15, 5.0 + slow * 0.5); + next.l_hand.offset = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1 + slow * 0.15, + skeleton_attr.hand.2 + slow * 0.5, + ); - next.l_hand.ori = Quaternion::rotation_x(0.0 + slow * -0.06); + next.l_hand.ori = Quaternion::rotation_x(slow * -0.06); next.l_hand.scale = Vec3::one(); - next.r_hand.offset = Vec3::new(7.0, -0.25 + slow * 0.15, 5.0 + slow * 0.5); - next.r_hand.ori = Quaternion::rotation_x(0.0 + slow * -0.06); + next.r_hand.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1 + slow * 0.15, + skeleton_attr.hand.2 + slow * 0.5, + ); + next.r_hand.ori = Quaternion::rotation_x(slow * -0.06); next.r_hand.scale = Vec3::one(); - next.l_foot.offset = Vec3::new(-3.4, -0.1, 8.0); - next.l_foot.ori = Quaternion::identity(); + next.l_foot.offset = Vec3::new( + -skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); next.l_foot.scale = Vec3::one(); - next.r_foot.offset = Vec3::new(3.4, -0.1, 8.0); - next.r_foot.ori = Quaternion::identity(); + next.r_foot.offset = Vec3::new( + skeleton_attr.foot.0, + skeleton_attr.foot.1, + skeleton_attr.foot.2, + ); next.r_foot.scale = Vec3::one(); - next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 5.0); - next.l_shoulder.ori = Quaternion::rotation_x(0.0); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.l_shoulder.scale = (Vec3::one() + breathe * -0.05) * 1.15; - next.r_shoulder.offset = Vec3::new(5.0, 0.0, 5.0); - next.r_shoulder.ori = Quaternion::rotation_x(0.0); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.1, + skeleton_attr.shoulder.2, + ); next.r_shoulder.scale = (Vec3::one() + breathe * -0.05) * 1.15; next.glider.offset = Vec3::new(0.0, 0.0, 10.0); - next.glider.ori = Quaternion::rotation_y(0.0); next.glider.scale = Vec3::one() * 0.0; - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); + next.main.offset = Vec3::new(-7.0, -5.0, 15.0); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); next.main.scale = Vec3::one(); - next.second.offset = Vec3::new( - 0.0 + skeleton_attr.weapon_x, - 0.0 + skeleton_attr.weapon_y, - 0.0, - ); - next.second.ori = Quaternion::rotation_y(0.0); + next.second.offset = Vec3::new(0.0, 0.0, 0.0); next.second.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(0.1) * Quaternion::rotation_y(0.1); next.lantern.scale = Vec3::one() * 0.65; @@ -111,16 +128,10 @@ impl Animation for StandAnimation { next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.control.offset = Vec3::new(0.0, 0.0, 0.0); - next.control.ori = Quaternion::rotation_x(0.0); next.control.scale = Vec3::one(); - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next } diff --git a/voxygen/src/anim/character/swim.rs b/voxygen/src/anim/character/swim.rs index 5836f7e23e..35787b7804 100644 --- a/voxygen/src/anim/character/swim.rs +++ b/voxygen/src/anim/character/swim.rs @@ -46,74 +46,95 @@ impl Animation for SwimAnimation { next.head.offset = Vec3::new( 0.0, - -3.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 13.0 + short * 0.3, + -3.0 + skeleton_attr.head.0, + skeleton_attr.head.1 - 1.0 + short * 0.3, ); next.head.ori = Quaternion::rotation_z(head_look.x - short * 0.4) * Quaternion::rotation_x(head_look.y + 0.35 + speed * 0.045); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + short * 1.3); + next.chest.offset = Vec3::new( + 0.0, + skeleton_attr.chest.0, + 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, 0.0, -2.0); + 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, -2.8, 7.25); + next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); next.back.ori = Quaternion::rotation_z(0.0); next.back.scale = Vec3::one() * 1.02; - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); + 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(-6.0, -0.25 - foot * 1.2, 5.0 + foot * -3.0); + next.l_hand.offset = Vec3::new( + -skeleton_attr.hand.0, + skeleton_attr.hand.1 - foot * 1.2, + 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(6.0, -0.25 + foot * 1.2, 5.0 + foot * 3.0); + next.r_hand.offset = Vec3::new( + skeleton_attr.hand.0, + skeleton_attr.hand.1 + foot * 1.2, + 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(-3.4, 6.0 + foot * 1.2, 0.0 + foot * 6.5); + next.l_foot.offset = Vec3::new( + -skeleton_attr.foot.0, + 4.0 + skeleton_attr.foot.1 + foot * 1.2, + -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(3.4, 6.0 - foot * 1.2, 0.0 + foot * -6.5); + next.r_foot.offset = Vec3::new( + skeleton_attr.foot.0, + 4.0 + skeleton_attr.foot.1 - foot * 1.2, + -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(-5.0, -1.0, 4.7); + next.l_shoulder.offset = Vec3::new( + -skeleton_attr.shoulder.0, + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.2, + ); next.l_shoulder.ori = Quaternion::rotation_x(short * 0.15); next.l_shoulder.scale = Vec3::one() * 1.1; - next.r_shoulder.offset = Vec3::new(5.0, -1.0, 4.7); + next.r_shoulder.offset = Vec3::new( + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.0, + skeleton_attr.shoulder.2, + ); next.r_shoulder.ori = Quaternion::rotation_x(short * -0.15); next.r_shoulder.scale = Vec3::one() * 1.1; - next.glider.offset = Vec3::new(0.0, 5.0, 0.0); - next.glider.ori = Quaternion::rotation_y(0.0); + next.glider.offset = Vec3::new(0.0, 0.0, 10.0); next.glider.scale = Vec3::one() * 0.0; - next.main.offset = Vec3::new( - -7.0 + skeleton_attr.weapon_x, - -5.0 + skeleton_attr.weapon_y, - 15.0, - ); + next.main.offset = Vec3::new(-7.0, -5.0, 15.0); next.main.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57 + short * 0.25); next.main.scale = Vec3::one(); - next.second.offset = Vec3::new( - 0.0 + skeleton_attr.weapon_x, - 0.0 + skeleton_attr.weapon_y, - 0.0, - ); - next.second.ori = Quaternion::rotation_y(0.0); next.second.scale = Vec3::one() * 0.0; - next.lantern.offset = Vec3::new(-5.0, 2.5, 5.5); + next.lantern.offset = Vec3::new( + skeleton_attr.lantern.0, + skeleton_attr.lantern.1, + skeleton_attr.lantern.2, + ); next.lantern.ori = Quaternion::rotation_x(0.0) * Quaternion::rotation_y(0.0); next.lantern.scale = Vec3::one() * 0.65; @@ -122,16 +143,10 @@ impl Animation for SwimAnimation { Quaternion::rotation_x(speed * -0.190 * wave_stop * 1.05) * Quaternion::rotation_y(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.control.offset = Vec3::new(0.0, 0.0, 0.0); - next.control.ori = Quaternion::rotation_x(0.0); next.control.scale = Vec3::one(); - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); next diff --git a/voxygen/src/anim/character/wield.rs b/voxygen/src/anim/character/wield.rs index 403796c601..4458f2df08 100644 --- a/voxygen/src/anim/character/wield.rs +++ b/voxygen/src/anim/character/wield.rs @@ -102,7 +102,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_y(0.5) * Quaternion::rotation_z(-0.27); next.r_hand.scale = Vec3::one() * 1.05; - next.main.offset = Vec3::new(9.2, 8.4, 13.2); + next.main.offset = Vec3::new(12.0, 8.4, 13.2); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(3.14 + 0.3) * Quaternion::rotation_z(0.9); @@ -121,11 +121,7 @@ impl Animation for WieldAnimation { next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, - ); + next.main.offset = Vec3::new(-6.0, 4.5, 0.0); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0); @@ -150,27 +146,9 @@ impl Animation for WieldAnimation { next.control.offset = Vec3::new(-7.0, 6.0, 6.0); next.control.ori = Quaternion::rotation_x(ultra_slow * 0.2) - * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(ultra_slow_cos * 0.1); next.control.scale = Vec3::one(); }, - Some(ToolKind::Dagger(_)) => { - next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); - next.l_hand.ori = Quaternion::rotation_x(-0.3); - next.l_hand.scale = Vec3::one() * 1.01; - next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); - next.r_hand.ori = Quaternion::rotation_x(-0.3); - next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - -6.0 + skeleton_attr.weapon_x, - 4.5 + skeleton_attr.weapon_y, - 0.0, - ); - next.main.ori = Quaternion::rotation_x(-0.3) - * Quaternion::rotation_y(0.0) - * Quaternion::rotation_z(0.0); - next.main.scale = Vec3::one(); - }, Some(ToolKind::Debug(_)) => { next.l_hand.offset = Vec3::new(-7.0, 4.0, 3.0); next.l_hand.ori = Quaternion::rotation_x(1.27 + wave * 0.25) @@ -182,11 +160,7 @@ impl Animation for WieldAnimation { * Quaternion::rotation_y(0.0) * Quaternion::rotation_z(-0.3); next.r_hand.scale = Vec3::one() * 1.01; - next.main.offset = Vec3::new( - 5.0 + skeleton_attr.weapon_x, - 8.75 + skeleton_attr.weapon_y, - -2.0, - ); + next.main.offset = Vec3::new(5.0, 8.75, -2.0); next.main.ori = Quaternion::rotation_x(-0.3) * Quaternion::rotation_y(-1.27) * Quaternion::rotation_z(wave * -0.25); @@ -227,29 +201,33 @@ impl Animation for WieldAnimation { * 0.1, ); next.head.offset = Vec3::new( - 0.0 + skeleton_attr.neck_right, - -2.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 14.0 + ultra_slow * 0.1, + 0.0, + -2.0 + skeleton_attr.head.0, + skeleton_attr.head.1 + ultra_slow * 0.1, ); next.head.ori = Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y.abs()); next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0 + slow_cos * 0.5, 0.0, 7.0 + ultra_slow * 0.5); + next.chest.offset = Vec3::new( + 0.0 + slow_cos * 0.5, + skeleton_attr.chest.0, + skeleton_attr.chest.1 + ultra_slow * 0.5, + ); 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, 0.0, -2.0); + next.belt.offset = Vec3::new(0.0, skeleton_attr.belt.0, skeleton_attr.belt.1); next.belt.ori = Quaternion::rotation_y(ultra_slow_cos * 0.03) * Quaternion::rotation_z(0.22); next.belt.scale = Vec3::one() * 1.02; - next.back.offset = Vec3::new(0.0, -2.8, 7.25); + next.back.offset = Vec3::new(0.0, skeleton_attr.back.0, skeleton_attr.back.1); next.back.ori = Quaternion::rotation_x(-0.2); next.back.scale = Vec3::one() * 1.02; - next.shorts.offset = Vec3::new(0.0, 0.0, -5.0); + 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(); @@ -262,15 +240,10 @@ impl Animation for WieldAnimation { next.r_foot.scale = Vec3::one(); next.torso.offset = Vec3::new(0.0, 0.0, 0.0) * skeleton_attr.scaler; - next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; - next.l_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.l_control.ori = Quaternion::rotation_x(0.0); next.l_control.scale = Vec3::one(); - next.r_control.offset = Vec3::new(0.0, 0.0, 0.0); - next.r_control.ori = Quaternion::rotation_x(0.0); next.r_control.scale = Vec3::one(); } diff --git a/voxygen/src/anim/mod.rs b/voxygen/src/anim/mod.rs index 834e021a27..60e67508c6 100644 --- a/voxygen/src/anim/mod.rs +++ b/voxygen/src/anim/mod.rs @@ -13,7 +13,6 @@ pub mod quadruped_medium; pub mod quadruped_small; use crate::render::FigureBoneData; -use common::comp::{self, item::tool::ToolKind}; use vek::*; #[derive(Copy, Clone, Debug)] @@ -63,139 +62,6 @@ pub trait Skeleton: Send + Sync + 'static { // rustc complains that `SkeletonAttr` fields are never read. // Pls remove when they are. -#[allow(dead_code)] -pub struct SkeletonAttr { - scaler: f32, - head_scale: f32, - neck_height: f32, - neck_forward: f32, - neck_right: f32, - weapon_x: f32, - weapon_y: f32, -} - -impl SkeletonAttr { - pub fn calculate_scale(body: &comp::humanoid::Body) -> f32 { - use comp::humanoid::{BodyType::*, Race::*}; - match (body.race, body.body_type) { - (Orc, Male) => 0.95, - (Orc, Female) => 0.8, - (Human, Male) => 0.8, - (Human, Female) => 0.75, - (Elf, Male) => 0.85, - (Elf, Female) => 0.8, - (Dwarf, Male) => 0.1, - (Dwarf, Female) => 0.65, - (Undead, Male) => 0.8, - (Undead, Female) => 0.75, - (Danari, Male) => 0.58, - (Danari, Female) => 0.58, - } - } -} - -impl Default for SkeletonAttr { - fn default() -> Self { - Self { - scaler: 1.0, - head_scale: 1.0, - neck_height: 1.0, - neck_forward: 1.0, - neck_right: 1.0, - weapon_x: 1.0, - weapon_y: 1.0, - } - } -} - -impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr { - fn from(body: &'a comp::humanoid::Body) -> Self { - use comp::humanoid::{BodyType::*, Race::*}; - Self { - scaler: SkeletonAttr::calculate_scale(body), - head_scale: match (body.race, body.body_type) { - (Orc, Male) => 0.9, - (Orc, Female) => 1.0, - (Human, Male) => 1.0, - (Human, Female) => 1.0, - (Elf, Male) => 0.95, - (Elf, Female) => 1.0, - (Dwarf, Male) => 1.0, - (Dwarf, Female) => 1.0, - (Undead, Male) => 1.0, - (Undead, Female) => 1.0, - (Danari, Male) => 1.15, - (Danari, Female) => 1.15, - }, - neck_height: match (body.race, body.body_type) { - (Orc, Male) => 0.0, - (Orc, Female) => 0.0, - (Human, Male) => 0.0, - (Human, Female) => 0.0, - (Elf, Male) => 0.0, - (Elf, Female) => 0.0, - (Dwarf, Male) => 0.0, - (Dwarf, Female) => 0.0, - (Undead, Male) => 0.5, - (Undead, Female) => 0.5, - (Danari, Male) => 0.5, - (Danari, Female) => 0.5, - }, - neck_forward: match (body.race, body.body_type) { - (Orc, Male) => 0.0, - (Orc, Female) => 0.0, - (Human, Male) => 0.5, - (Human, Female) => 0.0, - (Elf, Male) => 0.5, - (Elf, Female) => 0.5, - (Dwarf, Male) => 0.5, - (Dwarf, Female) => 0.0, - (Undead, Male) => 0.5, - (Undead, Female) => 0.5, - (Danari, Male) => 0.0, - (Danari, Female) => 0.0, - }, - neck_right: match (body.race, body.body_type) { - (Orc, Male) => 0.0, - (Orc, Female) => 0.0, - (Human, Male) => 0.0, - (Human, Female) => 0.0, - (Elf, Male) => 0.0, - (Elf, Female) => 0.0, - (Dwarf, Male) => 0.0, - (Dwarf, Female) => 0.0, - (Undead, Male) => 0.0, - (Undead, Female) => 0.0, - (Danari, Male) => 0.0, - (Danari, Female) => 0.0, - }, - weapon_x: match ToolKind::Empty { - // TODO: Inventory - ToolKind::Sword(_) => 0.0, - ToolKind::Axe(_) => 3.0, - ToolKind::Hammer(_) => 0.0, - ToolKind::Shield(_) => 3.0, - ToolKind::Staff(_) => 3.0, - ToolKind::Bow(_) => 0.0, - ToolKind::Dagger(_) => 0.0, - ToolKind::Debug(_) => 0.0, - ToolKind::Empty => 0.0, - }, - weapon_y: match ToolKind::Empty { - // TODO: Inventory - ToolKind::Sword(_) => -1.25, - ToolKind::Axe(_) => 0.0, - ToolKind::Hammer(_) => -2.0, - ToolKind::Shield(_) => 0.0, - ToolKind::Staff(_) => 0.0, - ToolKind::Bow(_) => -2.0, - ToolKind::Dagger(_) => -2.0, - ToolKind::Debug(_) => 0.0, - ToolKind::Empty => 0.0, - }, - } - } -} pub trait Animation { type Skeleton: Skeleton; diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 5cd3bf01c2..d5cc47a654 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -2645,7 +2645,10 @@ pub fn mesh_object( use object::Body; let (name, offset) = match obj { - Body::Arrow => ("weapon.projectile.simple-arrow", Vec3::new(-5.5, -5.5, 0.0)), + Body::Arrow => ( + "weapon.projectile.simple-arrow", + Vec3::new(-0.5, -6.0, -1.5), + ), Body::Bomb => ("object.bomb", Vec3::new(-5.5, -5.5, 0.0)), Body::Scarecrow => ("object.scarecrow", Vec3::new(-9.5, -4.0, 0.0)), Body::Cauldron => ("object.cauldron", Vec3::new(-10.0, -10.0, 0.0)),