diff --git a/common/src/comp/body/biped_large.rs b/common/src/comp/body/biped_large.rs index 3891c0a4f8..5e11487e88 100644 --- a/common/src/comp/body/biped_large.rs +++ b/common/src/comp/body/biped_large.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Ogre, + body_type: BodyType::Female, + } + } +} + impl From
for super::Body { fn from(body: Body) -> Self { super::Body::BipedLarge(body) } } diff --git a/common/src/comp/body/biped_small.rs b/common/src/comp/body/biped_small.rs index 945586f393..67a23a0fe2 100644 --- a/common/src/comp/body/biped_small.rs +++ b/common/src/comp/body/biped_small.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Gnome, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::BipedSmall(body) } } diff --git a/common/src/comp/body/bird_large.rs b/common/src/comp/body/bird_large.rs index 629317082a..f32ec2c8cd 100644 --- a/common/src/comp/body/bird_large.rs +++ b/common/src/comp/body/bird_large.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Phoenix, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::BirdLarge(body) } } diff --git a/common/src/comp/body/bird_medium.rs b/common/src/comp/body/bird_medium.rs index 5eb7dbee65..b9ff1b9b2f 100644 --- a/common/src/comp/body/bird_medium.rs +++ b/common/src/comp/body/bird_medium.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Duck, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::BirdMedium(body) } } diff --git a/common/src/comp/body/dragon.rs b/common/src/comp/body/dragon.rs index 07c3991a44..c14a8e6bd6 100644 --- a/common/src/comp/body/dragon.rs +++ b/common/src/comp/body/dragon.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Reddragon, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::Dragon(body) } } diff --git a/common/src/comp/body/fish_medium.rs b/common/src/comp/body/fish_medium.rs index 924bf09f36..72bf540d6f 100644 --- a/common/src/comp/body/fish_medium.rs +++ b/common/src/comp/body/fish_medium.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Marlin, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::FishMedium(body) } } diff --git a/common/src/comp/body/fish_small.rs b/common/src/comp/body/fish_small.rs index 952a3f5412..c148f0351e 100644 --- a/common/src/comp/body/fish_small.rs +++ b/common/src/comp/body/fish_small.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Clownfish, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::FishSmall(body) } } diff --git a/common/src/comp/body/golem.rs b/common/src/comp/body/golem.rs index a0549a5595..7a5233835f 100644 --- a/common/src/comp/body/golem.rs +++ b/common/src/comp/body/golem.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::StoneGolem, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::Golem(body) } } diff --git a/common/src/comp/body/humanoid.rs b/common/src/comp/body/humanoid.rs index dc63f8fd9c..d96c83375d 100644 --- a/common/src/comp/body/humanoid.rs +++ b/common/src/comp/body/humanoid.rs @@ -65,6 +65,22 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Danari, + body_type: BodyType::Female, + hair_style: 0, + beard: 0, + accessory: 0, + hair_color: 0, + skin: 0, + eye_color: 0, + eyes: 0, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::Humanoid(body) } } diff --git a/common/src/comp/body/object.rs b/common/src/comp/body/object.rs index ccdf3bc3bb..bedf30a111 100644 --- a/common/src/comp/body/object.rs +++ b/common/src/comp/body/object.rs @@ -89,6 +89,10 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { Body::Arrow } +} + pub const ALL_OBJECTS: [Body; 67] = [ Body::Arrow, Body::Bomb, diff --git a/common/src/comp/body/quadruped_low.rs b/common/src/comp/body/quadruped_low.rs index f2c14091e2..ef4defcef8 100644 --- a/common/src/comp/body/quadruped_low.rs +++ b/common/src/comp/body/quadruped_low.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Crocodile, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::QuadrupedLow(body) } } diff --git a/common/src/comp/body/quadruped_medium.rs b/common/src/comp/body/quadruped_medium.rs index 192e7559b5..20498f9b38 100644 --- a/common/src/comp/body/quadruped_medium.rs +++ b/common/src/comp/body/quadruped_medium.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Grolgar, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::QuadrupedMedium(body) } } diff --git a/common/src/comp/body/quadruped_small.rs b/common/src/comp/body/quadruped_small.rs index 1d4f294e64..13be59b94e 100644 --- a/common/src/comp/body/quadruped_small.rs +++ b/common/src/comp/body/quadruped_small.rs @@ -25,6 +25,15 @@ impl Body { } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Pig, + body_type: BodyType::Female, + } + } +} + impl From for super::Body { fn from(body: Body) -> Self { super::Body::QuadrupedSmall(body) } } diff --git a/common/src/comp/body/ship.rs b/common/src/comp/body/ship.rs index f880683d47..4e17ce9258 100644 --- a/common/src/comp/body/ship.rs +++ b/common/src/comp/body/ship.rs @@ -54,6 +54,10 @@ impl Body { pub fn mass(&self) -> Mass { Mass((self.hull_vol() + self.balloon_vol()) * self.density().0) } } +impl Default for Body { + fn default() -> Self { Body::DefaultAirship } +} + /// Terrain is 11.0 scale relative to small-scale voxels, /// airship scale is multiplied by 11 to reach terrain scale. pub const AIRSHIP_SCALE: f32 = 11.0; diff --git a/common/src/comp/body/theropod.rs b/common/src/comp/body/theropod.rs index 5f1abcda53..97467edf65 100644 --- a/common/src/comp/body/theropod.rs +++ b/common/src/comp/body/theropod.rs @@ -25,6 +25,15 @@ impl From for super::Body { fn from(body: Body) -> Self { super::Body::Theropod(body) } } +impl Default for Body { + fn default() -> Self { + Self { + species: Species::Archaeos, + body_type: BodyType::Female, + } + } +} + #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[repr(u32)] pub enum Species { diff --git a/voxygen/anim/src/character/idle.rs b/voxygen/anim/src/character/idle.rs index 4b8464241d..ad17581bd3 100644 --- a/voxygen/anim/src/character/idle.rs +++ b/voxygen/anim/src/character/idle.rs @@ -42,7 +42,6 @@ impl Animation for IdleAnimation { next.back.scale = Vec3::one() * 1.02; next.hold.scale = Vec3::one() * 0.0; next.lantern.scale = Vec3::one() * 0.65; - next.torso.scale = Vec3::one() / 11.0 * s_a.scaler; next.shoulder_l.scale = Vec3::one() * 1.1; next.shoulder_r.scale = Vec3::one() * 1.1; @@ -135,7 +134,7 @@ impl Animation for IdleAnimation { next.lantern.position = Vec3::new(s_a.lantern.0, s_a.lantern.1, s_a.lantern.2); next.lantern.orientation = Quaternion::rotation_x(0.1) * Quaternion::rotation_y(0.1); - next.torso.position = Vec3::new(0.0, 0.0, 0.0) * s_a.scaler; + next.torso.position = Vec3::new(0.0, 0.0, 0.0); next.second.scale = match hands { (Some(Hands::One), Some(Hands::One)) => Vec3::one(), diff --git a/voxygen/anim/src/character/mod.rs b/voxygen/anim/src/character/mod.rs index ad446fcff1..8d5d5b2eee 100644 --- a/voxygen/anim/src/character/mod.rs +++ b/voxygen/anim/src/character/mod.rs @@ -70,12 +70,14 @@ skeleton_impls!(struct CharacterSkeleton { control_l, control_r, :: // Begin non-bone fields + body: Body, holding_lantern: bool, }); impl CharacterSkeleton { - pub fn new(holding_lantern: bool) -> Self { + pub fn new(body: Body, holding_lantern: bool) -> Self { Self { + body, holding_lantern, ..Self::default() } @@ -97,7 +99,10 @@ impl Skeleton for CharacterSkeleton { base_mat: Mat4