From bc95484863cbe63cd56bec6c7560f9a00244bb56 Mon Sep 17 00:00:00 2001 From: Snowram Date: Fri, 2 Apr 2021 02:04:32 +0200 Subject: [PATCH] Swaps bird_small skeleton to a new bird_large --- assets/common/npc_names.ron | 15 +- .../voxel/bird_large_central_manifest.ron | 54 +++ .../voxel/bird_large_lateral_manifest.ron | 86 ++++ .../voxygen/voxel/npc/phoenix/male/beak.vox | 3 + .../voxygen/voxel/npc/phoenix/male/chest.vox | 3 + .../voxygen/voxel/npc/phoenix/male/foot_l.vox | 3 + .../voxygen/voxel/npc/phoenix/male/foot_r.vox | 3 + .../voxygen/voxel/npc/phoenix/male/head.vox | 3 + .../voxygen/voxel/npc/phoenix/male/leg_l.vox | 3 + .../voxygen/voxel/npc/phoenix/male/leg_r.vox | 3 + .../voxygen/voxel/npc/phoenix/male/neck.vox | 3 + .../voxel/npc/phoenix/male/tail_front.vox | 3 + .../voxel/npc/phoenix/male/tail_rear.vox | 3 + .../voxel/npc/phoenix/male/wing_in_l.vox | 3 + .../voxel/npc/phoenix/male/wing_in_r.vox | 3 + .../voxel/npc/phoenix/male/wing_mid_l.vox | 3 + .../voxel/npc/phoenix/male/wing_mid_r.vox | 3 + .../voxel/npc/phoenix/male/wing_out_l.vox | 3 + .../voxel/npc/phoenix/male/wing_out_r.vox | 3 + common/src/comp/agent.rs | 2 +- common/src/comp/body.rs | 22 +- common/src/comp/body/bird_large.rs | 79 ++++ common/src/comp/body/bird_small.rs | 66 --- common/src/comp/fluid_dynamics.rs | 4 +- common/src/comp/mod.rs | 2 +- common/src/generation.rs | 1 + common/src/npc.rs | 13 +- common/src/states/utils.rs | 10 +- server/src/rtsim/entity.rs | 2 +- voxygen/anim/src/bird_large/fly.rs | 146 ++++++ voxygen/anim/src/bird_large/idle.rs | 89 ++++ voxygen/anim/src/bird_large/mod.rs | 174 ++++++++ voxygen/anim/src/bird_large/run.rs | 140 ++++++ voxygen/anim/src/bird_small/idle.rs | 42 -- voxygen/anim/src/bird_small/jump.rs | 42 -- voxygen/anim/src/bird_small/mod.rs | 67 --- voxygen/anim/src/bird_small/run.rs | 42 -- voxygen/anim/src/lib.rs | 2 +- .../audio/sfx/event_mapper/movement/mod.rs | 4 +- .../audio/sfx/event_mapper/movement/tests.rs | 8 +- voxygen/src/scene/figure/load.rs | 416 +++++++++++++++--- voxygen/src/scene/figure/mod.rs | 78 ++-- 42 files changed, 1281 insertions(+), 373 deletions(-) create mode 100644 assets/voxygen/voxel/bird_large_central_manifest.ron create mode 100644 assets/voxygen/voxel/bird_large_lateral_manifest.ron create mode 100644 assets/voxygen/voxel/npc/phoenix/male/beak.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/chest.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/foot_l.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/foot_r.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/head.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/leg_l.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/leg_r.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/neck.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/tail_front.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/tail_rear.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/wing_in_l.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/wing_in_r.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/wing_mid_l.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/wing_mid_r.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/wing_out_l.vox create mode 100644 assets/voxygen/voxel/npc/phoenix/male/wing_out_r.vox create mode 100644 common/src/comp/body/bird_large.rs delete mode 100644 common/src/comp/body/bird_small.rs create mode 100644 voxygen/anim/src/bird_large/fly.rs create mode 100644 voxygen/anim/src/bird_large/idle.rs create mode 100644 voxygen/anim/src/bird_large/mod.rs create mode 100644 voxygen/anim/src/bird_large/run.rs delete mode 100644 voxygen/anim/src/bird_small/idle.rs delete mode 100644 voxygen/anim/src/bird_small/jump.rs delete mode 100644 voxygen/anim/src/bird_small/mod.rs delete mode 100644 voxygen/anim/src/bird_small/run.rs diff --git a/assets/common/npc_names.ron b/assets/common/npc_names.ron index 5f273b5593..71d0a83499 100644 --- a/assets/common/npc_names.ron +++ b/assets/common/npc_names.ron @@ -1068,12 +1068,19 @@ ) ) ), - bird_small: ( + bird_large: ( body: ( - keyword: "bird_small", - names_0: [] + keyword: "bird_large", + names_0: [ + "Aitvaras" + ] ), - species: () + species: ( + phoenix: ( + keyword: "phoenix", + generic: "Phoenix" + ), + ) ), quadruped_low: ( body: ( diff --git a/assets/voxygen/voxel/bird_large_central_manifest.ron b/assets/voxygen/voxel/bird_large_central_manifest.ron new file mode 100644 index 0000000000..2671ef6b84 --- /dev/null +++ b/assets/voxygen/voxel/bird_large_central_manifest.ron @@ -0,0 +1,54 @@ +({ + (Phoenix, Male): ( + head: ( + offset: (-2.0, -1.0, -0.0), + central: ("npc.phoenix.male.head"), + ), + beak: ( + offset: (-2.0, 0.0, -1.0), + central: ("npc.phoenix.male.beak"), + ), + neck: ( + offset: (-2.0, -0.0, -0.0), + central: ("npc.phoenix.male.neck"), + ), + chest: ( + offset: (-3.0, -5.5, -4.0), + central: ("npc.phoenix.male.chest"), + ), + tail_front: ( + offset: (-2.0, -3.0, -3.0), + central: ("npc.phoenix.male.tail_front"), + ), + tail_rear: ( + offset: (-1.0, -3.0, -3.0), + central: ("npc.phoenix.male.tail_rear"), + ) + ), + (Phoenix, Female): ( + head: ( + offset: (-2.0, -1.0, -0.0), + central: ("npc.phoenix.male.head"), + ), + beak: ( + offset: (-2.0, 0.0, -1.0), + central: ("npc.phoenix.male.beak"), + ), + neck: ( + offset: (-2.0, -0.0, -0.0), + central: ("npc.phoenix.male.neck"), + ), + chest: ( + offset: (-3.0, -5.5, -4.0), + central: ("npc.phoenix.male.chest"), + ), + tail_front: ( + offset: (-2.0, -3.0, -3.0), + central: ("npc.phoenix.male.tail_front"), + ), + tail_rear: ( + offset: (-1.0, -3.0, -3.0), + central: ("npc.phoenix.male.tail_rear"), + ) + ), +}) diff --git a/assets/voxygen/voxel/bird_large_lateral_manifest.ron b/assets/voxygen/voxel/bird_large_lateral_manifest.ron new file mode 100644 index 0000000000..1f8e4ab12d --- /dev/null +++ b/assets/voxygen/voxel/bird_large_lateral_manifest.ron @@ -0,0 +1,86 @@ +({ + (Phoenix, Male): ( + wing_in_l: ( + offset: (-6.0, -5.0, -2.0), + lateral: ("npc.phoenix.male.wing_in_l"), + ), + wing_in_r: ( + offset: (0.0, -5.0, -2.0), + lateral: ("npc.phoenix.male.wing_in_r"), + ), + wing_mid_l: ( + offset: (-2.5, -7.0, -2.0), + lateral: ("npc.phoenix.male.wing_mid_l"), + ), + wing_mid_r: ( + offset: (-2.5, -7.0, -2.0), + lateral: ("npc.phoenix.male.wing_mid_r"), + ), + wing_out_l: ( + offset: (-9.0, -8.0, -2.0), + lateral: ("npc.phoenix.male.wing_out_l"), + ), + wing_out_r: ( + offset: (0.0, -8.0, -2.0), + lateral: ("npc.phoenix.male.wing_out_r"), + ), + leg_l: ( + offset: (-1.5, -1.5, -1.5), + lateral: ("npc.phoenix.male.leg_l"), + ), + leg_r: ( + offset: (-1.5, -1.5, -1.5), + lateral: ("npc.phoenix.male.leg_r"), + ), + foot_l: ( + offset: (-1.5, -2.0, -4.0), + lateral: ("npc.phoenix.male.foot_l"), + ), + foot_r: ( + offset: (-1.5, -2.0, -4.0), + lateral: ("npc.phoenix.male.foot_r"), + ) + ), + (Phoenix, Female): ( + wing_in_l: ( + offset: (-6.0, -5.0, -2.0), + lateral: ("npc.phoenix.male.wing_in_l"), + ), + wing_in_r: ( + offset: (0.0, -5.0, -2.0), + lateral: ("npc.phoenix.male.wing_in_r"), + ), + wing_mid_l: ( + offset: (-2.5, -7.0, -2.0), + lateral: ("npc.phoenix.male.wing_mid_l"), + ), + wing_mid_r: ( + offset: (-2.5, -7.0, -2.0), + lateral: ("npc.phoenix.male.wing_mid_r"), + ), + wing_out_l: ( + offset: (-9.0, -8.0, -2.0), + lateral: ("npc.phoenix.male.wing_out_l"), + ), + wing_out_r: ( + offset: (0.0, -8.0, -2.0), + lateral: ("npc.phoenix.male.wing_out_r"), + ), + leg_l: ( + offset: (-1.5, -1.5, -1.5), + lateral: ("npc.phoenix.male.leg_l"), + ), + leg_r: ( + offset: (-1.5, -1.5, -1.5), + lateral: ("npc.phoenix.male.leg_r"), + ), + foot_l: ( + offset: (-1.5, -2.0, -4.0), + lateral: ("npc.phoenix.male.foot_l"), + ), + foot_r: ( + offset: (-1.5, -2.0, -4.0), + lateral: ("npc.phoenix.male.foot_r"), + ) + ), +}) \ No newline at end of file diff --git a/assets/voxygen/voxel/npc/phoenix/male/beak.vox b/assets/voxygen/voxel/npc/phoenix/male/beak.vox new file mode 100644 index 0000000000..3e741877d1 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/beak.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87f096438df3e7962be2a18123c76e229877f7b0cc87cd464812041ee10185bb +size 26739 diff --git a/assets/voxygen/voxel/npc/phoenix/male/chest.vox b/assets/voxygen/voxel/npc/phoenix/male/chest.vox new file mode 100644 index 0000000000..cda3cf94e9 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/chest.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e5532902efb783e2c98cc17d8e19264cadd3040d0805ba975db528476876140 +size 2120 diff --git a/assets/voxygen/voxel/npc/phoenix/male/foot_l.vox b/assets/voxygen/voxel/npc/phoenix/male/foot_l.vox new file mode 100644 index 0000000000..bde15a7c43 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/foot_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9f61f8cfac427534cd542007480b88893f669a95c12c69640abed0a83d7cf75 +size 1156 diff --git a/assets/voxygen/voxel/npc/phoenix/male/foot_r.vox b/assets/voxygen/voxel/npc/phoenix/male/foot_r.vox new file mode 100644 index 0000000000..bde15a7c43 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/foot_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9f61f8cfac427534cd542007480b88893f669a95c12c69640abed0a83d7cf75 +size 1156 diff --git a/assets/voxygen/voxel/npc/phoenix/male/head.vox b/assets/voxygen/voxel/npc/phoenix/male/head.vox new file mode 100644 index 0000000000..7ecd09f783 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/head.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c0de42ab8cca96d8c3cea12a7bcf57229ffc5ab4eb7a7a31265129afc48fa7b +size 1408 diff --git a/assets/voxygen/voxel/npc/phoenix/male/leg_l.vox b/assets/voxygen/voxel/npc/phoenix/male/leg_l.vox new file mode 100644 index 0000000000..3399409d3a --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/leg_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d31f5f6553d9b9e1739c0afc4ebe2f3d84eadfa8f88eed13c6a74ad94ce3cec8 +size 1172 diff --git a/assets/voxygen/voxel/npc/phoenix/male/leg_r.vox b/assets/voxygen/voxel/npc/phoenix/male/leg_r.vox new file mode 100644 index 0000000000..3399409d3a --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/leg_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d31f5f6553d9b9e1739c0afc4ebe2f3d84eadfa8f88eed13c6a74ad94ce3cec8 +size 1172 diff --git a/assets/voxygen/voxel/npc/phoenix/male/neck.vox b/assets/voxygen/voxel/npc/phoenix/male/neck.vox new file mode 100644 index 0000000000..0fca2ba645 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/neck.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62e1607fb522f218a0ed7273449bb08bf65a9b1b8265417768abc104461be4fe +size 1240 diff --git a/assets/voxygen/voxel/npc/phoenix/male/tail_front.vox b/assets/voxygen/voxel/npc/phoenix/male/tail_front.vox new file mode 100644 index 0000000000..96064d0c2e --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/tail_front.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6e7de90bc10879198eacdd3a90c2b79555976e11bd22391cec26c68ced49ea6 +size 1136 diff --git a/assets/voxygen/voxel/npc/phoenix/male/tail_rear.vox b/assets/voxygen/voxel/npc/phoenix/male/tail_rear.vox new file mode 100644 index 0000000000..c6520c5d71 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/tail_rear.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23b717da1b45a0991c1da78baedff2f1d3b10ab8b8d1db56fa4151413428ddf0 +size 1120 diff --git a/assets/voxygen/voxel/npc/phoenix/male/wing_in_l.vox b/assets/voxygen/voxel/npc/phoenix/male/wing_in_l.vox new file mode 100644 index 0000000000..a5519a63dd --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/wing_in_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17b3fcf2ca92de9478495abb38b9b4c1dc8860eb4550abc31613be9b7e8e1aa7 +size 1248 diff --git a/assets/voxygen/voxel/npc/phoenix/male/wing_in_r.vox b/assets/voxygen/voxel/npc/phoenix/male/wing_in_r.vox new file mode 100644 index 0000000000..de19144625 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/wing_in_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef70ed895f052308aea2b1d9302597d981a8b60ad581857663753aa8b27d9815 +size 1248 diff --git a/assets/voxygen/voxel/npc/phoenix/male/wing_mid_l.vox b/assets/voxygen/voxel/npc/phoenix/male/wing_mid_l.vox new file mode 100644 index 0000000000..88eba2be05 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/wing_mid_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7aa8b949cffebf4fd59e7945792defa28eac3151e1873018e1debdf4f7616a9c +size 1204 diff --git a/assets/voxygen/voxel/npc/phoenix/male/wing_mid_r.vox b/assets/voxygen/voxel/npc/phoenix/male/wing_mid_r.vox new file mode 100644 index 0000000000..cd9a41ac54 --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/wing_mid_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1098fd85915c6ee7a96be7cbd2926c3b1a3565f87a23798cc0a564f3ead1d04 +size 1204 diff --git a/assets/voxygen/voxel/npc/phoenix/male/wing_out_l.vox b/assets/voxygen/voxel/npc/phoenix/male/wing_out_l.vox new file mode 100644 index 0000000000..ad01ca23ad --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/wing_out_l.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:08e8b0ae325de84ca1a50205415dc4300e47cea795447f4572dcc4ea3299a817 +size 1272 diff --git a/assets/voxygen/voxel/npc/phoenix/male/wing_out_r.vox b/assets/voxygen/voxel/npc/phoenix/male/wing_out_r.vox new file mode 100644 index 0000000000..46444d12ed --- /dev/null +++ b/assets/voxygen/voxel/npc/phoenix/male/wing_out_r.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70636fce4dd61aa20c975f43c516e4586afad18d47eca78d5125b1aee66f4e70 +size 1272 diff --git a/common/src/comp/agent.rs b/common/src/comp/agent.rs index a777055891..68b30b314f 100644 --- a/common/src/comp/agent.rs +++ b/common/src/comp/agent.rs @@ -247,7 +247,7 @@ impl<'a> From<&'a Body> for Psyche { }, Body::BipedSmall(_) => 0.5, Body::BirdMedium(_) => 0.5, - Body::BirdSmall(_) => 0.4, + Body::BirdLarge(_) => 0.4, Body::FishMedium(_) => 0.15, Body::FishSmall(_) => 0.0, Body::BipedLarge(_) => 1.0, diff --git a/common/src/comp/body.rs b/common/src/comp/body.rs index 4da8d22f83..cca0db27de 100644 --- a/common/src/comp/body.rs +++ b/common/src/comp/body.rs @@ -1,7 +1,7 @@ pub mod biped_large; pub mod biped_small; +pub mod bird_large; pub mod bird_medium; -pub mod bird_small; pub mod dragon; pub mod fish_medium; pub mod fish_small; @@ -38,7 +38,7 @@ make_case_elim!( BirdMedium(body: bird_medium::Body) = 3, FishMedium(body: fish_medium::Body) = 4, Dragon(body: dragon::Body) = 5, - BirdSmall(body: bird_small::Body) = 6, + BirdLarge(body: bird_large::Body) = 6, FishSmall(body: fish_small::Body) = 7, BipedLarge(body: biped_large::Body)= 8, BipedSmall(body: biped_small::Body)= 9, @@ -73,7 +73,7 @@ pub struct AllBodies { pub bird_medium: BodyData>, pub fish_medium: BodyData>, pub dragon: BodyData>, - pub bird_small: BodyData, + pub bird_large: BodyData>, pub fish_small: BodyData>, pub biped_large: BodyData>, pub biped_small: BodyData>, @@ -95,6 +95,7 @@ impl core::ops::Index for AllBodies &self.quadruped_small.body, NpcKind::Wolf => &self.quadruped_medium.body, NpcKind::Duck => &self.bird_medium.body, + NpcKind::Phoenix => &self.bird_large.body, NpcKind::Marlin => &self.fish_medium.body, NpcKind::Clownfish => &self.fish_small.body, NpcKind::Ogre => &self.biped_large.body, @@ -118,9 +119,10 @@ impl<'a, BodyMeta, SpeciesMeta> core::ops::Index<&'a Body> for AllBodies &self.quadruped_small.body, Body::QuadrupedMedium(_) => &self.quadruped_medium.body, Body::BirdMedium(_) => &self.bird_medium.body, + Body::BirdLarge(_) => &self.bird_large.body, Body::FishMedium(_) => &self.fish_medium.body, Body::Dragon(_) => &self.dragon.body, - Body::BirdSmall(_) => &self.bird_small.body, + Body::BirdLarge(_) => &self.bird_large.body, Body::FishSmall(_) => &self.fish_small.body, Body::BipedLarge(_) => &self.biped_large.body, Body::BipedSmall(_) => &self.biped_small.body, @@ -152,7 +154,7 @@ impl Body { let d = match self { // based on a house sparrow (Passer domesticus) Body::BirdMedium(_) => 700.0, - Body::BirdSmall(_) => 700.0, + Body::BirdLarge(_) => 700.0, // based on its mass divided by the volume of a bird scaled up to the size of the dragon Body::Dragon(_) => 3_700.0, @@ -184,7 +186,7 @@ impl Body { // ravens are 0.69-2 kg, crows are 0.51 kg on average Body::BirdMedium(_) => 1.0, // australian magpies are around 0.22-0.35 kg - Body::BirdSmall(_) => 0.3, + Body::BirdLarge(_) => 0.3, Body::Dragon(_) => 20_000.0, Body::FishMedium(_) => 2.5, @@ -285,7 +287,7 @@ impl Body { bird_medium::Species::Cockatrice => Vec3::new(2.0, 1.0, 1.8), _ => Vec3::new(2.0, 1.0, 1.1), }, - Body::BirdSmall(_) => Vec3::new(1.2, 0.6, 1.1), + Body::BirdLarge(_) => Vec3::new(1.2, 0.6, 1.1), Body::Dragon(_) => Vec3::new(16.0, 10.0, 16.0), Body::FishMedium(_) => Vec3::new(0.5, 2.0, 0.8), Body::FishSmall(_) => Vec3::new(0.3, 1.2, 0.6), @@ -435,7 +437,7 @@ impl Body { }, Body::FishMedium(_) => 50, Body::Dragon(_) => 5000, - Body::BirdSmall(_) => 50, + Body::BirdLarge(_) => 50, Body::FishSmall(_) => 20, Body::BipedLarge(biped_large) => match biped_large.species { biped_large::Species::Ogre => 2500, @@ -548,7 +550,7 @@ impl Body { }, Body::FishMedium(_) => 10, Body::Dragon(_) => 500, - Body::BirdSmall(_) => 10, + Body::BirdLarge(_) => 10, Body::FishSmall(_) => 10, Body::BipedLarge(biped_large) => match biped_large.species { biped_large::Species::Ogre => 70, @@ -587,7 +589,7 @@ impl Body { pub fn flying_height(&self) -> f32 { match self { - Body::BirdSmall(_) => 30.0, + Body::BirdLarge(_) => 30.0, Body::BirdMedium(_) => 40.0, Body::Dragon(_) => 60.0, Body::Ship(ship::Body::DefaultAirship) => 60.0, diff --git a/common/src/comp/body/bird_large.rs b/common/src/comp/body/bird_large.rs new file mode 100644 index 0000000000..2c12eee089 --- /dev/null +++ b/common/src/comp/body/bird_large.rs @@ -0,0 +1,79 @@ +use crate::{make_case_elim, make_proj_elim}; +use rand::{seq::SliceRandom, thread_rng}; +use serde::{Deserialize, Serialize}; + +make_proj_elim!( + body, + #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] + pub struct Body { + pub species: Species, + pub body_type: BodyType, + } +); + +impl Body { + pub fn random() -> Self { + let mut rng = thread_rng(); + let species = *(&ALL_SPECIES).choose(&mut rng).unwrap(); + Self::random_with(&mut rng, &species) + } + + #[inline] + pub fn random_with(rng: &mut impl rand::Rng, &species: &Species) -> Self { + let body_type = *(&ALL_BODY_TYPES).choose(rng).unwrap(); + Self { species, body_type } + } +} + +impl From for super::Body { + fn from(body: Body) -> Self { super::Body::BirdLarge(body) } +} + +make_case_elim!( + species, + #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] + #[repr(u32)] + pub enum Species { + Phoenix = 0, + } +); + +/// Data representing per-species generic data. +/// +/// NOTE: Deliberately don't (yet?) implement serialize. +#[derive(Clone, Debug, Deserialize)] +pub struct AllSpecies { + pub phoenix: SpeciesMeta, +} + +impl<'a, SpeciesMeta> core::ops::Index<&'a Species> for AllSpecies { + type Output = SpeciesMeta; + + #[inline] + fn index(&self, &index: &'a Species) -> &Self::Output { + match index { + Species::Phoenix => &self.phoenix, + } + } +} + +pub const ALL_SPECIES: [Species; 1] = [Species::Phoenix]; + +impl<'a, SpeciesMeta: 'a> IntoIterator for &'a AllSpecies { + type IntoIter = std::iter::Copied>; + type Item = Species; + + fn into_iter(self) -> Self::IntoIter { ALL_SPECIES.iter().copied() } +} + +make_case_elim!( + body_type, + #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] + #[repr(u32)] + pub enum BodyType { + Female = 0, + Male = 1, + } +); + +pub const ALL_BODY_TYPES: [BodyType; 2] = [BodyType::Female, BodyType::Male]; diff --git a/common/src/comp/body/bird_small.rs b/common/src/comp/body/bird_small.rs deleted file mode 100644 index a3be8c3087..0000000000 --- a/common/src/comp/body/bird_small.rs +++ /dev/null @@ -1,66 +0,0 @@ -use crate::{make_case_elim, make_proj_elim}; -use rand::{seq::SliceRandom, thread_rng}; -use serde::{Deserialize, Serialize}; - -make_proj_elim!( - body, - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] - pub struct Body { - pub head: Head, - pub torso: Torso, - pub wing_l: WingL, - pub wing_r: WingR, - } -); - -impl Body { - pub fn random() -> Self { - let mut rng = thread_rng(); - Self { - head: *(&ALL_HEADS).choose(&mut rng).unwrap(), - torso: *(&ALL_TORSOS).choose(&mut rng).unwrap(), - wing_l: *(&ALL_WING_LS).choose(&mut rng).unwrap(), - wing_r: *(&ALL_WING_RS).choose(&mut rng).unwrap(), - } - } -} - -make_case_elim!( - head, - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] - #[repr(u32)] - pub enum Head { - Default = 0, - } -); -const ALL_HEADS: [Head; 1] = [Head::Default]; - -make_case_elim!( - torso, - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] - #[repr(u32)] - pub enum Torso { - Default = 0, - } -); -const ALL_TORSOS: [Torso; 1] = [Torso::Default]; - -make_case_elim!( - wing_l, - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] - #[repr(u32)] - pub enum WingL { - Default = 0, - } -); -const ALL_WING_LS: [WingL; 1] = [WingL::Default]; - -make_case_elim!( - wing_r, - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] - #[repr(u32)] - pub enum WingR { - Default = 0, - } -); -const ALL_WING_RS: [WingR; 1] = [WingR::Default]; diff --git a/common/src/comp/fluid_dynamics.rs b/common/src/comp/fluid_dynamics.rs index 79b60eaf2e..6508160168 100644 --- a/common/src/comp/fluid_dynamics.rs +++ b/common/src/comp/fluid_dynamics.rs @@ -129,11 +129,11 @@ impl Body { }, // Cross-section, zero-lift angle; exclude the wings (width * 0.2) - Body::BirdMedium(_) | Body::BirdSmall(_) | Body::Dragon(_) => { + Body::BirdMedium(_) | Body::BirdLarge(_) | Body::Dragon(_) => { let dim = self.dimensions().map(|a| a * 0.5); let cd = match self { Body::BirdMedium(_) => 0.2, - Body::BirdSmall(_) => 0.4, + Body::BirdLarge(_) => 0.4, _ => 0.7, }; cd * std::f32::consts::PI * dim.x * 0.2 * dim.z diff --git a/common/src/comp/mod.rs b/common/src/comp/mod.rs index 2c3664a2c7..5f563a3836 100644 --- a/common/src/comp/mod.rs +++ b/common/src/comp/mod.rs @@ -50,7 +50,7 @@ pub use self::{ aura::{Aura, AuraChange, AuraKind, Auras}, beam::{Beam, BeamSegment}, body::{ - biped_large, biped_small, bird_medium, bird_small, dragon, fish_medium, fish_small, golem, + biped_large, biped_small, bird_large, bird_medium, dragon, fish_medium, fish_small, golem, humanoid, object, quadruped_low, quadruped_medium, quadruped_small, ship, theropod, AllBodies, Body, BodyData, }, diff --git a/common/src/generation.rs b/common/src/generation.rs index 9b187ecc05..e922f604c7 100644 --- a/common/src/generation.rs +++ b/common/src/generation.rs @@ -135,6 +135,7 @@ impl EntityInfo { Some(get_npc_name(&npc_names.quadruped_medium, body.species)) }, Body::BirdMedium(body) => Some(get_npc_name(&npc_names.bird_medium, body.species)), + Body::BirdLarge(body) => Some(get_npc_name(&npc_names.bird_large, body.species)), Body::FishSmall(body) => Some(get_npc_name(&npc_names.fish_small, body.species)), Body::FishMedium(body) => Some(get_npc_name(&npc_names.fish_medium, body.species)), Body::Theropod(body) => Some(get_npc_name(&npc_names.theropod, body.species)), diff --git a/common/src/npc.rs b/common/src/npc.rs index d7eebe5f17..5712c33696 100644 --- a/common/src/npc.rs +++ b/common/src/npc.rs @@ -13,6 +13,7 @@ pub enum NpcKind { Wolf, Pig, Duck, + Phoenix, Clownfish, Marlin, Ogre, @@ -23,11 +24,12 @@ pub enum NpcKind { Crocodile, } -pub const ALL_NPCS: [NpcKind; 12] = [ +pub const ALL_NPCS: [NpcKind; 13] = [ NpcKind::Humanoid, NpcKind::Wolf, NpcKind::Pig, NpcKind::Duck, + NpcKind::Phoenix, NpcKind::Clownfish, NpcKind::Marlin, NpcKind::Ogre, @@ -122,6 +124,7 @@ pub fn kind_to_body(kind: NpcKind) -> Body { NpcKind::Pig => comp::quadruped_small::Body::random().into(), NpcKind::Wolf => comp::quadruped_medium::Body::random().into(), NpcKind::Duck => comp::bird_medium::Body::random().into(), + NpcKind::Phoenix => comp::bird_large::Body::random().into(), NpcKind::Clownfish => comp::fish_small::Body::random().into(), NpcKind::Marlin => comp::fish_medium::Body::random().into(), NpcKind::Ogre => comp::biped_large::Body::random().into(), @@ -228,6 +231,14 @@ impl NpcBody { comp::bird_medium::Body::random_with, ) }) + .or_else(|| { + parse( + s, + NpcKind::Phoenix, + &npc_names.bird_large, + comp::bird_large::Body::random_with, + ) + }) .or_else(|| { parse( s, diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 654fa44ade..d5a5acdf23 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -77,7 +77,7 @@ impl Body { Body::BirdMedium(_) => 80.0, Body::FishMedium(_) => 80.0, Body::Dragon(_) => 250.0, - Body::BirdSmall(_) => 75.0, + Body::BirdLarge(_) => 75.0, Body::FishSmall(_) => 60.0, Body::BipedSmall(biped_small) => match biped_small.species { biped_small::Species::Haniwa => 65.0, @@ -133,7 +133,7 @@ impl Body { Body::BirdMedium(_) => 6.0, Body::FishMedium(_) => 6.0, Body::Dragon(_) => 1.0, - Body::BirdSmall(_) => 7.0, + Body::BirdLarge(_) => 7.0, Body::FishSmall(_) => 7.0, Body::BipedLarge(_) => 1.6, Body::BipedSmall(_) => 2.4, @@ -165,7 +165,7 @@ impl Body { Body::BipedLarge(_) | Body::Golem(_) => Some(200.0 * self.mass().0), Body::BipedSmall(_) => Some(100.0 * self.mass().0), Body::BirdMedium(_) => Some(50.0 * self.mass().0), - Body::BirdSmall(_) => Some(50.0 * self.mass().0), + Body::BirdLarge(_) => Some(50.0 * self.mass().0), Body::FishMedium(_) => Some(50.0 * self.mass().0), Body::FishSmall(_) => Some(50.0 * self.mass().0), Body::Dragon(_) => Some(200.0 * self.mass().0), @@ -188,7 +188,7 @@ impl Body { pub fn fly_thrust(&self) -> Option { match self { Body::BirdMedium(_) => Some(GRAVITY * self.mass().0 * 2.0), - Body::BirdSmall(_) => Some(GRAVITY * self.mass().0 * 2.0), + Body::BirdLarge(_) => Some(GRAVITY * self.mass().0 * 2.0), Body::Dragon(_) => Some(200_000.0), Body::Ship(ship::Body::DefaultAirship) => Some(300_000.0), _ => None, @@ -377,7 +377,7 @@ pub fn fly_move(data: &JoinData, update: &mut StateUpdate, efficiency: f32) -> b // Elevation control match data.body { // flappy flappy - Body::Dragon(_) | Body::BirdMedium(_) | Body::BirdSmall(_) => { + Body::Dragon(_) | Body::BirdMedium(_) | Body::BirdLarge(_) => { let anti_grav = GRAVITY * (1.0 + data.inputs.move_z.min(0.0)); update.vel.0.z += data.dt.0 * (anti_grav + accel * data.inputs.move_z.max(0.0)); }, diff --git a/server/src/rtsim/entity.rs b/server/src/rtsim/entity.rs index 8d265b929d..c79a4e3b43 100644 --- a/server/src/rtsim/entity.rs +++ b/server/src/rtsim/entity.rs @@ -60,7 +60,7 @@ impl Entity { comp::Body::BirdMedium(b) => { get_npc_name(&npc_names.bird_medium, b.species).to_string() }, - comp::Body::BirdSmall(_) => "Warbler".to_string(), + comp::Body::BirdLarge(_) => "Warbler".to_string(), comp::Body::Dragon(b) => get_npc_name(&npc_names.dragon, b.species).to_string(), comp::Body::Humanoid(b) => get_npc_name(&npc_names.humanoid, b.species).to_string(), comp::Body::Ship(_) => "Veloren Air".to_string(), diff --git a/voxygen/anim/src/bird_large/fly.rs b/voxygen/anim/src/bird_large/fly.rs new file mode 100644 index 0000000000..e5b1ec551c --- /dev/null +++ b/voxygen/anim/src/bird_large/fly.rs @@ -0,0 +1,146 @@ +use super::{ + super::{vek::*, Animation}, + BirdLargeSkeleton, SkeletonAttr, +}; + +pub struct FlyAnimation; + +impl Animation for FlyAnimation { + type Dependency = (Vec3, Vec3, Vec3, f32, Vec3, f32); + type Skeleton = BirdLargeSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"bird_large_fly\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_fly")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (velocity, orientation, last_ori, _global_time, avg_vel, _acc_vel): Self::Dependency, + anim_time: f32, + _rate: &mut f32, + s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let slow = (anim_time * 2.0).sin(); + let fast = (anim_time * 4.0).sin(); + + let freq = 8.0; + let off1 = 0.0; + let off2 = -1.7; + let off3 = -2.0; + let off4 = -2.4; + let flap1 = 7.0 / 16.0 * (freq * anim_time + off1).sin() + + 7.0 / 64.0 * (freq * 2.0 * anim_time + off1).sin() + + 1.0 / 48.0 * (freq * 3.0 * anim_time + off1).sin(); + let flap2 = 7.0 / 16.0 * (freq * anim_time + off2).sin() + + 7.0 / 64.0 * (freq * 2.0 * anim_time + off2).sin() + + 1.0 / 48.0 * (freq * 3.0 * anim_time + off2).sin(); + let flap3 = 7.0 / 16.0 * (freq * anim_time + off3).sin() + + 7.0 / 64.0 * (freq * 2.0 * anim_time + off3).sin() + + 1.0 / 48.0 * (freq * 3.0 * anim_time + off3).sin(); + let flap4 = 7.0 / 16.0 * (freq * anim_time + off4).sin() + + 7.0 / 64.0 * (freq * 2.0 * anim_time + off4).sin() + + 1.0 / 48.0 * (freq * 3.0 * anim_time + off4).sin(); + + let ori: Vec2 = 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; + let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude()); + + next.chest.scale = Vec3::one() * s_a.scaler / 4.0; + + next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); + next.neck.orientation = Quaternion::rotation_x(0.2); + + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1 - 3.0); + next.head.orientation = Quaternion::rotation_x(0.2 + fast * 0.05); + + next.beak.position = Vec3::new(0.0, s_a.beak.0, s_a.beak.1); + + dbg!(velocity); + if velocity.z > 2.0 { + next.chest.position = + Vec3::new(0.0, s_a.chest.0, s_a.chest.1 - flap4 * 1.5) * s_a.scaler / 4.0; + next.chest.orientation = + Quaternion::rotation_x(-0.5 - flap1 * 0.2) * Quaternion::rotation_y(tilt * 1.8); + + next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + + next.wing_in_l.orientation = + Quaternion::rotation_y(-flap1 * 1.9 + 0.2) * Quaternion::rotation_x(0.4); + next.wing_in_r.orientation = + Quaternion::rotation_y(flap1 * 1.9 - 0.2) * Quaternion::rotation_x(0.4); + + next.wing_mid_l.position = Vec3::new(-s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_r.position = Vec3::new(s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_l.orientation = Quaternion::rotation_y(-flap2 * 1.4 - 0.2); + next.wing_mid_r.orientation = Quaternion::rotation_y(flap2 * 1.4 + 0.2); + + next.wing_out_l.position = Vec3::new(-s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_r.position = Vec3::new(s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_l.orientation = Quaternion::rotation_y(-flap3 * 1.2 - 0.3); + next.wing_out_r.orientation = Quaternion::rotation_y(flap3 * 1.2 + 0.3); + + next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1); + next.tail_front.orientation = + Quaternion::rotation_x(-flap2 * 0.2) * Quaternion::rotation_z(-tilt * 1.0); + next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1); + next.tail_rear.orientation = + Quaternion::rotation_x(-flap3 * 0.3) * Quaternion::rotation_z(-tilt * 1.0); + } else { + next.chest.position = + Vec3::new(0.0, s_a.chest.0, s_a.chest.1 + slow * 0.05) * s_a.scaler / 4.0; + next.chest.orientation = + Quaternion::rotation_x(-0.5 + slow * 0.05) * Quaternion::rotation_y(tilt * 1.8); + + next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + + next.wing_in_l.orientation = + Quaternion::rotation_y(0.1 + slow * 0.04) * Quaternion::rotation_x(0.6); + next.wing_in_r.orientation = + Quaternion::rotation_y(-0.1 + slow * -0.04) * Quaternion::rotation_x(0.6); + + next.wing_mid_l.position = Vec3::new(-s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_r.position = Vec3::new(s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_l.orientation = Quaternion::rotation_y(0.1 + slow * 0.04); + next.wing_mid_r.orientation = Quaternion::rotation_y(-0.1 + slow * -0.04); + + next.wing_out_l.position = Vec3::new(-s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_r.position = Vec3::new(s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_l.orientation = Quaternion::rotation_y(0.1 + slow * 0.04); + next.wing_out_r.orientation = Quaternion::rotation_y(-0.1 + slow * -0.04); + + next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1); + next.tail_front.orientation = + Quaternion::rotation_x(slow * 0.04) * Quaternion::rotation_z(-tilt * 1.0); + next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1); + next.tail_rear.orientation = + Quaternion::rotation_x(-0.2 + slow * 0.08) * Quaternion::rotation_z(-tilt * 1.0); + } + + next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + 3.0); + next.leg_l.orientation = Quaternion::rotation_x(-1.0 - flap1 * 0.1); + next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + 3.0); + next.leg_r.orientation = Quaternion::rotation_x(-1.0 - flap1 * 0.1); + + next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2); + next.foot_l.orientation = Quaternion::rotation_x(-1.0 - flap1 * 0.1); + next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2); + next.foot_r.orientation = Quaternion::rotation_x(-1.0 - flap1 * 0.1); + + next + } +} diff --git a/voxygen/anim/src/bird_large/idle.rs b/voxygen/anim/src/bird_large/idle.rs new file mode 100644 index 0000000000..f25cfa7664 --- /dev/null +++ b/voxygen/anim/src/bird_large/idle.rs @@ -0,0 +1,89 @@ +use super::{ + super::{vek::*, Animation}, + BirdLargeSkeleton, SkeletonAttr, +}; + +pub struct IdleAnimation; + +impl Animation for IdleAnimation { + type Dependency = f32; + type Skeleton = BirdLargeSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"bird_large_idle\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_idle")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + _global_time: Self::Dependency, + anim_time: f32, + _rate: &mut f32, + s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + + let fast = anim_time * 4.0; + + let freq = 8.0; + let off2 = -1.7; + let off3 = -2.0; + let off4 = -2.4; + let flap1 = 7.0 / 16.0 * (freq * anim_time).sin() + + 7.0 / 64.0 * (freq * 2.0 * anim_time).sin() + + 1.0 / 48.0 * (freq * 3.0 * anim_time).sin(); + let flap2 = 7.0 / 16.0 * (freq * anim_time + off2).sin() + + 7.0 / 64.0 * (freq * 2.0 * anim_time + off2).sin() + + 1.0 / 48.0 * (freq * 3.0 * anim_time + off2).sin(); + let flap3 = 7.0 / 16.0 * (freq * anim_time + off3).sin() + + 7.0 / 64.0 * (freq * 2.0 * anim_time + off3).sin() + + 1.0 / 48.0 * (freq * 3.0 * anim_time + off3).sin(); + let flap4 = 7.0 / 16.0 * (freq * anim_time + off4).sin() + + 7.0 / 64.0 * (freq * 2.0 * anim_time + off4).sin() + + 1.0 / 48.0 * (freq * 3.0 * anim_time + off4).sin(); + + next.chest.scale = Vec3::one() * s_a.scaler / 4.0; + next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1) * s_a.scaler / 4.0; + next.chest.orientation = Quaternion::rotation_x(0.0); + + next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); + next.neck.orientation = Quaternion::rotation_x(0.0); + + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.head.orientation = Quaternion::rotation_x(0.0); + + next.beak.position = Vec3::new(0.0, s_a.beak.0, s_a.beak.1); + + next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1); + next.tail_front.orientation = Quaternion::rotation_x(0.0); + next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1); + next.tail_rear.orientation = Quaternion::rotation_x(0.0); + + next.wing_in_l.position = Vec3::new(-s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + next.wing_in_r.position = Vec3::new(s_a.wing_in.0, s_a.wing_in.1, s_a.wing_in.2); + + next.wing_in_l.orientation = Quaternion::rotation_y(0.0); + next.wing_in_r.orientation = Quaternion::rotation_y(0.0) * Quaternion::rotation_x(0.0); + + next.wing_mid_l.position = Vec3::new(-s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_r.position = Vec3::new(s_a.wing_mid.0, s_a.wing_mid.1, s_a.wing_mid.2); + next.wing_mid_l.orientation = Quaternion::rotation_y(0.0); + next.wing_mid_r.orientation = Quaternion::rotation_y(0.0); + + next.wing_out_l.position = Vec3::new(-s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_r.position = Vec3::new(s_a.wing_out.0, s_a.wing_out.1, s_a.wing_out.2); + next.wing_out_l.orientation = Quaternion::rotation_y(0.0); + next.wing_out_r.orientation = Quaternion::rotation_y(0.0); + + next.leg_l.position = Vec3::new(-s_a.leg.0, s_a.leg.1, s_a.leg.2 + 3.0); + next.leg_l.orientation = Quaternion::rotation_x(0.0); + next.leg_r.position = Vec3::new(s_a.leg.0, s_a.leg.1, s_a.leg.2 + 3.0); + next.leg_r.orientation = Quaternion::rotation_x(0.0); + + next.foot_l.position = Vec3::new(-s_a.foot.0, s_a.foot.1, s_a.foot.2); + next.foot_l.orientation = Quaternion::rotation_x(0.0); + next.foot_r.position = Vec3::new(s_a.foot.0, s_a.foot.1, s_a.foot.2); + next.foot_r.orientation = Quaternion::rotation_x(0.0); + + next + } +} diff --git a/voxygen/anim/src/bird_large/mod.rs b/voxygen/anim/src/bird_large/mod.rs new file mode 100644 index 0000000000..a4c938bff3 --- /dev/null +++ b/voxygen/anim/src/bird_large/mod.rs @@ -0,0 +1,174 @@ +pub mod fly; +pub mod idle; +pub mod run; + +// Reexports +pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; + +use super::{make_bone, vek::*, FigureBoneData, Skeleton}; +use common::comp::{self}; +use core::convert::TryFrom; + +pub type Body = comp::bird_large::Body; + +skeleton_impls!(struct BirdLargeSkeleton { + + head, + + beak, + + neck, + + chest, + + tail_front, + + tail_rear, + + wing_in_l, + + wing_in_r, + + wing_mid_l, + + wing_mid_r, + + wing_out_l, + + wing_out_r, + + leg_l, + + leg_r, + + foot_l, + + foot_r, +}); + +impl Skeleton for BirdLargeSkeleton { + type Attr = SkeletonAttr; + type Body = Body; + + const BONE_COUNT: usize = 16; + #[cfg(feature = "use-dyn-lib")] + const COMPUTE_FN: &'static [u8] = b"bird_large_compute_mats\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_compute_mats")] + + fn compute_matrices_inner( + &self, + base_mat: Mat4, + buf: &mut [FigureBoneData; super::MAX_BONE_COUNT], + ) -> Vec3 { + let chest_mat = base_mat * Mat4::::from(self.chest); + let neck_mat = chest_mat * Mat4::::from(self.neck); + let head_mat = neck_mat * Mat4::::from(self.head); + let beak_mat = head_mat * Mat4::::from(self.beak); + let tail_front_mat = chest_mat * Mat4::::from(self.tail_front); + let tail_rear_mat = tail_front_mat * Mat4::::from(self.tail_rear); + let wing_in_l_mat = chest_mat * Mat4::::from(self.wing_in_l); + let wing_in_r_mat = chest_mat * Mat4::::from(self.wing_in_r); + let wing_mid_l_mat = wing_in_l_mat * Mat4::::from(self.wing_mid_l); + let wing_mid_r_mat = wing_in_r_mat * Mat4::::from(self.wing_mid_r); + let wing_out_l_mat = wing_mid_l_mat * Mat4::::from(self.wing_out_l); + let wing_out_r_mat = wing_mid_r_mat * Mat4::::from(self.wing_out_r); + let leg_l_mat = chest_mat * Mat4::::from(self.leg_l); + let leg_r_mat = chest_mat * Mat4::::from(self.leg_r); + let foot_l_mat = chest_mat * Mat4::::from(self.leg_l); + let foot_r_mat = chest_mat * Mat4::::from(self.leg_r); + + *(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [ + make_bone(head_mat), + make_bone(beak_mat), + make_bone(neck_mat), + make_bone(chest_mat), + make_bone(tail_front_mat), + make_bone(tail_rear_mat), + make_bone(wing_in_l_mat), + make_bone(wing_in_r_mat), + make_bone(wing_mid_l_mat), + make_bone(wing_mid_r_mat), + make_bone(wing_out_l_mat), + make_bone(wing_out_r_mat), + make_bone(leg_l_mat), + make_bone(leg_r_mat), + make_bone(foot_l_mat), + make_bone(foot_r_mat), + ]; + Vec3::default() + } +} + +pub struct SkeletonAttr { + chest: (f32, f32), + neck: (f32, f32), + head: (f32, f32), + beak: (f32, f32), + tail_front: (f32, f32), + tail_rear: (f32, f32), + wing_in: (f32, f32, f32), + wing_mid: (f32, f32, f32), + wing_out: (f32, f32, f32), + leg: (f32, f32, f32), + foot: (f32, f32, f32), + scaler: f32, +} + +impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { + type Error = (); + + fn try_from(body: &'a comp::Body) -> Result { + match body { + comp::Body::BirdLarge(body) => Ok(SkeletonAttr::from(body)), + _ => Err(()), + } + } +} + +impl Default for SkeletonAttr { + fn default() -> Self { + Self { + chest: (0.0, 0.0), + neck: (0.0, 0.0), + head: (0.0, 0.0), + beak: (0.0, 0.0), + tail_front: (0.0, 0.0), + tail_rear: (0.0, 0.0), + wing_in: (0.0, 0.0, 0.0), + wing_mid: (0.0, 0.0, 0.0), + wing_out: (0.0, 0.0, 0.0), + leg: (0.0, 0.0, 0.0), + foot: (0.0, 0.0, 0.0), + scaler: 0.0, + } + } +} + +impl<'a> From<&'a Body> for SkeletonAttr { + fn from(body: &'a Body) -> Self { + use comp::bird_large::Species::*; + Self { + chest: match (body.species, body.body_type) { + (Phoenix, _) => (2.5, 8.5), + }, + neck: match (body.species, body.body_type) { + (Phoenix, _) => (0.5, 3.0), + }, + head: match (body.species, body.body_type) { + (Phoenix, _) => (2.0, 3.0), + }, + beak: match (body.species, body.body_type) { + (Phoenix, _) => (2.0, 1.0), + }, + tail_front: match (body.species, body.body_type) { + (Phoenix, _) => (-5.5, -2.0), + }, + tail_rear: match (body.species, body.body_type) { + (Phoenix, _) => (-3.0, -3.0), + }, + wing_in: match (body.species, body.body_type) { + (Phoenix, _) => (3.0, 2.5, 4.0), + }, + wing_mid: match (body.species, body.body_type) { + (Phoenix, _) => (6.5, -1.0, 0.0), + }, + wing_out: match (body.species, body.body_type) { + (Phoenix, _) => (0.5, -1.0, 0.0), + }, + leg: match (body.species, body.body_type) { + (Phoenix, _) => (2.5, -2.5, -6.5), + }, + foot: match (body.species, body.body_type) { + (Phoenix, _) => (2.5, -16.5, -6.5), + }, + scaler: match (body.species, body.body_type) { + (Phoenix, _) => (1.0), + }, + } + } +} diff --git a/voxygen/anim/src/bird_large/run.rs b/voxygen/anim/src/bird_large/run.rs new file mode 100644 index 0000000000..a308ce2e4f --- /dev/null +++ b/voxygen/anim/src/bird_large/run.rs @@ -0,0 +1,140 @@ +use super::{ + super::{vek::*, Animation}, + BirdLargeSkeleton, SkeletonAttr, +}; +use std::f32::consts::PI; + +pub struct RunAnimation; + +impl Animation for RunAnimation { + type Dependency = (Vec3, Vec3, Vec3, f32, Vec3, f32); + type Skeleton = BirdLargeSkeleton; + + #[cfg(feature = "use-dyn-lib")] + const UPDATE_FN: &'static [u8] = b"bird_large_run\0"; + + #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_large_run")] + fn update_skeleton_inner( + skeleton: &Self::Skeleton, + (velocity, orientation, last_ori, _global_time, avg_vel, acc_vel): Self::Dependency, + _anim_time: f32, + rate: &mut f32, + s_a: &SkeletonAttr, + ) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + let speed = (Vec2::::from(velocity).magnitude()).min(22.0); + *rate = 1.0; + + //let speednorm = speed / 13.0; + let speednorm = (speed / 13.0).powf(0.25); + + let speedmult = 1.0; + let lab: f32 = 0.6; //6 + + let short = ((1.0 + / (0.72 + + 0.28 * ((acc_vel * 1.0 * lab * speedmult + PI * -0.15 - 0.5).sin()).powi(2))) + .sqrt()) + * ((acc_vel * 1.0 * lab * speedmult + PI * -0.15 - 0.5).sin()) + * speednorm; + + // + let shortalt = (acc_vel * 1.0 * lab * speedmult + PI * 3.0 / 8.0 - 0.5).sin() * speednorm; + + //FL + let foot1a = (acc_vel * 1.0 * lab * speedmult + 0.0 + PI).sin() * speednorm; //1.5 + let foot1b = (acc_vel * 1.0 * lab * speedmult + 1.57 + PI).sin() * speednorm; //1.9 + //FR + let foot2a = (acc_vel * 1.0 * lab * speedmult).sin() * speednorm; //1.2 + let foot2b = (acc_vel * 1.0 * lab * speedmult + 1.57).sin() * speednorm; //1.6 + let ori: Vec2 = 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; + let x_tilt = avg_vel.z.atan2(avg_vel.xy().magnitude()) * speednorm; + + next.head.scale = Vec3::one() * 1.02; + next.neck.scale = Vec3::one() * 0.98; + next.beak.scale = Vec3::one() * 0.98; + next.foot_l.scale = Vec3::one() * 0.96; + next.foot_r.scale = Vec3::one() * 0.96; + next.chest.scale = Vec3::one() * s_a.scaler / 4.0; + + next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1); + next.head.orientation = Quaternion::rotation_x(-0.1 * speednorm + short * -0.05) + * Quaternion::rotation_y(tilt * 0.8) + * Quaternion::rotation_z(shortalt * -0.2 - tilt * 2.5); + + next.beak.position = Vec3::new(0.0, s_a.beak.0, s_a.beak.1); + next.beak.orientation = Quaternion::rotation_x(short * -0.03); + + next.neck.position = Vec3::new(0.0, s_a.neck.0, s_a.neck.1); + next.neck.orientation = Quaternion::rotation_x(-0.1 * speednorm + short * -0.04) + * Quaternion::rotation_y(tilt * 0.3) + * Quaternion::rotation_z(shortalt * -0.1 - tilt * 3.2); + + next.chest.position = Vec3::new( + 0.0, + s_a.chest.0, + s_a.chest.1 + short * 0.5 + x_tilt * 10.0 + 0.5 * speednorm, + ) * s_a.scaler + / 4.0; + next.chest.orientation = Quaternion::rotation_x(short * 0.07 + x_tilt) + * Quaternion::rotation_y(tilt * 0.8) + * Quaternion::rotation_z(shortalt * 0.15 + tilt * -1.5); + + next.tail_front.position = Vec3::new(0.0, s_a.tail_front.0, s_a.tail_front.1); + next.tail_front.orientation = Quaternion::rotation_x(0.1 + short * -0.02) + * Quaternion::rotation_z(shortalt * -0.1 + tilt * 1.0); + + next.tail_rear.position = Vec3::new(0.0, s_a.tail_rear.0, s_a.tail_rear.1); + next.tail_rear.orientation = Quaternion::rotation_x(0.2 + short * -0.1) + * Quaternion::rotation_z(shortalt * -0.2 + tilt * 1.4); + + next.leg_l.position = Vec3::new( + -s_a.leg.0 + speednorm * 1.5, + s_a.leg.1 + foot1b * -1.3, + s_a.leg.2 + foot1a * 1.0, + ); + next.leg_l.orientation = Quaternion::rotation_x(-0.2 * speednorm + foot1a * 0.15) + * Quaternion::rotation_y(tilt * 0.5) + * Quaternion::rotation_z(foot1a * -0.3 + tilt * -0.5); + + next.leg_r.position = Vec3::new( + s_a.leg.0 + speednorm * -1.5, + s_a.leg.1 + foot2b * -1.3, + s_a.leg.2 + foot2a * 1.0, + ); + next.leg_r.orientation = Quaternion::rotation_x(-0.2 * speednorm + foot2a * 0.15) + * Quaternion::rotation_y(tilt * 0.5) + * Quaternion::rotation_z(foot2a * 0.3 + tilt * -0.5); + + next.foot_l.position = Vec3::new( + -s_a.foot.0, + s_a.foot.1 + foot1b * -2.0, + s_a.foot.2 + speednorm * 0.5 + (foot1a * 1.5).max(0.0), + ); + next.foot_l.orientation = Quaternion::rotation_x(-0.2 * speednorm + foot1b * -0.35) + * Quaternion::rotation_y(tilt * -1.0) + * Quaternion::rotation_z(tilt * -0.5); + + next.foot_r.position = Vec3::new( + s_a.foot.0, + s_a.foot.1 + foot2b * -2.0, + s_a.foot.2 + speednorm * 0.5 + (foot2a * 1.5).max(0.0), + ); + next.foot_r.orientation = Quaternion::rotation_x(-0.2 * speednorm + foot2b * -0.35) + * Quaternion::rotation_y(tilt * -1.0); + + next + } +} diff --git a/voxygen/anim/src/bird_small/idle.rs b/voxygen/anim/src/bird_small/idle.rs deleted file mode 100644 index c87c59a1a8..0000000000 --- a/voxygen/anim/src/bird_small/idle.rs +++ /dev/null @@ -1,42 +0,0 @@ -use super::{super::Animation, BirdSmallSkeleton, SkeletonAttr}; -//use std::{f32::consts::PI, ops::Mul}; -use super::super::vek::*; - -pub struct IdleAnimation; - -impl Animation for IdleAnimation { - type Dependency = f32; - type Skeleton = BirdSmallSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"bird_small_idle\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_small_idle")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - _global_time: Self::Dependency, - _anim_time: f32, - _rate: &mut f32, - _skeleton_attr: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - - next.head.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.head.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.head.scale = Vec3::one() / 10.88; - - next.torso.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.torso.scale = Vec3::one() / 10.88; - - next.wing_l.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.wing_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.wing_l.scale = Vec3::one() / 10.88; - - next.wing_r.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.wing_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.wing_r.scale = Vec3::one() / 10.88; - - next - } -} diff --git a/voxygen/anim/src/bird_small/jump.rs b/voxygen/anim/src/bird_small/jump.rs deleted file mode 100644 index 5a940935ce..0000000000 --- a/voxygen/anim/src/bird_small/jump.rs +++ /dev/null @@ -1,42 +0,0 @@ -use super::{super::Animation, BirdSmallSkeleton, SkeletonAttr}; -//use std::f32::consts::PI; -use super::super::vek::*; - -pub struct JumpAnimation; - -impl Animation for JumpAnimation { - type Dependency = (f32, f32); - type Skeleton = BirdSmallSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"bird_small_jump\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_small_jump")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - _global_time: Self::Dependency, - _anim_time: f32, - _rate: &mut f32, - _skeleton_attr: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - - next.head.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.head.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.head.scale = Vec3::one() / 10.88; - - next.torso.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.torso.scale = Vec3::one() / 10.88; - - next.wing_l.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.wing_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.wing_l.scale = Vec3::one() / 10.88; - - next.wing_r.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.wing_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.wing_r.scale = Vec3::one() / 10.88; - - next - } -} diff --git a/voxygen/anim/src/bird_small/mod.rs b/voxygen/anim/src/bird_small/mod.rs deleted file mode 100644 index b5ffa053a5..0000000000 --- a/voxygen/anim/src/bird_small/mod.rs +++ /dev/null @@ -1,67 +0,0 @@ -pub mod idle; -pub mod jump; -pub mod run; - -// Reexports -pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; - -use super::{make_bone, vek::*, FigureBoneData, Skeleton}; -use common::comp::{self}; -use core::convert::TryFrom; - -pub type Body = comp::bird_small::Body; - -skeleton_impls!(struct BirdSmallSkeleton { - + head, - + torso, - + wing_l, - + wing_r, -}); - -impl Skeleton for BirdSmallSkeleton { - type Attr = SkeletonAttr; - type Body = Body; - - const BONE_COUNT: usize = 4; - #[cfg(feature = "use-dyn-lib")] - const COMPUTE_FN: &'static [u8] = b"bird_small_compute_mats\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_small_compute_mats")] - - fn compute_matrices_inner( - &self, - base_mat: Mat4, - buf: &mut [FigureBoneData; super::MAX_BONE_COUNT], - ) -> Vec3 { - let torso_mat = base_mat * Mat4::::from(self.torso); - - *(<&mut [_; Self::BONE_COUNT]>::try_from(&mut buf[0..Self::BONE_COUNT]).unwrap()) = [ - make_bone(torso_mat * Mat4::::from(self.head)), - make_bone(torso_mat), - make_bone(torso_mat * Mat4::::from(self.wing_l)), - make_bone(torso_mat * Mat4::::from(self.wing_r)), - ]; - Vec3::default() - } -} - -pub struct SkeletonAttr; - -impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { - type Error = (); - - fn try_from(body: &'a comp::Body) -> Result { - match body { - comp::Body::BirdSmall(body) => Ok(SkeletonAttr::from(body)), - _ => Err(()), - } - } -} - -impl Default for SkeletonAttr { - fn default() -> Self { Self } -} - -impl<'a> From<&'a Body> for SkeletonAttr { - fn from(_body: &'a Body) -> Self { Self } -} diff --git a/voxygen/anim/src/bird_small/run.rs b/voxygen/anim/src/bird_small/run.rs deleted file mode 100644 index 67b01ad7af..0000000000 --- a/voxygen/anim/src/bird_small/run.rs +++ /dev/null @@ -1,42 +0,0 @@ -use super::{super::Animation, BirdSmallSkeleton, SkeletonAttr}; -//use std::{f32::consts::PI, ops::Mul}; -use super::super::vek::*; - -pub struct RunAnimation; - -impl Animation for RunAnimation { - type Dependency = (f32, f32); - type Skeleton = BirdSmallSkeleton; - - #[cfg(feature = "use-dyn-lib")] - const UPDATE_FN: &'static [u8] = b"bird_small_run\0"; - - #[cfg_attr(feature = "be-dyn-lib", export_name = "bird_small_run")] - fn update_skeleton_inner( - skeleton: &Self::Skeleton, - (_velocity, _global_time): Self::Dependency, - _anim_time: f32, - _rate: &mut f32, - _skeleton_attr: &SkeletonAttr, - ) -> Self::Skeleton { - let mut next = (*skeleton).clone(); - - next.head.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.head.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.head.scale = Vec3::one() / 10.88; - - next.torso.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.torso.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.torso.scale = Vec3::one() / 10.88; - - next.wing_l.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.wing_l.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.wing_l.scale = Vec3::one() / 10.88; - - next.wing_r.position = Vec3::new(0.0, 7.5, 15.0) / 11.0; - next.wing_r.orientation = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); - next.wing_r.scale = Vec3::one() / 10.88; - - next - } -} diff --git a/voxygen/anim/src/lib.rs b/voxygen/anim/src/lib.rs index 8895e92841..45d7e65e87 100644 --- a/voxygen/anim/src/lib.rs +++ b/voxygen/anim/src/lib.rs @@ -50,8 +50,8 @@ macro_rules! skeleton_impls { pub mod biped_large; pub mod biped_small; +pub mod bird_large; pub mod bird_medium; -pub mod bird_small; pub mod character; pub mod dragon; #[cfg(feature = "use-dyn-lib")] pub mod dyn_lib; diff --git a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs index 1816f057c8..d4300e1610 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/mod.rs @@ -93,7 +93,7 @@ impl EventMapper for MovementEventMapper { Body::QuadrupedMedium(_) | Body::QuadrupedSmall(_) | Body::QuadrupedLow(_) => { Self::map_quadruped_movement_event(physics, vel.0, underfoot_block_kind) }, - Body::BirdMedium(_) | Body::BirdSmall(_) | Body::BipedLarge(_) => { + Body::BirdMedium(_) | Body::BirdLarge(_) | Body::BipedLarge(_) => { Self::map_non_humanoid_movement_event(physics, vel.0, underfoot_block_kind) }, _ => SfxEvent::Idle, // Ignore fish, etc... @@ -281,7 +281,7 @@ impl MovementEventMapper { Body::QuadrupedMedium(_) => 0.7, Body::QuadrupedLow(_) => 0.7, Body::BirdMedium(_) => 0.3, - Body::BirdSmall(_) => 0.2, + Body::BirdLarge(_) => 0.2, Body::BipedLarge(_) => 1.0, _ => 0.9, } diff --git a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs index 0fa422308a..0c89e29f2e 100644 --- a/voxygen/src/audio/sfx/event_mapper/movement/tests.rs +++ b/voxygen/src/audio/sfx/event_mapper/movement/tests.rs @@ -2,7 +2,7 @@ use super::*; use crate::audio::sfx::SfxEvent; use common::{ comp::{ - bird_small, humanoid, quadruped_medium, quadruped_small, Body, CharacterState, InputKind, + bird_large, humanoid, quadruped_medium, quadruped_small, Body, CharacterState, InputKind, PhysicsState, }, states, @@ -340,12 +340,12 @@ fn determines_relative_volumes() { quadruped_small::Body::random(), )); - let bird_small = - MovementEventMapper::get_volume_for_body_type(&Body::BirdSmall(bird_small::Body::random())); + let bird_large = + MovementEventMapper::get_volume_for_body_type(&Body::BirdLarge(bird_large::Body::random())); assert!(quadruped_medium < human); assert!(quadruped_small < quadruped_medium); - assert!(bird_small < quadruped_small); + assert!(bird_large < quadruped_small); } fn empty_ability_info() -> states::utils::AbilityInfo { diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index ae677b6127..bb612c8ef2 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -4,8 +4,8 @@ use common::{ comp::{ biped_large::{self, BodyType as BLBodyType, Species as BLSpecies}, biped_small, + bird_large::{self, BodyType as BLABodyType, Species as BLASpecies}, bird_medium::{self, BodyType as BMBodyType, Species as BMSpecies}, - bird_small, dragon::{self, BodyType as DBodyType, Species as DSpecies}, fish_medium::{self, BodyType as FMBodyType, Species as FMSpecies}, fish_small::{self, BodyType as FSBodyType, Species as FSSpecies}, @@ -3109,65 +3109,379 @@ impl DragonLateralSpec { } //// +#[derive(Deserialize)] +struct BirdLargeCentralSpec(HashMap<(BLASpecies, BLABodyType), SidedBLACentralVoxSpec>); + +#[derive(Deserialize)] +struct SidedBLACentralVoxSpec { + head: BirdLargeCentralSubSpec, + beak: BirdLargeCentralSubSpec, + neck: BirdLargeCentralSubSpec, + chest: BirdLargeCentralSubSpec, + tail_front: BirdLargeCentralSubSpec, + tail_rear: BirdLargeCentralSubSpec, +} +#[derive(Deserialize)] +struct BirdLargeCentralSubSpec { + offset: [f32; 3], // Should be relative to initial origin + central: VoxSimple, +} + +#[derive(Deserialize)] +struct BirdLargeLateralSpec(HashMap<(BLASpecies, BLABodyType), SidedBLALateralVoxSpec>); + +#[derive(Deserialize)] +struct SidedBLALateralVoxSpec { + wing_in_l: BirdLargeLateralSubSpec, + wing_in_r: BirdLargeLateralSubSpec, + wing_mid_l: BirdLargeLateralSubSpec, + wing_mid_r: BirdLargeLateralSubSpec, + wing_out_l: BirdLargeLateralSubSpec, + wing_out_r: BirdLargeLateralSubSpec, + leg_l: BirdLargeLateralSubSpec, + leg_r: BirdLargeLateralSubSpec, + foot_l: BirdLargeLateralSubSpec, + foot_r: BirdLargeLateralSubSpec, +} +#[derive(Deserialize)] +struct BirdLargeLateralSubSpec { + offset: [f32; 3], // Should be relative to initial origin + lateral: VoxSimple, +} + make_vox_spec!( - bird_small::Body, - struct BirdSmallSpec {}, - |FigureKey { body, .. }, _spec| { + bird_large::Body, + struct BirdLargeSpec { + central: BirdLargeCentralSpec = "voxygen.voxel.bird_large_central_manifest", + lateral: BirdLargeLateralSpec = "voxygen.voxel.bird_large_lateral_manifest", + }, + |FigureKey { body, .. }, spec| { [ - Some(mesh_bird_small_head(body.head)), - Some(mesh_bird_small_torso(body.torso)), - Some(mesh_bird_small_wing_l(body.wing_l)), - Some(mesh_bird_small_wing_r(body.wing_r)), - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, + Some(spec.central.read().0.mesh_head( + body.species, + body.body_type, + )), + Some(spec.central.read().0.mesh_beak( + body.species, + body.body_type, + )), + Some(spec.central.read().0.mesh_neck( + body.species, + body.body_type, + )), + Some(spec.central.read().0.mesh_chest( + body.species, + body.body_type, + )), + Some(spec.central.read().0.mesh_tail_front( + body.species, + body.body_type, + )), + Some(spec.central.read().0.mesh_tail_rear( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_wing_in_l( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_wing_in_r( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_wing_mid_l( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_wing_mid_r( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_wing_out_l( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_wing_out_r( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_leg_l( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_leg_r( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_foot_l( + body.species, + body.body_type, + )), + Some(spec.lateral.read().0.mesh_foot_r( + body.species, + body.body_type, + )), ] }, ); -fn mesh_bird_small_head(head: bird_small::Head) -> BoneMeshes { - load_mesh( - match head { - bird_small::Head::Default => "npc.crow.head", - }, - Vec3::new(-7.0, -6.0, -6.0), - ) -} +impl BirdLargeCentralSpec { + fn mesh_head(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No head specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let central = graceful_load_segment(&spec.head.central.0); -fn mesh_bird_small_torso(torso: bird_small::Torso) -> BoneMeshes { - load_mesh( - match torso { - bird_small::Torso::Default => "npc.crow.torso", - }, - Vec3::new(-7.0, -6.0, -6.0), - ) -} + (central, Vec3::from(spec.head.offset)) + } -fn mesh_bird_small_wing_l(wing_l: bird_small::WingL) -> BoneMeshes { - load_mesh( - match wing_l { - bird_small::WingL::Default => "npc.crow.wing_l", - }, - Vec3::new(-7.0, -6.0, -6.0), - ) -} + fn mesh_beak(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No beak 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.beak.central.0); -fn mesh_bird_small_wing_r(wing_r: bird_small::WingR) -> BoneMeshes { - load_mesh( - match wing_r { - bird_small::WingR::Default => "npc.crow.wing_r", - }, - Vec3::new(-7.0, -6.0, -6.0), - ) + (central, Vec3::from(spec.beak.offset)) + } + + fn mesh_neck(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No neck 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.neck.central.0); + + (central, Vec3::from(spec.neck.offset)) + } + + fn mesh_chest(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No chest 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.chest.central.0); + + (central, Vec3::from(spec.chest.offset)) + } + + fn mesh_tail_front(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No tail front specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let central = graceful_load_segment(&spec.tail_front.central.0); + + (central, Vec3::from(spec.tail_front.offset)) + } + + fn mesh_tail_rear(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No tail rear specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let central = graceful_load_segment(&spec.tail_rear.central.0); + + (central, Vec3::from(spec.tail_rear.offset)) + } +} +impl BirdLargeLateralSpec { + fn mesh_wing_in_l(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing in in left specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.wing_in_l.lateral.0); + + (lateral, Vec3::from(spec.wing_in_l.offset)) + } + + fn mesh_wing_in_r(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing in right specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.wing_in_r.lateral.0); + + (lateral, Vec3::from(spec.wing_in_r.offset)) + } + + fn mesh_wing_mid_l(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing mid specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.wing_mid_l.lateral.0); + + (lateral, Vec3::from(spec.wing_mid_l.offset)) + } + + fn mesh_wing_mid_r(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing mid specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.wing_in_l.lateral.0); + + (lateral, Vec3::from(spec.wing_mid_r.offset)) + } + + fn mesh_wing_out_l(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing out specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.wing_out_l.lateral.0); + + (lateral, Vec3::from(spec.wing_out_l.offset)) + } + + fn mesh_wing_out_r(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No wing out specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.wing_out_r.lateral.0); + + (lateral, Vec3::from(spec.wing_out_r.offset)) + } + + fn mesh_leg_l(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No leg specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.leg_l.lateral.0); + + (lateral, Vec3::from(spec.leg_l.offset)) + } + + fn mesh_leg_r(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No leg specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.leg_r.lateral.0); + + (lateral, Vec3::from(spec.leg_r.offset)) + } + + fn mesh_foot_l(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No foot specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.foot_l.lateral.0); + + (lateral, Vec3::from(spec.foot_l.offset)) + } + + fn mesh_foot_r(&self, species: BLASpecies, body_type: BLABodyType) -> BoneMeshes { + let spec = match self.0.get(&(species, body_type)) { + Some(spec) => spec, + None => { + error!( + "No foot specification exists for the combination of {:?} and {:?}", + species, body_type + ); + return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5)); + }, + }; + let lateral = graceful_load_segment(&spec.foot_r.lateral.0); + + (lateral, Vec3::from(spec.foot_r.offset)) + } } //// diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index e583942cfa..a74a4e3b5a 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -19,7 +19,7 @@ use crate::{ }; use anim::{ biped_large::BipedLargeSkeleton, biped_small::BipedSmallSkeleton, - bird_medium::BirdMediumSkeleton, bird_small::BirdSmallSkeleton, character::CharacterSkeleton, + bird_large::BirdLargeSkeleton, bird_medium::BirdMediumSkeleton, character::CharacterSkeleton, dragon::DragonSkeleton, fish_medium::FishMediumSkeleton, fish_small::FishSmallSkeleton, golem::GolemSkeleton, object::ObjectSkeleton, quadruped_low::QuadrupedLowSkeleton, quadruped_medium::QuadrupedMediumSkeleton, quadruped_small::QuadrupedSmallSkeleton, @@ -95,7 +95,7 @@ struct FigureMgrStates { fish_medium_states: HashMap>, theropod_states: HashMap>, dragon_states: HashMap>, - bird_small_states: HashMap>, + bird_large_states: HashMap>, fish_small_states: HashMap>, biped_large_states: HashMap>, biped_small_states: HashMap>, @@ -115,7 +115,7 @@ impl FigureMgrStates { fish_medium_states: HashMap::new(), theropod_states: HashMap::new(), dragon_states: HashMap::new(), - bird_small_states: HashMap::new(), + bird_large_states: HashMap::new(), fish_small_states: HashMap::new(), biped_large_states: HashMap::new(), biped_small_states: HashMap::new(), @@ -164,8 +164,8 @@ impl FigureMgrStates { .get_mut(&entity) .map(DerefMut::deref_mut), Body::Dragon(_) => self.dragon_states.get_mut(&entity).map(DerefMut::deref_mut), - Body::BirdSmall(_) => self - .bird_small_states + Body::BirdLarge(_) => self + .bird_large_states .get_mut(&entity) .map(DerefMut::deref_mut), Body::FishSmall(_) => self @@ -202,7 +202,7 @@ impl FigureMgrStates { Body::FishMedium(_) => self.fish_medium_states.remove(&entity).map(|e| e.meta), Body::Theropod(_) => self.theropod_states.remove(&entity).map(|e| e.meta), Body::Dragon(_) => self.dragon_states.remove(&entity).map(|e| e.meta), - Body::BirdSmall(_) => self.bird_small_states.remove(&entity).map(|e| e.meta), + Body::BirdLarge(_) => self.bird_large_states.remove(&entity).map(|e| e.meta), Body::FishSmall(_) => self.fish_small_states.remove(&entity).map(|e| e.meta), Body::BipedLarge(_) => self.biped_large_states.remove(&entity).map(|e| e.meta), Body::BipedSmall(_) => self.biped_small_states.remove(&entity).map(|e| e.meta), @@ -222,7 +222,7 @@ impl FigureMgrStates { self.fish_medium_states.retain(|k, v| f(k, &mut *v)); self.theropod_states.retain(|k, v| f(k, &mut *v)); self.dragon_states.retain(|k, v| f(k, &mut *v)); - self.bird_small_states.retain(|k, v| f(k, &mut *v)); + self.bird_large_states.retain(|k, v| f(k, &mut *v)); self.fish_small_states.retain(|k, v| f(k, &mut *v)); self.biped_large_states.retain(|k, v| f(k, &mut *v)); self.biped_small_states.retain(|k, v| f(k, &mut *v)); @@ -241,7 +241,7 @@ impl FigureMgrStates { + self.fish_medium_states.len() + self.theropod_states.len() + self.dragon_states.len() - + self.bird_small_states.len() + + self.bird_large_states.len() + self.fish_small_states.len() + self.biped_large_states.len() + self.biped_small_states.len() @@ -291,7 +291,7 @@ impl FigureMgrStates { .filter(|(_, c)| c.visible()) .count() + self - .bird_small_states + .bird_large_states .iter() .filter(|(_, c)| c.visible()) .count() @@ -332,7 +332,7 @@ pub struct FigureMgr { quadruped_medium_model_cache: FigureModelCache, quadruped_low_model_cache: FigureModelCache, bird_medium_model_cache: FigureModelCache, - bird_small_model_cache: FigureModelCache, + bird_large_model_cache: FigureModelCache, dragon_model_cache: FigureModelCache, fish_medium_model_cache: FigureModelCache, fish_small_model_cache: FigureModelCache, @@ -354,7 +354,7 @@ impl FigureMgr { quadruped_medium_model_cache: FigureModelCache::new(), quadruped_low_model_cache: FigureModelCache::new(), bird_medium_model_cache: FigureModelCache::new(), - bird_small_model_cache: FigureModelCache::new(), + bird_large_model_cache: FigureModelCache::new(), dragon_model_cache: FigureModelCache::new(), fish_medium_model_cache: FigureModelCache::new(), fish_small_model_cache: FigureModelCache::new(), @@ -381,7 +381,7 @@ impl FigureMgr { .clean(&mut self.col_lights, tick); self.bird_medium_model_cache .clean(&mut self.col_lights, tick); - self.bird_small_model_cache + self.bird_large_model_cache .clean(&mut self.col_lights, tick); self.dragon_model_cache.clean(&mut self.col_lights, tick); self.fish_medium_model_cache @@ -3263,8 +3263,8 @@ impl FigureMgr { physics.ground_vel, ); }, - Body::BirdSmall(body) => { - let (model, skeleton_attr) = self.bird_small_model_cache.get_or_create_model( + Body::BirdLarge(body) => { + let (model, skeleton_attr) = self.bird_large_model_cache.get_or_create_model( renderer, &mut self.col_lights, *body, @@ -3277,14 +3277,14 @@ impl FigureMgr { let state = self .states - .bird_small_states + .bird_large_states .entry(entity) .or_insert_with(|| { - FigureState::new(renderer, BirdSmallSkeleton::default()) + FigureState::new(renderer, BirdLargeSkeleton::default()) }); // Average velocity relative to the current ground - let _rel_avg_vel = state.avg_vel - physics.ground_vel; + let rel_avg_vel = state.avg_vel - physics.ground_vel; let (character, last_character) = match (character, last_character) { (Some(c), Some(l)) => (c, l), @@ -3301,33 +3301,49 @@ impl FigureMgr { physics.in_liquid().is_some(), // In water ) { // Standing - (true, false, false) => anim::bird_small::IdleAnimation::update_skeleton( - &BirdSmallSkeleton::default(), + (true, false, false) => anim::bird_large::IdleAnimation::update_skeleton( + &BirdLargeSkeleton::default(), time, state.state_time, &mut state_animation_rate, skeleton_attr, ), // Running - (true, true, false) => anim::bird_small::RunAnimation::update_skeleton( - &BirdSmallSkeleton::default(), - (rel_vel.magnitude(), time), + (true, true, false) => anim::bird_large::RunAnimation::update_skeleton( + &BirdLargeSkeleton::default(), + ( + rel_vel, + // TODO: Update to use the quaternion. + ori * anim::vek::Vec3::::unit_y(), + state.last_ori * anim::vek::Vec3::::unit_y(), + time, + rel_avg_vel, + state.acc_vel, + ), state.state_time, &mut state_animation_rate, skeleton_attr, ), // In air - (false, _, false) => anim::bird_small::JumpAnimation::update_skeleton( - &BirdSmallSkeleton::default(), - (rel_vel.magnitude(), time), + (false, _, false) => anim::bird_large::FlyAnimation::update_skeleton( + &BirdLargeSkeleton::default(), + ( + rel_vel, + // TODO: Update to use the quaternion. + ori * anim::vek::Vec3::::unit_y(), + state.last_ori * anim::vek::Vec3::::unit_y(), + time, + rel_avg_vel, + state.acc_vel, + ), state.state_time, &mut state_animation_rate, skeleton_attr, ), // TODO! - _ => anim::bird_small::IdleAnimation::update_skeleton( - &BirdSmallSkeleton::default(), + _ => anim::bird_large::IdleAnimation::update_skeleton( + &BirdLargeSkeleton::default(), time, state.state_time, &mut state_animation_rate, @@ -4572,7 +4588,7 @@ impl FigureMgr { quadruped_medium_model_cache, quadruped_low_model_cache, bird_medium_model_cache, - bird_small_model_cache, + bird_large_model_cache, dragon_model_cache, fish_medium_model_cache, fish_small_model_cache, @@ -4591,7 +4607,7 @@ impl FigureMgr { fish_medium_states, theropod_states, dragon_states, - bird_small_states, + bird_large_states, fish_small_states, biped_large_states, biped_small_states, @@ -4738,14 +4754,14 @@ impl FigureMgr { ), ) }), - Body::BirdSmall(body) => bird_small_states + Body::BirdLarge(body) => bird_large_states .get(&entity) .filter(|state| filter_state(&*state)) .map(move |state| { ( state.locals(), state.bone_consts(), - bird_small_model_cache.get_model( + bird_large_model_cache.get_model( col_lights, *body, inventory,