full bipedsmall armor swaps

This commit is contained in:
jshipsey 2021-02-13 01:06:43 -05:00
parent df70976ff5
commit 57d5e90ddd
66 changed files with 669 additions and 1210 deletions

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Adlet",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Head("AdletBow"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Adlet",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Head("AdletSpear"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Adlet",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Belt("Adlet"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Gnarling",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Head("Gnarling"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Gnarling",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Belt("Gnarling"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Haniwa",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Head("Haniwa"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Kappa",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Head("Kappa"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Kappa",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Belt("Kappa"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Myrmidon",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Head("Myrmidon"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Myrmidon",
description: "Ceremonial attire used by members..",
kind: Armor((
kind: Belt("Myrmidon"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Sahagin",
description: "Ceremonial attire used by members.",
kind: Armor((
kind: Head("Sahagin"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -0,0 +1,12 @@
ItemDef(
name: "Sahagin",
description: "Ceremonial attire used by members..",
kind: Armor((
kind: Belt("Sahagin"),
stats: (
protection: Normal(2.0),
poise_resilience: Normal(1.0),
),
)),
quality: Low,
)

View File

@ -1,10 +1,10 @@
(( ((
default: ( default: (
left: ( left: (
vox_spec: ("armor.foot.foot_right_none", (-1.5, -2.0, -4.0)), vox_spec: ("armor.empty", (0.0, 0.0, 0.0)),
), ),
right: ( right: (
vox_spec: ("armor.foot.foot_right_none", (-1.5, -2.0, -4.0)), vox_spec: ("armor.empty", (0.0, 0.0, 0.0)),
) )
), ),
map: { map: {

View File

@ -1,10 +1,10 @@
(( ((
default: ( default: (
left: ( left: (
vox_spec: ("armor.hand.hand_reft_none", (-3.0, -2.0, -5.0)), vox_spec: ("armor.empty", (0.0, 0.0, 0.0)),
), ),
right: ( right: (
vox_spec: ("armor.hand.hand_right_none", (-3.0, -2.0, -5.0)), vox_spec: ("armor.empty", (0.0, 0.0, 0.0)),
) )
), ),
map: { map: {

View File

@ -0,0 +1,40 @@
((
default: (
vox_spec: ("armor.empty", (0.0, 0.0, 0.0)),
),
map: {
"Gnome": (
vox_spec: ("npc.gnome.male.head", (-8.0, -6.5, -12.0)),
),
"Sahagin": (
vox_spec: ("npc.sahagin.male.head", (-2.5, 0.0, -4.5)),
),
"AdletSpear": (
vox_spec: ("npc.adlet.male.spear.head", (-7.0, -4.5, -6.0)),
),
"AdletBow": (
vox_spec: ("npc.adlet.male.bow.head", (-7.0, -4.5, -6.0)),
),
"Gnarling": (
vox_spec: ("npc.gnarling.male.head", (-6.5, -5.5, -4.5)),
),
"Mandragora": (
vox_spec: ("npc.mandragora.male.head", (0.0, 0.0, 0.0)),
),
"Kappa": (
vox_spec: ("npc.kappa.male.chest", (-4.5, -5.0, -4.5)),
),
"Cactid": (
vox_spec: ("npc.cactid.male.head", (-8.0, -4.0, -7.5)),
),
"Gnoll": (
vox_spec: ("npc.gnoll.male.head", (-4.0, -1.5, -3.0)),
),
"Haniwa": (
vox_spec: ("npc.haniwa.male.head", (-5.5, -5.5, -5.5)),
),
"Myrmidon": (
vox_spec: ("npc.myrmidon.male.head", (-4.5, -7.0, -6.5)),
),
},
))

View File

@ -1,6 +1,6 @@
(( ((
default: ( default: (
vox_spec: ("armor.pants.pants_none", (-5.0, -3.5, 1.0)), vox_spec: ("armor.empty", (0.0, 0.0, 0.0)),
), ),
map: { map: {
"Gnome": ( "Gnome": (

View File

@ -0,0 +1,25 @@
((
default: (
vox_spec: ("armor.empty", (0.0, 0.0, 0.0)),
),
map: {
"Sahagin": (
vox_spec: ("npc.sahagin.male.tail", (-1.5, -13.0, -5.0)),
),
"Adlet": (
vox_spec: ("npc.adlet.male.tail", (-1.0, -5.0, -1.0)),
),
"Gnarling": (
vox_spec: ("npc.gnarling.male.tail", (-1.5, -13.0, -3.0)),
),
"Kappa": (
vox_spec: ("npc.kappa.male.tail", (-2.5, -10.0, -5.0)),
),
"Gnoll": (
vox_spec: ("npc.gnoll.male.tail", (-1.0, -11.0, -1.0)),
),
"Myrmidon": (
vox_spec: ("npc.myrmidon.male.tail", (-2.5, -7.0, -2.5)),
),
},
))

View File

@ -1,362 +0,0 @@
({
(Gnome, Male): (
head: (
offset: (-8.0, -6.5, -12.0),
central: ("npc.gnome.male.head"),
),
chest: (
offset: (-5.0, -3.0, -2.5),
central: ("npc.gnome.male.chest"),
),
shorts: (
offset: (-4.0, -3.5, -2.5),
central: ("npc.gnome.male.shorts"),
),
tail: (
offset: (-0.5, -5.0, -2.5),
central: ("armor.empty"),
),
),
(Gnome, Female): (
head: (
offset: (-8.0, -6.5, -12.0),
central: ("npc.gnome.male.head"),
),
chest: (
offset: (-5.0, -3.0, -2.5),
central: ("npc.gnome.male.chest"),
),
shorts: (
offset: (-4.0, -3.5, -2.5),
central: ("npc.gnome.male.shorts"),
),
tail: (
offset: (-0.5, -5.0, -2.5),
central: ("armor.empty"),
),
),
(Sahagin, Male): (
head: (
offset: (-2.5, 0.0, -4.5),
central: ("npc.sahagin.male.head"),
),
chest: (
offset: (-4.5, -8.0, -8.0),
central: ("npc.sahagin.male.chest"),
),
shorts: (
offset: (-2.5, -3.5, -2.0),
central: ("npc.sahagin.male.shorts"),
),
tail: (
offset: (-1.5, -13.0, -5.0),
central: ("npc.sahagin.male.tail"),
),
),
(Sahagin, Female): (
head: (
offset: (-2.5, 0.0, -4.5),
central: ("npc.sahagin.male.head"),
),
chest: (
offset: (-4.5, -8.0, -8.0),
central: ("npc.sahagin.male.chest"),
),
shorts: (
offset: (-2.5, -3.5, -2.0),
central: ("npc.sahagin.male.shorts"),
),
tail: (
offset: (-1.5, -13.0, -5.0),
central: ("npc.sahagin.male.tail"),
),
),
(Adlet, Male): (
head: (
offset: (-7.0, -4.5, -6.0),
central: ("npc.adlet.male.head"),
),
chest: (
offset: (-5.0, -3.5, -2.0),
central: ("npc.adlet.male.chest"),
),
shorts: (
offset: (-5.0, -4.5, -3.0),
central: ("npc.adlet.male.shorts"),
),
tail: (
offset: (-1.0, -5.0, -1.0),
central: ("npc.adlet.male.tail"),
),
),
(Adlet, Female): (
head: (
offset: (-7.0, -4.5, -6.0),
central: ("npc.adlet.male.head"),
),
chest: (
offset: (-5.0, -3.5, -2.0),
central: ("npc.adlet.male.chest"),
),
shorts: (
offset: (-5.0, -4.5, -3.0),
central: ("npc.adlet.male.shorts"),
),
tail: (
offset: (-1.0, -5.0, -1.0),
central: ("npc.adlet.male.tail"),
),
),
(Gnarling, Male): (
head: (
offset: (-6.5, -5.5, -4.5),
central: ("npc.gnarling.male.head"),
),
chest: (
offset: (-4.5, -3.5, -2.5),
central: ("npc.gnarling.male.chest"),
),
shorts: (
offset: (-3.5, -3.0, -2.5),
central: ("npc.gnarling.male.shorts"),
),
tail: (
offset: (-1.5, -13.0, -3.0),
central: ("npc.gnarling.male.tail"),
),
),
(Gnarling, Female): (
head: (
offset: (-6.5, -5.5, -4.5),
central: ("npc.gnarling.male.head"),
),
chest: (
offset: (-4.5, -3.5, -2.5),
central: ("npc.gnarling.male.chest"),
),
shorts: (
offset: (-3.5, -3.0, -2.5),
central: ("npc.gnarling.male.shorts"),
),
tail: (
offset: (-1.5, -13.0, -3.0),
central: ("npc.gnarling.male.tail"),
),
),
(Mandragora, Male): (
head: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
),
chest: (
offset: (-11.0, -11.0, -6.5),
central: ("npc.mandragora.male.chest"),
),
shorts: (
offset: (-3.0, -3.0, -1.0),
central: ("npc.mandragora.male.shorts"),
),
tail: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
),
),
(Mandragora, Female): (
head: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
),
chest: (
offset: (-11.0, -11.0, -6.5),
central: ("npc.mandragora.male.chest"),
),
shorts: (
offset: (-3.0, -3.0, -1.0),
central: ("npc.mandragora.male.shorts"),
),
tail: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
),
),
(Kappa, Male): (
head: (
offset: (-4.5, -5.0, -4.5),
central: ("npc.kappa.male.head"),
),
chest: (
offset: (-6.5, -8.0, -7.0),
central: ("npc.kappa.male.chest"),
),
shorts: (
offset: (-3.5, -4.0, -1.5),
central: ("npc.kappa.male.shorts"),
),
tail: (
offset: (-2.5, -10.0, -5.0),
central: ("npc.kappa.male.tail"),
),
),
(Kappa, Female): (
head: (
offset: (-4.5, -5.0, -4.5),
central: ("npc.kappa.male.head"),
),
chest: (
offset: (-6.5, -8.0, -7.0),
central: ("npc.kappa.male.chest"),
),
shorts: (
offset: (-3.5, -4.0, -1.5),
central: ("npc.kappa.male.shorts"),
),
tail: (
offset: (-2.5, -10.0, -5.0),
central: ("npc.kappa.male.tail"),
),
),
(Cactid, Male): (
head: (
offset: (-8.0, -4.0, -7.5),
central: ("npc.cactid.male.head"),
),
chest: (
offset: (-3.0, -3.0, -2.5),
central: ("npc.cactid.male.chest"),
),
shorts: (
offset: (-3.0, -2.0, -1.0),
central: ("npc.cactid.male.shorts"),
),
tail: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
),
),
(Cactid, Female): (
head: (
offset: (-8.0, -4.0, -7.5),
central: ("npc.cactid.male.head"),
),
chest: (
offset: (-3.0, -3.0, -2.5),
central: ("npc.cactid.male.chest"),
),
shorts: (
offset: (-3.0, -2.0, -1.0),
central: ("npc.cactid.male.shorts"),
),
tail: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
),
),
(Gnoll, Male): (
head: (
offset: (-4.0, -1.5, -3.0),
central: ("npc.gnoll.male.head"),
),
chest: (
offset: (-5.0, -4.5, -6.0),
central: ("npc.gnoll.male.chest"),
),
shorts: (
offset: (-5.0, -4.0, -3.0),
central: ("npc.gnoll.male.shorts"),
),
tail: (
offset: (-1.0, -11.0, -1.0),
central: ("npc.gnoll.male.tail"),
),
),
(Gnoll, Female): (
head: (
offset: (-4.0, -1.5, -3.0),
central: ("npc.gnoll.male.head"),
),
chest: (
offset: (-5.0, -4.5, -6.0),
central: ("npc.gnoll.male.chest"),
),
shorts: (
offset: (-5.0, -4.0, -3.0),
central: ("npc.gnoll.male.shorts"),
),
tail: (
offset: (-1.0, -11.0, -1.0),
central: ("npc.gnoll.male.tail"),
),
),
(Haniwa, Male): (
head: (
offset: (-5.5, -5.5, -5.5),
central: ("npc.haniwa.male.head"),
),
chest: (
offset: (-6.5, -4.0, -3.0),
central: ("npc.haniwa.male.chest"),
),
shorts: (
offset: (-4.5, -4.5, -1.5),
central: ("npc.haniwa.male.shorts"),
),
tail: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
),
),
(Haniwa, Female): (
head: (
offset: (-5.5, -5.5, -5.5),
central: ("npc.haniwa.male.head"),
),
chest: (
offset: (-6.5, -4.0, -3.0),
central: ("npc.haniwa.male.chest"),
),
shorts: (
offset: (-4.5, -4.5, -1.5),
central: ("npc.haniwa.male.shorts"),
),
tail: (
offset: (0.0, 0.0, 0.0),
central: ("armor.empty"),
),
),
(Myrmidon, Male): (
head: (
offset: (-4.5, -7.0, -6.5),
central: ("npc.myrmidon.male.head"),
),
chest: (
offset: (-5.5, -4.0, -3.0),
central: ("npc.myrmidon.male.chest"),
),
shorts: (
offset: (-2.5, -3.5, -2.0),
central: ("npc.myrmidon.male.shorts"),
),
tail: (
offset: (-2.5, -7.0, -2.5),
central: ("npc.myrmidon.male.tail"),
),
),
(Myrmidon, Female): (
head: (
offset: (-4.5, -7.0, -6.5),
central: ("npc.myrmidon.male.head"),
),
chest: (
offset: (-5.5, -4.0, -3.0),
central: ("npc.myrmidon.male.chest"),
),
shorts: (
offset: (-2.5, -3.5, -2.0),
central: ("npc.myrmidon.male.shorts"),
),
tail: (
offset: (-2.5, -7.0, -2.5),
central: ("npc.myrmidon.male.tail"),
),
),
})

View File

@ -1,202 +0,0 @@
({
(Gnome, Male): (
foot_l: (
offset: (-1.5, -2.0, -4.0),
lateral: ("npc.gnome.male.foot_l"),
),
foot_r: (
offset: (-1.5, -2.0, -4.0),
lateral: ("npc.gnome.male.foot_r"),
),
),
(Gnome, Female): (
foot_l: (
offset: (-1.5, -2.0, -4.0),
lateral: ("npc.gnome.male.foot_l"),
),
foot_r: (
offset: (-1.5, -2.0, -4.0),
lateral: ("npc.gnome.male.foot_r"),
),
),
(Sahagin, Male): (
foot_l: (
offset: (-2.5, -2.0, -8.0),
lateral: ("npc.sahagin.male.foot_l"),
),
foot_r: (
offset: (-2.5, -2.0, -8.0),
lateral: ("npc.sahagin.male.foot_r"),
),
),
(Sahagin, Female): (
foot_l: (
offset: (-2.5, -2.0, -8.0),
lateral: ("npc.sahagin.male.foot_l"),
),
foot_r: (
offset: (-2.5, -2.0, -8.0),
lateral: ("npc.sahagin.male.foot_r"),
),
),
(Adlet, Male): (
foot_l: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.adlet.male.foot_l"),
),
foot_r: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.adlet.male.foot_r"),
),
),
(Adlet, Female): (
foot_l: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.adlet.male.foot_l"),
),
foot_r: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.adlet.male.foot_r"),
),
),
(Gnarling, Male): (
foot_l: (
offset: (-1.0, -2.0, -5.0),
lateral: ("npc.gnarling.male.foot_l"),
),
foot_r: (
offset: (-1.0, -2.0, -5.0),
lateral: ("npc.gnarling.male.foot_r"),
),
),
(Gnarling, Female): (
foot_l: (
offset: (-1.0, -2.0, -5.0),
lateral: ("npc.gnarling.male.foot_l"),
),
foot_r: (
offset: (-1.0, -2.0, -5.0),
lateral: ("npc.gnarling.male.foot_r"),
),
),
(Mandragora, Male): (
foot_l: (
offset: (-1.0, -1.5, -4.0),
lateral: ("npc.mandragora.male.foot_l"),
),
foot_r: (
offset: (-1.0, -1.5, -4.0),
lateral: ("npc.mandragora.male.foot_r"),
),
),
(Mandragora, Female): (
foot_l: (
offset: (-1.0, -1.5, -4.0),
lateral: ("npc.mandragora.male.foot_l"),
),
foot_r: (
offset: (-1.0, -1.5, -4.0),
lateral: ("npc.mandragora.male.foot_r"),
),
),
(Kappa, Male): (
foot_l: (
offset: (-2.5, -3.0, -9.0),
lateral: ("npc.kappa.male.foot_l"),
),
foot_r: (
offset: (-2.5, -3.0, -9.0),
lateral: ("npc.kappa.male.foot_r"),
),
),
(Kappa, Female): (
foot_l: (
offset: (-2.5, -3.0, -9.0),
lateral: ("npc.kappa.male.foot_l"),
),
foot_r: (
offset: (-2.5, -3.0, -9.0),
lateral: ("npc.kappa.male.foot_r"),
),
),
(Cactid, Male): (
foot_l: (
offset: (-1.5, -2.0, -5.0),
lateral: ("npc.cactid.male.foot_l"),
),
foot_r: (
offset: (-1.5, -2.0, -5.0),
lateral: ("npc.cactid.male.foot_r"),
),
),
(Cactid, Female): (
foot_l: (
offset: (-1.5, -2.0, -5.0),
lateral: ("npc.cactid.male.foot_l"),
),
foot_r: (
offset: (-1.5, -2.0, -5.0),
lateral: ("npc.cactid.male.foot_r"),
),
),
(Gnoll, Male): (
foot_l: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.gnoll.male.foot_l"),
),
foot_r: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.gnoll.male.foot_r"),
),
),
(Gnoll, Female): (
foot_l: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.gnoll.male.foot_l"),
),
foot_r: (
offset: (-1.5, -3.0, -7.0),
lateral: ("npc.gnoll.male.foot_r"),
),
),
(Haniwa, Male): (
foot_l: (
offset: (-2.0, -2.5, -8.0),
lateral: ("npc.haniwa.male.foot_l"),
),
foot_r: (
offset: (-2.0, -2.5, -8.0),
lateral: ("npc.haniwa.male.foot_r"),
),
),
(Haniwa, Female): (
foot_l: (
offset: (-2.0, -2.5, -8.0),
lateral: ("npc.haniwa.male.foot_l"),
),
foot_r: (
offset: (-2.0, -2.5, -8.0),
lateral: ("npc.haniwa.male.foot_r"),
),
),
(Myrmidon, Male): (
foot_l: (
offset: (-1.5, -2.5, -7.0),
lateral: ("npc.myrmidon.male.foot_l"),
),
foot_r: (
offset: (-1.5, -2.5, -7.0),
lateral: ("npc.myrmidon.male.foot_r"),
),
),
(Myrmidon, Female): (
foot_l: (
offset: (-1.5, -2.5, -7.0),
lateral: ("npc.myrmidon.male.foot_l"),
),
foot_r: (
offset: (-1.5, -2.5, -7.0),
lateral: ("npc.myrmidon.male.foot_r"),
),
),
})

Binary file not shown.

View File

@ -289,32 +289,44 @@ impl LoadoutBuilder {
Adlet => match active_tool_kind { Adlet => match active_tool_kind {
Some(ToolKind::Bow) => LoadoutBuilder::new() Some(ToolKind::Bow) => LoadoutBuilder::new()
.active_item(active_item) .active_item(active_item)
.head(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.adlet.head.adlet_bow",
)))
.hands(Some(Item::new_from_asset_expect( .hands(Some(Item::new_from_asset_expect(
"common.items.npc_armor.hand.adlet.adlet_bow", "common.items.npc_armor.biped_small.adlet.hand.adlet_bow",
))) )))
.feet(Some(Item::new_from_asset_expect( .feet(Some(Item::new_from_asset_expect(
"common.items.npc_armor.foot.adlet.adlet", "common.items.npc_armor.biped_small.adlet.foot.adlet",
))) )))
.chest(Some(Item::new_from_asset_expect( .chest(Some(Item::new_from_asset_expect(
"common.items.npc_armor.chest.adlet.adlet_bow", "common.items.npc_armor.biped_small.adlet.chest.adlet_bow",
))) )))
.pants(Some(Item::new_from_asset_expect( .pants(Some(Item::new_from_asset_expect(
"common.items.npc_armor.pants.adlet.adlet_bow", "common.items.npc_armor.biped_small.adlet.pants.adlet_bow",
)))
.belt(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.adlet.tail.adlet",
))) )))
.build(), .build(),
Some(ToolKind::Spear) | Some(ToolKind::Staff) => LoadoutBuilder::new() Some(ToolKind::Spear) | Some(ToolKind::Staff) => LoadoutBuilder::new()
.active_item(active_item) .active_item(active_item)
.head(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.adlet.head.adlet_spear",
)))
.hands(Some(Item::new_from_asset_expect( .hands(Some(Item::new_from_asset_expect(
"common.items.npc_armor.hand.adlet.adlet_spear", "common.items.npc_armor.biped_small.adlet.hand.adlet_spear",
))) )))
.feet(Some(Item::new_from_asset_expect( .feet(Some(Item::new_from_asset_expect(
"common.items.npc_armor.foot.adlet.adlet", "common.items.npc_armor.biped_small.adlet.foot.adlet",
))) )))
.chest(Some(Item::new_from_asset_expect( .chest(Some(Item::new_from_asset_expect(
"common.items.npc_armor.chest.adlet.adlet_spear", "common.items.npc_armor.biped_small.adlet.chest.adlet_spear",
))) )))
.pants(Some(Item::new_from_asset_expect( .pants(Some(Item::new_from_asset_expect(
"common.items.npc_armor.pants.adlet.adlet_spear", "common.items.npc_armor.biped_small.adlet.pants.adlet_spear",
)))
.belt(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.adlet.tail.adlet",
))) )))
.build(), .build(),
_ => LoadoutBuilder::new().active_item(active_item).build(), _ => LoadoutBuilder::new().active_item(active_item).build(),
@ -322,94 +334,124 @@ impl LoadoutBuilder {
Gnarling => match active_tool_kind { Gnarling => match active_tool_kind {
Some(ToolKind::Bow) => LoadoutBuilder::new() Some(ToolKind::Bow) => LoadoutBuilder::new()
.active_item(active_item) .active_item(active_item)
.head(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.gnarling.head.gnarling",
)))
.feet(Some(Item::new_from_asset_expect( .feet(Some(Item::new_from_asset_expect(
"common.items.npc_armor.foot.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.foot.gnarling",
))) )))
.hands(Some(Item::new_from_asset_expect( .hands(Some(Item::new_from_asset_expect(
"common.items.npc_armor.hand.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.hand.gnarling",
))) )))
.chest(Some(Item::new_from_asset_expect( .chest(Some(Item::new_from_asset_expect(
"common.items.npc_armor.chest.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.chest.gnarling",
))) )))
.pants(Some(Item::new_from_asset_expect( .pants(Some(Item::new_from_asset_expect(
"common.items.npc_armor.pants.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.pants.gnarling",
)))
.belt(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.gnarling.tail.gnarling",
))) )))
.build(), .build(),
Some(ToolKind::Staff) => LoadoutBuilder::new() Some(ToolKind::Staff) => LoadoutBuilder::new()
.active_item(active_item) .active_item(active_item)
.head(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.gnarling.head.gnarling",
)))
.feet(Some(Item::new_from_asset_expect( .feet(Some(Item::new_from_asset_expect(
"common.items.npc_armor.foot.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.foot.gnarling",
))) )))
.hands(Some(Item::new_from_asset_expect( .hands(Some(Item::new_from_asset_expect(
"common.items.npc_armor.hand.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.hand.gnarling",
))) )))
.chest(Some(Item::new_from_asset_expect( .chest(Some(Item::new_from_asset_expect(
"common.items.npc_armor.chest.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.chest.gnarling",
))) )))
.pants(Some(Item::new_from_asset_expect( .pants(Some(Item::new_from_asset_expect(
"common.items.npc_armor.pants.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.pants.gnarling",
)))
.belt(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.gnarling.tail.gnarling",
))) )))
.build(), .build(),
Some(ToolKind::Spear) => LoadoutBuilder::new() Some(ToolKind::Spear) => LoadoutBuilder::new()
.active_item(active_item) .active_item(active_item)
.head(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.gnarling.head.gnarling",
)))
.feet(Some(Item::new_from_asset_expect( .feet(Some(Item::new_from_asset_expect(
"common.items.npc_armor.foot.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.foot.gnarling",
))) )))
.hands(Some(Item::new_from_asset_expect( .hands(Some(Item::new_from_asset_expect(
"common.items.npc_armor.hand.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.hand.gnarling",
))) )))
.chest(Some(Item::new_from_asset_expect( .chest(Some(Item::new_from_asset_expect(
"common.items.npc_armor.chest.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.chest.gnarling",
))) )))
.pants(Some(Item::new_from_asset_expect( .pants(Some(Item::new_from_asset_expect(
"common.items.npc_armor.pants.gnarling.gnarling", "common.items.npc_armor.biped_small.gnarling.pants.gnarling",
))) )))
.build(), .build(),
_ => LoadoutBuilder::new().active_item(active_item).build(), _ => LoadoutBuilder::new().active_item(active_item).build(),
}, },
Sahagin => LoadoutBuilder::new() Sahagin => LoadoutBuilder::new()
.active_item(active_item) .active_item(active_item)
.hands(Some(Item::new_from_asset_expect( .head(Some(Item::new_from_asset_expect(
"common.items.npc_armor.hand.sahagin.sahagin", "common.items.npc_armor.biped_small.sahagin.head.sahagin",
))) )))
.feet(Some(Item::new_from_asset_expect( .feet(Some(Item::new_from_asset_expect(
"common.items.npc_armor.foot.sahagin.sahagin", "common.items.npc_armor.biped_small.sahagin.foot.sahagin",
)))
.hands(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.sahagin.hand.sahagin",
))) )))
.chest(Some(Item::new_from_asset_expect( .chest(Some(Item::new_from_asset_expect(
"common.items.npc_armor.chest.sahagin.sahagin", "common.items.npc_armor.biped_small.sahagin.chest.sahagin",
))) )))
.pants(Some(Item::new_from_asset_expect( .pants(Some(Item::new_from_asset_expect(
"common.items.npc_armor.pants.sahagin.sahagin", "common.items.npc_armor.biped_small.sahagin.pants.sahagin",
)))
.belt(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.sahagin.belt.sahagin",
))) )))
.build(), .build(),
Haniwa => LoadoutBuilder::new() Haniwa => LoadoutBuilder::new()
.active_item(active_item) .active_item(active_item)
.hands(Some(Item::new_from_asset_expect( .head(Some(Item::new_from_asset_expect(
"common.items.npc_armor.hand.haniwa.haniwa", "common.items.npc_armor.biped_small.haniwa.head.haniwa",
))) )))
.feet(Some(Item::new_from_asset_expect( .feet(Some(Item::new_from_asset_expect(
"common.items.npc_armor.foot.haniwa.haniwa", "common.items.npc_armor.biped_small.haniwa.foot.haniwa",
)))
.hands(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.haniwa.hand.haniwa",
))) )))
.chest(Some(Item::new_from_asset_expect( .chest(Some(Item::new_from_asset_expect(
"common.items.npc_armor.chest.haniwa.haniwa", "common.items.npc_armor.biped_small.haniwa.chest.haniwa",
))) )))
.pants(Some(Item::new_from_asset_expect( .pants(Some(Item::new_from_asset_expect(
"common.items.npc_armor.pants.haniwa.haniwa", "common.items.npc_armor.biped_small.haniwa.pants.haniwa",
))) )))
.build(), .build(),
Myrmidon => LoadoutBuilder::new() Myrmidon => LoadoutBuilder::new()
.active_item(active_item) .active_item(active_item)
.hands(Some(Item::new_from_asset_expect( .head(Some(Item::new_from_asset_expect(
"common.items.npc_armor.hand.myrmidon.myrmidon", "common.items.npc_armor.biped_small.myrmidon.head.myrmidon",
))) )))
.feet(Some(Item::new_from_asset_expect( .feet(Some(Item::new_from_asset_expect(
"common.items.npc_armor.foot.myrmidon.myrmidon", "common.items.npc_armor.biped_small.myrmidon.foot.myrmidon",
)))
.hands(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.myrmidon.hand.myrmidon",
))) )))
.chest(Some(Item::new_from_asset_expect( .chest(Some(Item::new_from_asset_expect(
"common.items.npc_armor.chest.myrmidon.myrmidon", "common.items.npc_armor.biped_small.myrmidon.chest.myrmidon",
))) )))
.pants(Some(Item::new_from_asset_expect( .pants(Some(Item::new_from_asset_expect(
"common.items.npc_armor.pants.myrmidon.myrmidon", "common.items.npc_armor.biped_small.myrmidon.pants.myrmidon",
)))
.belt(Some(Item::new_from_asset_expect(
"common.items.npc_armor.biped_small.myrmidon.belt.myrmidon",
))) )))
.build(), .build(),
Guard => LoadoutBuilder::new() Guard => LoadoutBuilder::new()

