diff --git a/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox index 5385ca652f..549939b87c 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/chest_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccb3946a7b70bbe3bbca76b0930651b1fafb6f10cf466d730dc838a8dd900102 -size 4556 +oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b +size 59039 diff --git a/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox index 03c2c36ca0..8db58555b4 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/chest_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5d9f4fa579f6456f4a642f94d6388074422858d7c4053e339e253bb0b86f888 -size 6080 +oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 +size 60563 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox index d9ad85b152..fe31aadd1a 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_bl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c3392c489527b685662705bdba578d8f2f12788c00a881885edd45505f741124 -size 1408 +oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox index 5f3d81ec51..08037dbe38 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_br.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ff5cc1eac6b2939d3658e21228f87366327665ae70dd83d5af92ac3b3dae0fb4 -size 1408 +oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox index f1e67b65c8..e71b7a0694 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_fl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ed4cb29ddba38424eb238ce2c3df7ea9b67d2e3b4f902194588f67a41f759b89 -size 1408 +oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox index 03497e9382..926f224e9a 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/foot_fr.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a5b309ae1146a4a5dab72e7bd534201b9ccbddcdc512d0a5619e4ef6880eefa -size 1408 +oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/female/head.vox b/assets/voxygen/voxel/npc/reddragon/female/head.vox index d27c554eac..f20fcb90dd 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/head.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/head.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3c6dcc28719e148e572786722426103d4e4e7af05b815e8328ee71515db813a -size 3040 +oid sha256:64b03f5b6dc36ab671f1e22280950f71f2fbe7a66b28490226c649290e7310b3 +size 57523 diff --git a/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox index 27a01ab209..f60dc1b402 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/tail_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da84212d78276b933a4b374c7b038d0ca5026c5be0d14a0dc93cb3fe15771d0c -size 1784 +oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 +size 56267 diff --git a/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox index 41d539f783..3bdb2326ff 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/tail_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26867c50e937a64890489706c33fe8b06d43138ff134c7fdaf165128ef24c470 -size 1392 +oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f +size 55875 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox index 41307eb524..848877f125 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b6de1eab081ed802022e61f5272e88b40d661ea2e485ed096293bad5a1588c8 +oid sha256:2ac7dcba1d88007c93479a6c88cc68ba52c963bfd1452790a6fdee5c4f84cfa7 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox index ef5fe55a9a..256e132edd 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_in_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:079da56ff2c225ed8d4edd13c61c2803f324e49b29a0eea69c485f7cc68c9587 +oid sha256:fe7f85574d91447578169d60f60b71ab88f81aa45f6d5b3a39a01ce79b37c131 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox index 93ca39dde2..1b25c929af 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8664be051f079672954ab69ae9f25a8323d64285987eab10744194f77c740400 +oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox index e56d2dde7d..020fd84512 100644 --- a/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/female/wing_out_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2d671e167445954ffad79a4305c90407a0a506c71c143287941d417da9edf78 +oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox b/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox index 5385ca652f..549939b87c 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/chest_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccb3946a7b70bbe3bbca76b0930651b1fafb6f10cf466d730dc838a8dd900102 -size 4556 +oid sha256:c30a1e43d470973cb292e122d3a3caa77daa5dd090ecc93ec17a772d4250ae4b +size 59039 diff --git a/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox index 03c2c36ca0..8db58555b4 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/chest_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f5d9f4fa579f6456f4a642f94d6388074422858d7c4053e339e253bb0b86f888 -size 6080 +oid sha256:04b93cb9f2fdbeea57194e220d5841381363334a3408835d23b340a22f993d01 +size 60563 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox index d9ad85b152..fe31aadd1a 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_bl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c3392c489527b685662705bdba578d8f2f12788c00a881885edd45505f741124 -size 1408 +oid sha256:90eeedf6db7050655ec413b78ec7c43666526bfc19f2310d879a97b2acb9ca7a +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox index 5f3d81ec51..08037dbe38 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_br.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ff5cc1eac6b2939d3658e21228f87366327665ae70dd83d5af92ac3b3dae0fb4 -size 1408 +oid sha256:d9d4b932d689ccc77c267476b37a9039a6acb92b22e3dc3db24fc956bf261afd +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox index f1e67b65c8..e71b7a0694 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_fl.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ed4cb29ddba38424eb238ce2c3df7ea9b67d2e3b4f902194588f67a41f759b89 -size 1408 +oid sha256:31344c4139a4b9b65ce5276fef90c73d57ff24f568804798a98f19e7f5ddb8f6 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox b/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox index 03497e9382..926f224e9a 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/foot_fr.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a5b309ae1146a4a5dab72e7bd534201b9ccbddcdc512d0a5619e4ef6880eefa -size 1408 +oid sha256:d7a926f2c92e3f84f3c8d03cfdc625f534068fc50ea34376bf36ef0a5a3d1393 +size 55891 diff --git a/assets/voxygen/voxel/npc/reddragon/male/head.vox b/assets/voxygen/voxel/npc/reddragon/male/head.vox index d27c554eac..f20fcb90dd 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/head.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/head.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d3c6dcc28719e148e572786722426103d4e4e7af05b815e8328ee71515db813a -size 3040 +oid sha256:64b03f5b6dc36ab671f1e22280950f71f2fbe7a66b28490226c649290e7310b3 +size 57523 diff --git a/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox b/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox index 27a01ab209..f60dc1b402 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/tail_front.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:da84212d78276b933a4b374c7b038d0ca5026c5be0d14a0dc93cb3fe15771d0c -size 1784 +oid sha256:b6f2788e99b8bebf450194101b01ec640266cfe4332ff40a3f5b9d277a7958c3 +size 56267 diff --git a/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox index 41d539f783..3bdb2326ff 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/tail_rear.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26867c50e937a64890489706c33fe8b06d43138ff134c7fdaf165128ef24c470 -size 1392 +oid sha256:81dcde4ff610b8720ba7d092891a8d6768651c46daaf820886b8766f1ff85e3f +size 55875 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox index 41307eb524..848877f125 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b6de1eab081ed802022e61f5272e88b40d661ea2e485ed096293bad5a1588c8 +oid sha256:2ac7dcba1d88007c93479a6c88cc68ba52c963bfd1452790a6fdee5c4f84cfa7 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox index ef5fe55a9a..256e132edd 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_in_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:079da56ff2c225ed8d4edd13c61c2803f324e49b29a0eea69c485f7cc68c9587 +oid sha256:fe7f85574d91447578169d60f60b71ab88f81aa45f6d5b3a39a01ce79b37c131 size 57352 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox index 93ca39dde2..1b25c929af 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_out_l.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8664be051f079672954ab69ae9f25a8323d64285987eab10744194f77c740400 +oid sha256:3ae980ae2576517a83af7b03f23df289781d7e39eed747d1c03ddf88cc038e72 size 58012 diff --git a/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox b/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox index e56d2dde7d..020fd84512 100644 --- a/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox +++ b/assets/voxygen/voxel/npc/reddragon/male/wing_out_r.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2d671e167445954ffad79a4305c90407a0a506c71c143287941d417da9edf78 +oid sha256:ff2a725e7fdb300ac5b302f3e8d6fb3151697502262f5ac28d9b4a7d5fbf836e size 58012 diff --git a/voxygen/src/anim/biped_large/mod.rs b/voxygen/src/anim/biped_large/mod.rs index 5ff549c924..8438ef999a 100644 --- a/voxygen/src/anim/biped_large/mod.rs +++ b/voxygen/src/anim/biped_large/mod.rs @@ -1,116 +1,114 @@ +pub mod fly; pub mod idle; -pub mod jump; pub mod run; // Reexports -pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation}; +pub use self::{fly::FlyAnimation, idle::IdleAnimation, run::RunAnimation}; use super::{Bone, Skeleton}; use crate::render::FigureBoneData; use common::comp::{self}; -use vek::Vec3; -#[derive(Clone)] -pub struct BipedLargeSkeleton { - head: Bone, - upper_torso: Bone, - lower_torso: Bone, - shoulder_l: Bone, - shoulder_r: Bone, - hand_l: Bone, - hand_r: Bone, - leg_l: Bone, - leg_r: Bone, - foot_l: Bone, - foot_r: Bone, - torso: Bone, +#[derive(Clone, Default)] +pub struct DragonSkeleton { + head_upper: Bone, + head_lower: Bone, + jaw: Bone, + chest_front: Bone, + chest_rear: Bone, + tail_front: Bone, + tail_rear: Bone, + wing_in_l: Bone, + wing_in_r: Bone, + wing_out_l: Bone, + wing_out_r: Bone, + foot_fl: Bone, + foot_fr: Bone, + foot_bl: Bone, + foot_br: Bone, } -impl BipedLargeSkeleton { - pub fn new() -> Self { - Self { - head: Bone::default(), - upper_torso: Bone::default(), - lower_torso: Bone::default(), - shoulder_l: Bone::default(), - shoulder_r: Bone::default(), - hand_l: Bone::default(), - hand_r: Bone::default(), - leg_l: Bone::default(), - leg_r: Bone::default(), - foot_l: Bone::default(), - foot_r: Bone::default(), - torso: Bone::default(), - } - } +impl DragonSkeleton { + pub fn new() -> Self { Self::default() } } -impl Skeleton for BipedLargeSkeleton { +impl Skeleton for DragonSkeleton { type Attr = SkeletonAttr; - fn bone_count(&self) -> usize { 11 } + fn bone_count(&self) -> usize { 15 } - fn compute_matrices(&self) -> ([FigureBoneData; 16], Vec3) { - let upper_torso_mat = self.upper_torso.compute_base_matrix(); - let shoulder_l_mat = self.shoulder_l.compute_base_matrix(); - let shoulder_r_mat = self.shoulder_r.compute_base_matrix(); - let leg_l_mat = self.leg_l.compute_base_matrix(); - let leg_r_mat = self.leg_r.compute_base_matrix(); - let torso_mat = self.torso.compute_base_matrix(); + fn compute_matrices(&self) -> [FigureBoneData; 16] { + let head_upper_mat = self.head_upper.compute_base_matrix(); + let head_lower_mat = self.head_lower.compute_base_matrix(); + let chest_front_mat = self.chest_front.compute_base_matrix(); + let chest_rear_mat = self.chest_rear.compute_base_matrix(); + let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); + let wing_in_r_mat = self.wing_in_r.compute_base_matrix(); + let tail_front_mat = self.tail_front.compute_base_matrix(); - ( - [ - FigureBoneData::new(torso_mat * upper_torso_mat * self.head.compute_base_matrix()), - FigureBoneData::new(torso_mat * upper_torso_mat), - FigureBoneData::new( - torso_mat * upper_torso_mat * self.lower_torso.compute_base_matrix(), - ), - FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_l_mat), - FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_r_mat), - FigureBoneData::new( - torso_mat * upper_torso_mat * self.hand_l.compute_base_matrix(), - ), - FigureBoneData::new( - torso_mat * upper_torso_mat * self.hand_r.compute_base_matrix(), - ), - FigureBoneData::new(torso_mat * upper_torso_mat * leg_l_mat), - FigureBoneData::new(torso_mat * upper_torso_mat * leg_r_mat), - FigureBoneData::new(self.foot_l.compute_base_matrix()), - FigureBoneData::new(self.foot_r.compute_base_matrix()), - FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), - FigureBoneData::default(), - ], - Vec3::default(), - ) + [ + FigureBoneData::new(chest_front_mat * head_lower_mat * head_upper_mat), + FigureBoneData::new(chest_front_mat * head_lower_mat), + FigureBoneData::new( + chest_front_mat * head_lower_mat * head_upper_mat * self.jaw.compute_base_matrix(), + ), + FigureBoneData::new(chest_front_mat), + FigureBoneData::new(chest_front_mat * self.chest_rear.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * chest_rear_mat * tail_front_mat), + FigureBoneData::new( + chest_front_mat + * chest_rear_mat + * tail_front_mat + * self.tail_rear.compute_base_matrix(), + ), + FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), + FigureBoneData::new( + chest_front_mat * wing_in_l_mat * self.wing_out_l.compute_base_matrix(), + ), + FigureBoneData::new( + chest_front_mat * wing_in_r_mat * self.wing_out_r.compute_base_matrix(), + ), + FigureBoneData::new(self.foot_fl.compute_base_matrix()), + FigureBoneData::new(self.foot_fr.compute_base_matrix()), + FigureBoneData::new(self.foot_bl.compute_base_matrix()), + FigureBoneData::new(self.foot_br.compute_base_matrix()), + FigureBoneData::default(), + ] } fn interpolate(&mut self, target: &Self, dt: f32) { - self.head.interpolate(&target.head, dt); - self.upper_torso.interpolate(&target.upper_torso, dt); - self.lower_torso.interpolate(&target.lower_torso, dt); - self.shoulder_l.interpolate(&target.shoulder_l, dt); - self.shoulder_r.interpolate(&target.shoulder_r, dt); - self.hand_l.interpolate(&target.hand_l, dt); - self.hand_r.interpolate(&target.hand_r, dt); - self.leg_l.interpolate(&target.leg_l, dt); - self.leg_r.interpolate(&target.leg_r, dt); - self.foot_l.interpolate(&target.foot_l, dt); - self.foot_r.interpolate(&target.foot_r, dt); - self.torso.interpolate(&target.torso, dt); + self.head_upper.interpolate(&target.head_upper, dt); + self.head_lower.interpolate(&target.head_lower, dt); + self.jaw.interpolate(&target.jaw, dt); + self.chest_front.interpolate(&target.chest_front, dt); + self.chest_rear.interpolate(&target.chest_rear, dt); + self.tail_front.interpolate(&target.tail_front, dt); + self.tail_rear.interpolate(&target.tail_rear, dt); + self.wing_in_l.interpolate(&target.wing_in_l, dt); + self.wing_in_r.interpolate(&target.wing_in_r, dt); + self.wing_out_l.interpolate(&target.wing_out_l, dt); + self.wing_out_r.interpolate(&target.wing_out_r, dt); + self.foot_fl.interpolate(&target.foot_fl, dt); + self.foot_fr.interpolate(&target.foot_fr, dt); + self.foot_bl.interpolate(&target.foot_bl, dt); + self.foot_br.interpolate(&target.foot_br, dt); } } pub struct SkeletonAttr { - head: (f32, f32), - upper_torso: (f32, f32), - lower_torso: (f32, f32), - shoulder: (f32, f32, f32), - hand: (f32, f32, f32), - leg: (f32, f32, f32), - foot: (f32, f32, f32), + head_upper: (f32, f32), + head_lower: (f32, f32), + jaw: (f32, f32), + chest_front: (f32, f32), + chest_rear: (f32, f32), + tail_front: (f32, f32), + tail_rear: (f32, f32), + wing_in: (f32, f32, f32), + wing_out: (f32, f32, f32), + feet_f: (f32, f32, f32), + feet_b: (f32, f32, f32), + height: f32, } impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { @@ -118,7 +116,7 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { fn try_from(body: &'a comp::Body) -> Result { match body { - comp::Body::BipedLarge(body) => Ok(SkeletonAttr::from(body)), + comp::Body::Dragon(body) => Ok(SkeletonAttr::from(body)), _ => Err(()), } } @@ -127,41 +125,61 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { impl Default for SkeletonAttr { fn default() -> Self { Self { - head: (0.0, 0.0), - upper_torso: (0.0, 0.0), - lower_torso: (0.0, 0.0), - shoulder: (0.0, 0.0, 0.0), - hand: (0.0, 0.0, 0.0), - leg: (0.0, 0.0, 0.0), - foot: (0.0, 0.0, 0.0), + head_upper: (0.0, 0.0), + head_lower: (0.0, 0.0), + jaw: (0.0, 0.0), + chest_front: (0.0, 0.0), + chest_rear: (0.0, 0.0), + tail_front: (0.0, 0.0), + tail_rear: (0.0, 0.0), + wing_in: (0.0, 0.0, 0.0), + wing_out: (0.0, 0.0, 0.0), + feet_f: (0.0, 0.0, 0.0), + feet_b: (0.0, 0.0, 0.0), + height: (0.0), } } } -impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr { - fn from(body: &'a comp::biped_large::Body) -> Self { - use comp::biped_large::Species::*; +impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { + fn from(body: &'a comp::dragon::Body) -> Self { + use comp::dragon::Species::*; Self { - head: match (body.species, body.body_type) { - (Ogre, _) => (3.0, 6.0), + head_upper: match (body.species, body.body_type) { + (Reddragon, _) => (2.5, 4.5), }, - upper_torso: match (body.species, body.body_type) { - (Ogre, _) => (0.0, 20.0), + head_lower: match (body.species, body.body_type) { + (Reddragon, _) => (7.5, 3.5), }, - lower_torso: match (body.species, body.body_type) { - (Ogre, _) => (1.0, -9.5), + jaw: match (body.species, body.body_type) { + (Reddragon, _) => (7.0, -5.0), }, - shoulder: match (body.species, body.body_type) { - (Ogre, _) => (6.1, 0.5, 2.5), + chest_front: match (body.species, body.body_type) { + (Reddragon, _) => (0.0, 14.0), }, - hand: match (body.species, body.body_type) { - (Ogre, _) => (10.5, -1.0, 0.5), + chest_rear: match (body.species, body.body_type) { + (Reddragon, _) => (-12.5, 0.0), }, - leg: match (body.species, body.body_type) { - (Ogre, _) => (0.0, 0.0, -6.0), + tail_front: match (body.species, body.body_type) { + (Reddragon, _) => (-6.5, 1.5), }, - foot: match (body.species, body.body_type) { - (Ogre, _) => (4.0, 0.5, 2.5), + tail_rear: match (body.species, body.body_type) { + (Reddragon, _) => (-11.5, -1.0), + }, + wing_in: match (body.species, body.body_type) { + (Reddragon, _) => (2.5, -16.5, 0.0), + }, + wing_out: match (body.species, body.body_type) { + (Reddragon, _) => (23.0, 0.5, 4.0), + }, + feet_f: match (body.species, body.body_type) { + (Reddragon, _) => (6.0, 0.0, 1.5), + }, + feet_b: match (body.species, body.body_type) { + (Reddragon, _) => (6.0, -15.0, 3.0), + }, + height: match (body.species, body.body_type) { + (Reddragon, _) => (1.0), }, } } diff --git a/voxygen/src/anim/dragon/idle.rs b/voxygen/src/anim/dragon/idle.rs index a732fd3615..7453edec83 100644 --- a/voxygen/src/anim/dragon/idle.rs +++ b/voxygen/src/anim/dragon/idle.rs @@ -1,6 +1,7 @@ use super::{super::Animation, DragonSkeleton, SkeletonAttr}; //use std::{f32::consts::PI, ops::Mul}; use vek::*; + pub struct IdleAnimation; impl Animation for IdleAnimation { @@ -16,45 +17,49 @@ impl Animation for IdleAnimation { ) -> Self::Skeleton { let mut next = (*skeleton).clone(); - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const HEAD_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const HEAD_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_F_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_F_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_R_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const CHEST_R_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_F_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_F_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_R_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const TAIL_R_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_IN_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] + const WING_IN_Y: f32 = 0.0; + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_IN_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_OUT_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] + const WING_OUT_Y: f32 = 0.0; + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const WING_OUT_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_Y: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_F_Z: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_B_X: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_B_Y: f32 = 0.0; - #[const_tweaker::tweak(min = -100.0, max = 20.0, step = 0.5)] + #[const_tweaker::tweak(min = -40.0, max = 40.0, step = 0.5)] const FEET_B_Z: f32 = 0.0; next.head.offset = Vec3::new(0.0, *HEAD_X, *HEAD_Z); @@ -77,19 +82,19 @@ impl Animation for IdleAnimation { next.tail_rear.ori = Quaternion::rotation_x(0.0); next.tail_rear.scale = Vec3::one() * 1.01; - next.wing_in_l.offset = Vec3::new(0.0, *WING_IN_X, *WING_IN_Z); + next.wing_in_l.offset = Vec3::new(*WING_IN_X, *WING_IN_Y, *WING_IN_Z); next.wing_in_l.ori = Quaternion::rotation_x(0.0); next.wing_in_l.scale = Vec3::one() * 1.01; - next.wing_in_r.offset = Vec3::new(0.0, *WING_IN_X, *WING_IN_Z); + next.wing_in_r.offset = Vec3::new(-*WING_IN_X, *WING_IN_Y, *WING_IN_Z); next.wing_in_r.ori = Quaternion::rotation_x(0.0); next.wing_in_r.scale = Vec3::one() * 1.01; - next.wing_out_l.offset = Vec3::new(0.0, *WING_OUT_X, *WING_OUT_Z); + next.wing_out_l.offset = Vec3::new(*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z); next.wing_out_l.ori = Quaternion::rotation_x(0.0); next.wing_out_l.scale = Vec3::one() * 1.01; - next.wing_out_r.offset = Vec3::new(0.0, *WING_OUT_X, *WING_OUT_Z); + next.wing_out_r.offset = Vec3::new(-*WING_OUT_X, *WING_OUT_Y, *WING_OUT_Z); next.wing_out_r.ori = Quaternion::rotation_x(0.0); next.wing_out_r.scale = Vec3::one() * 1.01; @@ -97,7 +102,7 @@ impl Animation for IdleAnimation { next.foot_fl.ori = Quaternion::rotation_x(0.0); next.foot_fl.scale = Vec3::one() * 1.01; - next.foot_fr.offset = Vec3::new(*FEET_F_X, *FEET_F_Y, *FEET_F_Z); + next.foot_fr.offset = Vec3::new(-*FEET_F_X, *FEET_F_Y, *FEET_F_Z); next.foot_fr.ori = Quaternion::rotation_x(0.0); next.foot_fr.scale = Vec3::one() * 1.01; @@ -105,7 +110,7 @@ impl Animation for IdleAnimation { next.foot_bl.ori = Quaternion::rotation_x(0.0); next.foot_bl.scale = Vec3::one() * 1.01; - next.foot_br.offset = Vec3::new(*FEET_F_X, *FEET_B_Y, *FEET_B_Z); + next.foot_br.offset = Vec3::new(-*FEET_F_X, *FEET_B_Y, *FEET_B_Z); next.foot_br.ori = Quaternion::rotation_x(0.0); next.foot_br.scale = Vec3::one() * 1.01; next diff --git a/voxygen/src/anim/dragon/mod.rs b/voxygen/src/anim/dragon/mod.rs index c144141096..4324d9053a 100644 --- a/voxygen/src/anim/dragon/mod.rs +++ b/voxygen/src/anim/dragon/mod.rs @@ -38,10 +38,12 @@ impl Skeleton for DragonSkeleton { fn compute_matrices(&self) -> ([FigureBoneData; 16], Vec3) { let chest_front_mat = self.chest_front.compute_base_matrix(); + let chest_rear_mat = self.chest_rear.compute_base_matrix(); let wing_in_l_mat = self.wing_in_l.compute_base_matrix(); let wing_in_r_mat = self.wing_in_r.compute_base_matrix(); let tail_front_mat = self.tail_front.compute_base_matrix(); +<<<<<<< HEAD ( [ FigureBoneData::new(self.head.compute_base_matrix() * chest_front_mat), @@ -63,6 +65,26 @@ impl Skeleton for DragonSkeleton { ], Vec3::default(), ) +======= + [ + FigureBoneData::new(self.head.compute_base_matrix() * chest_front_mat), + FigureBoneData::new(chest_front_mat), + FigureBoneData::new(self.chest_rear.compute_base_matrix() * chest_front_mat), + FigureBoneData::new(chest_rear_mat * self.tail_front.compute_base_matrix()), + FigureBoneData::new(self.tail_rear.compute_base_matrix() * tail_front_mat), + FigureBoneData::new(chest_front_mat * self.wing_in_l.compute_base_matrix()), + FigureBoneData::new(chest_front_mat * self.wing_in_r.compute_base_matrix()), + FigureBoneData::new(self.wing_out_l.compute_base_matrix() * wing_in_l_mat), + FigureBoneData::new(self.wing_out_r.compute_base_matrix() * wing_in_r_mat), + FigureBoneData::new(self.foot_fl.compute_base_matrix()), + FigureBoneData::new(self.foot_fr.compute_base_matrix()), + FigureBoneData::new(self.foot_bl.compute_base_matrix()), + FigureBoneData::new(self.foot_br.compute_base_matrix()), + FigureBoneData::default(), + FigureBoneData::default(), + FigureBoneData::default(), + ] +>>>>>>> Symmetry of dragon skeleton } fn interpolate(&mut self, target: &Self, dt: f32) { @@ -88,8 +110,8 @@ pub struct SkeletonAttr { chest_rear: (f32, f32), tail_front: (f32, f32), tail_rear: (f32, f32), - wing_in: (f32, f32), - wing_out: (f32, f32), + wing_in: (f32, f32, f32), + wing_out: (f32, f32, f32), feet_f: (f32, f32, f32), feet_b: (f32, f32, f32), } @@ -113,8 +135,8 @@ impl Default for SkeletonAttr { chest_rear: (0.0, 0.0), tail_front: (0.0, 0.0), tail_rear: (0.0, 0.0), - wing_in: (0.0, 0.0), - wing_out: (0.0, 0.0), + wing_in: (0.0, 0.0, 0.0), + wing_out: (0.0, 0.0, 0.0), feet_f: (0.0, 0.0, 0.0), feet_b: (0.0, 0.0, 0.0), } @@ -141,10 +163,10 @@ impl<'a> From<&'a comp::dragon::Body> for SkeletonAttr { (Reddragon, _) => (0.0, 0.0), }, wing_in: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0), + (Reddragon, _) => (0.0, 0.0, 0.0), }, wing_out: match (body.species, body.body_type) { - (Reddragon, _) => (0.0, 0.0), + (Reddragon, _) => (0.0, 0.0, 0.0), }, feet_f: match (body.species, body.body_type) { (Reddragon, _) => (0.0, 0.0, 0.0), diff --git a/world/src/lib.rs b/world/src/lib.rs index 41b8a54b36..6f47c7a311 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -21,7 +21,7 @@ use crate::{ util::{Grid, Sampler}, }; use common::{ - comp::{self, bird_medium, critter, quadruped_medium, quadruped_small, dragon}, + comp::{self, bird_medium, critter, quadruped_medium, quadruped_small}, generation::{ChunkSupplement, EntityInfo}, terrain::{Block, BlockKind, TerrainChunk, TerrainChunkMeta, TerrainChunkSize}, vol::{ReadVol, RectVolSize, Vox, WriteVol},