mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'timo-cleanup-body' into 'master'
Clean up ecs actor body components See merge request veloren/veloren!261
This commit is contained in:
commit
305296090f
@ -1,314 +0,0 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
use specs::{Component, FlaggedStorage, VecStorage};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Race {
|
||||
Danari,
|
||||
Dwarf,
|
||||
Elf,
|
||||
Human,
|
||||
Orc,
|
||||
Undead,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum BodyType {
|
||||
Female,
|
||||
Male,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Chest {
|
||||
Blue,
|
||||
Brown,
|
||||
Dark,
|
||||
Green,
|
||||
Orange,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Belt {
|
||||
Dark,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Pants {
|
||||
Blue,
|
||||
Brown,
|
||||
Dark,
|
||||
Green,
|
||||
Orange,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Hand {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Foot {
|
||||
Dark,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Shoulder {
|
||||
None,
|
||||
Brown1,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Weapon {
|
||||
Daggers,
|
||||
SwordShield,
|
||||
Sword,
|
||||
Axe,
|
||||
Hammer,
|
||||
Bow,
|
||||
Staff,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Draw {
|
||||
Default,
|
||||
}
|
||||
////
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum PigHead {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum PigChest {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum PigLegL {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum PigLegR {
|
||||
Default,
|
||||
}
|
||||
/////
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfHeadUpper {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfJaw {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfHeadLower {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfTail {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfTorsoBack {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfTorsoMid {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfEars {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfFootLF {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfFootRF {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfFootLB {
|
||||
Default,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum WolfFootRB {
|
||||
Default,
|
||||
}
|
||||
|
||||
pub const ALL_RACES: [Race; 6] = [
|
||||
Race::Danari,
|
||||
Race::Dwarf,
|
||||
Race::Elf,
|
||||
Race::Human,
|
||||
Race::Orc,
|
||||
Race::Undead,
|
||||
];
|
||||
pub const ALL_BODY_TYPES: [BodyType; 2] = [BodyType::Female, BodyType::Male];
|
||||
pub const ALL_CHESTS: [Chest; 5] = [
|
||||
Chest::Blue,
|
||||
Chest::Brown,
|
||||
Chest::Dark,
|
||||
Chest::Green,
|
||||
Chest::Orange,
|
||||
];
|
||||
pub const ALL_BELTS: [Belt; 1] = [
|
||||
//Belt::Default,
|
||||
Belt::Dark,
|
||||
];
|
||||
pub const ALL_PANTS: [Pants; 5] = [
|
||||
Pants::Blue,
|
||||
Pants::Brown,
|
||||
Pants::Dark,
|
||||
Pants::Green,
|
||||
Pants::Orange,
|
||||
];
|
||||
pub const ALL_HANDS: [Hand; 1] = [Hand::Default];
|
||||
pub const ALL_FEET: [Foot; 1] = [Foot::Dark];
|
||||
pub const ALL_WEAPONS: [Weapon; 7] = [
|
||||
Weapon::Daggers,
|
||||
Weapon::SwordShield,
|
||||
Weapon::Sword,
|
||||
Weapon::Axe,
|
||||
Weapon::Hammer,
|
||||
Weapon::Bow,
|
||||
Weapon::Staff,
|
||||
];
|
||||
pub const ALL_SHOULDERS: [Shoulder; 2] = [Shoulder::None, Shoulder::Brown1];
|
||||
pub const ALL_DRAW: [Draw; 1] = [Draw::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub struct HumanoidBody {
|
||||
pub race: Race,
|
||||
pub body_type: BodyType,
|
||||
pub chest: Chest,
|
||||
pub belt: Belt,
|
||||
pub pants: Pants,
|
||||
pub hand: Hand,
|
||||
pub foot: Foot,
|
||||
pub weapon: Weapon,
|
||||
pub shoulder: Shoulder,
|
||||
pub draw: Draw,
|
||||
}
|
||||
|
||||
impl HumanoidBody {
|
||||
pub fn random() -> Self {
|
||||
let mut rng = thread_rng();
|
||||
Self {
|
||||
race: *(&ALL_RACES).choose(&mut rng).unwrap(),
|
||||
body_type: *(&ALL_BODY_TYPES).choose(&mut rng).unwrap(),
|
||||
chest: *(&ALL_CHESTS).choose(&mut rng).unwrap(),
|
||||
belt: *(&ALL_BELTS).choose(&mut rng).unwrap(),
|
||||
pants: *(&ALL_PANTS).choose(&mut rng).unwrap(),
|
||||
hand: *(&ALL_HANDS).choose(&mut rng).unwrap(),
|
||||
foot: *(&ALL_FEET).choose(&mut rng).unwrap(),
|
||||
weapon: *(&ALL_WEAPONS).choose(&mut rng).unwrap(),
|
||||
shoulder: *(&ALL_SHOULDERS).choose(&mut rng).unwrap(),
|
||||
draw: *(&ALL_DRAW).choose(&mut rng).unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
///////////
|
||||
const ALL_QBODY_TYPES: [BodyType; 2] = [BodyType::Female, BodyType::Male];
|
||||
const ALL_QPIG_HEADS: [PigHead; 1] = [PigHead::Default];
|
||||
const ALL_QPIG_CHESTS: [PigChest; 1] = [PigChest::Default];
|
||||
const ALL_QPIG_LEG_LS: [PigLegL; 1] = [PigLegL::Default];
|
||||
const ALL_QPIG_LEG_RS: [PigLegR; 1] = [PigLegR::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub struct QuadrupedBody {
|
||||
pub body_type: BodyType,
|
||||
pub pig_head: PigHead,
|
||||
pub pig_chest: PigChest,
|
||||
pub pig_leg_l: PigLegL,
|
||||
pub pig_leg_r: PigLegR,
|
||||
}
|
||||
|
||||
impl QuadrupedBody {
|
||||
pub fn random() -> Self {
|
||||
let mut rng = thread_rng();
|
||||
Self {
|
||||
body_type: *(&ALL_QBODY_TYPES).choose(&mut rng).unwrap(),
|
||||
pig_head: *(&ALL_QPIG_HEADS).choose(&mut rng).unwrap(),
|
||||
pig_chest: *(&ALL_QPIG_CHESTS).choose(&mut rng).unwrap(),
|
||||
pig_leg_l: *(&ALL_QPIG_LEG_LS).choose(&mut rng).unwrap(),
|
||||
pig_leg_r: *(&ALL_QPIG_LEG_RS).choose(&mut rng).unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
/////////////
|
||||
const ALL_QMBODY_TYPES: [BodyType; 2] = [BodyType::Female, BodyType::Male];
|
||||
const ALL_QMWOLF_HEADS_UPPER: [WolfHeadUpper; 1] = [WolfHeadUpper::Default];
|
||||
const ALL_QMWOLF_JAWS: [WolfJaw; 1] = [WolfJaw::Default];
|
||||
const ALL_QMWOLF_HEADS_LOWER: [WolfHeadLower; 1] = [WolfHeadLower::Default];
|
||||
const ALL_QMWOLF_TAILS: [WolfTail; 1] = [WolfTail::Default];
|
||||
const ALL_QMWOLF_TORSOS_BACK: [WolfTorsoBack; 1] = [WolfTorsoBack::Default];
|
||||
const ALL_QMWOLF_TORSOS_MID: [WolfTorsoMid; 1] = [WolfTorsoMid::Default];
|
||||
const ALL_QMWOLF_EARS: [WolfEars; 1] = [WolfEars::Default];
|
||||
const ALL_QMWOLF_FEET_LF: [WolfFootLF; 1] = [WolfFootLF::Default];
|
||||
const ALL_QMWOLF_FEET_RF: [WolfFootRF; 1] = [WolfFootRF::Default];
|
||||
const ALL_QMWOLF_FEET_LB: [WolfFootLB; 1] = [WolfFootLB::Default];
|
||||
const ALL_QMWOLF_FEET_RB: [WolfFootRB; 1] = [WolfFootRB::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub struct QuadrupedMediumBody {
|
||||
pub body_type: BodyType,
|
||||
pub wolf_head_upper: WolfHeadUpper,
|
||||
pub wolf_jaw: WolfJaw,
|
||||
pub wolf_head_lower: WolfHeadLower,
|
||||
pub wolf_tail: WolfTail,
|
||||
pub wolf_torso_back: WolfTorsoBack,
|
||||
pub wolf_torso_mid: WolfTorsoMid,
|
||||
pub wolf_ears: WolfEars,
|
||||
pub wolf_foot_lf: WolfFootLF,
|
||||
pub wolf_foot_rf: WolfFootRF,
|
||||
pub wolf_foot_lb: WolfFootLB,
|
||||
pub wolf_foot_rb: WolfFootRB,
|
||||
}
|
||||
|
||||
impl QuadrupedMediumBody {
|
||||
pub fn random() -> Self {
|
||||
let mut rng = thread_rng();
|
||||
Self {
|
||||
body_type: *(&ALL_QMBODY_TYPES).choose(&mut rng).unwrap(),
|
||||
wolf_head_upper: *(&ALL_QMWOLF_HEADS_UPPER).choose(&mut rng).unwrap(),
|
||||
wolf_jaw: *(&ALL_QMWOLF_JAWS).choose(&mut rng).unwrap(),
|
||||
wolf_head_lower: *(&ALL_QMWOLF_HEADS_LOWER).choose(&mut rng).unwrap(),
|
||||
wolf_tail: *(&ALL_QMWOLF_TAILS).choose(&mut rng).unwrap(),
|
||||
wolf_torso_back: *(&ALL_QMWOLF_TORSOS_BACK).choose(&mut rng).unwrap(),
|
||||
wolf_torso_mid: *(&ALL_QMWOLF_TORSOS_MID).choose(&mut rng).unwrap(),
|
||||
wolf_ears: *(&ALL_QMWOLF_EARS).choose(&mut rng).unwrap(),
|
||||
wolf_foot_lf: *(&ALL_QMWOLF_FEET_LF).choose(&mut rng).unwrap(),
|
||||
wolf_foot_rf: *(&ALL_QMWOLF_FEET_RF).choose(&mut rng).unwrap(),
|
||||
wolf_foot_lb: *(&ALL_QMWOLF_FEET_LB).choose(&mut rng).unwrap(),
|
||||
wolf_foot_rb: *(&ALL_QMWOLF_FEET_RB).choose(&mut rng).unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Body {
|
||||
Humanoid(HumanoidBody),
|
||||
Quadruped(QuadrupedBody),
|
||||
QuadrupedMedium(QuadrupedMediumBody),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Actor {
|
||||
Character { name: String, body: Body },
|
||||
}
|
||||
|
||||
impl Component for Actor {
|
||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
||||
}
|
21
common/src/comp/body.rs
Normal file
21
common/src/comp/body.rs
Normal file
@ -0,0 +1,21 @@
|
||||
pub mod humanoid;
|
||||
pub mod quadruped;
|
||||
pub mod quadruped_medium;
|
||||
|
||||
use specs::{Component, FlaggedStorage, VecStorage};
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Actor {
|
||||
Character { name: String, body: Body },
|
||||
}
|
||||
|
||||
impl Component for Actor {
|
||||
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Body {
|
||||
Humanoid(humanoid::Body),
|
||||
Quadruped(quadruped::Body),
|
||||
QuadrupedMedium(quadruped_medium::Body),
|
||||
}
|
114
common/src/comp/body/humanoid.rs
Normal file
114
common/src/comp/body/humanoid.rs
Normal file
@ -0,0 +1,114 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub struct Body {
|
||||
pub race: Race,
|
||||
pub body_type: BodyType,
|
||||
pub chest: Chest,
|
||||
pub belt: Belt,
|
||||
pub pants: Pants,
|
||||
pub hand: Hand,
|
||||
pub foot: Foot,
|
||||
pub shoulder: Shoulder,
|
||||
}
|
||||
|
||||
impl Body {
|
||||
pub fn random() -> Self {
|
||||
let mut rng = thread_rng();
|
||||
Self {
|
||||
race: *(&ALL_RACES).choose(&mut rng).unwrap(),
|
||||
body_type: *(&ALL_BODY_TYPES).choose(&mut rng).unwrap(),
|
||||
chest: *(&ALL_CHESTS).choose(&mut rng).unwrap(),
|
||||
belt: *(&ALL_BELTS).choose(&mut rng).unwrap(),
|
||||
pants: *(&ALL_PANTS).choose(&mut rng).unwrap(),
|
||||
hand: *(&ALL_HANDS).choose(&mut rng).unwrap(),
|
||||
foot: *(&ALL_FEET).choose(&mut rng).unwrap(),
|
||||
shoulder: *(&ALL_SHOULDERS).choose(&mut rng).unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Race {
|
||||
Danari,
|
||||
Dwarf,
|
||||
Elf,
|
||||
Human,
|
||||
Orc,
|
||||
Undead,
|
||||
}
|
||||
pub const ALL_RACES: [Race; 6] = [
|
||||
Race::Danari,
|
||||
Race::Dwarf,
|
||||
Race::Elf,
|
||||
Race::Human,
|
||||
Race::Orc,
|
||||
Race::Undead,
|
||||
];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum BodyType {
|
||||
Female,
|
||||
Male,
|
||||
}
|
||||
pub const ALL_BODY_TYPES: [BodyType; 2] = [BodyType::Female, BodyType::Male];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Chest {
|
||||
Blue,
|
||||
Brown,
|
||||
Dark,
|
||||
Green,
|
||||
Orange,
|
||||
}
|
||||
pub const ALL_CHESTS: [Chest; 5] = [
|
||||
Chest::Blue,
|
||||
Chest::Brown,
|
||||
Chest::Dark,
|
||||
Chest::Green,
|
||||
Chest::Orange,
|
||||
];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Belt {
|
||||
Dark,
|
||||
}
|
||||
pub const ALL_BELTS: [Belt; 1] = [
|
||||
//Belt::Default,
|
||||
Belt::Dark,
|
||||
];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Pants {
|
||||
Blue,
|
||||
Brown,
|
||||
Dark,
|
||||
Green,
|
||||
Orange,
|
||||
}
|
||||
pub const ALL_PANTS: [Pants; 5] = [
|
||||
Pants::Blue,
|
||||
Pants::Brown,
|
||||
Pants::Dark,
|
||||
Pants::Green,
|
||||
Pants::Orange,
|
||||
];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Hand {
|
||||
Default,
|
||||
}
|
||||
pub const ALL_HANDS: [Hand; 1] = [Hand::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Foot {
|
||||
Dark,
|
||||
}
|
||||
pub const ALL_FEET: [Foot; 1] = [Foot::Dark];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Shoulder {
|
||||
None,
|
||||
Brown1,
|
||||
}
|
||||
pub const ALL_SHOULDERS: [Shoulder; 2] = [Shoulder::None, Shoulder::Brown1];
|
45
common/src/comp/body/quadruped.rs
Normal file
45
common/src/comp/body/quadruped.rs
Normal file
@ -0,0 +1,45 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub struct Body {
|
||||
pub head: Head,
|
||||
pub chest: Chest,
|
||||
pub leg_l: LegL,
|
||||
pub leg_r: LegR,
|
||||
}
|
||||
|
||||
impl Body {
|
||||
pub fn random() -> Self {
|
||||
let mut rng = thread_rng();
|
||||
Self {
|
||||
head: *(&ALL_HEADS).choose(&mut rng).unwrap(),
|
||||
chest: *(&ALL_CHESTS).choose(&mut rng).unwrap(),
|
||||
leg_l: *(&ALL_LEGS_L).choose(&mut rng).unwrap(),
|
||||
leg_r: *(&ALL_LEGS_R).choose(&mut rng).unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Head {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS: [Head; 1] = [Head::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Chest {
|
||||
Default,
|
||||
}
|
||||
const ALL_CHESTS: [Chest; 1] = [Chest::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum LegL {
|
||||
Default,
|
||||
}
|
||||
const ALL_LEGS_L: [LegL; 1] = [LegL::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum LegR {
|
||||
Default,
|
||||
}
|
||||
const ALL_LEGS_R: [LegR; 1] = [LegR::Default];
|
101
common/src/comp/body/quadruped_medium.rs
Normal file
101
common/src/comp/body/quadruped_medium.rs
Normal file
@ -0,0 +1,101 @@
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub struct Body {
|
||||
pub head_upper: HeadUpper,
|
||||
pub jaw: Jaw,
|
||||
pub head_lower: HeadLower,
|
||||
pub tail: Tail,
|
||||
pub torso_back: TorsoBack,
|
||||
pub torso_mid: TorsoMid,
|
||||
pub ears: Ears,
|
||||
pub foot_lf: FootLF,
|
||||
pub foot_rf: FootRF,
|
||||
pub foot_lb: FootLB,
|
||||
pub foot_rb: FootRB,
|
||||
}
|
||||
|
||||
impl Body {
|
||||
pub fn random() -> Self {
|
||||
let mut rng = thread_rng();
|
||||
Self {
|
||||
head_upper: *(&ALL_HEADS_UPPER).choose(&mut rng).unwrap(),
|
||||
jaw: *(&ALL_JAWS).choose(&mut rng).unwrap(),
|
||||
head_lower: *(&ALL_HEADS_LOWER).choose(&mut rng).unwrap(),
|
||||
tail: *(&ALL_TAILS).choose(&mut rng).unwrap(),
|
||||
torso_back: *(&ALL_TORSOS_BACK).choose(&mut rng).unwrap(),
|
||||
torso_mid: *(&ALL_TORSOS_MID).choose(&mut rng).unwrap(),
|
||||
ears: *(&ALL_EARS).choose(&mut rng).unwrap(),
|
||||
foot_lf: *(&ALL_FEETS_LF).choose(&mut rng).unwrap(),
|
||||
foot_rf: *(&ALL_FEETS_RF).choose(&mut rng).unwrap(),
|
||||
foot_lb: *(&ALL_FEETS_LB).choose(&mut rng).unwrap(),
|
||||
foot_rb: *(&ALL_FEETS_RB).choose(&mut rng).unwrap(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum HeadUpper {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS_UPPER: [HeadUpper; 1] = [HeadUpper::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Jaw {
|
||||
Default,
|
||||
}
|
||||
const ALL_JAWS: [Jaw; 1] = [Jaw::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum HeadLower {
|
||||
Default,
|
||||
}
|
||||
const ALL_HEADS_LOWER: [HeadLower; 1] = [HeadLower::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Tail {
|
||||
Default,
|
||||
}
|
||||
const ALL_TAILS: [Tail; 1] = [Tail::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum TorsoBack {
|
||||
Default,
|
||||
}
|
||||
const ALL_TORSOS_BACK: [TorsoBack; 1] = [TorsoBack::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum TorsoMid {
|
||||
Default,
|
||||
}
|
||||
const ALL_TORSOS_MID: [TorsoMid; 1] = [TorsoMid::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Ears {
|
||||
Default,
|
||||
}
|
||||
const ALL_EARS: [Ears; 1] = [Ears::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum FootLF {
|
||||
Default,
|
||||
}
|
||||
const ALL_FEETS_LF: [FootLF; 1] = [FootLF::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum FootRF {
|
||||
Default,
|
||||
}
|
||||
const ALL_FEETS_RF: [FootRF; 1] = [FootRF::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum FootLB {
|
||||
Default,
|
||||
}
|
||||
const ALL_FEETS_LB: [FootLB; 1] = [FootLB::Default];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum FootRB {
|
||||
Default,
|
||||
}
|
||||
const ALL_FEETS_RB: [FootRB; 1] = [FootRB::Default];
|
@ -1,16 +1,35 @@
|
||||
use crate::comp::actor;
|
||||
use specs::{Component, VecStorage};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Weapon {
|
||||
Daggers,
|
||||
SwordShield,
|
||||
Sword,
|
||||
Axe,
|
||||
Hammer,
|
||||
Bow,
|
||||
Staff,
|
||||
}
|
||||
pub const ALL_WEAPONS: [Weapon; 7] = [
|
||||
Weapon::Daggers,
|
||||
Weapon::SwordShield,
|
||||
Weapon::Sword,
|
||||
Weapon::Axe,
|
||||
Weapon::Hammer,
|
||||
Weapon::Bow,
|
||||
Weapon::Staff,
|
||||
];
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub enum Armor {
|
||||
// TODO: Don't make armor be a body part. Wearing enemy's head is funny but also creepy thing to do.
|
||||
Helmet,
|
||||
Shoulders(actor::Shoulder),
|
||||
Chestplate(actor::Chest),
|
||||
Belt(actor::Belt),
|
||||
Gloves(actor::Hand),
|
||||
Pants(actor::Pants),
|
||||
Boots(actor::Foot),
|
||||
Shoulders,
|
||||
Chestplate,
|
||||
Belt,
|
||||
Gloves,
|
||||
Pants,
|
||||
Boots,
|
||||
Back,
|
||||
Tabard,
|
||||
Gem,
|
||||
@ -31,7 +50,6 @@ pub enum Item {
|
||||
damage: i32,
|
||||
strength: i32,
|
||||
rarity: Rarity,
|
||||
variant: actor::Weapon,
|
||||
},
|
||||
Armor {
|
||||
defense: i32,
|
@ -1,18 +1,20 @@
|
||||
pub mod actor;
|
||||
mod agent;
|
||||
mod animation;
|
||||
mod body;
|
||||
mod controller;
|
||||
mod inputs;
|
||||
mod inventory;
|
||||
mod phys;
|
||||
mod player;
|
||||
mod stats;
|
||||
|
||||
// Reexports
|
||||
pub use actor::{Actor, Body, HumanoidBody, QuadrupedBody, QuadrupedMediumBody};
|
||||
pub use agent::Agent;
|
||||
pub use animation::{Animation, AnimationInfo};
|
||||
pub use body::{humanoid, quadruped, quadruped_medium, Actor, Body};
|
||||
pub use controller::Controller;
|
||||
pub use inputs::{Attacking, Gliding, Jumping, MoveDir, OnGround, Respawning, Rolling};
|
||||
pub use inventory::{item, Inventory};
|
||||
pub use phys::{ForceUpdate, Ori, Pos, Vel};
|
||||
pub use player::Player;
|
||||
pub use stats::{Dying, HealthSource, Stats};
|
||||
|
@ -16,7 +16,6 @@ pub mod assets;
|
||||
pub mod clock;
|
||||
pub mod comp;
|
||||
pub mod figure;
|
||||
pub mod inventory;
|
||||
pub mod msg;
|
||||
pub mod npc;
|
||||
pub mod ray;
|
||||
|
@ -2,7 +2,7 @@
|
||||
pub use sphynx::Uid;
|
||||
|
||||
use crate::{
|
||||
comp, inventory,
|
||||
comp,
|
||||
msg::{EcsCompPacket, EcsResPacket},
|
||||
sys,
|
||||
terrain::{TerrainChunk, TerrainMap},
|
||||
@ -123,7 +123,7 @@ impl State {
|
||||
ecs.register::<comp::Respawning>();
|
||||
ecs.register::<comp::Dying>();
|
||||
ecs.register::<comp::ForceUpdate>();
|
||||
ecs.register::<inventory::Inventory>();
|
||||
ecs.register::<comp::Inventory>();
|
||||
|
||||
// Register synced resources used by the ECS.
|
||||
ecs.add_resource_synced(TimeOfDay(0.0));
|
||||
|
@ -307,8 +307,8 @@ fn alignment_to_agent(alignment: &str, target: EcsEntity) -> Option<comp::Agent>
|
||||
|
||||
fn kind_to_body(kind: NpcKind) -> comp::Body {
|
||||
match kind {
|
||||
NpcKind::Humanoid => comp::Body::Humanoid(comp::HumanoidBody::random()),
|
||||
NpcKind::Pig => comp::Body::Quadruped(comp::QuadrupedBody::random()),
|
||||
NpcKind::Wolf => comp::Body::QuadrupedMedium(comp::QuadrupedMediumBody::random()),
|
||||
NpcKind::Humanoid => comp::Body::Humanoid(comp::humanoid::Body::random()),
|
||||
NpcKind::Pig => comp::Body::Quadruped(comp::quadruped::Body::random()),
|
||||
NpcKind::Wolf => comp::Body::QuadrupedMedium(comp::quadruped_medium::Body::random()),
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ pub mod quadruped;
|
||||
pub mod quadrupedmedium;
|
||||
|
||||
use crate::render::FigureBoneData;
|
||||
use common::comp::actor::{BodyType, HumanoidBody, Race, Weapon};
|
||||
use common::comp::{self, item::Weapon};
|
||||
use vek::*;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
@ -70,85 +70,87 @@ impl Default for SkeletonAttr {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a HumanoidBody> for SkeletonAttr {
|
||||
fn from(body: &'a HumanoidBody) -> Self {
|
||||
impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
fn from(body: &'a comp::humanoid::Body) -> Self {
|
||||
use comp::humanoid::{BodyType::*, Race::*};
|
||||
Self {
|
||||
scaler: match (body.race, body.body_type) {
|
||||
(Race::Orc, BodyType::Male) => 1.2,
|
||||
(Race::Orc, BodyType::Female) => 1.0,
|
||||
(Race::Human, BodyType::Male) => 1.0,
|
||||
(Race::Human, BodyType::Female) => 0.90,
|
||||
(Race::Elf, BodyType::Male) => 1.0,
|
||||
(Race::Elf, BodyType::Female) => 1.0,
|
||||
(Race::Dwarf, BodyType::Male) => 0.92,
|
||||
(Race::Dwarf, BodyType::Female) => 0.89,
|
||||
(Race::Undead, BodyType::Male) => 0.98,
|
||||
(Race::Undead, BodyType::Female) => 0.93,
|
||||
(Race::Danari, BodyType::Male) => 0.85,
|
||||
(Race::Danari, BodyType::Female) => 0.82,
|
||||
(Orc, Male) => 1.2,
|
||||
(Orc, Female) => 1.0,
|
||||
(Human, Male) => 1.0,
|
||||
(Human, Female) => 0.90,
|
||||
(Elf, Male) => 1.0,
|
||||
(Elf, Female) => 1.0,
|
||||
(Dwarf, Male) => 0.92,
|
||||
(Dwarf, Female) => 0.89,
|
||||
(Undead, Male) => 0.98,
|
||||
(Undead, Female) => 0.93,
|
||||
(Danari, Male) => 0.85,
|
||||
(Danari, Female) => 0.82,
|
||||
_ => 1.0,
|
||||
},
|
||||
head_scale: match (body.race, body.body_type) {
|
||||
(Race::Orc, BodyType::Male) => 0.9,
|
||||
(Race::Orc, BodyType::Female) => 1.0,
|
||||
(Race::Human, BodyType::Male) => 1.0,
|
||||
(Race::Human, BodyType::Female) => 1.0,
|
||||
(Race::Elf, BodyType::Male) => 1.0,
|
||||
(Race::Elf, BodyType::Female) => 1.0,
|
||||
(Race::Dwarf, BodyType::Male) => 1.0,
|
||||
(Race::Dwarf, BodyType::Female) => 1.0,
|
||||
(Race::Undead, BodyType::Male) => 1.0,
|
||||
(Race::Undead, BodyType::Female) => 1.0,
|
||||
(Race::Danari, BodyType::Male) => 1.11,
|
||||
(Race::Danari, BodyType::Female) => 1.11,
|
||||
(Orc, Male) => 0.9,
|
||||
(Orc, Female) => 1.0,
|
||||
(Human, Male) => 1.0,
|
||||
(Human, Female) => 1.0,
|
||||
(Elf, Male) => 1.0,
|
||||
(Elf, Female) => 1.0,
|
||||
(Dwarf, Male) => 1.0,
|
||||
(Dwarf, Female) => 1.0,
|
||||
(Undead, Male) => 1.0,
|
||||
(Undead, Female) => 1.0,
|
||||
(Danari, Male) => 1.11,
|
||||
(Danari, Female) => 1.11,
|
||||
_ => 1.0,
|
||||
},
|
||||
neck_height: match (body.race, body.body_type) {
|
||||
(Race::Orc, BodyType::Male) => -2.0,
|
||||
(Race::Orc, BodyType::Female) => -2.0,
|
||||
(Race::Human, BodyType::Male) => 6.0,
|
||||
(Race::Human, BodyType::Female) => -2.0,
|
||||
(Race::Elf, BodyType::Male) => 0.75,
|
||||
(Race::Elf, BodyType::Female) => -1.25,
|
||||
(Race::Dwarf, BodyType::Male) => -0.0,
|
||||
(Race::Dwarf, BodyType::Female) => -1.0,
|
||||
(Race::Undead, BodyType::Male) => -1.0,
|
||||
(Race::Undead, BodyType::Female) => -0.5,
|
||||
(Race::Danari, BodyType::Male) => 0.5,
|
||||
(Race::Danari, BodyType::Female) => -0.5,
|
||||
(Orc, Male) => -2.0,
|
||||
(Orc, Female) => -2.0,
|
||||
(Human, Male) => 6.0,
|
||||
(Human, Female) => -2.0,
|
||||
(Elf, Male) => 0.75,
|
||||
(Elf, Female) => -1.25,
|
||||
(Dwarf, Male) => -0.0,
|
||||
(Dwarf, Female) => -1.0,
|
||||
(Undead, Male) => -1.0,
|
||||
(Undead, Female) => -0.5,
|
||||
(Danari, Male) => 0.5,
|
||||
(Danari, Female) => -0.5,
|
||||
_ => 1.0,
|
||||
},
|
||||
neck_forward: match (body.race, body.body_type) {
|
||||
(Race::Orc, BodyType::Male) => 1.0,
|
||||
(Race::Orc, BodyType::Female) => -1.0,
|
||||
(Race::Human, BodyType::Male) => 0.0,
|
||||
(Race::Human, BodyType::Female) => -1.0,
|
||||
(Race::Elf, BodyType::Male) => 1.75,
|
||||
(Race::Elf, BodyType::Female) => -0.5,
|
||||
(Race::Dwarf, BodyType::Male) => 2.0,
|
||||
(Race::Dwarf, BodyType::Female) => 0.0,
|
||||
(Race::Undead, BodyType::Male) => 1.0,
|
||||
(Race::Undead, BodyType::Female) => 1.0,
|
||||
(Race::Danari, BodyType::Male) => 0.5,
|
||||
(Race::Danari, BodyType::Female) => 0.0,
|
||||
(Orc, Male) => 1.0,
|
||||
(Orc, Female) => -1.0,
|
||||
(Human, Male) => 0.0,
|
||||
(Human, Female) => -1.0,
|
||||
(Elf, Male) => 1.75,
|
||||
(Elf, Female) => -0.5,
|
||||
(Dwarf, Male) => 2.0,
|
||||
(Dwarf, Female) => 0.0,
|
||||
(Undead, Male) => 1.0,
|
||||
(Undead, Female) => 1.0,
|
||||
(Danari, Male) => 0.5,
|
||||
(Danari, Female) => 0.0,
|
||||
_ => 1.0,
|
||||
},
|
||||
neck_right: match (body.race, body.body_type) {
|
||||
(Race::Orc, BodyType::Male) => 0.0,
|
||||
(Race::Orc, BodyType::Female) => 0.0,
|
||||
(Race::Human, BodyType::Male) => 0.0,
|
||||
(Race::Human, BodyType::Female) => 0.0,
|
||||
(Race::Elf, BodyType::Male) => -1.0,
|
||||
(Race::Elf, BodyType::Female) => 0.25,
|
||||
(Race::Dwarf, BodyType::Male) => 0.0,
|
||||
(Race::Dwarf, BodyType::Female) => 0.0,
|
||||
(Race::Undead, BodyType::Male) => -0.5,
|
||||
(Race::Undead, BodyType::Female) => 0.0,
|
||||
(Race::Danari, BodyType::Male) => 0.0,
|
||||
(Race::Danari, BodyType::Female) => 0.0,
|
||||
(Orc, Male) => 0.0,
|
||||
(Orc, Female) => 0.0,
|
||||
(Human, Male) => 0.0,
|
||||
(Human, Female) => 0.0,
|
||||
(Elf, Male) => -1.0,
|
||||
(Elf, Female) => 0.25,
|
||||
(Dwarf, Male) => 0.0,
|
||||
(Dwarf, Female) => 0.0,
|
||||
(Undead, Male) => -0.5,
|
||||
(Undead, Female) => 0.0,
|
||||
(Danari, Male) => 0.0,
|
||||
(Danari, Female) => 0.0,
|
||||
_ => 1.0,
|
||||
},
|
||||
weapon_x: match body.weapon {
|
||||
weapon_x: match Weapon::Sword {
|
||||
// TODO: Inventory
|
||||
Weapon::Sword => 0.0,
|
||||
Weapon::Axe => 3.0,
|
||||
Weapon::Hammer => 0.0,
|
||||
@ -159,7 +161,8 @@ impl<'a> From<&'a HumanoidBody> for SkeletonAttr {
|
||||
|
||||
_ => 1.0,
|
||||
},
|
||||
weapon_y: match body.weapon {
|
||||
weapon_y: match Weapon::Sword {
|
||||
// TODO: Inventory
|
||||
Weapon::Sword => -1.25,
|
||||
Weapon::Axe => 0.0,
|
||||
Weapon::Hammer => -2.0,
|
||||
|
@ -15,7 +15,7 @@ use crate::{
|
||||
};
|
||||
use client::Client;
|
||||
use common::{
|
||||
comp::{Body, HumanoidBody},
|
||||
comp::{humanoid, Body},
|
||||
state::DeltaTime,
|
||||
};
|
||||
use log::error;
|
||||
@ -79,7 +79,7 @@ impl Scene {
|
||||
&self.globals
|
||||
}
|
||||
|
||||
pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client, body: HumanoidBody) {
|
||||
pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client, body: humanoid::Body) {
|
||||
self.camera.set_focus_pos(Vec3::unit_z() * 2.0);
|
||||
self.camera.update(client.state().get_time());
|
||||
self.camera.set_distance(4.2);
|
||||
@ -126,7 +126,7 @@ impl Scene {
|
||||
);
|
||||
}
|
||||
|
||||
pub fn render(&mut self, renderer: &mut Renderer, client: &Client, body: HumanoidBody) {
|
||||
pub fn render(&mut self, renderer: &mut Renderer, client: &Client, body: humanoid::Body) {
|
||||
renderer.render_skybox(&self.skybox.model, &self.globals, &self.skybox.locals);
|
||||
|
||||
let model = &self
|
||||
|
@ -7,10 +7,7 @@ use crate::{
|
||||
},
|
||||
window::Window,
|
||||
};
|
||||
use common::comp::{
|
||||
actor::{BodyType, Race, Weapon, ALL_CHESTS},
|
||||
HumanoidBody,
|
||||
};
|
||||
use common::comp::{humanoid, item::Weapon, quadruped, quadruped_medium};
|
||||
use conrod_core::{
|
||||
color,
|
||||
color::TRANSPARENT,
|
||||
@ -229,9 +226,8 @@ pub struct CharSelectionUi {
|
||||
fonts: Fonts,
|
||||
character_creation: bool,
|
||||
pub character_name: String,
|
||||
pub character_body: HumanoidBody,
|
||||
pub character_weapon: Weapon,
|
||||
pub body_type: BodyType,
|
||||
pub character_body: humanoid::Body,
|
||||
pub character_weapon: Weapon, // TODO: Move into ecs inventory struct?
|
||||
}
|
||||
|
||||
impl CharSelectionUi {
|
||||
@ -254,9 +250,8 @@ impl CharSelectionUi {
|
||||
fonts,
|
||||
character_creation: false,
|
||||
character_name: "Character Name".to_string(),
|
||||
character_body: HumanoidBody::random(),
|
||||
character_body: humanoid::Body::random(),
|
||||
character_weapon: Weapon::Sword,
|
||||
body_type: BodyType::Male,
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,7 +360,7 @@ impl CharSelectionUi {
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_creation = true;
|
||||
self.character_body.weapon = Weapon::Sword;
|
||||
self.character_weapon = Weapon::Sword;
|
||||
}
|
||||
|
||||
// Alpha Version
|
||||
@ -538,36 +533,40 @@ impl CharSelectionUi {
|
||||
.w_h(70.0, 70.0)
|
||||
.top_left_with_margins_on(self.ids.creation_buttons_alignment_1, 0.0, 0.0)
|
||||
.set(self.ids.male, ui_widgets);
|
||||
if Button::image(if let BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
})
|
||||
if Button::image(
|
||||
if let humanoid::BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
},
|
||||
)
|
||||
.middle_of(self.ids.male)
|
||||
.hover_image(self.imgs.icon_border_mo)
|
||||
.press_image(self.imgs.icon_border_press)
|
||||
.set(self.ids.body_type_1, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.body_type = BodyType::Male;
|
||||
self.character_body.body_type = humanoid::BodyType::Male;
|
||||
}
|
||||
// Female
|
||||
Image::new(self.imgs.female)
|
||||
.w_h(70.0, 70.0)
|
||||
.top_right_with_margins_on(self.ids.creation_buttons_alignment_1, 0.0, 0.0)
|
||||
.set(self.ids.female, ui_widgets);
|
||||
if Button::image(if let BodyType::Female = self.character_body.body_type {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
})
|
||||
if Button::image(
|
||||
if let humanoid::BodyType::Female = self.character_body.body_type {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
},
|
||||
)
|
||||
.middle_of(self.ids.female)
|
||||
.hover_image(self.imgs.icon_border_mo)
|
||||
.press_image(self.imgs.icon_border_press)
|
||||
.set(self.ids.body_type_2, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.body_type = BodyType::Female;
|
||||
self.character_body.body_type = humanoid::BodyType::Female;
|
||||
}
|
||||
|
||||
// Alignment for Races and Weapons
|
||||
@ -576,15 +575,17 @@ impl CharSelectionUi {
|
||||
.set(self.ids.creation_buttons_alignment_2, ui_widgets);
|
||||
|
||||
// Human
|
||||
Image::new(if let BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.human_m
|
||||
} else {
|
||||
self.imgs.human_f
|
||||
})
|
||||
Image::new(
|
||||
if let humanoid::BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.human_m
|
||||
} else {
|
||||
self.imgs.human_f
|
||||
},
|
||||
)
|
||||
.w_h(70.0, 70.0)
|
||||
.top_left_with_margins_on(self.ids.creation_buttons_alignment_2, 0.0, 0.0)
|
||||
.set(self.ids.human, ui_widgets);
|
||||
if Button::image(if let Race::Human = self.character_body.race {
|
||||
if Button::image(if let humanoid::Race::Human = self.character_body.race {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -595,19 +596,21 @@ impl CharSelectionUi {
|
||||
.set(self.ids.race_1, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.race = Race::Human;
|
||||
self.character_body.race = humanoid::Race::Human;
|
||||
}
|
||||
|
||||
// Orc
|
||||
Image::new(if let BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.orc_m
|
||||
} else {
|
||||
self.imgs.orc_f
|
||||
})
|
||||
Image::new(
|
||||
if let humanoid::BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.orc_m
|
||||
} else {
|
||||
self.imgs.orc_f
|
||||
},
|
||||
)
|
||||
.w_h(70.0, 70.0)
|
||||
.right_from(self.ids.human, 2.0)
|
||||
.set(self.ids.orc, ui_widgets);
|
||||
if Button::image(if let Race::Orc = self.character_body.race {
|
||||
if Button::image(if let humanoid::Race::Orc = self.character_body.race {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -618,18 +621,20 @@ impl CharSelectionUi {
|
||||
.set(self.ids.race_2, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.race = Race::Orc;
|
||||
self.character_body.race = humanoid::Race::Orc;
|
||||
}
|
||||
// Dwarf
|
||||
Image::new(if let BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.dwarf_m
|
||||
} else {
|
||||
self.imgs.dwarf_f
|
||||
})
|
||||
Image::new(
|
||||
if let humanoid::BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.dwarf_m
|
||||
} else {
|
||||
self.imgs.dwarf_f
|
||||
},
|
||||
)
|
||||
.w_h(70.0, 70.0)
|
||||
.right_from(self.ids.orc, 2.0)
|
||||
.set(self.ids.dwarf, ui_widgets);
|
||||
if Button::image(if let Race::Dwarf = self.character_body.race {
|
||||
if Button::image(if let humanoid::Race::Dwarf = self.character_body.race {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -640,18 +645,20 @@ impl CharSelectionUi {
|
||||
.set(self.ids.race_3, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.race = Race::Dwarf;
|
||||
self.character_body.race = humanoid::Race::Dwarf;
|
||||
}
|
||||
// Elf
|
||||
Image::new(if let BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.elf_m
|
||||
} else {
|
||||
self.imgs.elf_f
|
||||
})
|
||||
Image::new(
|
||||
if let humanoid::BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.elf_m
|
||||
} else {
|
||||
self.imgs.elf_f
|
||||
},
|
||||
)
|
||||
.w_h(70.0, 70.0)
|
||||
.down_from(self.ids.human, 2.0)
|
||||
.set(self.ids.elf, ui_widgets);
|
||||
if Button::image(if let Race::Elf = self.character_body.race {
|
||||
if Button::image(if let humanoid::Race::Elf = self.character_body.race {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -662,18 +669,20 @@ impl CharSelectionUi {
|
||||
.set(self.ids.race_4, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.race = Race::Elf;
|
||||
self.character_body.race = humanoid::Race::Elf;
|
||||
}
|
||||
// Undead
|
||||
Image::new(if let BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.undead_m
|
||||
} else {
|
||||
self.imgs.undead_f
|
||||
})
|
||||
Image::new(
|
||||
if let humanoid::BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.undead_m
|
||||
} else {
|
||||
self.imgs.undead_f
|
||||
},
|
||||
)
|
||||
.w_h(70.0, 70.0)
|
||||
.right_from(self.ids.elf, 2.0)
|
||||
.set(self.ids.undead, ui_widgets);
|
||||
if Button::image(if let Race::Undead = self.character_body.race {
|
||||
if Button::image(if let humanoid::Race::Undead = self.character_body.race {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -684,17 +693,19 @@ impl CharSelectionUi {
|
||||
.set(self.ids.race_5, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.race = Race::Undead;
|
||||
self.character_body.race = humanoid::Race::Undead;
|
||||
}
|
||||
// Danari
|
||||
Image::new(if let BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.danari_m
|
||||
} else {
|
||||
self.imgs.danari_f
|
||||
})
|
||||
Image::new(
|
||||
if let humanoid::BodyType::Male = self.character_body.body_type {
|
||||
self.imgs.danari_m
|
||||
} else {
|
||||
self.imgs.danari_f
|
||||
},
|
||||
)
|
||||
.right_from(self.ids.undead, 2.0)
|
||||
.set(self.ids.danari, ui_widgets);
|
||||
if Button::image(if let Race::Danari = self.character_body.race {
|
||||
if Button::image(if let humanoid::Race::Danari = self.character_body.race {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -706,7 +717,7 @@ impl CharSelectionUi {
|
||||
.set(self.ids.race_6, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.race = Race::Danari;
|
||||
self.character_body.race = humanoid::Race::Danari;
|
||||
}
|
||||
|
||||
// Hammer
|
||||
@ -715,7 +726,7 @@ impl CharSelectionUi {
|
||||
.w_h(70.0, 70.0)
|
||||
.bottom_left_with_margins_on(self.ids.creation_buttons_alignment_2, 0.0, 0.0)
|
||||
.set(self.ids.hammer, ui_widgets);
|
||||
if Button::image(if let Weapon::Hammer = self.character_body.weapon {
|
||||
if Button::image(if let Weapon::Hammer = self.character_weapon {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -726,7 +737,7 @@ impl CharSelectionUi {
|
||||
.set(self.ids.hammer_button, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.weapon = Weapon::Hammer;
|
||||
self.character_weapon = Weapon::Hammer;
|
||||
}
|
||||
// REMOVE THIS AFTER IMPLEMENTATION
|
||||
/*Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8))
|
||||
@ -739,7 +750,7 @@ impl CharSelectionUi {
|
||||
.w_h(70.0, 70.0)
|
||||
.right_from(self.ids.hammer, 2.0)
|
||||
.set(self.ids.bow, ui_widgets);
|
||||
if Button::image(if let Weapon::Bow = self.character_body.weapon {
|
||||
if Button::image(if let Weapon::Bow = self.character_weapon {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -750,7 +761,7 @@ impl CharSelectionUi {
|
||||
.set(self.ids.bow_button, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
//self.character_body.weapon = Weapon::Bow;
|
||||
//self.character_weapon = Weapon::Bow;
|
||||
}
|
||||
// REMOVE THIS AFTER IMPLEMENTATION
|
||||
Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8))
|
||||
@ -761,7 +772,7 @@ impl CharSelectionUi {
|
||||
.w_h(70.0, 70.0)
|
||||
.right_from(self.ids.bow, 2.0)
|
||||
.set(self.ids.staff, ui_widgets);
|
||||
if Button::image(if let Weapon::Staff = self.character_body.weapon {
|
||||
if Button::image(if let Weapon::Staff = self.character_weapon {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -772,7 +783,7 @@ impl CharSelectionUi {
|
||||
.set(self.ids.staff_button, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
//self.character_body.weapon = Weapon::Staff;
|
||||
//self.character_weapon = Weapon::Staff;
|
||||
}
|
||||
// REMOVE THIS AFTER IMPLEMENTATION
|
||||
Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8))
|
||||
@ -783,7 +794,7 @@ impl CharSelectionUi {
|
||||
.w_h(70.0, 70.0)
|
||||
.up_from(self.ids.hammer, 2.0)
|
||||
.set(self.ids.sword, ui_widgets);
|
||||
if Button::image(if let Weapon::Sword = self.character_body.weapon {
|
||||
if Button::image(if let Weapon::Sword = self.character_weapon {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -794,7 +805,7 @@ impl CharSelectionUi {
|
||||
.set(self.ids.sword_button, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.weapon = Weapon::Sword;
|
||||
self.character_weapon = Weapon::Sword;
|
||||
}
|
||||
|
||||
// Daggers
|
||||
@ -802,7 +813,7 @@ impl CharSelectionUi {
|
||||
.w_h(70.0, 70.0)
|
||||
.right_from(self.ids.sword, 2.0)
|
||||
.set(self.ids.daggers, ui_widgets);
|
||||
if Button::image(if let Weapon::Daggers = self.character_body.weapon {
|
||||
if Button::image(if let Weapon::Daggers = self.character_weapon {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -813,7 +824,7 @@ impl CharSelectionUi {
|
||||
.set(self.ids.daggers_button, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
// self.character_body.weapon = Weapon::Daggers;
|
||||
// self.character_weapon = Weapon::Daggers;
|
||||
} // REMOVE THIS AFTER IMPLEMENTATION
|
||||
Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8))
|
||||
.middle_of(self.ids.daggers)
|
||||
@ -824,7 +835,7 @@ impl CharSelectionUi {
|
||||
.w_h(70.0, 70.0)
|
||||
.right_from(self.ids.daggers, 2.0)
|
||||
.set(self.ids.axe, ui_widgets);
|
||||
if Button::image(if let Weapon::Axe = self.character_body.weapon {
|
||||
if Button::image(if let Weapon::Axe = self.character_weapon {
|
||||
self.imgs.icon_border_pressed
|
||||
} else {
|
||||
self.imgs.icon_border
|
||||
@ -835,7 +846,7 @@ impl CharSelectionUi {
|
||||
.set(self.ids.axe_button, ui_widgets)
|
||||
.was_clicked()
|
||||
{
|
||||
self.character_body.weapon = Weapon::Axe;
|
||||
self.character_weapon = Weapon::Axe;
|
||||
}
|
||||
// REMOVE THIS AFTER IMPLEMENTATION
|
||||
/*Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8))
|
||||
@ -853,12 +864,12 @@ impl CharSelectionUi {
|
||||
.set(self.ids.hairstyle_text, ui_widgets);
|
||||
let current_chest = self.character_body.chest;
|
||||
if let Some(new_val) = ImageSlider::discrete(
|
||||
ALL_CHESTS
|
||||
humanoid::ALL_CHESTS
|
||||
.iter()
|
||||
.position(|&c| c == current_chest)
|
||||
.unwrap_or(0),
|
||||
0,
|
||||
ALL_CHESTS.len() - 1,
|
||||
humanoid::ALL_CHESTS.len() - 1,
|
||||
self.imgs.slider_indicator,
|
||||
self.imgs.slider_range,
|
||||
)
|
||||
@ -869,7 +880,7 @@ impl CharSelectionUi {
|
||||
.pad_track((5.0, 5.0))
|
||||
.set(self.ids.hairstyle_slider, ui_widgets)
|
||||
{
|
||||
self.character_body.chest = ALL_CHESTS[new_val];
|
||||
self.character_body.chest = humanoid::ALL_CHESTS[new_val];
|
||||
}
|
||||
|
||||
// Hair Color
|
||||
@ -882,12 +893,12 @@ impl CharSelectionUi {
|
||||
.set(self.ids.haircolor_text, ui_widgets);
|
||||
let current_chest = self.character_body.chest;
|
||||
if let Some(new_val) = ImageSlider::discrete(
|
||||
ALL_CHESTS
|
||||
humanoid::ALL_CHESTS
|
||||
.iter()
|
||||
.position(|&c| c == current_chest)
|
||||
.unwrap_or(0),
|
||||
0,
|
||||
ALL_CHESTS.len() - 1,
|
||||
humanoid::ALL_CHESTS.len() - 1,
|
||||
self.imgs.slider_indicator,
|
||||
self.imgs.slider_range,
|
||||
)
|
||||
@ -898,7 +909,7 @@ impl CharSelectionUi {
|
||||
.pad_track((5.0, 5.0))
|
||||
.set(self.ids.haircolor_slider, ui_widgets)
|
||||
{
|
||||
self.character_body.chest = ALL_CHESTS[new_val];
|
||||
self.character_body.chest = humanoid::ALL_CHESTS[new_val];
|
||||
}
|
||||
|
||||
// Skin
|
||||
@ -911,12 +922,12 @@ impl CharSelectionUi {
|
||||
.set(self.ids.skin_text, ui_widgets);
|
||||
let current_chest = self.character_body.chest;
|
||||
if let Some(new_val) = ImageSlider::discrete(
|
||||
ALL_CHESTS
|
||||
humanoid::ALL_CHESTS
|
||||
.iter()
|
||||
.position(|&c| c == current_chest)
|
||||
.unwrap_or(0),
|
||||
0,
|
||||
ALL_CHESTS.len() - 1,
|
||||
humanoid::ALL_CHESTS.len() - 1,
|
||||
self.imgs.slider_indicator,
|
||||
self.imgs.slider_range,
|
||||
)
|
||||
@ -927,7 +938,7 @@ impl CharSelectionUi {
|
||||
.pad_track((5.0, 5.0))
|
||||
.set(self.ids.skin_slider, ui_widgets)
|
||||
{
|
||||
self.character_body.chest = ALL_CHESTS[new_val];
|
||||
self.character_body.chest = humanoid::ALL_CHESTS[new_val];
|
||||
}
|
||||
|
||||
// EyeBrows
|
||||
@ -939,12 +950,12 @@ impl CharSelectionUi {
|
||||
.set(self.ids.eyebrows_text, ui_widgets);
|
||||
let current_chest = self.character_body.chest;
|
||||
if let Some(new_val) = ImageSlider::discrete(
|
||||
ALL_CHESTS
|
||||
humanoid::ALL_CHESTS
|
||||
.iter()
|
||||
.position(|&c| c == current_chest)
|
||||
.unwrap_or(0),
|
||||
0,
|
||||
ALL_CHESTS.len() - 1,
|
||||
humanoid::ALL_CHESTS.len() - 1,
|
||||
self.imgs.slider_indicator,
|
||||
self.imgs.slider_range,
|
||||
)
|
||||
@ -955,7 +966,7 @@ impl CharSelectionUi {
|
||||
.pad_track((5.0, 5.0))
|
||||
.set(self.ids.eyebrows_slider, ui_widgets)
|
||||
{
|
||||
self.character_body.chest = ALL_CHESTS[new_val];
|
||||
self.character_body.chest = humanoid::ALL_CHESTS[new_val];
|
||||
}
|
||||
|
||||
// EyeColor
|
||||
@ -967,12 +978,12 @@ impl CharSelectionUi {
|
||||
.set(self.ids.eyecolor_text, ui_widgets);
|
||||
let current_chest = self.character_body.chest;
|
||||
if let Some(new_val) = ImageSlider::discrete(
|
||||
ALL_CHESTS
|
||||
humanoid::ALL_CHESTS
|
||||
.iter()
|
||||
.position(|&c| c == current_chest)
|
||||
.unwrap_or(0),
|
||||
0,
|
||||
ALL_CHESTS.len() - 1,
|
||||
humanoid::ALL_CHESTS.len() - 1,
|
||||
self.imgs.slider_indicator,
|
||||
self.imgs.slider_range,
|
||||
)
|
||||
@ -983,7 +994,7 @@ impl CharSelectionUi {
|
||||
.pad_track((5.0, 5.0))
|
||||
.set(self.ids.eyecolor_slider, ui_widgets)
|
||||
{
|
||||
self.character_body.chest = ALL_CHESTS[new_val];
|
||||
self.character_body.chest = humanoid::ALL_CHESTS[new_val];
|
||||
}
|
||||
// Accessories
|
||||
Text::new("Accessories")
|
||||
@ -994,12 +1005,12 @@ impl CharSelectionUi {
|
||||
.set(self.ids.accessories_text, ui_widgets);
|
||||
let current_chest = self.character_body.chest;
|
||||
if let Some(new_val) = ImageSlider::discrete(
|
||||
ALL_CHESTS
|
||||
humanoid::ALL_CHESTS
|
||||
.iter()
|
||||
.position(|&c| c == current_chest)
|
||||
.unwrap_or(0),
|
||||
0,
|
||||
ALL_CHESTS.len() - 1,
|
||||
humanoid::ALL_CHESTS.len() - 1,
|
||||
self.imgs.slider_indicator,
|
||||
self.imgs.slider_range,
|
||||
)
|
||||
@ -1010,11 +1021,11 @@ impl CharSelectionUi {
|
||||
.pad_track((5.0, 5.0))
|
||||
.set(self.ids.accessories_slider, ui_widgets)
|
||||
{
|
||||
self.character_body.chest = ALL_CHESTS[new_val];
|
||||
self.character_body.chest = humanoid::ALL_CHESTS[new_val];
|
||||
}
|
||||
|
||||
// Beard
|
||||
if let BodyType::Male = self.character_body.body_type {
|
||||
if let humanoid::BodyType::Male = self.character_body.body_type {
|
||||
Text::new("Beard")
|
||||
.mid_bottom_with_margin_on(self.ids.accessories_slider, -40.0)
|
||||
.font_size(18)
|
||||
@ -1023,12 +1034,12 @@ impl CharSelectionUi {
|
||||
.set(self.ids.beard_text, ui_widgets);
|
||||
|
||||
if let Some(new_val) = ImageSlider::discrete(
|
||||
ALL_CHESTS
|
||||
humanoid::ALL_CHESTS
|
||||
.iter()
|
||||
.position(|&c| c == current_chest)
|
||||
.unwrap_or(0),
|
||||
0,
|
||||
ALL_CHESTS.len() - 1,
|
||||
humanoid::ALL_CHESTS.len() - 1,
|
||||
self.imgs.slider_indicator,
|
||||
self.imgs.slider_range,
|
||||
)
|
||||
@ -1039,7 +1050,7 @@ impl CharSelectionUi {
|
||||
.pad_track((5.0, 5.0))
|
||||
.set(self.ids.beard_slider, ui_widgets)
|
||||
{
|
||||
self.character_body.chest = ALL_CHESTS[new_val];
|
||||
self.character_body.chest = humanoid::ALL_CHESTS[new_val];
|
||||
}
|
||||
} else {
|
||||
Text::new("Beard")
|
||||
|
@ -1,9 +1,7 @@
|
||||
use crate::{
|
||||
anim::{
|
||||
character::{self, CharacterSkeleton},
|
||||
quadruped::{self, QuadrupedSkeleton},
|
||||
quadrupedmedium::{self, QuadrupedMediumSkeleton},
|
||||
Animation, Skeleton, SkeletonAttr,
|
||||
self, character::CharacterSkeleton, quadruped::QuadrupedSkeleton,
|
||||
quadrupedmedium::QuadrupedMediumSkeleton, Animation, Skeleton, SkeletonAttr,
|
||||
},
|
||||
mesh::Meshable,
|
||||
render::{
|
||||
@ -13,15 +11,7 @@ use crate::{
|
||||
use client::Client;
|
||||
use common::{
|
||||
assets,
|
||||
comp::{
|
||||
self,
|
||||
actor::{
|
||||
Belt, BodyType, Chest, Draw, Foot, Hand, Pants, PigChest, PigHead, PigLegL, PigLegR,
|
||||
Race, Shoulder, Weapon, WolfEars, WolfFootLB, WolfFootLF, WolfFootRB, WolfFootRF,
|
||||
WolfHeadLower, WolfHeadUpper, WolfJaw, WolfTail, WolfTorsoBack, WolfTorsoMid,
|
||||
},
|
||||
Body,
|
||||
},
|
||||
comp::{self, humanoid, item::Weapon, quadruped, quadruped_medium, Body},
|
||||
figure::Segment,
|
||||
state::DeltaTime,
|
||||
terrain::TerrainChunkSize,
|
||||
@ -71,22 +61,22 @@ impl FigureModelCache {
|
||||
Some(Self::load_right_hand(body.hand)),
|
||||
Some(Self::load_left_foot(body.foot)),
|
||||
Some(Self::load_right_foot(body.foot)),
|
||||
Some(Self::load_weapon(body.weapon)),
|
||||
Some(Self::load_weapon(Weapon::Axe)), // TODO: Inventory
|
||||
Some(Self::load_left_shoulder(body.shoulder)),
|
||||
Some(Self::load_right_shoulder(body.shoulder)),
|
||||
Some(Self::load_draw(body.draw)),
|
||||
Some(Self::load_left_equip(body.weapon)),
|
||||
Some(Self::load_draw()),
|
||||
Some(Self::load_left_equip(Weapon::Axe)), // TODO: Inventory
|
||||
Some(Self::load_right_equip(body.hand)),
|
||||
None,
|
||||
None,
|
||||
],
|
||||
Body::Quadruped(body) => [
|
||||
Some(Self::load_pig_head(body.pig_head)),
|
||||
Some(Self::load_pig_chest(body.pig_chest)),
|
||||
Some(Self::load_pig_leg_lf(body.pig_leg_l)),
|
||||
Some(Self::load_pig_leg_rf(body.pig_leg_r)),
|
||||
Some(Self::load_pig_leg_lb(body.pig_leg_l)),
|
||||
Some(Self::load_pig_leg_rb(body.pig_leg_r)),
|
||||
Some(Self::load_pig_head(body.head)),
|
||||
Some(Self::load_pig_chest(body.chest)),
|
||||
Some(Self::load_pig_leg_lf(body.leg_l)),
|
||||
Some(Self::load_pig_leg_rf(body.leg_r)),
|
||||
Some(Self::load_pig_leg_lb(body.leg_l)),
|
||||
Some(Self::load_pig_leg_rb(body.leg_r)),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
@ -99,17 +89,17 @@ impl FigureModelCache {
|
||||
None,
|
||||
],
|
||||
Body::QuadrupedMedium(body) => [
|
||||
Some(Self::load_wolf_head_upper(body.wolf_head_upper)),
|
||||
Some(Self::load_wolf_jaw(body.wolf_jaw)),
|
||||
Some(Self::load_wolf_head_lower(body.wolf_head_lower)),
|
||||
Some(Self::load_wolf_tail(body.wolf_tail)),
|
||||
Some(Self::load_wolf_torso_back(body.wolf_torso_back)),
|
||||
Some(Self::load_wolf_torso_mid(body.wolf_torso_mid)),
|
||||
Some(Self::load_wolf_ears(body.wolf_ears)),
|
||||
Some(Self::load_wolf_foot_lf(body.wolf_foot_lf)),
|
||||
Some(Self::load_wolf_foot_rf(body.wolf_foot_rf)),
|
||||
Some(Self::load_wolf_foot_lb(body.wolf_foot_lb)),
|
||||
Some(Self::load_wolf_foot_rb(body.wolf_foot_rb)),
|
||||
Some(Self::load_wolf_head_upper(body.head_upper)),
|
||||
Some(Self::load_wolf_jaw(body.jaw)),
|
||||
Some(Self::load_wolf_head_lower(body.head_lower)),
|
||||
Some(Self::load_wolf_tail(body.tail)),
|
||||
Some(Self::load_wolf_torso_back(body.torso_back)),
|
||||
Some(Self::load_wolf_torso_mid(body.torso_mid)),
|
||||
Some(Self::load_wolf_ears(body.ears)),
|
||||
Some(Self::load_wolf_foot_lf(body.foot_lf)),
|
||||
Some(Self::load_wolf_foot_rf(body.foot_rf)),
|
||||
Some(Self::load_wolf_foot_lb(body.foot_lb)),
|
||||
Some(Self::load_wolf_foot_rb(body.foot_rb)),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
@ -158,53 +148,55 @@ impl FigureModelCache {
|
||||
.generate_mesh(position)
|
||||
}
|
||||
|
||||
fn load_head(race: Race, body_type: BodyType) -> Mesh<FigurePipeline> {
|
||||
fn load_head(race: humanoid::Race, body_type: humanoid::BodyType) -> Mesh<FigurePipeline> {
|
||||
use humanoid::{BodyType::*, Race::*};
|
||||
|
||||
let (name, offset) = match (race, body_type) {
|
||||
(Race::Human, BodyType::Male) => (
|
||||
(Human, Male) => (
|
||||
"figure/head/head_human_male.vox",
|
||||
Vec3::new(-7.0, -5.5, -9.25),
|
||||
),
|
||||
(Race::Human, BodyType::Female) => (
|
||||
(Human, Female) => (
|
||||
"figure/head/head_human_female.vox",
|
||||
Vec3::new(-7.0, -7.5, -3.25),
|
||||
),
|
||||
(Race::Elf, BodyType::Male) => (
|
||||
(Elf, Male) => (
|
||||
"figure/head/head_elf_male.vox",
|
||||
Vec3::new(-7.0, -6.5, -3.75),
|
||||
),
|
||||
(Race::Elf, BodyType::Female) => (
|
||||
(Elf, Female) => (
|
||||
"figure/head/head_elf_female.vox",
|
||||
Vec3::new(-8.0, -5.5, -3.0),
|
||||
),
|
||||
(Race::Dwarf, BodyType::Male) => (
|
||||
(Dwarf, Male) => (
|
||||
"figure/head/head_dwarf_male.vox",
|
||||
Vec3::new(-6.0, -5.0, -12.5),
|
||||
),
|
||||
(Race::Dwarf, BodyType::Female) => (
|
||||
(Dwarf, Female) => (
|
||||
"figure/head/head_dwarf_female.vox",
|
||||
Vec3::new(-6.0, -6.0, -9.25),
|
||||
),
|
||||
(Race::Orc, BodyType::Male) => (
|
||||
(Orc, Male) => (
|
||||
"figure/head/head_orc_male.vox",
|
||||
Vec3::new(-8.0, -6.0, -2.75),
|
||||
),
|
||||
(Race::Orc, BodyType::Female) => (
|
||||
(Orc, Female) => (
|
||||
"figure/head/head_orc_female.vox",
|
||||
Vec3::new(-8.0, -5.5, -2.75),
|
||||
),
|
||||
(Race::Undead, BodyType::Male) => (
|
||||
(Undead, Male) => (
|
||||
"figure/head/head_undead_male.vox",
|
||||
Vec3::new(-5.5, -5.0, -2.5),
|
||||
),
|
||||
(Race::Undead, BodyType::Female) => (
|
||||
(Undead, Female) => (
|
||||
"figure/head/head_undead_female.vox",
|
||||
Vec3::new(-6.0, -5.0, -2.5),
|
||||
),
|
||||
(Race::Danari, BodyType::Male) => (
|
||||
(Danari, Male) => (
|
||||
"figure/head/head_danari_male.vox",
|
||||
Vec3::new(-9.0, -5.0, -2.75),
|
||||
),
|
||||
(Race::Danari, BodyType::Female) => (
|
||||
(Danari, Female) => (
|
||||
"figure/head/head_danari_female.vox",
|
||||
Vec3::new(-9.0, -5.5, -2.5),
|
||||
),
|
||||
@ -227,73 +219,83 @@ impl FigureModelCache {
|
||||
// Self::load_mesh(name, offset)
|
||||
// }
|
||||
|
||||
fn load_chest(chest: Chest) -> Mesh<FigurePipeline> {
|
||||
fn load_chest(chest: humanoid::Chest) -> Mesh<FigurePipeline> {
|
||||
use humanoid::Chest::*;
|
||||
|
||||
Self::load_mesh(
|
||||
match chest {
|
||||
Chest::Blue => "armor/chest/chest_blue.vox",
|
||||
Chest::Brown => "armor/chest/chest_brown.vox",
|
||||
Chest::Dark => "armor/chest/chest_dark.vox",
|
||||
Chest::Green => "armor/chest/chest_green.vox",
|
||||
Chest::Orange => "armor/chest/chest_orange.vox",
|
||||
Blue => "armor/chest/chest_blue.vox",
|
||||
Brown => "armor/chest/chest_brown.vox",
|
||||
Dark => "armor/chest/chest_dark.vox",
|
||||
Green => "armor/chest/chest_green.vox",
|
||||
Orange => "armor/chest/chest_orange.vox",
|
||||
},
|
||||
Vec3::new(-6.0, -3.5, 0.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_belt(belt: Belt) -> Mesh<FigurePipeline> {
|
||||
fn load_belt(belt: humanoid::Belt) -> Mesh<FigurePipeline> {
|
||||
use humanoid::Belt::*;
|
||||
|
||||
Self::load_mesh(
|
||||
match belt {
|
||||
//Belt::Default => "figure/body/belt_male.vox",
|
||||
Belt::Dark => "armor/belt/belt_dark.vox",
|
||||
Dark => "armor/belt/belt_dark.vox",
|
||||
},
|
||||
Vec3::new(-5.0, -3.5, 0.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_pants(pants: Pants) -> Mesh<FigurePipeline> {
|
||||
fn load_pants(pants: humanoid::Pants) -> Mesh<FigurePipeline> {
|
||||
use humanoid::Pants::*;
|
||||
|
||||
Self::load_mesh(
|
||||
match pants {
|
||||
Pants::Blue => "armor/pants/pants_blue.vox",
|
||||
Pants::Brown => "armor/pants/pants_brown.vox",
|
||||
Pants::Dark => "armor/pants/pants_dark.vox",
|
||||
Pants::Green => "armor/pants/pants_green.vox",
|
||||
Pants::Orange => "armor/pants/pants_orange.vox",
|
||||
Blue => "armor/pants/pants_blue.vox",
|
||||
Brown => "armor/pants/pants_brown.vox",
|
||||
Dark => "armor/pants/pants_dark.vox",
|
||||
Green => "armor/pants/pants_green.vox",
|
||||
Orange => "armor/pants/pants_orange.vox",
|
||||
},
|
||||
Vec3::new(-5.0, -3.5, 0.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_left_hand(hand: Hand) -> Mesh<FigurePipeline> {
|
||||
fn load_left_hand(hand: humanoid::Hand) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match hand {
|
||||
Hand::Default => "figure/body/hand.vox",
|
||||
humanoid::Hand::Default => "figure/body/hand.vox",
|
||||
},
|
||||
Vec3::new(-2.0, -2.5, -2.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_right_hand(hand: Hand) -> Mesh<FigurePipeline> {
|
||||
fn load_right_hand(hand: humanoid::Hand) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match hand {
|
||||
Hand::Default => "figure/body/hand.vox",
|
||||
humanoid::Hand::Default => "figure/body/hand.vox",
|
||||
},
|
||||
Vec3::new(-2.0, -2.5, -2.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_left_foot(foot: Foot) -> Mesh<FigurePipeline> {
|
||||
fn load_left_foot(foot: humanoid::Foot) -> Mesh<FigurePipeline> {
|
||||
use humanoid::Foot::*;
|
||||
|
||||
Self::load_mesh(
|
||||
match foot {
|
||||
Foot::Dark => "armor/foot/foot_dark.vox",
|
||||
Dark => "armor/foot/foot_dark.vox",
|
||||
},
|
||||
Vec3::new(-2.5, -3.5, -9.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_right_foot(foot: Foot) -> Mesh<FigurePipeline> {
|
||||
fn load_right_foot(foot: humanoid::Foot) -> Mesh<FigurePipeline> {
|
||||
use humanoid::Foot::*;
|
||||
|
||||
Self::load_mesh(
|
||||
match foot {
|
||||
Foot::Dark => "armor/foot/foot_dark.vox",
|
||||
Dark => "armor/foot/foot_dark.vox",
|
||||
},
|
||||
Vec3::new(-2.5, -3.5, -9.0),
|
||||
)
|
||||
@ -313,33 +315,29 @@ impl FigureModelCache {
|
||||
Self::load_mesh(name, offset)
|
||||
}
|
||||
|
||||
fn load_left_shoulder(shoulder: Shoulder) -> Mesh<FigurePipeline> {
|
||||
fn load_left_shoulder(shoulder: humanoid::Shoulder) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match shoulder {
|
||||
Shoulder::None => "figure/empty.vox",
|
||||
Shoulder::Brown1 => "armor/shoulder/shoulder_l_brown.vox",
|
||||
humanoid::Shoulder::None => "figure/empty.vox",
|
||||
humanoid::Shoulder::Brown1 => "armor/shoulder/shoulder_l_brown.vox",
|
||||
},
|
||||
Vec3::new(2.5, -0.5, 0.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_right_shoulder(shoulder: Shoulder) -> Mesh<FigurePipeline> {
|
||||
fn load_right_shoulder(shoulder: humanoid::Shoulder) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match shoulder {
|
||||
Shoulder::None => "figure/empty.vox",
|
||||
Shoulder::Brown1 => "armor/shoulder/shoulder_r_brown.vox",
|
||||
humanoid::Shoulder::None => "figure/empty.vox",
|
||||
humanoid::Shoulder::Brown1 => "armor/shoulder/shoulder_r_brown.vox",
|
||||
},
|
||||
Vec3::new(2.5, -0.5, 0.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_draw(draw: Draw) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match draw {
|
||||
Draw::Default => "object/glider.vox",
|
||||
},
|
||||
Vec3::new(-26.0, -26.0, -5.0),
|
||||
)
|
||||
// TODO: Inventory
|
||||
fn load_draw() -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh("object/glider.vox", Vec3::new(-26.0, -26.0, -5.0))
|
||||
}
|
||||
|
||||
fn load_left_equip(weapon: Weapon) -> Mesh<FigurePipeline> {
|
||||
@ -356,164 +354,164 @@ impl FigureModelCache {
|
||||
Self::load_mesh(name, offset)
|
||||
}
|
||||
|
||||
fn load_right_equip(hand: Hand) -> Mesh<FigurePipeline> {
|
||||
fn load_right_equip(hand: humanoid::Hand) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match hand {
|
||||
Hand::Default => "figure/body/hand.vox",
|
||||
humanoid::Hand::Default => "figure/body/hand.vox",
|
||||
},
|
||||
Vec3::new(-2.0, -2.5, -5.0),
|
||||
)
|
||||
}
|
||||
|
||||
/////////
|
||||
fn load_pig_head(pig_head: PigHead) -> Mesh<FigurePipeline> {
|
||||
fn load_pig_head(head: quadruped::Head) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match pig_head {
|
||||
PigHead::Default => "npc/pig_purple/pig_head.vox",
|
||||
match head {
|
||||
quadruped::Head::Default => "npc/pig_purple/pig_head.vox",
|
||||
},
|
||||
Vec3::new(-6.0, 4.5, 3.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_pig_chest(pig_chest: PigChest) -> Mesh<FigurePipeline> {
|
||||
fn load_pig_chest(chest: quadruped::Chest) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match pig_chest {
|
||||
PigChest::Default => "npc/pig_purple/pig_chest.vox",
|
||||
match chest {
|
||||
quadruped::Chest::Default => "npc/pig_purple/pig_chest.vox",
|
||||
},
|
||||
Vec3::new(-5.0, 4.5, 0.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_pig_leg_lf(pig_leg_l: PigLegL) -> Mesh<FigurePipeline> {
|
||||
fn load_pig_leg_lf(leg_l: quadruped::LegL) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match pig_leg_l {
|
||||
PigLegL::Default => "npc/pig_purple/pig_leg_l.vox",
|
||||
match leg_l {
|
||||
quadruped::LegL::Default => "npc/pig_purple/pig_leg_l.vox",
|
||||
},
|
||||
Vec3::new(0.0, -1.0, -1.5),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_pig_leg_rf(pig_leg_r: PigLegR) -> Mesh<FigurePipeline> {
|
||||
fn load_pig_leg_rf(leg_r: quadruped::LegR) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match pig_leg_r {
|
||||
PigLegR::Default => "npc/pig_purple/pig_leg_r.vox",
|
||||
match leg_r {
|
||||
quadruped::LegR::Default => "npc/pig_purple/pig_leg_r.vox",
|
||||
},
|
||||
Vec3::new(0.0, -1.0, -1.5),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_pig_leg_lb(pig_leg_l: PigLegL) -> Mesh<FigurePipeline> {
|
||||
fn load_pig_leg_lb(leg_l: quadruped::LegL) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match pig_leg_l {
|
||||
PigLegL::Default => "npc/pig_purple/pig_leg_l.vox",
|
||||
match leg_l {
|
||||
quadruped::LegL::Default => "npc/pig_purple/pig_leg_l.vox",
|
||||
},
|
||||
Vec3::new(0.0, -1.0, -1.5),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_pig_leg_rb(pig_leg_r: PigLegR) -> Mesh<FigurePipeline> {
|
||||
fn load_pig_leg_rb(leg_r: quadruped::LegR) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match pig_leg_r {
|
||||
PigLegR::Default => "npc/pig_purple/pig_leg_r.vox",
|
||||
match leg_r {
|
||||
quadruped::LegR::Default => "npc/pig_purple/pig_leg_r.vox",
|
||||
},
|
||||
Vec3::new(0.0, -1.0, -1.5),
|
||||
)
|
||||
}
|
||||
//////
|
||||
fn load_wolf_head_upper(wolf_upper_head: WolfHeadUpper) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_head_upper(upper_head: quadruped_medium::HeadUpper) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_upper_head {
|
||||
WolfHeadUpper::Default => "npc/wolf/wolf_head_upper.vox",
|
||||
match upper_head {
|
||||
quadruped_medium::HeadUpper::Default => "npc/wolf/wolf_head_upper.vox",
|
||||
},
|
||||
Vec3::new(-7.0, -6.0, -5.5),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_jaw(wolf_jaw: WolfJaw) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_jaw(jaw: quadruped_medium::Jaw) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_jaw {
|
||||
WolfJaw::Default => "npc/wolf/wolf_jaw.vox",
|
||||
match jaw {
|
||||
quadruped_medium::Jaw::Default => "npc/wolf/wolf_jaw.vox",
|
||||
},
|
||||
Vec3::new(-3.0, -3.0, -2.5),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_head_lower(wolf_head_lower: WolfHeadLower) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_head_lower(head_lower: quadruped_medium::HeadLower) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_head_lower {
|
||||
WolfHeadLower::Default => "npc/wolf/wolf_head_lower.vox",
|
||||
match head_lower {
|
||||
quadruped_medium::HeadLower::Default => "npc/wolf/head_lower.vox",
|
||||
},
|
||||
Vec3::new(-7.0, -6.0, -5.5),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_tail(wolf_tail: WolfTail) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_tail(tail: quadruped_medium::Tail) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_tail {
|
||||
WolfTail::Default => "npc/wolf/wolf_tail.vox",
|
||||
match tail {
|
||||
quadruped_medium::Tail::Default => "npc/wolf/wolf_tail.vox",
|
||||
},
|
||||
Vec3::new(-2.0, -12.0, -5.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_torso_back(wolf_torso_back: WolfTorsoBack) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_torso_back(torso_back: quadruped_medium::TorsoBack) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_torso_back {
|
||||
WolfTorsoBack::Default => "npc/wolf/wolf_torso_back.vox",
|
||||
match torso_back {
|
||||
quadruped_medium::TorsoBack::Default => "npc/wolf/wolf_torso_back.vox",
|
||||
},
|
||||
Vec3::new(-7.0, -6.0, -6.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_torso_mid(wolf_torso_mid: WolfTorsoMid) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_torso_mid(torso_mid: quadruped_medium::TorsoMid) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_torso_mid {
|
||||
WolfTorsoMid::Default => "npc/wolf/wolf_torso_mid.vox",
|
||||
match torso_mid {
|
||||
quadruped_medium::TorsoMid::Default => "npc/wolf/wolf_torso_mid.vox",
|
||||
},
|
||||
Vec3::new(-8.0, -5.5, -6.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_ears(wolf_ears: WolfEars) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_ears(ears: quadruped_medium::Ears) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_ears {
|
||||
WolfEars::Default => "npc/wolf/wolf_ears.vox",
|
||||
match ears {
|
||||
quadruped_medium::Ears::Default => "npc/wolf/wolf_ears.vox",
|
||||
},
|
||||
Vec3::new(-4.0, -1.0, -1.0),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_foot_lf(wolf_foot_lf: WolfFootLF) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_foot_lf(foot_lf: quadruped_medium::FootLF) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_foot_lf {
|
||||
WolfFootLF::Default => "npc/wolf/wolf_foot_lf.vox",
|
||||
match foot_lf {
|
||||
quadruped_medium::FootLF::Default => "npc/wolf/wolf_foot_lf.vox",
|
||||
},
|
||||
Vec3::new(-2.5, -4.0, -2.5),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_foot_rf(wolf_foot_rf: WolfFootRF) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_foot_rf(foot_rf: quadruped_medium::FootRF) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_foot_rf {
|
||||
WolfFootRF::Default => "npc/wolf/wolf_foot_rf.vox",
|
||||
match foot_rf {
|
||||
quadruped_medium::FootRF::Default => "npc/wolf/wolf_foot_rf.vox",
|
||||
},
|
||||
Vec3::new(-2.5, -4.0, -2.5),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_foot_lb(wolf_foot_lb: WolfFootLB) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_foot_lb(foot_lb: quadruped_medium::FootLB) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_foot_lb {
|
||||
WolfFootLB::Default => "npc/wolf/wolf_foot_lb.vox",
|
||||
match foot_lb {
|
||||
quadruped_medium::FootLB::Default => "npc/wolf/wolf_foot_lb.vox",
|
||||
},
|
||||
Vec3::new(-2.5, -4.0, -2.5),
|
||||
)
|
||||
}
|
||||
|
||||
fn load_wolf_foot_rb(wolf_foot_rb: WolfFootRB) -> Mesh<FigurePipeline> {
|
||||
fn load_wolf_foot_rb(foot_rb: quadruped_medium::FootRB) -> Mesh<FigurePipeline> {
|
||||
Self::load_mesh(
|
||||
match wolf_foot_rb {
|
||||
WolfFootRB::Default => "npc/wolf/wolf_foot_rb.vox",
|
||||
match foot_rb {
|
||||
quadruped_medium::FootRB::Default => "npc/wolf/wolf_foot_rb.vox",
|
||||
},
|
||||
Vec3::new(-2.5, -4.0, -2.5),
|
||||
)
|
||||
@ -613,46 +611,56 @@ impl FigureMgr {
|
||||
});
|
||||
|
||||
let target_skeleton = match animation_info.animation {
|
||||
comp::Animation::Idle => character::IdleAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
),
|
||||
comp::Animation::Run => character::RunAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
),
|
||||
comp::Animation::Jump => character::JumpAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
),
|
||||
comp::Animation::Attack => {
|
||||
character::AttackAnimation::update_skeleton(
|
||||
comp::Animation::Idle => {
|
||||
anim::character::IdleAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
)
|
||||
}
|
||||
comp::Animation::Roll => character::RollAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
),
|
||||
comp::Animation::Crun => character::CrunAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
),
|
||||
comp::Animation::Run => {
|
||||
anim::character::RunAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
)
|
||||
}
|
||||
comp::Animation::Jump => {
|
||||
anim::character::JumpAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
)
|
||||
}
|
||||
comp::Animation::Attack => {
|
||||
anim::character::AttackAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
)
|
||||
}
|
||||
comp::Animation::Roll => {
|
||||
anim::character::RollAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
)
|
||||
}
|
||||
comp::Animation::Crun => {
|
||||
anim::character::CrunAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
)
|
||||
}
|
||||
comp::Animation::Cidle => {
|
||||
character::CidleAnimation::update_skeleton(
|
||||
anim::character::CidleAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
@ -660,7 +668,7 @@ impl FigureMgr {
|
||||
)
|
||||
}
|
||||
comp::Animation::Gliding => {
|
||||
character::GlidingAnimation::update_skeleton(
|
||||
anim::character::GlidingAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
@ -678,24 +686,30 @@ impl FigureMgr {
|
||||
});
|
||||
|
||||
let target_skeleton = match animation_info.animation {
|
||||
comp::Animation::Run => quadruped::RunAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
),
|
||||
comp::Animation::Idle => quadruped::IdleAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
),
|
||||
comp::Animation::Jump => quadruped::JumpAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
),
|
||||
comp::Animation::Run => {
|
||||
anim::quadruped::RunAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
)
|
||||
}
|
||||
comp::Animation::Idle => {
|
||||
anim::quadruped::IdleAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
)
|
||||
}
|
||||
comp::Animation::Jump => {
|
||||
anim::quadruped::JumpAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
skeleton_attr,
|
||||
)
|
||||
}
|
||||
|
||||
// TODO!
|
||||
_ => state.skeleton_mut().clone(),
|
||||
@ -714,7 +728,7 @@ impl FigureMgr {
|
||||
|
||||
let target_skeleton = match animation_info.animation {
|
||||
comp::Animation::Run => {
|
||||
quadrupedmedium::RunAnimation::update_skeleton(
|
||||
anim::quadrupedmedium::RunAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
@ -722,7 +736,7 @@ impl FigureMgr {
|
||||
)
|
||||
}
|
||||
comp::Animation::Idle => {
|
||||
quadrupedmedium::IdleAnimation::update_skeleton(
|
||||
anim::quadrupedmedium::IdleAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
time,
|
||||
animation_info.time,
|
||||
@ -730,7 +744,7 @@ impl FigureMgr {
|
||||
)
|
||||
}
|
||||
comp::Animation::Jump => {
|
||||
quadrupedmedium::JumpAnimation::update_skeleton(
|
||||
anim::quadrupedmedium::JumpAnimation::update_skeleton(
|
||||
state.skeleton_mut(),
|
||||
(vel.0.magnitude(), time),
|
||||
animation_info.time,
|
||||
|
Loading…
Reference in New Issue
Block a user