View File

@ -45,33 +45,31 @@ impl Animation for AlphaAnimation {
let footrotr = let footrotr =
(((1.0) / (0.5 + (0.5) * ((acc_vel * lab as f32 + PI * 0.4).sin()).powi(2))).sqrt()) (((1.0) / (0.5 + (0.5) * ((acc_vel * lab as f32 + PI * 0.4).sin()).powi(2))).sqrt())
* ((acc_vel * lab as f32 + PI * 0.4).sin()); * ((acc_vel * lab as f32 + PI * 0.4).sin());
let (movement1base, movement2base, movement3) = match stage_section { let (move1base, move2base, move3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)), Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)),
_ => (0.0, 0.0, 0.0), _ => (0.0, 0.0, 0.0),
}; };
let pullback = 1.0 - movement3; let pullback = 1.0 - move3;
let movement1 = movement1base * pullback; let move1 = move1base * pullback;
let movement2 = movement2base * pullback; let move2 = move2base * pullback;
next.shoulder_l.position = Vec3::new( next.shoulder_l.position = Vec3::new(
-s_a.shoulder.0, -s_a.shoulder.0,
s_a.shoulder.1, s_a.shoulder.1,
s_a.shoulder.2 - foothorir * 1.0, s_a.shoulder.2 - foothorir * 1.0,
); );
next.shoulder_l.orientation = Quaternion::rotation_x( next.shoulder_l.orientation =
movement1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm, Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotr * -0.2) * speednorm);
);
next.shoulder_r.position = Vec3::new( next.shoulder_r.position = Vec3::new(
s_a.shoulder.0, s_a.shoulder.0,
s_a.shoulder.1, s_a.shoulder.1,
s_a.shoulder.2 - foothoril * 1.0, s_a.shoulder.2 - foothoril * 1.0,
); );
next.shoulder_r.orientation = Quaternion::rotation_x( next.shoulder_r.orientation =
movement1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm, Quaternion::rotation_x(move1 * 0.8 + 0.6 * speednorm + (footrotl * -0.2) * speednorm);
);
next.torso.orientation = Quaternion::rotation_z(0.0); next.torso.orientation = Quaternion::rotation_z(0.0);
next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.position = Vec3::new(0.0, 0.0, 0.0);
@ -87,53 +85,51 @@ impl Animation for AlphaAnimation {
Some(ToolKind::SwordSimple) => { Some(ToolKind::SwordSimple) => {
next.control_l.position = Vec3::new(-1.0, 1.0, 1.0); next.control_l.position = Vec3::new(-1.0, 1.0, 1.0);
next.control_r.position = Vec3::new(0.0, 2.0, -3.0); next.control_r.position = Vec3::new(0.0, 2.0, -3.0);
next.head.orientation = Quaternion::rotation_x(movement1 * -0.25) next.head.orientation = Quaternion::rotation_x(move1 * -0.25)
* Quaternion::rotation_z(movement1 * -0.2 + movement2 * 0.6); * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6);
next.control.position = Vec3::new( next.control.position = Vec3::new(
-3.0 + movement1 * -4.0 + movement2 * 5.0, -3.0 + move1 * -4.0 + move2 * 5.0,
5.0 + s_a.grip / 1.2 + movement1 * -4.0 + movement2 * 8.0, 5.0 + s_a.grip / 1.2 + move1 * -4.0 + move2 * 8.0,
-4.0 + -s_a.grip / 2.0 + movement2 * -5.0, -4.0 + -s_a.grip / 2.0 + move2 * -5.0,
); );
next.upper_torso.orientation = next.upper_torso.orientation =
Quaternion::rotation_z(movement1base * 0.5 + movement2 * -0.7); Quaternion::rotation_z(move1base * 0.5 + move2 * -0.7);
next.lower_torso.orientation = next.lower_torso.orientation =
Quaternion::rotation_z(movement1base * -0.5 + movement2 * 0.7); Quaternion::rotation_z(move1base * -0.5 + move2 * 0.7);
next.control_l.orientation = next.control_l.orientation =
Quaternion::rotation_x(PI / 2.0 + movement1 * -0.5 + movement2 * 1.5) Quaternion::rotation_x(PI / 2.0 + move1 * -0.5 + move2 * 1.5)
* Quaternion::rotation_y(-0.2); * Quaternion::rotation_y(-0.2);
next.control_r.orientation = next.control_r.orientation =
Quaternion::rotation_x(PI / 2.2 + movement1 * -0.5 + movement2 * 1.5) Quaternion::rotation_x(PI / 2.2 + move1 * -0.5 + move2 * 1.5)
* Quaternion::rotation_y(0.2) * Quaternion::rotation_y(0.2)
* Quaternion::rotation_z(0.0); * Quaternion::rotation_z(0.0);
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(-0.2 + movement1 * 0.5 + movement2 * -1.5) Quaternion::rotation_x(-0.2 + move1 * 0.5 + move2 * -1.5)
* Quaternion::rotation_y(-0.1 + movement1 * -0.5 + movement2 * 1.0); * Quaternion::rotation_y(-0.1 + move1 * -0.5 + move2 * 1.0);
}, },
Some(ToolKind::HammerSimple) => { Some(ToolKind::HammerSimple) => {
next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + movement2 * -10.0); next.control_l.position = Vec3::new(-1.0, 2.0, 12.0 + move2 * -10.0);
next.control_r.position = Vec3::new(1.0, 2.0, -2.0); next.control_r.position = Vec3::new(1.0, 2.0, -2.0);
next.control.position = Vec3::new( next.control.position = Vec3::new(
4.0 + movement1 * -12.0 + movement2 * 20.0, 4.0 + move1 * -12.0 + move2 * 20.0,
(s_a.grip / 1.0) + movement1 * -3.0 + movement2 * 5.0, (s_a.grip / 1.0) + move1 * -3.0 + move2 * 5.0,
(-s_a.grip / 0.8) + movement1 * -2.0 + movement2 * 8.0, (-s_a.grip / 0.8) + move1 * -2.0 + move2 * 8.0,
); );
next.head.orientation = Quaternion::rotation_x(movement1 * -0.25) next.head.orientation = Quaternion::rotation_x(move1 * -0.25)
* Quaternion::rotation_z(movement1 * -0.2 + movement2 * 0.6); * Quaternion::rotation_z(move1 * -0.2 + move2 * 0.6);
next.upper_torso.orientation = next.upper_torso.orientation = Quaternion::rotation_z(move1 * 0.2 + move2 * -0.4);
Quaternion::rotation_z(movement1 * 0.2 + movement2 * -0.4); next.control_l.orientation =
next.control_l.orientation = Quaternion::rotation_x(PI / 2.0 + movement2 * 0.8) Quaternion::rotation_x(PI / 2.0 + move2 * 0.8) * Quaternion::rotation_y(-0.0);
* Quaternion::rotation_y(-0.0); next.control_r.orientation = Quaternion::rotation_x(PI / 2.0 + 0.2 + move2 * 0.8)
next.control_r.orientation =
Quaternion::rotation_x(PI / 2.0 + 0.2 + movement2 * 0.8)
* Quaternion::rotation_y(0.0) * Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0); * Quaternion::rotation_z(0.0);
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(-1.0 + movement1 * -0.5 + movement2 * -0.3) Quaternion::rotation_x(-1.0 + move1 * -0.5 + move2 * -0.3)
* Quaternion::rotation_y(-1.8 + movement1 * -0.8 + movement2 * 3.0) * Quaternion::rotation_y(-1.8 + move1 * -0.8 + move2 * 3.0)
* Quaternion::rotation_z(movement1 * -0.8 + movement2 * -0.8); * Quaternion::rotation_z(move1 * -0.8 + move2 * -0.8);
}, },
Some(ToolKind::Debug) => { Some(ToolKind::Debug) => {
next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0); next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0);

View File

@ -53,27 +53,27 @@ impl Animation for AlphaAnimation {
let speednorm = speed / 9.4; let speednorm = speed / 9.4;
let speednormcancel = 1.0 - speednorm; let speednormcancel = 1.0 - speednorm;
let (movement1base, movement2base, movement3) = match stage_section { let (move1base, move2base, move3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).sqrt(), 0.0, 0.0), Some(StageSection::Buildup) => ((anim_time as f32).sqrt(), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, (anim_time as f32).powi(4), 0.0), Some(StageSection::Swing) => (1.0, (anim_time as f32).powi(4), 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32),
_ => (0.0, 0.0, 0.0), _ => (0.0, 0.0, 0.0),
}; };
let pullback = 1.0 - movement3; let pullback = 1.0 - move3;
let movement1abs = movement1base * pullback; let move1abs = move1base * pullback;
let movement2abs = movement2base * pullback; let move2abs = move2base * pullback;
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * 0.3) next.head.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * 0.3)
* Quaternion::rotation_z(movement1abs * -0.2 + movement2abs * 0.6) * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.6)
* Quaternion::rotation_y(movement1abs * 0.3 + movement2abs * -0.5); * Quaternion::rotation_y(move1abs * 0.3 + move2abs * -0.5);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) / 13.0; next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) / 13.0;
next.chest.orientation = Quaternion::rotation_x(movement1abs * -0.2 + movement2abs * 0.3) next.chest.orientation = Quaternion::rotation_x(move1abs * -0.2 + move2abs * 0.3)
* Quaternion::rotation_z(movement1abs * 0.5 + movement2abs * -0.6); * Quaternion::rotation_z(move1abs * 0.5 + move2abs * -0.6);
next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1); next.pants.position = Vec3::new(0.0, s_a.pants.0, s_a.pants.1);
next.pants.orientation = Quaternion::rotation_x(movement1abs * 0.2 + movement2abs * -0.3) next.pants.orientation = Quaternion::rotation_x(move1abs * 0.2 + move2abs * -0.3)
* Quaternion::rotation_z(movement1abs * -0.2 + movement2abs * 0.2); * Quaternion::rotation_z(move1abs * -0.2 + move2abs * 0.2);
next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0); next.main.orientation = Quaternion::rotation_x(0.0);
@ -88,22 +88,21 @@ impl Animation for AlphaAnimation {
next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 2.0, 2.0); next.control_r.position = Vec3::new(-1.0 + s_a.grip.0 * 2.0, 2.0, 2.0);
next.control.position = Vec3::new( next.control.position = Vec3::new(
-3.0 + movement1abs * -3.0 + movement2abs * 5.0, -3.0 + move1abs * -3.0 + move2abs * 5.0,
s_a.grip.2 + movement1abs * -12.0 + movement2abs * 17.0, s_a.grip.2 + move1abs * -12.0 + move2abs * 17.0,
-s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0 + movement2abs * 5.0, -s_a.grip.2 / 2.5 + s_a.grip.0 * -2.0 + move2abs * 5.0,
); );
next.control_l.orientation = next.control_l.orientation =
Quaternion::rotation_x(PI / 1.5 + movement1abs * -1.5 + movement2abs * 2.5) Quaternion::rotation_x(PI / 1.5 + move1abs * -1.5 + move2abs * 2.5)
* Quaternion::rotation_y(-0.3); * Quaternion::rotation_y(-0.3);
next.control_r.orientation = Quaternion::rotation_x( next.control_r.orientation =
PI / 1.5 + s_a.grip.0 * 0.2 + movement1abs * -1.5 + movement2abs * 2.5, Quaternion::rotation_x(PI / 1.5 + s_a.grip.0 * 0.2 + move1abs * -1.5 + move2abs * 2.5)
) * Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2); * Quaternion::rotation_y(0.5 + s_a.grip.0 * 0.2);
next.control.orientation = next.control.orientation = Quaternion::rotation_x(-1.35 + move1abs * -0.3 + move2abs * 0.5)
Quaternion::rotation_x(-1.35 + movement1abs * -0.3 + movement2abs * 0.5) * Quaternion::rotation_z(move1abs * 1.0 + move2abs * -1.0)
* Quaternion::rotation_z(movement1abs * 1.0 + movement2abs * -1.0) * Quaternion::rotation_y(move2abs * 0.0);
* Quaternion::rotation_y(movement2abs * 0.0);
next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1); next.tail.position = Vec3::new(0.0, s_a.tail.0, s_a.tail.1);
next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel) next.tail.orientation = Quaternion::rotation_x(0.05 * fastalt * speednormcancel)

View File

@ -34,7 +34,7 @@ impl Animation for AlphaAnimation {
let lab = 1.0; let lab = 1.0;
let (movement1, movement2, movement3) = match stage_section { let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)), Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)),
@ -70,22 +70,19 @@ impl Animation for AlphaAnimation {
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.sc.0, s_a.sc.0,
s_a.sc.1 + movement1 * -4.0 + movement2 * 16.0 + movement3 * -4.0, s_a.sc.1 + move1 * -4.0 + move2 * 16.0 + move3 * -4.0,
s_a.sc.2 + movement1 * 1.0, s_a.sc.2 + move1 * 1.0,
); );
next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + movement1 * -0.5) next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + move1 * -0.5)
* Quaternion::rotation_y( * Quaternion::rotation_y(s_a.sc.4 + move1 * -1.0 + move2 * -0.6 + move3 * 1.0)
s_a.sc.4 + movement1 * -1.0 + movement2 * -0.6 + movement3 * 1.0, * Quaternion::rotation_z(s_a.sc.5 + move1 * -1.2 + move2 * 1.3);
)
* Quaternion::rotation_z(s_a.sc.5 + movement1 * -1.2 + movement2 * 1.3);
next.chest.orientation = Quaternion::rotation_z( next.chest.orientation =
movement1 * 1.5 + (movement2 * 1.75).sin() * -3.0 + movement3 * 0.5, Quaternion::rotation_z(move1 * 1.5 + (move2 * 1.75).sin() * -3.0 + move3 * 0.5);
);
next.head.position = Vec3::new(0.0 + movement2 * 2.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0 + move2 * 2.0, s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_z( next.head.orientation = Quaternion::rotation_z(
movement1 * -0.9 + (movement2 * 1.75).sin() * 2.5 + movement3 * -0.5, move1 * -0.9 + (move2 * 1.75).sin() * 2.5 + move3 * -0.5,
); );
}, },
Some(ToolKind::Dagger) => { Some(ToolKind::Dagger) => {
@ -104,45 +101,39 @@ impl Animation for AlphaAnimation {
next.hand_r.orientation = next.hand_r.orientation =
Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5); Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
next.head.position = Vec3::new( next.head.position =
0. + movement2 * 2.0, Vec3::new(0. + move2 * 2.0, s_a.head.0 + move2 * 2.0, s_a.head.1);
s_a.head.0 + movement2 * 2.0,
s_a.head.1,
);
let (movement1, movement2, movement3) = match stage_section { let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)), Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)),
_ => (0.0, 0.0, 0.0), _ => (0.0, 0.0, 0.0),
}; };
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.ac.0 + movement1 * -1.0 + movement2 * -2.0 + movement3 * 0.0, s_a.ac.0 + move1 * -1.0 + move2 * -2.0 + move3 * 0.0,
s_a.ac.1 + movement1 * -3.0 + movement2 * 3.0 + movement3 * -3.5, s_a.ac.1 + move1 * -3.0 + move2 * 3.0 + move3 * -3.5,
s_a.ac.2 + movement1 * 6.0 + movement2 * -15.0 + movement3 * -2.0, s_a.ac.2 + move1 * 6.0 + move2 * -15.0 + move3 * -2.0,
); );
next.control.orientation = Quaternion::rotation_x( next.control.orientation =
s_a.ac.3 + movement1 * 0.0 + movement2 * -3.0 + movement3 * 0.4, Quaternion::rotation_x(s_a.ac.3 + move1 * 0.0 + move2 * -3.0 + move3 * 0.4)
) * Quaternion::rotation_y( * Quaternion::rotation_y(
s_a.ac.4 + movement1 * -0.0 + movement2 * -0.6 + movement3 * 0.8, s_a.ac.4 + move1 * -0.0 + move2 * -0.6 + move3 * 0.8,
) * Quaternion::rotation_z( )
s_a.ac.5 + movement1 * -2.0 + movement2 * -1.0 + movement3 * 2.5, * Quaternion::rotation_z(
s_a.ac.5 + move1 * -2.0 + move2 * -1.0 + move3 * 2.5,
); );
next.control.scale = Vec3::one(); next.control.scale = Vec3::one();
next.chest.orientation = Quaternion::rotation_x( next.chest.orientation =
0.0 + movement1 * 0.6 + movement2 * -0.6 + movement3 * 0.4, Quaternion::rotation_x(0.0 + move1 * 0.6 + move2 * -0.6 + move3 * 0.4)
) * Quaternion::rotation_y( * Quaternion::rotation_y(0.0 + move1 * 0.0 + move2 * 0.0 + move3 * 0.0)
0.0 + movement1 * 0.0 + movement2 * 0.0 + movement3 * 0.0, * Quaternion::rotation_z(0.0 + move1 * 1.5 + move2 * -2.5 + move3 * 1.5);
) * Quaternion::rotation_z( next.head.orientation =
0.0 + movement1 * 1.5 + movement2 * -2.5 + movement3 * 1.5, Quaternion::rotation_z(0.0 + move1 * -1.5 + move2 * 2.5 + move3 * -1.0);
);
next.head.orientation = Quaternion::rotation_z(
0.0 + movement1 * -1.5 + movement2 * 2.5 + movement3 * -1.0,
);
}, },
Some(ToolKind::Hammer) => { Some(ToolKind::Hammer) => {
let (movement1, movement2, movement3) = match stage_section { let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)), Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)),
@ -150,8 +141,7 @@ impl Animation for AlphaAnimation {
}; };
next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0); next.main.orientation = Quaternion::rotation_x(0.0);
next.hand_l.position = next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2 + move2 * -7.0);
Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2 + movement2 * -7.0);
next.hand_l.orientation = next.hand_l.orientation =
Quaternion::rotation_x(s_a.hhl.3) * Quaternion::rotation_y(s_a.hhl.4); Quaternion::rotation_x(s_a.hhl.3) * Quaternion::rotation_y(s_a.hhl.4);
next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2); next.hand_r.position = Vec3::new(s_a.hhr.0, s_a.hhr.1, s_a.hhr.2);
@ -159,34 +149,26 @@ impl Animation for AlphaAnimation {
Quaternion::rotation_x(s_a.hhr.3) * Quaternion::rotation_y(s_a.hhr.4); Quaternion::rotation_x(s_a.hhr.3) * Quaternion::rotation_y(s_a.hhr.4);
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.hc.0 + (movement1 * -13.0) * (1.0 - movement3), s_a.hc.0 + (move1 * -13.0) * (1.0 - move3),
s_a.hc.1 + (movement2 * 5.0) * (1.0 - movement3), s_a.hc.1 + (move2 * 5.0) * (1.0 - move3),
s_a.hc.2, s_a.hc.2,
); );
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(s_a.hc.3 + (movement1 * 1.5 + movement2 * -2.5)) Quaternion::rotation_x(s_a.hc.3 + (move1 * 1.5 + move2 * -2.5))
* (1.0 - movement3) * (1.0 - move3)
* Quaternion::rotation_y(s_a.hc.4 + (movement1 * 1.57)) * Quaternion::rotation_y(s_a.hc.4 + (move1 * 1.57))
* (1.0 - movement3) * (1.0 - move3)
* Quaternion::rotation_z(s_a.hc.5 + (movement2 * -0.5) * (1.0 - movement3)); * Quaternion::rotation_z(s_a.hc.5 + (move2 * -0.5) * (1.0 - move3));
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation = next.head.orientation =
Quaternion::rotation_x((movement1 * 0.1 + movement2 * 0.3) * (1.0 - movement3)) Quaternion::rotation_x((move1 * 0.1 + move2 * 0.3) * (1.0 - move3))
* Quaternion::rotation_z( * Quaternion::rotation_z((move1 * -0.2 + move2 * 0.2) * (1.0 - move3));
(movement1 * -0.2 + movement2 * 0.2) * (1.0 - movement3), next.chest.position =
); Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move2 * -2.0 * (1.0 - move3));
next.chest.position = Vec3::new( next.chest.orientation =
0.0, Quaternion::rotation_x((move1 * 0.4 + move2 * -0.7) * (1.0 - move3))
s_a.chest.0, * Quaternion::rotation_y((move1 * 0.3 + move2 * -0.4) * (1.0 - move3))
s_a.chest.1 + movement2 * -2.0 * (1.0 - movement3), * Quaternion::rotation_z((move1 * 0.5 + move2 * -0.5) * (1.0 - move3));
);
next.chest.orientation = Quaternion::rotation_x(
(movement1 * 0.4 + movement2 * -0.7) * (1.0 - movement3),
) * Quaternion::rotation_y(
(movement1 * 0.3 + movement2 * -0.4) * (1.0 - movement3),
) * Quaternion::rotation_z(
(movement1 * 0.5 + movement2 * -0.5) * (1.0 - movement3),
);
if velocity > 0.5 { if velocity > 0.5 {
next.foot_l.position = Vec3::new(-s_a.foot.0, foot * -6.0, s_a.foot.2); next.foot_l.position = Vec3::new(-s_a.foot.0, foot * -6.0, s_a.foot.2);
@ -207,10 +189,8 @@ impl Animation for AlphaAnimation {
next.foot_r.orientation = Quaternion::rotation_x(slower * 0.1) next.foot_r.orientation = Quaternion::rotation_x(slower * 0.1)
* Quaternion::rotation_z((slower * 0.5).max(0.0)); * Quaternion::rotation_z((slower * 0.5).max(0.0));
next.belt.orientation = next.belt.orientation = Quaternion::rotation_x(move1 * -0.2 + move2 * 0.2);
Quaternion::rotation_x(movement1 * -0.2 + movement2 * 0.2); next.shorts.orientation = Quaternion::rotation_x(move1 * -0.3 + move2 * 0.3);
next.shorts.orientation =
Quaternion::rotation_x(movement1 * -0.3 + movement2 * 0.3);
} }
}, },
Some(ToolKind::Debug) => { Some(ToolKind::Debug) => {

View File

@ -32,7 +32,7 @@ impl Animation for BeamAnimation {
*rate = 1.0; *rate = 1.0;
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let (movement1, movement2, movement3) = match stage_section { let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0), Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0),
Some(StageSection::Cast) => (1.0, anim_time as f32, 0.0), Some(StageSection::Cast) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32),
@ -56,59 +56,53 @@ impl Animation for BeamAnimation {
match active_tool_kind { match active_tool_kind {
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => { Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.stc.0 + (movement1 * 16.0) * (1.0 - movement3), s_a.stc.0 + (move1 * 16.0) * (1.0 - move3),
s_a.stc.1 + (movement1 + (movement2 * 8.0).sin() * 2.0) * (1.0 - movement3), s_a.stc.1 + (move1 + (move2 * 8.0).sin() * 2.0) * (1.0 - move3),
s_a.stc.2 + (movement1 * 10.0) * (1.0 - movement3), s_a.stc.2 + (move1 * 10.0) * (1.0 - move3),
); );
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(s_a.stc.3 + (movement1 * -1.2) * (1.0 - movement3)) Quaternion::rotation_x(s_a.stc.3 + (move1 * -1.2) * (1.0 - move3))
* Quaternion::rotation_y( * Quaternion::rotation_y(
s_a.stc.4 s_a.stc.4
+ (movement1 * -1.4 + (movement2 * 16.0).sin() * 0.07) + (move1 * -1.4 + (move2 * 16.0).sin() * 0.07) * (1.0 - move3),
* (1.0 - movement3),
) )
* Quaternion::rotation_z( * Quaternion::rotation_z(
(movement1 * -1.7 + (movement2 * 8.0 + PI / 4.0).sin() * 0.3) (move1 * -1.7 + (move2 * 8.0 + PI / 4.0).sin() * 0.3) * (1.0 - move3),
* (1.0 - movement3),
); );
next.head.orientation = Quaternion::rotation_x(0.0); next.head.orientation = Quaternion::rotation_x(0.0);
next.hand_l.position = Vec3::new( next.hand_l.position = Vec3::new(
0.0 + (movement1 * -1.0 + (movement2 * 8.0).sin() * 3.5) * (1.0 - movement3), 0.0 + (move1 * -1.0 + (move2 * 8.0).sin() * 3.5) * (1.0 - move3),
0.0 + (movement1 * -5.0 0.0 + (move1 * -5.0 + (move2 * 8.0).sin() * -2.0 + (move2 * 16.0).sin() * -1.5)
+ (movement2 * 8.0).sin() * -2.0 * (1.0 - move3),
+ (movement2 * 16.0).sin() * -1.5) -4.0 + (move1 * 19.0 + (move2 * 8.0 + PI / 2.0).sin() * 3.5) * (1.0 - move3),
* (1.0 - movement3),
-4.0 + (movement1 * 19.0 + (movement2 * 8.0 + PI / 2.0).sin() * 3.5)
* (1.0 - movement3),
); );
next.hand_l.orientation = next.hand_l.orientation =
Quaternion::rotation_x(s_a.sthr.3 + (movement1 * -0.3) * (1.0 - movement3)) Quaternion::rotation_x(s_a.sthr.3 + (move1 * -0.3) * (1.0 - move3))
* Quaternion::rotation_y( * Quaternion::rotation_y(
(movement1 * -1.1 + (movement2 * 8.0 + PI / 2.0).sin() * -0.3) (move1 * -1.1 + (move2 * 8.0 + PI / 2.0).sin() * -0.3) * (1.0 - move3),
* (1.0 - movement3),
) )
* Quaternion::rotation_z((movement1 * -2.8) * (1.0 - movement3)); * Quaternion::rotation_z((move1 * -2.8) * (1.0 - move3));
if velocity < 0.5 { if velocity < 0.5 {
next.head.orientation = next.head.orientation =
Quaternion::rotation_z(movement1 * -0.5 + (movement2 * 16.0).sin() * 0.05); Quaternion::rotation_z(move1 * -0.5 + (move2 * 16.0).sin() * 0.05);
next.foot_l.position = next.foot_l.position =
Vec3::new(-s_a.foot.0, s_a.foot.1 + movement1 * -3.0, s_a.foot.2); Vec3::new(-s_a.foot.0, s_a.foot.1 + move1 * -3.0, s_a.foot.2);
next.foot_l.orientation = Quaternion::rotation_x(movement1 * -0.5) next.foot_l.orientation =
* Quaternion::rotation_z(movement1 * 0.5); Quaternion::rotation_x(move1 * -0.5) * Quaternion::rotation_z(move1 * 0.5);
next.foot_r.position = next.foot_r.position =
Vec3::new(s_a.foot.0, s_a.foot.1 + movement1 * 4.0, s_a.foot.2); Vec3::new(s_a.foot.0, s_a.foot.1 + move1 * 4.0, s_a.foot.2);
next.foot_r.orientation = Quaternion::rotation_z(movement1 * 0.5); next.foot_r.orientation = Quaternion::rotation_z(move1 * 0.5);
next.chest.orientation = next.chest.orientation =
Quaternion::rotation_x(movement1 * -0.2 + (movement2 * 8.0).sin() * 0.05) Quaternion::rotation_x(move1 * -0.2 + (move2 * 8.0).sin() * 0.05)
* Quaternion::rotation_z(movement1 * 0.5); * Quaternion::rotation_z(move1 * 0.5);
next.belt.orientation = Quaternion::rotation_x(movement1 * 0.1) next.belt.orientation =
* Quaternion::rotation_z(movement1 * -0.1); Quaternion::rotation_x(move1 * 0.1) * Quaternion::rotation_z(move1 * -0.1);
next.shorts.orientation = Quaternion::rotation_x(movement1 * 0.2) next.shorts.orientation =
* Quaternion::rotation_z(movement1 * -0.2); Quaternion::rotation_x(move1 * 0.2) * Quaternion::rotation_z(move1 * -0.2);
} else { } else {
}; };
}, },

View File

@ -30,7 +30,7 @@ impl Animation for BetaAnimation {
*rate = 1.0; *rate = 1.0;
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let (movement1, movement2, movement3) = match stage_section { let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)), Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)),
@ -48,21 +48,17 @@ impl Animation for BetaAnimation {
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4); Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.sc.0 + (-1.4 + movement1 * -3.0 + movement2 * -2.0) * (1.0 - movement3), s_a.sc.0 + (-1.4 + move1 * -3.0 + move2 * -2.0) * (1.0 - move3),
s_a.sc.1 + (-1.4 + movement1 * 3.0 + movement2 * 3.0) * (1.0 - movement3), s_a.sc.1 + (-1.4 + move1 * 3.0 + move2 * 3.0) * (1.0 - move3),
s_a.sc.2 + (-1.9 + movement1 * 2.5 * (1.0 - movement3)), s_a.sc.2 + (-1.9 + move1 * 2.5 * (1.0 - move3)),
); );
next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + (-1.7) * (1.0 - movement3)) next.control.orientation = Quaternion::rotation_x(s_a.sc.3 + (-1.7) * (1.0 - move3))
* Quaternion::rotation_y( * Quaternion::rotation_y(s_a.sc.4 + (0.4 + move1 * 1.5 + move2 * -2.5) * (1.0 - move3))
s_a.sc.4 + (0.4 + movement1 * 1.5 + movement2 * -2.5) * (1.0 - movement3), * Quaternion::rotation_z(s_a.sc.5 + (1.67 + move2 * 1.57) * (1.0 - move3));
)
* Quaternion::rotation_z(s_a.sc.5 + (1.67 + movement2 * 1.57) * (1.0 - movement3));
next.chest.orientation = Quaternion::rotation_x(0.15) next.chest.orientation = Quaternion::rotation_x(0.15)
* Quaternion::rotation_y((-0.1) * (1.0 - movement3)) * Quaternion::rotation_y((-0.1) * (1.0 - move3))
* Quaternion::rotation_z( * Quaternion::rotation_z((0.4 + move1 * 1.5 + move2 * -2.5) * (1.0 - move3));
(0.4 + movement1 * 1.5 + movement2 * -2.5) * (1.0 - movement3), next.head.orientation = Quaternion::rotation_z((-0.4) * (1.0 - move3));
);
next.head.orientation = Quaternion::rotation_z((-0.4) * (1.0 - movement3));
next next
} }

View File

@ -1,164 +0,0 @@
use super::{
super::{vek::*, Animation},
CharacterSkeleton, SkeletonAttr,
};
use common::comp::item::ToolKind;
pub struct ChargeAnimation;
impl Animation for ChargeAnimation {
type Dependency = (
Option<ToolKind>,
Option<ToolKind>,
f32,
Vec3<f32>,
Vec3<f32>,
f64,
);
type Skeleton = CharacterSkeleton;
#[cfg(feature = "use-dyn-lib")]
const UPDATE_FN: &'static [u8] = b"character_charge\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "character_charge")]
#[allow(clippy::approx_constant)] // TODO: Pending review in #587
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(active_tool_kind, _second_tool_kind, velocity, orientation, last_ori, _global_time): Self::Dependency,
anim_time: f64,
rate: &mut f32,
s_a: &SkeletonAttr,
) -> Self::Skeleton {
*rate = 1.0;
let mut next = (*skeleton).clone();
let lab = 1.0;
let foot = (((5.0) / (0.2 + 4.8 * ((anim_time as f32 * lab as f32 * 8.0).sin()).powi(2)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 8.0).sin());
let foote = (((5.0)
/ (0.5 + 4.5 * ((anim_time as f32 * lab as f32 * 8.0 + 1.57).sin()).powi(2)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 8.0).sin());
let stress =
(((5.0) / (0.5 + 4.5 * ((anim_time as f32 * lab as f32 * 20.0).cos()).powi(2))).sqrt())
* ((anim_time as f32 * lab as f32 * 20.0).cos());
let quick = (((5.0) / (3.5 + 1.5 * ((anim_time as f32 * lab as f32 * 8.0).sin()).powi(2)))
.sqrt())
* ((anim_time as f32 * lab as f32 * 8.0).sin());
let stop = ((anim_time as f32).powf(0.3)).min(1.2);
let stopa = ((anim_time as f32).powf(0.9)).min(5.0);
let ori: Vec2<f32> = Vec2::from(orientation);
let last_ori = Vec2::from(last_ori);
let tilt = if ::vek::Vec2::new(ori, last_ori)
.map(|o| o.magnitude_squared())
.map(|m| m > 0.001 && m.is_finite())
.reduce_and()
&& ori.angle_between(last_ori).is_finite()
{
ori.angle_between(last_ori).min(0.2)
* last_ori.determine_side(Vec2::zero(), ori).signum()
} else {
0.0
} * 1.3;
next.head.position = Vec3::new(stop * -2.0, -1.5 + stop * 2.5 + s_a.head.0, s_a.head.1);
next.head.orientation =
Quaternion::rotation_z(stop * -1.0 + tilt * -2.0) * Quaternion::rotation_y(stop * -0.3);
next.head.scale = Vec3::one() * s_a.head_scale;
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
next.chest.orientation =
Quaternion::rotation_z(stop * 1.2 + stress * stop * 0.02 + tilt * -2.0);
next.belt.position = Vec3::new(0.0, s_a.belt.0, s_a.belt.1);
next.belt.orientation = Quaternion::rotation_z(stop * -0.5 + tilt * 2.0);
next.shorts.position = Vec3::new(0.0, s_a.shorts.0, s_a.shorts.1);
next.shorts.orientation = Quaternion::rotation_z(stop * -0.7 + tilt * 4.0);
match active_tool_kind {
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
next.hand_r.position = Vec3::new(s_a.sthr.0, s_a.sthr.1, s_a.sthr.2);
next.hand_r.orientation =
Quaternion::rotation_x(s_a.sthr.3) * Quaternion::rotation_y(s_a.sthr.4);
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_y(0.0);
next.control.position = Vec3::new(
s_a.stc.0 + quick * 3.5 * (1.0 / (stopa + 0.1)),
s_a.stc.1,
s_a.stc.2 - stop * 3.0,
);
next.control.orientation = Quaternion::rotation_x(s_a.stc.3 + stop * -0.2)
* Quaternion::rotation_y(s_a.stc.4)
* Quaternion::rotation_z(s_a.stc.5 + stop * 0.2);
},
Some(ToolKind::Bow) => {
next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0);
next.hand_l.position = Vec3::new(s_a.bhl.0, s_a.bhl.1, s_a.bhl.2);
next.hand_l.orientation = Quaternion::rotation_x(s_a.bhl.3);
next.hand_r.position = Vec3::new(s_a.bhr.0, s_a.bhr.1, s_a.bhr.2);
next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
next.hold.position = Vec3::new(0.0, -1.0, -5.2);
next.hold.orientation = Quaternion::rotation_x(-1.57);
next.hold.scale = Vec3::one() * 1.0;
next.control.position = Vec3::new(
3.0 + s_a.bc.0 + stop * 13.0,
-5.0 + s_a.bc.1 + stop * 4.0,
6.0 + s_a.bc.2,
);
next.control.orientation = Quaternion::rotation_x(0.2 + s_a.bc.3)
* Quaternion::rotation_y(-0.8 + s_a.bc.4 + stop * -0.4)
* Quaternion::rotation_z(s_a.bc.5 + stop * -0.6);
},
_ => {},
}
if velocity > 0.2 {
next.foot_l.position = Vec3::new(
-s_a.foot.0 - foot * 1.5,
s_a.foot.1 + foote * 2.0,
s_a.foot.2,
);
next.foot_l.orientation = Quaternion::rotation_x(foote * -0.1)
* Quaternion::rotation_z(0.4)
* Quaternion::rotation_y(0.15);
next.foot_r.position = Vec3::new(
s_a.foot.0 + foot * 1.5,
s_a.foot.1 + foote * -1.5,
s_a.foot.2,
);
next.foot_r.orientation = Quaternion::rotation_z(0.4);
} else {
next.foot_l.position = Vec3::new(
-s_a.foot.0,
-2.5 + stop * -1.3,
s_a.foot.2 + tilt * -4.0 * foot,
);
next.foot_l.orientation =
Quaternion::rotation_x(stop * -0.2 - 0.2 + stop * stress * 0.02)
* Quaternion::rotation_z(stop * 0.1)
* Quaternion::rotation_y(stop * 0.08);
next.foot_r.position =
Vec3::new(s_a.foot.0, 3.5 + stop * 1.5, s_a.foot.2 + tilt * 4.0 * foot);
next.foot_r.orientation =
Quaternion::rotation_x(stop * 0.1) * Quaternion::rotation_z(stop * 0.1);
}
next
}
}

View File

@ -37,7 +37,7 @@ impl Animation for ChargeswingAnimation {
* ((anim_time as f32 * lab as f32 * 8.0).sin()); * ((anim_time as f32 * lab as f32 * 8.0).sin());
// end spin stuff // end spin stuff
let (movement1, movement2, movement3, tension) = match stage_section { let (move1, move2, move3, tension) = match stage_section {
Some(StageSection::Charge) => ( Some(StageSection::Charge) => (
(anim_time as f32).min(1.0), (anim_time as f32).min(1.0),
0.0, 0.0,
@ -54,7 +54,7 @@ impl Animation for ChargeswingAnimation {
next.hand_l.position = Vec3::new( next.hand_l.position = Vec3::new(
s_a.hhl.0, s_a.hhl.0,
s_a.hhl.1, s_a.hhl.1,
s_a.hhl.2 + (movement2 * -8.0) * (1.0 - movement3), s_a.hhl.2 + (move2 * -8.0) * (1.0 - move3),
); );
next.hand_l.orientation = next.hand_l.orientation =
Quaternion::rotation_x(s_a.hhl.3) * Quaternion::rotation_y(s_a.hhl.4); Quaternion::rotation_x(s_a.hhl.3) * Quaternion::rotation_y(s_a.hhl.4);
@ -63,27 +63,26 @@ impl Animation for ChargeswingAnimation {
Quaternion::rotation_x(s_a.hhr.3) * Quaternion::rotation_y(s_a.hhr.4); Quaternion::rotation_x(s_a.hhr.3) * Quaternion::rotation_y(s_a.hhr.4);
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.hc.0 + (movement1 * -2.0 + movement2 * -3.0) * (1.0 - movement3), s_a.hc.0 + (move1 * -2.0 + move2 * -3.0) * (1.0 - move3),
s_a.hc.1 + (movement1 * 2.0 + movement2 * 3.0) * (1.0 - movement3), s_a.hc.1 + (move1 * 2.0 + move2 * 3.0) * (1.0 - move3),
s_a.hc.2 + (movement1 * 2.0 + movement2 * 4.0) * (1.0 - movement3), s_a.hc.2 + (move1 * 2.0 + move2 * 4.0) * (1.0 - move3),
);
next.control.orientation = Quaternion::rotation_x(s_a.hc.3+(movement2*4.0)*(1.0-movement3))
* Quaternion::rotation_y(s_a.hc.4+(tension*0.08+movement1 * 0.7+movement2*-3.5)*(1.0-movement3))//+fire * 0.1
* Quaternion::rotation_z(s_a.hc.5+(movement1 * 0.2+movement2*-0.5)*(1.0-movement3));
next.chest.orientation = Quaternion::rotation_z(
short * 0.04 + (movement1 * 2.0 + movement2 * -2.5) * (1.0 - movement3),
); );
next.control.orientation = Quaternion::rotation_x(s_a.hc.3+(move2*4.0)*(1.0-move3))
* Quaternion::rotation_y(s_a.hc.4+(tension*0.08+move1 * 0.7+move2*-3.5)*(1.0-move3))//+fire * 0.1
* Quaternion::rotation_z(s_a.hc.5+(move1 * 0.2+move2*-0.5)*(1.0-move3));
next.chest.orientation =
Quaternion::rotation_z(short * 0.04 + (move1 * 2.0 + move2 * -2.5) * (1.0 - move3));
next.belt.orientation = next.belt.orientation =
Quaternion::rotation_z(short * 0.08 + (movement1 * -1.0) * (1.0 - movement3)); Quaternion::rotation_z(short * 0.08 + (move1 * -1.0) * (1.0 - move3));
next.shorts.orientation = next.shorts.orientation =
Quaternion::rotation_z(short * 0.15 + (movement1 * -1.0) * (1.0 - movement3)); Quaternion::rotation_z(short * 0.15 + (move1 * -1.0) * (1.0 - move3));
next.head.position = Vec3::new( next.head.position = Vec3::new(
0.0 + (movement1 * -1.0 + movement2 * 2.0) * (1.0 - movement3), 0.0 + (move1 * -1.0 + move2 * 2.0) * (1.0 - move3),
s_a.head.0 + (movement1 * 1.0) * (1.0 - movement3), s_a.head.0 + (move1 * 1.0) * (1.0 - move3),
s_a.head.1, s_a.head.1,
); );
next.head.orientation = next.head.orientation =
Quaternion::rotation_z((movement1 * -1.5 + movement2 * 2.2) * (1.0 - movement3)); Quaternion::rotation_z((move1 * -1.5 + move2 * 2.2) * (1.0 - move3));
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
} }
next next

View File

@ -31,7 +31,7 @@ impl Animation for LeapAnimation {
*rate = 1.0; *rate = 1.0;
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let (movement1, movement2, movement3, movement4) = match stage_section { let (move1, move2, move3, move4) = match stage_section {
Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0, 0.0), Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0, 0.0),
Some(StageSection::Movement) => (1.0, (anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Movement) => (1.0, (anim_time as f32).powf(0.25), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, 1.0, (anim_time as f32).powf(0.25), 0.0), Some(StageSection::Swing) => (1.0, 1.0, (anim_time as f32).powf(0.25), 0.0),
@ -50,38 +50,37 @@ impl Animation for LeapAnimation {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.hc.0 + movement2 * -10.0 + movement3 * 6.0, s_a.hc.0 + move2 * -10.0 + move3 * 6.0,
s_a.hc.1 + movement2 * 5.0 + movement3 * 7.0, s_a.hc.1 + move2 * 5.0 + move3 * 7.0,
s_a.hc.2 + movement2 * 5.0 + movement3 * -10.0, s_a.hc.2 + move2 * 5.0 + move3 * -10.0,
); );
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(s_a.hc.3 + movement2 * 1.57 + movement3 * -2.3) Quaternion::rotation_x(s_a.hc.3 + move2 * 1.57 + move3 * -2.3)
* Quaternion::rotation_y(s_a.hc.4 + movement2 * 1.3) * Quaternion::rotation_y(s_a.hc.4 + move2 * 1.3)
* Quaternion::rotation_z(s_a.hc.5 + movement2 * -1.0 + movement3 * 0.5); * Quaternion::rotation_z(s_a.hc.5 + move2 * -1.0 + move3 * 0.5);
next.chest.orientation = next.chest.orientation =
Quaternion::rotation_x( Quaternion::rotation_x(move1 * 0.3 + move2 * 0.3 + move3 * -0.9 + move4 * 0.3)
movement1 * 0.3 + movement2 * 0.3 + movement3 * -0.9 + movement4 * 0.3, * Quaternion::rotation_z(move1 * 0.5 + move2 * 0.2 + move3 * -0.7);
) * Quaternion::rotation_z(movement1 * 0.5 + movement2 * 0.2 + movement3 * -0.7);
next.head.orientation = Quaternion::rotation_x(movement3 * 0.2) next.head.orientation = Quaternion::rotation_x(move3 * 0.2)
* Quaternion::rotation_y(0.0 + movement2 * -0.1) * Quaternion::rotation_y(0.0 + move2 * -0.1)
* Quaternion::rotation_z(movement1 * -0.4 + movement2 * -0.2 + movement3 * 0.6); * Quaternion::rotation_z(move1 * -0.4 + move2 * -0.2 + move3 * 0.6);
//next.hand_l.position = Vec3::new(-12.0 + movement3 * 10.0, 0.0, 0.0); //next.hand_l.position = Vec3::new(-12.0 + move3 * 10.0, 0.0, 0.0);
next.foot_l.position = Vec3::new( next.foot_l.position = Vec3::new(
-s_a.foot.0, -s_a.foot.0,
s_a.foot.1 + movement3 * 13.0, s_a.foot.1 + move3 * 13.0,
s_a.foot.2 + movement3 * -2.0, s_a.foot.2 + move3 * -2.0,
); );
next.foot_l.orientation = Quaternion::rotation_x(-0.8 + movement3 * 1.7); next.foot_l.orientation = Quaternion::rotation_x(-0.8 + move3 * 1.7);
next.foot_r.position = Vec3::new( next.foot_r.position = Vec3::new(
s_a.foot.0, s_a.foot.0,
s_a.foot.1 + 8.0 + movement3 * -13.0, s_a.foot.1 + 8.0 + move3 * -13.0,
s_a.foot.2 + 5.0 + movement3 * -5.0, s_a.foot.2 + 5.0 + move3 * -5.0,
); );
next.foot_r.orientation = Quaternion::rotation_x(0.9 + movement3 * -1.7); next.foot_r.orientation = Quaternion::rotation_x(0.9 + move3 * -1.7);
} else if let Some(ToolKind::Axe) = active_tool_kind { } else if let Some(ToolKind::Axe) = active_tool_kind {
next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2); next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2);
next.hand_l.orientation = Quaternion::rotation_x(s_a.ahl.3); next.hand_l.orientation = Quaternion::rotation_x(s_a.ahl.3);
@ -93,45 +92,42 @@ impl Animation for LeapAnimation {
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.ac.0 + movement1 * 8.0, s_a.ac.0 + move1 * 8.0,
s_a.ac.1 + movement1 * 4.0 + movement3 * 3.0, s_a.ac.1 + move1 * 4.0 + move3 * 3.0,
s_a.ac.2 + movement1 * 6.0 + movement2 * 1.0 + movement3 * -14.0, s_a.ac.2 + move1 * 6.0 + move2 * 1.0 + move3 * -14.0,
); );
next.control.orientation = Quaternion::rotation_x( next.control.orientation = Quaternion::rotation_x(
s_a.ac.3 + movement1 * -2.0 + movement2 * 0.7 + movement3 * -2.3 s_a.ac.3 + move1 * -2.0 + move2 * 0.7 + move3 * -2.3
) * Quaternion::rotation_y(s_a.ac.4)// + movement1 * 0.5) ) * Quaternion::rotation_y(s_a.ac.4)// + move1 * 0.5)
* Quaternion::rotation_z(s_a.ac.5+movement1*PI); // - movement1 * 0.2); * Quaternion::rotation_z(s_a.ac.5+move1*PI); // - move1 * 0.2);
next.torso.orientation = Quaternion::rotation_x( next.torso.orientation = Quaternion::rotation_x(
-0.3 + movement2 * -1.6 * PI -0.3 + move2 * -1.6 * PI + move2 * -0.3 + move3 * -0.2 * PI + move4 * -0.1 * PI,
+ movement2 * -0.3
+ movement3 * -0.2 * PI
+ movement4 * -0.1 * PI,
) * Quaternion::rotation_y(0.0) ) * Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0); * Quaternion::rotation_z(0.0);
next.head.orientation = next.head.orientation =
Quaternion::rotation_x(0.0 + movement1 * -0.4 + movement2 * 0.4 + movement3 * 0.2); Quaternion::rotation_x(0.0 + move1 * -0.4 + move2 * 0.4 + move3 * 0.2);
next.foot_l.position = Vec3::new( next.foot_l.position = Vec3::new(
-s_a.foot.0, -s_a.foot.0,
s_a.foot.1 + movement2 * 4.0 + movement3 * -1.0, s_a.foot.1 + move2 * 4.0 + move3 * -1.0,
s_a.foot.2, s_a.foot.2,
); );
next.foot_r.position = Vec3::new( next.foot_r.position = Vec3::new(
s_a.foot.0, s_a.foot.0,
s_a.foot.1 + movement2 * 4.0 + movement3 * -8.0, s_a.foot.1 + move2 * 4.0 + move3 * -8.0,
s_a.foot.2 + movement3 * -3.0, s_a.foot.2 + move3 * -3.0,
); );
next.foot_l.orientation = next.foot_l.orientation =
Quaternion::rotation_x(movement1 * 0.9 - movement2 * 1.0 + movement3 * 1.8); Quaternion::rotation_x(move1 * 0.9 - move2 * 1.0 + move3 * 1.8);
next.foot_r.orientation = Quaternion::rotation_x(movement1 * 0.9 - movement3 * 1.8); next.foot_r.orientation = Quaternion::rotation_x(move1 * 0.9 - move3 * 1.8);
next.belt.orientation = Quaternion::rotation_x(movement1 * 0.22 + movement2 * 0.1); next.belt.orientation = Quaternion::rotation_x(move1 * 0.22 + move2 * 0.1);
next.shorts.orientation = Quaternion::rotation_x(movement1 * 0.3 + movement2 * 0.1); next.shorts.orientation = Quaternion::rotation_x(move1 * 0.3 + move2 * 0.1);
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1); next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
} }

View File

@ -2,7 +2,6 @@ pub mod alpha;
pub mod beam; pub mod beam;
pub mod beta; pub mod beta;
pub mod block; pub mod block;
pub mod charge;
pub mod chargeswing; pub mod chargeswing;
pub mod climb; pub mod climb;
pub mod dance; pub mod dance;
@ -33,14 +32,14 @@ pub mod wield;
// Reexports // Reexports
pub use self::{ pub use self::{
alpha::AlphaAnimation, beam::BeamAnimation, beta::BetaAnimation, block::BlockAnimation, alpha::AlphaAnimation, beam::BeamAnimation, beta::BetaAnimation, block::BlockAnimation,
charge::ChargeAnimation, chargeswing::ChargeswingAnimation, climb::ClimbAnimation, chargeswing::ChargeswingAnimation, climb::ClimbAnimation, dance::DanceAnimation,
dance::DanceAnimation, dash::DashAnimation, equip::EquipAnimation, dash::DashAnimation, equip::EquipAnimation, glidewield::GlideWieldAnimation,
glidewield::GlideWieldAnimation, gliding::GlidingAnimation, idle::IdleAnimation, gliding::GlidingAnimation, idle::IdleAnimation, jump::JumpAnimation, leapmelee::LeapAnimation,
jump::JumpAnimation, leapmelee::LeapAnimation, repeater::RepeaterAnimation, repeater::RepeaterAnimation, roll::RollAnimation, run::RunAnimation,
roll::RollAnimation, run::RunAnimation, shockwave::ShockwaveAnimation, shoot::ShootAnimation, shockwave::ShockwaveAnimation, shoot::ShootAnimation, sit::SitAnimation, sneak::SneakAnimation,
sit::SitAnimation, sneak::SneakAnimation, spin::SpinAnimation, spinmelee::SpinMeleeAnimation, spin::SpinAnimation, spinmelee::SpinMeleeAnimation, staggered::StaggeredAnimation,
staggered::StaggeredAnimation, stand::StandAnimation, stunned::StunnedAnimation, stand::StandAnimation, stunned::StunnedAnimation, swim::SwimAnimation,
swim::SwimAnimation, swimwield::SwimWieldAnimation, talk::TalkAnimation, wield::WieldAnimation, swimwield::SwimWieldAnimation, talk::TalkAnimation, wield::WieldAnimation,
}; };
use super::{make_bone, vek::*, FigureBoneData, Skeleton}; use super::{make_bone, vek::*, FigureBoneData, Skeleton};
use common::comp; use common::comp;

View File

@ -30,7 +30,7 @@ impl Animation for RepeaterAnimation {
*rate = 1.0; *rate = 1.0;
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let (movement1, movement2, movement3, _movement4) = match stage_section { let (move1, move2, move3, _move4) = match stage_section {
Some(StageSection::Movement) => (anim_time as f32, 0.0, 0.0, 0.0), Some(StageSection::Movement) => (anim_time as f32, 0.0, 0.0, 0.0),
Some(StageSection::Buildup) => (1.0, anim_time as f32, 0.0, 0.0), Some(StageSection::Buildup) => (1.0, anim_time as f32, 0.0, 0.0),
Some(StageSection::Shoot) => (1.0, 1.0, anim_time as f32, 0.0), Some(StageSection::Shoot) => (1.0, 1.0, anim_time as f32, 0.0),
@ -52,48 +52,43 @@ impl Animation for RepeaterAnimation {
next.hold.position = Vec3::new(1.2, -1.0, -5.2); next.hold.position = Vec3::new(1.2, -1.0, -5.2);
next.hold.orientation = Quaternion::rotation_x(-1.7) * Quaternion::rotation_z(-0.1); next.hold.orientation = Quaternion::rotation_x(-1.7) * Quaternion::rotation_z(-0.1);
next.hold.scale = Vec3::one() * 1.0 * (1.0 - movement3); next.hold.scale = Vec3::one() * 1.0 * (1.0 - move3);
next.foot_l.position = Vec3::new( next.foot_l.position = Vec3::new(
-s_a.foot.0 + movement1 * -0.75 - 0.75, -s_a.foot.0 + move1 * -0.75 - 0.75,
s_a.foot.1 + movement1 * 4.0 + 4.0, s_a.foot.1 + move1 * 4.0 + 4.0,
s_a.foot.2 + movement1 * 2.5 + 2.5, s_a.foot.2 + move1 * 2.5 + 2.5,
); );
next.foot_l.orientation = next.foot_l.orientation = Quaternion::rotation_x(move1 * 0.6 + 0.6 + move2 * -0.2)
Quaternion::rotation_x(movement1 * 0.6 + 0.6 + movement2 * -0.2) * Quaternion::rotation_z(move1 * 0.3 + 0.3);
* Quaternion::rotation_z(movement1 * 0.3 + 0.3);
next.foot_r.position = Vec3::new( next.foot_r.position = Vec3::new(
s_a.foot.0 + movement1 * 0.75 + 0.75, s_a.foot.0 + move1 * 0.75 + 0.75,
s_a.foot.1 + movement1 * 4.0 + 4.0, s_a.foot.1 + move1 * 4.0 + 4.0,
s_a.foot.2 + movement1 * 2.5 + 2.5, s_a.foot.2 + move1 * 2.5 + 2.5,
); );
next.foot_r.orientation = next.foot_r.orientation = Quaternion::rotation_x(move1 * 0.6 + 0.6 + move2 * -0.2)
Quaternion::rotation_x(movement1 * 0.6 + 0.6 + movement2 * -0.2) * Quaternion::rotation_z(move1 * -0.3 - 0.3);
* Quaternion::rotation_z(movement1 * -0.3 - 0.3); next.shorts.position =
next.shorts.position = Vec3::new( Vec3::new(0.0, s_a.shorts.0 + move1 * 4.0, s_a.shorts.1 + move1 * 1.0);
0.0, next.shorts.orientation = Quaternion::rotation_x(move1 * 0.6);
s_a.shorts.0 + movement1 * 4.0, next.belt.position = Vec3::new(0.0, s_a.belt.0 + move1 * 2.0, s_a.belt.1);
s_a.shorts.1 + movement1 * 1.0, next.belt.orientation = Quaternion::rotation_x(move1 * 0.2);
);
next.shorts.orientation = Quaternion::rotation_x(movement1 * 0.6);
next.belt.position = Vec3::new(0.0, s_a.belt.0 + movement1 * 2.0, s_a.belt.1);
next.belt.orientation = Quaternion::rotation_x(movement1 * 0.2);
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.bc.0 + movement1 * 5.0, s_a.bc.0 + move1 * 5.0,
s_a.bc.1 + movement1 * 3.0, s_a.bc.1 + move1 * 3.0,
s_a.bc.2 + movement1 * 1.0, s_a.bc.2 + move1 * 1.0,
); );
next.control.orientation = Quaternion::rotation_x(s_a.bc.3 + movement1 * 0.4) next.control.orientation = Quaternion::rotation_x(s_a.bc.3 + move1 * 0.4)
* Quaternion::rotation_y(s_a.bc.4 + movement1 * 0.8) * Quaternion::rotation_y(s_a.bc.4 + move1 * 0.8)
* Quaternion::rotation_z(s_a.bc.5); * Quaternion::rotation_z(s_a.bc.5);
next.head.orientation = Quaternion::rotation_y(movement1 * 0.15 + movement2 * 0.05); next.head.orientation = Quaternion::rotation_y(move1 * 0.15 + move2 * 0.05);
next.torso.orientation = next.torso.orientation =
Quaternion::rotation_x(movement1 * 0.1 + movement2 * 0.1 + movement3 * 0.15); Quaternion::rotation_x(move1 * 0.1 + move2 * 0.1 + move3 * 0.15);
next.hand_l.position = Vec3::new( next.hand_l.position = Vec3::new(
2.0 + fire(movement3) * -6.0 - 3.0, 2.0 + fire(move3) * -6.0 - 3.0,
1.5 + fire(movement3) * -6.0 - 3.0, 1.5 + fire(move3) * -6.0 - 3.0,
0.0, 0.0,
); );
next.hand_l.orientation = Quaternion::rotation_x(1.20) next.hand_l.orientation = Quaternion::rotation_x(1.20)

View File

@ -34,7 +34,7 @@ impl Animation for ShockwaveAnimation {
*rate = 1.0; *rate = 1.0;
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let (movement1, movement2, movement3) = match stage_section { let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0), Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0),
Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32),
@ -56,53 +56,53 @@ impl Animation for ShockwaveAnimation {
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(s_a.stc.3) * Quaternion::rotation_y(s_a.stc.4); Quaternion::rotation_x(s_a.stc.3) * Quaternion::rotation_y(s_a.stc.4);
let twist = movement1 * 0.8; let twist = move1 * 0.8;
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.stc.0 + (movement1 * 5.0) * (1.0 - movement3), s_a.stc.0 + (move1 * 5.0) * (1.0 - move3),
s_a.stc.1 + (movement1 * 5.0) * (1.0 - movement3), s_a.stc.1 + (move1 * 5.0) * (1.0 - move3),
s_a.stc.2 + (movement1 * 10.0 + movement2 * -10.0) * (1.0 - movement3), s_a.stc.2 + (move1 * 10.0 + move2 * -10.0) * (1.0 - move3),
); );
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(s_a.stc.3 + (movement1 * 0.8) * (1.0 - movement3)) Quaternion::rotation_x(s_a.stc.3 + (move1 * 0.8) * (1.0 - move3))
* Quaternion::rotation_y( * Quaternion::rotation_y(
s_a.stc.4 + (movement1 * -0.15 + movement2 * -0.15) * (1.0 - movement3), s_a.stc.4 + (move1 * -0.15 + move2 * -0.15) * (1.0 - move3),
) )
* Quaternion::rotation_z((movement1 * 0.8 + movement2 * -0.8) * (1.0 - movement3)); * Quaternion::rotation_z((move1 * 0.8 + move2 * -0.8) * (1.0 - move3));
next.head.orientation = Quaternion::rotation_x((movement1 * 0.4) * (1.0 - movement3)) next.head.orientation = Quaternion::rotation_x((move1 * 0.4) * (1.0 - move3))
* Quaternion::rotation_z((twist * 0.2 + movement2 * -0.8) * (1.0 - movement3)); * Quaternion::rotation_z((twist * 0.2 + move2 * -0.8) * (1.0 - move3));
next.chest.position = Vec3::new( next.chest.position = Vec3::new(
0.0, 0.0,
s_a.chest.0, s_a.chest.0,
s_a.chest.1 + (movement1 * 2.0 + movement2 * -4.0) * (1.0 - movement3), s_a.chest.1 + (move1 * 2.0 + move2 * -4.0) * (1.0 - move3),
); );
next.chest.orientation = Quaternion::rotation_x((movement2 * -0.8) * (1.0 - movement3)) next.chest.orientation = Quaternion::rotation_x((move2 * -0.8) * (1.0 - move3))
* Quaternion::rotation_z(twist * -0.2 + movement2 * -0.1 + (1.0 - movement3)); * Quaternion::rotation_z(twist * -0.2 + move2 * -0.1 + (1.0 - move3));
next.belt.orientation = Quaternion::rotation_x((movement2 * 0.2) * (1.0 - movement3)) next.belt.orientation = Quaternion::rotation_x((move2 * 0.2) * (1.0 - move3))
* Quaternion::rotation_z((twist * 0.6 + movement2 * -0.48) * (1.0 - movement3)); * Quaternion::rotation_z((twist * 0.6 + move2 * -0.48) * (1.0 - move3));
next.shorts.orientation = Quaternion::rotation_x((movement2 * 0.3) * (1.0 - movement3)) next.shorts.orientation = Quaternion::rotation_x((move2 * 0.3) * (1.0 - move3))
* Quaternion::rotation_z((twist + movement2 * -0.8) * (1.0 - movement3)); * Quaternion::rotation_z((twist + move2 * -0.8) * (1.0 - move3));
if velocity < 0.5 { if velocity < 0.5 {
next.foot_l.position = Vec3::new( next.foot_l.position = Vec3::new(
-s_a.foot.0, -s_a.foot.0,
s_a.foot.1 + movement1 * -7.0 + movement2 * 7.0, s_a.foot.1 + move1 * -7.0 + move2 * 7.0,
s_a.foot.2, s_a.foot.2,
); );
next.foot_l.orientation = Quaternion::rotation_x(movement1 * -0.8 + movement2 * 0.8) next.foot_l.orientation = Quaternion::rotation_x(move1 * -0.8 + move2 * 0.8)
* Quaternion::rotation_z(movement1 * 0.3 + movement2 * -0.3); * Quaternion::rotation_z(move1 * 0.3 + move2 * -0.3);
next.foot_r.position = Vec3::new( next.foot_r.position = Vec3::new(
s_a.foot.0, s_a.foot.0,
s_a.foot.1 + movement1 * 5.0 + movement2 * -5.0, s_a.foot.1 + move1 * 5.0 + move2 * -5.0,
s_a.foot.2, s_a.foot.2,
); );
next.foot_r.orientation = Quaternion::rotation_y(movement1 * -0.3 + movement2 * 0.3) next.foot_r.orientation = Quaternion::rotation_y(move1 * -0.3 + move2 * 0.3)
* Quaternion::rotation_z(movement1 * 0.4 + movement2 * -0.4); * Quaternion::rotation_z(move1 * 0.4 + move2 * -0.4);
} }
next next
} }

View File

@ -63,14 +63,14 @@ impl Animation for ShootAnimation {
} * 1.3; } * 1.3;
match active_tool_kind { match active_tool_kind {
Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => { Some(ToolKind::Staff) | Some(ToolKind::Sceptre) => {
let (movement1, movement2, movement3) = match stage_section { let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0), Some(StageSection::Buildup) => (anim_time as f32, 0.0, 0.0),
Some(StageSection::Swing) => (1.0, (anim_time as f32).powf(0.25), 0.0), Some(StageSection::Swing) => (1.0, (anim_time as f32).powf(0.25), 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32), Some(StageSection::Recover) => (1.0, 1.0, anim_time as f32),
_ => (0.0, 0.0, 0.0), _ => (0.0, 0.0, 0.0),
}; };
let xmove = (movement1 as f32 * 6.0 * lab as f32 + PI).sin(); let xmove = (move1 as f32 * 6.0 * lab as f32 + PI).sin();
let ymove = (movement1 as f32 * 6.0 * lab as f32 + PI * (0.5)).sin(); let ymove = (move1 as f32 * 6.0 * lab as f32 + PI * (0.5)).sin();
next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2); next.hand_l.position = Vec3::new(s_a.sthl.0, s_a.sthl.1, s_a.sthl.2);
next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3); next.hand_l.orientation = Quaternion::rotation_x(s_a.sthl.3);
@ -82,22 +82,21 @@ impl Animation for ShootAnimation {
next.main.orientation = Quaternion::rotation_y(0.0); next.main.orientation = Quaternion::rotation_y(0.0);
next.control.position = Vec3::new( next.control.position = Vec3::new(
s_a.stc.0 + (xmove * 3.0 + movement1 * -4.0) * (1.0 - movement3), s_a.stc.0 + (xmove * 3.0 + move1 * -4.0) * (1.0 - move3),
s_a.stc.1 + (2.0 + ymove * 3.0 + movement2 * 3.0) * (1.0 - movement3), s_a.stc.1 + (2.0 + ymove * 3.0 + move2 * 3.0) * (1.0 - move3),
s_a.stc.2, s_a.stc.2,
); );
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(s_a.stc.3 + (movement2 * 0.6) * (1.0 - movement3)) Quaternion::rotation_x(s_a.stc.3 + (move2 * 0.6) * (1.0 - move3))
* Quaternion::rotation_y(s_a.stc.4 + (movement1 * 0.5 + movement2 * -0.5)) * Quaternion::rotation_y(s_a.stc.4 + (move1 * 0.5 + move2 * -0.5))
* Quaternion::rotation_z( * Quaternion::rotation_z(
s_a.stc.5 s_a.stc.5 - (0.2 + move1 * -0.5 + move2 * 0.8) * (1.0 - move3),
- (0.2 + movement1 * -0.5 + movement2 * 0.8) * (1.0 - movement3),
); );
next.chest.orientation = next.chest.orientation =
Quaternion::rotation_z((movement1 * 0.3 + movement2 * 0.2) * (1.0 - movement3)); Quaternion::rotation_z((move1 * 0.3 + move2 * 0.2) * (1.0 - move3));
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_z( next.head.orientation = Quaternion::rotation_z(
tilt * -2.5 + (movement1 * -0.2 + movement2 * -0.4) * (1.0 - movement3), tilt * -2.5 + (move1 * -0.2 + move2 * -0.4) * (1.0 - move3),
); );
if speed < 0.5 { if speed < 0.5 {
@ -117,7 +116,7 @@ impl Animation for ShootAnimation {
}; };
}, },
Some(ToolKind::Bow) => { Some(ToolKind::Bow) => {
let (_movement1, movement2, _movement3) = match stage_section { let (_move1, move2, _move3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)), Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powi(4)),
@ -126,37 +125,36 @@ impl Animation for ShootAnimation {
next.main.position = Vec3::new(0.0, 0.0, 0.0); next.main.position = Vec3::new(0.0, 0.0, 0.0);
next.main.orientation = Quaternion::rotation_x(0.0); next.main.orientation = Quaternion::rotation_x(0.0);
next.hand_l.position = Vec3::new( next.hand_l.position = Vec3::new(
s_a.bhl.0 + movement2 * -2.0, s_a.bhl.0 + move2 * -2.0,
s_a.bhl.1 + movement2 * -6.0, s_a.bhl.1 + move2 * -6.0,
s_a.bhl.2 + movement2 * -3.0, s_a.bhl.2 + move2 * -3.0,
); );
next.hand_l.orientation = Quaternion::rotation_x(s_a.bhl.3); next.hand_l.orientation = Quaternion::rotation_x(s_a.bhl.3);
next.hand_r.position = Vec3::new(s_a.bhr.0, s_a.bhr.1, s_a.bhr.2); next.hand_r.position = Vec3::new(s_a.bhr.0, s_a.bhr.1, s_a.bhr.2);
next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3); next.hand_r.orientation = Quaternion::rotation_x(s_a.bhr.3);
next.hold.position = Vec3::new(0.0, -1.0 + movement2 * 2.0, -5.2 + movement2 * 7.0); next.hold.position = Vec3::new(0.0, -1.0 + move2 * 2.0, -5.2 + move2 * 7.0);
next.hold.orientation = Quaternion::rotation_x(-1.57); next.hold.orientation = Quaternion::rotation_x(-1.57);
next.hold.scale = Vec3::one() * 1.0 * (1.0 - movement2); next.hold.scale = Vec3::one() * 1.0 * (1.0 - move2);
next.control.position = Vec3::new(s_a.bc.0 + 11.0, s_a.bc.1 + 2.0, s_a.bc.2 + 8.0); next.control.position = Vec3::new(s_a.bc.0 + 11.0, s_a.bc.1 + 2.0, s_a.bc.2 + 8.0);
next.control.orientation = next.control.orientation = Quaternion::rotation_x(0.0 + (move2 as f32 * 0.1).sin())
Quaternion::rotation_x(0.0 + (movement2 as f32 * 0.1).sin())
* Quaternion::rotation_y(s_a.bc.4 - 1.25) * Quaternion::rotation_y(s_a.bc.4 - 1.25)
* Quaternion::rotation_z(s_a.bc.5 - 0.2 + (movement2 as f32 * -0.2).sin()); * Quaternion::rotation_z(s_a.bc.5 - 0.2 + (move2 as f32 * -0.2).sin());
next.chest.orientation = Quaternion::rotation_z(0.8); next.chest.orientation = Quaternion::rotation_z(0.8);
next.head.position = Vec3::new(0.0 - 2.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0 - 2.0, s_a.head.0, s_a.head.1);
next.head.orientation = next.head.orientation =
Quaternion::rotation_z(tilt * -2.5 - 0.5 + (movement2 as f32 * 0.2).sin()); Quaternion::rotation_z(tilt * -2.5 - 0.5 + (move2 as f32 * 0.2).sin());
if speed < 0.5 { if speed < 0.5 {
next.chest.orientation = next.chest.orientation =
Quaternion::rotation_z(0.8 + (movement2 as f32 * 0.1).sin()); Quaternion::rotation_z(0.8 + (move2 as f32 * 0.1).sin());
next.belt.orientation = Quaternion::rotation_x(0.07) next.belt.orientation = Quaternion::rotation_x(0.07)
* Quaternion::rotation_z((movement2 as f32 * -0.1).sin()); * Quaternion::rotation_z((move2 as f32 * -0.1).sin());
next.shorts.orientation = Quaternion::rotation_x(0.08) next.shorts.orientation = Quaternion::rotation_x(0.08)
* Quaternion::rotation_z((movement2 as f32 * -0.15).sin()); * Quaternion::rotation_z((move2 as f32 * -0.15).sin());
next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1 - 5.0, s_a.foot.2); next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1 - 5.0, s_a.foot.2);
next.foot_l.orientation = Quaternion::rotation_x(-0.5); next.foot_l.orientation = Quaternion::rotation_x(-0.5);

View File

@ -30,7 +30,7 @@ impl Animation for SpinMeleeAnimation {
s_a: &SkeletonAttr, s_a: &SkeletonAttr,
) -> Self::Skeleton { ) -> Self::Skeleton {
*rate = 1.0; *rate = 1.0;
let (movement1, movement2, movement3) = match stage_section { let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0), Some(StageSection::Buildup) => ((anim_time as f32).powf(0.25), 0.0, 0.0),
Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0), Some(StageSection::Swing) => (1.0, anim_time as f32, 0.0),
Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powf(4.0)), Some(StageSection::Recover) => (1.0, 1.0, (anim_time as f32).powf(4.0)),
@ -50,24 +50,19 @@ impl Animation for SpinMeleeAnimation {
next.hand_r.orientation = next.hand_r.orientation =
Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4); Quaternion::rotation_x(s_a.shr.3) * Quaternion::rotation_y(s_a.shr.4);
next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2 + movement1 * 2.0); next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2 + move1 * 2.0);
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(s_a.sc.3 + movement1 * -PI / 2.5 + movement3 * PI / 2.0) Quaternion::rotation_x(s_a.sc.3 + move1 * -PI / 2.5 + move3 * PI / 2.0)
* Quaternion::rotation_z( * Quaternion::rotation_z(s_a.sc.5 + move1 * -PI / 2.0 + move3 * PI / 2.0);
s_a.sc.5 + movement1 * -PI / 2.0 + movement3 * PI / 2.0, next.torso.orientation = Quaternion::rotation_z(move2 * PI * 2.0);
);
next.torso.orientation = Quaternion::rotation_z(movement2 * PI * 2.0);
next.chest.position = Vec3::new( next.chest.position =
0.0, Vec3::new(0.0, s_a.chest.0 + move1 * -2.0, s_a.chest.1 + move1 * -3.0);
s_a.chest.0 + movement1 * -2.0, next.chest.orientation = Quaternion::rotation_x(move1 * -0.3)
s_a.chest.1 + movement1 * -3.0, * Quaternion::rotation_y(move1 * 0.15 + move3 * -0.15);
);
next.chest.orientation = Quaternion::rotation_x(movement1 * -0.3)
* Quaternion::rotation_y(movement1 * 0.15 + movement3 * -0.15);
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.head.orientation = Quaternion::rotation_x(movement1 * 0.2 + movement3 * 0.15) next.head.orientation = Quaternion::rotation_x(move1 * 0.2 + move3 * 0.15)
* Quaternion::rotation_z(movement2 * 0.8 + movement3 * -0.6); * Quaternion::rotation_z(move2 * 0.8 + move3 * -0.6);
next.belt.orientation = Quaternion::rotation_x(0.1); next.belt.orientation = Quaternion::rotation_x(0.1);
next.shorts.orientation = Quaternion::rotation_x(0.2); next.shorts.orientation = Quaternion::rotation_x(0.2);
}, },
@ -82,63 +77,52 @@ impl Animation for SpinMeleeAnimation {
next.hand_r.orientation = next.hand_r.orientation =
Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5); Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5);
next.control.position = Vec3::new( next.control.position =
s_a.ac.0 + movement1 * 8.0, Vec3::new(s_a.ac.0 + move1 * 8.0, s_a.ac.1, s_a.ac.2 + move1 * -4.0);
s_a.ac.1,
s_a.ac.2 + movement1 * -4.0,
);
next.control.orientation = next.control.orientation =
Quaternion::rotation_x(s_a.ac.3 + movement1 * -0.8 * (1.0 - movement3)) Quaternion::rotation_x(s_a.ac.3 + move1 * -0.8 * (1.0 - move3))
* Quaternion::rotation_y(s_a.ac.4 + movement1 * -PI * (1.0 - movement3)) * Quaternion::rotation_y(s_a.ac.4 + move1 * -PI * (1.0 - move3))
* Quaternion::rotation_z(s_a.ac.5 + movement1 * 1.2 * (1.0 - movement3)); * Quaternion::rotation_z(s_a.ac.5 + move1 * 1.2 * (1.0 - move3));
next.head.orientation = next.head.orientation = Quaternion::rotation_x(move1 * -0.2 * (1.0 - move3))
Quaternion::rotation_x(movement1 * -0.2 * (1.0 - movement3)) * Quaternion::rotation_z(move1 * 0.4 * (1.0 - move3));
* Quaternion::rotation_z(movement1 * 0.4 * (1.0 - movement3)); next.head.position = Vec3::new(0.0, s_a.head.0 + move1 * 2.0, s_a.head.1);
next.head.position = Vec3::new(0.0, s_a.head.0 + movement1 * 2.0, s_a.head.1);
next.chest.position = Vec3::new( next.chest.position =
0.0, Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + move1 * -1.0 * (1.0 - move3));
s_a.chest.0, next.chest.orientation = Quaternion::rotation_x(move1 * 0.3 * (1.0 - move3))
s_a.chest.1 + movement1 * -1.0 * (1.0 - movement3), * Quaternion::rotation_y(move1 * 0.3 * (1.0 - move3));
);
next.chest.orientation =
Quaternion::rotation_x(movement1 * 0.3 * (1.0 - movement3))
* Quaternion::rotation_y(movement1 * 0.3 * (1.0 - movement3));
next.belt.position = Vec3::new( next.belt.position = Vec3::new(
0.0, 0.0,
1.0 + s_a.belt.0, 1.0 + s_a.belt.0,
s_a.belt.1 + movement1 * 0.5 * (1.0 - movement3), s_a.belt.1 + move1 * 0.5 * (1.0 - move3),
); );
next.belt.orientation = Quaternion::rotation_x(0.15); next.belt.orientation = Quaternion::rotation_x(0.15);
next.shorts.position = Vec3::new( next.shorts.position = Vec3::new(
0.0, 0.0,
1.0 + s_a.shorts.0 + movement1 * 1.0 * (1.0 - movement3), 1.0 + s_a.shorts.0 + move1 * 1.0 * (1.0 - move3),
s_a.shorts.1 + movement1 * 1.0 * (1.0 - movement3), s_a.shorts.1 + move1 * 1.0 * (1.0 - move3),
); );
next.shorts.orientation = next.shorts.orientation =
Quaternion::rotation_x(0.15 + 0.15 * movement1 * (1.0 - movement3)); Quaternion::rotation_x(0.15 + 0.15 * move1 * (1.0 - move3));
next.torso.orientation = Quaternion::rotation_z( next.torso.orientation =
movement1 * 1.0 * (1.0 - movement3) + movement2 * -2.0 * PI, Quaternion::rotation_z(move1 * 1.0 * (1.0 - move3) + move2 * -2.0 * PI);
);
next.foot_l.position = Vec3::new( next.foot_l.position = Vec3::new(
-s_a.foot.0, -s_a.foot.0,
s_a.foot.1 + movement1 * 7.0 * (1.0 - movement3), s_a.foot.1 + move1 * 7.0 * (1.0 - move3),
s_a.foot.2, s_a.foot.2,
); );
next.foot_l.orientation = next.foot_l.orientation = Quaternion::rotation_x(move1 * 0.8 * (1.0 - move3));
Quaternion::rotation_x(movement1 * 0.8 * (1.0 - movement3));
next.foot_r.position = Vec3::new( next.foot_r.position = Vec3::new(
s_a.foot.0, s_a.foot.0,
s_a.foot.1 + movement1 * -3.0 * (1.0 - movement3), s_a.foot.1 + move1 * -3.0 * (1.0 - move3),
s_a.foot.2, s_a.foot.2,
); );
next.foot_r.orientation = next.foot_r.orientation = Quaternion::rotation_x(move1 * -0.5 * (1.0 - move3));
Quaternion::rotation_x(movement1 * -0.5 * (1.0 - movement3));
}, },
_ => {}, _ => {},

View File

@ -86,6 +86,7 @@ pub(super) struct CharacterToolKey {
/// Character data that exists in third person only. /// Character data that exists in third person only.
#[derive(Eq, Hash, PartialEq)] #[derive(Eq, Hash, PartialEq)]
pub(super) struct CharacterThirdPersonKey { pub(super) struct CharacterThirdPersonKey {
pub head: Option<String>,
pub shoulder: Option<String>, pub shoulder: Option<String>,
pub chest: Option<String>, pub chest: Option<String>,
pub belt: Option<String>, pub belt: Option<String>,
@ -141,6 +142,17 @@ impl CharacterCacheKey {
None None
} else { } else {
Some(CharacterThirdPersonKey { Some(CharacterThirdPersonKey {
head: if let Some(ItemKind::Armor(Armor {
kind: ArmorKind::Head(armor),
..
})) = inventory
.equipped(EquipSlot::Armor(ArmorSlot::Head))
.map(|i| i.kind())
{
Some(armor.clone())
} else {
None
},
shoulder: if let Some(ItemKind::Armor(Armor { shoulder: if let Some(ItemKind::Armor(Armor {
kind: ArmorKind::Shoulder(armor), kind: ArmorKind::Shoulder(armor),
.. ..

View File

@ -2469,23 +2469,11 @@ impl FishSmallLateralSpec {
//// ////
#[derive(Deserialize)]
struct BipedSmallCentralSpec(HashMap<(BSSpecies, BSBodyType), SidedBSCentralVoxSpec>);
#[derive(Deserialize)]
struct SidedBSCentralVoxSpec {
head: BipedSmallCentralSubSpec,
tail: BipedSmallCentralSubSpec,
}
#[derive(Deserialize)]
struct BipedSmallCentralSubSpec {
offset: [f32; 3], // Should be relative to initial origin
central: VoxSimple,
}
#[derive(Deserialize)] #[derive(Deserialize)]
struct BipedSmallWeaponSpec(HashMap<String, ArmorVoxSpec>); struct BipedSmallWeaponSpec(HashMap<String, ArmorVoxSpec>);
#[derive(Deserialize)] #[derive(Deserialize)]
struct BipedSmallArmorHeadSpec(ArmorVoxSpecMap<String, ArmorVoxSpec>);
#[derive(Deserialize)]
struct BipedSmallArmorHandSpec(ArmorVoxSpecMap<String, SidedArmorVoxSpec>); struct BipedSmallArmorHandSpec(ArmorVoxSpecMap<String, SidedArmorVoxSpec>);
#[derive(Deserialize)] #[derive(Deserialize)]
struct BipedSmallArmorFootSpec(ArmorVoxSpecMap<String, SidedArmorVoxSpec>); struct BipedSmallArmorFootSpec(ArmorVoxSpecMap<String, SidedArmorVoxSpec>);
@ -2493,15 +2481,18 @@ struct BipedSmallArmorFootSpec(ArmorVoxSpecMap<String, SidedArmorVoxSpec>);
struct BipedSmallArmorChestSpec(ArmorVoxSpecMap<String, ArmorVoxSpec>); struct BipedSmallArmorChestSpec(ArmorVoxSpecMap<String, ArmorVoxSpec>);
#[derive(Deserialize)] #[derive(Deserialize)]
struct BipedSmallArmorPantsSpec(ArmorVoxSpecMap<String, ArmorVoxSpec>); struct BipedSmallArmorPantsSpec(ArmorVoxSpecMap<String, ArmorVoxSpec>);
#[derive(Deserialize)]
struct BipedSmallArmorTailSpec(ArmorVoxSpecMap<String, ArmorVoxSpec>);
make_vox_spec!( make_vox_spec!(
biped_small::Body, biped_small::Body,
struct BipedSmallSpec { struct BipedSmallSpec {
central: BipedSmallCentralSpec = "voxygen.voxel.biped_small_central_manifest",
armor_foot: BipedSmallArmorFootSpec = "voxygen.voxel.biped_small_armor_foot_manifest", armor_foot: BipedSmallArmorFootSpec = "voxygen.voxel.biped_small_armor_foot_manifest",
weapon: BipedSmallWeaponSpec = "voxygen.voxel.biped_small_weapon_manifest", weapon: BipedSmallWeaponSpec = "voxygen.voxel.biped_small_weapon_manifest",
armor_hand: BipedSmallArmorHandSpec = "voxygen.voxel.biped_small_armor_hand_manifest", armor_hand: BipedSmallArmorHandSpec = "voxygen.voxel.biped_small_armor_hand_manifest",
armor_chest: BipedSmallArmorChestSpec = "voxygen.voxel.biped_small_armor_chest_manifest", armor_chest: BipedSmallArmorChestSpec = "voxygen.voxel.biped_small_armor_chest_manifest",
armor_pants: BipedSmallArmorPantsSpec = "voxygen.voxel.biped_small_armor_pants_manifest", armor_pants: BipedSmallArmorPantsSpec = "voxygen.voxel.biped_small_armor_pants_manifest",
armor_head: BipedSmallArmorHeadSpec = "voxygen.voxel.biped_small_armor_head_manifest",
armor_tail: BipedSmallArmorTailSpec = "voxygen.voxel.biped_small_armor_tail_manifest",
}, },
|FigureKey { body, extra }, spec| { |FigureKey { body, extra }, spec| {
@ -2523,10 +2514,11 @@ make_vox_spec!(
[ [
Some(spec.central.read().0.mesh_head( third_person.map(|loadout| {
body.species, spec.armor_head.read().0.mesh_head(
body.body_type, loadout.head.as_deref(),
)), )
}),
third_person.map(|loadout| { third_person.map(|loadout| {
spec.armor_chest.read().0.mesh_chest( spec.armor_chest.read().0.mesh_chest(
loadout.chest.as_deref(), loadout.chest.as_deref(),
@ -2537,10 +2529,11 @@ make_vox_spec!(
loadout.pants.as_deref(), loadout.pants.as_deref(),
) )
}), }),
Some(spec.central.read().0.mesh_tail( third_person.map(|loadout| {
body.species, spec.armor_tail.read().0.mesh_tail(
body.body_type, loadout.belt.as_deref(),
)), )
}),
tool.and_then(|tool| tool.active.as_ref()).map(|tool| { tool.and_then(|tool| tool.active.as_ref()).map(|tool| {
spec.weapon.read().0.mesh_main( spec.weapon.read().0.mesh_main(
tool, tool,
@ -2570,40 +2563,27 @@ make_vox_spec!(
}, },
); );
impl BipedSmallCentralSpec { impl BipedSmallArmorHeadSpec {
fn mesh_head(&self, species: BSSpecies, body_type: BSBodyType) -> BoneMeshes { fn mesh_head(&self, head: Option<&str>) -> BoneMeshes {
let spec = match self.0.get(&(species, body_type)) { let spec = if let Some(head) = head {
match self.0.map.get(head) {
Some(spec) => spec, Some(spec) => spec,
None => { None => {
error!( error!(?head, "No head specification exists");
"No head specification exists for the combination of {:?} and {:?}", return load_mesh("not_found", Vec3::new(-1.5, -1.5, -7.0));
species, body_type
);
return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5));
}, },
}
} else {
&self.0.default
}; };
let central = graceful_load_segment(&spec.head.central.0);
(central, Vec3::from(spec.head.offset)) let head_segment = graceful_load_segment(&spec.vox_spec.0);
}
fn mesh_tail(&self, species: BSSpecies, body_type: BSBodyType) -> BoneMeshes { let offset = Vec3::new(spec.vox_spec.1[0], spec.vox_spec.1[1], spec.vox_spec.1[2]);
let spec = match self.0.get(&(species, body_type)) {
Some(spec) => spec,
None => {
error!(
"No tail specification exists for the combination of {:?} and {:?}",
species, body_type
);
return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5));
},
};
let central = graceful_load_segment(&spec.tail.central.0);
(central, Vec3::from(spec.tail.offset)) (head_segment, offset)
} }
} }
impl BipedSmallArmorChestSpec { impl BipedSmallArmorChestSpec {
fn mesh_chest(&self, chest: Option<&str>) -> BoneMeshes { fn mesh_chest(&self, chest: Option<&str>) -> BoneMeshes {
let spec = if let Some(chest) = chest { let spec = if let Some(chest) = chest {
@ -2625,6 +2605,27 @@ impl BipedSmallArmorChestSpec {
(chest_segment, offset) (chest_segment, offset)
} }
} }
impl BipedSmallArmorTailSpec {
fn mesh_tail(&self, tail: Option<&str>) -> BoneMeshes {
let spec = if let Some(tail) = tail {
match self.0.map.get(tail) {
Some(spec) => spec,
None => {
error!(?tail, "No tail specification exists");
return load_mesh("not_found", Vec3::new(-1.5, -1.5, -7.0));
},
}
} else {
&self.0.default
};
let tail_segment = graceful_load_segment(&spec.vox_spec.0);
let offset = Vec3::new(spec.vox_spec.1[0], spec.vox_spec.1[1], spec.vox_spec.1[2]);
(tail_segment, offset)
}
}
impl BipedSmallArmorPantsSpec { impl BipedSmallArmorPantsSpec {
fn mesh_pants(&self, pants: Option<&str>) -> BoneMeshes { fn mesh_pants(&self, pants: Option<&str>) -> BoneMeshes {
let spec = if let Some(pants) = pants { let spec = if let Some(pants) = pants {

View File

@ -1326,16 +1326,6 @@ impl FigureMgr {
skeleton_attr, skeleton_attr,
) )
}, },
/*
CharacterState::Charge(_) => {
anim::character::ChargeAnimation::update_skeleton(
&target_base,
(active_tool_kind, time),
state.state_time,
&mut state_animation_rate,
skeleton_attr,
)
}*/
CharacterState::Equipping { .. } => { CharacterState::Equipping { .. } => {
anim::character::EquipAnimation::update_skeleton( anim::character::EquipAnimation::update_skeleton(
&target_base, &target_base,

View File

@ -642,7 +642,7 @@ impl ParticleMgr {
let theta = ori_vec.y.atan2(ori_vec.x); let theta = ori_vec.y.atan2(ori_vec.x);
let dtheta = radians / distance; let dtheta = radians / distance;
let heartbeats = self.scheduler.heartbeats(Duration::from_millis(5)); let heartbeats = self.scheduler.heartbeats(Duration::from_millis(2));
for heartbeat in 0..heartbeats { for heartbeat in 0..heartbeats {
if shockwave.properties.requires_ground { if shockwave.properties.requires_ground {

View File

@ -861,17 +861,6 @@ impl Floor {
2 2
], ],
3 => vec![ 3 => vec![
EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::BipedLarge(
comp::biped_large::Body::random_with(
dynamic_rng,
&comp::biped_large::Species::Minotaur,
),
))
.with_name("Minotaur".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
],
4 => vec![
EntityInfo::at(tile_wcenter.map(|e| e as f32)) EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::Golem( .with_body(comp::Body::Golem(
comp::golem::Body::random_with( comp::golem::Body::random_with(
@ -882,6 +871,17 @@ impl Floor {
.with_name("Stonework Defender".to_string()) .with_name("Stonework Defender".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)), .with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
], ],
4 => vec![
EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::BipedLarge(
comp::biped_large::Body::random_with(
dynamic_rng,
&comp::biped_large::Species::Minotaur,
),
))
.with_name("Minotaur".to_string())
.with_loot_drop(comp::Item::new_from_asset_expect(chosen)),
],
5 => vec![ 5 => vec![
EntityInfo::at(tile_wcenter.map(|e| e as f32)) EntityInfo::at(tile_wcenter.map(|e| e as f32))
.with_body(comp::Body::BipedLarge( .with_body(comp::Body::BipedLarge(