streamlined body part naming scheme, swapped quadruped to quadruped_small, rewrote mesh names to reflect body type instead of npckind. finally.

This commit is contained in:
jshipsey 2019-10-24 21:26:32 -04:00
parent 345095a183
commit c503f6e063
103 changed files with 364 additions and 523 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,13 +1,13 @@
pub mod biped_large;
pub mod bird_medium;
pub mod bird_small;
pub mod dragon;
pub mod fish_medium;
pub mod fish_small;
pub mod humanoid;
pub mod object;
pub mod quadruped;
pub mod quadruped_medium;
pub mod bird_medium;
pub mod fish_medium;
pub mod dragon;
pub mod bird_small;
pub mod fish_small;
pub mod biped_large;
pub mod quadruped_small;
use specs::{Component, FlaggedStorage};
use specs_idvs::IDVStorage;
@ -15,7 +15,7 @@ use specs_idvs::IDVStorage;
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Body {
Humanoid(humanoid::Body),
Quadruped(quadruped::Body),
QuadrupedSmall(quadruped_small::Body),
QuadrupedMedium(quadruped_medium::Body),
BirdMedium(bird_medium::Body),
FishMedium(fish_medium::Body),

View File

@ -97,4 +97,4 @@ const ALL_FOOT_LS: [FootL; 1] = [FootL::Default];
pub enum FootR {
Default,
}
const ALL_FOOT_RS: [FootR; 1] = [FootR::Default];
const ALL_FOOT_RS: [FootR; 1] = [FootR::Default];

View File

@ -65,4 +65,4 @@ const ALL_LEG_LS: [LegL; 1] = [LegL::Default];
pub enum LegR {
Default,
}
const ALL_LEG_RS: [LegR; 1] = [LegR::Default];
const ALL_LEG_RS: [LegR; 1] = [LegR::Default];

View File

@ -31,7 +31,6 @@ pub enum Torso {
}
const ALL_TORSOS: [Torso; 1] = [Torso::Default];
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum WingL {
Default,

View File

@ -15,9 +15,6 @@ pub struct Body {
pub foot_fr: FootFR,
pub foot_bl: FootBL,
pub foot_br: FootBR,
}
impl Body {
pub fn random() -> Self {
@ -36,8 +33,6 @@ impl Body {
foot_fr: *(&ALL_FOOT_FRS).choose(&mut rng).unwrap(),
foot_bl: *(&ALL_FOOT_BLS).choose(&mut rng).unwrap(),
foot_br: *(&ALL_FOOT_BRS).choose(&mut rng).unwrap(),
}
}
}
@ -118,4 +113,4 @@ const ALL_FOOT_BLS: [FootBL; 1] = [FootBL::Default];
pub enum FootBR {
Default,
}
const ALL_FOOT_BRS: [FootBR; 1] = [FootBR::Default];
const ALL_FOOT_BRS: [FootBR; 1] = [FootBR::Default];

View File

@ -19,7 +19,6 @@ impl Body {
tail: *(&ALL_TAILS).choose(&mut rng).unwrap(),
fin_l: *(&ALL_FIN_LS).choose(&mut rng).unwrap(),
fin_r: *(&ALL_FIN_RS).choose(&mut rng).unwrap(),
}
}
}

View File

@ -15,7 +15,6 @@ impl Body {
}
}
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Torso {
Default,
@ -26,4 +25,4 @@ const ALL_TORSOS: [Torso; 1] = [Torso::Default];
pub enum Tail {
Default,
}
const ALL_TAILS: [Tail; 1] = [Tail::Default];
const ALL_TAILS: [Tail; 1] = [Tail::Default];

View File

@ -16,7 +16,10 @@ mod visual;
// Reexports
pub use admin::Admin;
pub use agent::Agent;
pub use body::{humanoid, object, quadruped, quadruped_medium, bird_medium, fish_medium, dragon, bird_small, fish_small, biped_large, Body};
pub use body::{
biped_large, bird_medium, bird_small, dragon, fish_medium, fish_small, humanoid, object,
quadruped_medium, quadruped_small, Body,
};
pub use character_state::{ActionState, CharacterState, MovementState};
pub use controller::{
ControlEvent, Controller, ControllerInputs, InventoryManip, MountState, Mounting,

View File

@ -553,7 +553,7 @@ 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::humanoid::Body::random()),
NpcKind::Pig => comp::Body::Quadruped(comp::quadruped::Body::random()),
NpcKind::Pig => comp::Body::QuadrupedSmall(comp::quadruped_small::Body::random()),
NpcKind::Wolf => comp::Body::QuadrupedMedium(comp::quadruped_medium::Body::random()),
}
}

View File

@ -38,60 +38,48 @@ impl Animation for IdleAnimation {
* 0.25,
);
next.knight_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_head.scale = Vec3::one() / 10.88;
next.knight_upper_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_upper_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_upper_torso.scale = Vec3::one() / 10.88;
next.knight_lower_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_lower_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_lower_torso.scale = Vec3::one() / 10.88;
next.knight_shoulder_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_shoulder_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_l.scale = Vec3::one() / 10.88;
next.knight_shoulder_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_shoulder_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_r.scale = Vec3::one() / 10.88;
next.knight_hand_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_hand_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_l.scale = Vec3::one() / 10.88;
next.knight_hand_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_hand_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_r.scale = Vec3::one() / 10.88;
next.knight_leg_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_leg_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_l.scale = Vec3::one() / 10.88;
next.knight_leg_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_leg_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_r.scale = Vec3::one() / 10.88;
next.knight_foot_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_foot_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_l.scale = Vec3::one() / 10.88;
next.knight_foot_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_foot_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_r.scale = Vec3::one() / 10.88;
next
}

View File

@ -25,61 +25,48 @@ impl Animation for JumpAnimation {
let wave_slow = (anim_time as f32 * 3.5 + PI).sin();
let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos();
next.knight_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_head.scale = Vec3::one() / 10.88;
next.knight_upper_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_upper_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_upper_torso.scale = Vec3::one() / 10.88;
next.knight_lower_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_lower_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_lower_torso.scale = Vec3::one() / 10.88;
next.knight_shoulder_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_shoulder_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_l.scale = Vec3::one() / 10.88;
next.knight_shoulder_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_shoulder_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_r.scale = Vec3::one() / 10.88;
next.knight_hand_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_hand_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_l.scale = Vec3::one() / 10.88;
next.knight_hand_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_hand_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_r.scale = Vec3::one() / 10.88;
next.knight_leg_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_leg_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_l.scale = Vec3::one() / 10.88;
next.knight_leg_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_leg_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_r.scale = Vec3::one() / 10.88;
next.knight_foot_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_foot_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_l.scale = Vec3::one() / 10.88;
next.knight_foot_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_foot_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_r.scale = Vec3::one() / 10.88;
next
}

View File

@ -23,9 +23,6 @@ pub struct BipedLargeSkeleton {
knight_leg_r: Bone,
knight_foot_l: Bone,
knight_foot_r: Bone,
}
impl BipedLargeSkeleton {
@ -42,7 +39,6 @@ impl BipedLargeSkeleton {
knight_leg_r: Bone::default(),
knight_foot_l: Bone::default(),
knight_foot_r: Bone::default(),
}
}
}
@ -55,17 +51,18 @@ impl Skeleton for BipedLargeSkeleton {
let leg_l_mat = self.knight_leg_l.compute_base_matrix();
let leg_r_mat = self.knight_leg_r.compute_base_matrix();
[
FigureBoneData::new(self.knight_head.compute_base_matrix()),
FigureBoneData::new(
upper_torso_mat,
),
FigureBoneData::new(upper_torso_mat),
FigureBoneData::new(self.knight_lower_torso.compute_base_matrix() * upper_torso_mat),
FigureBoneData::new(shoulder_l_mat * upper_torso_mat),
FigureBoneData::new(shoulder_r_mat * upper_torso_mat),
FigureBoneData::new(self.knight_hand_l.compute_base_matrix() * shoulder_l_mat * upper_torso_mat),
FigureBoneData::new(self.knight_hand_r.compute_base_matrix() * shoulder_r_mat * upper_torso_mat),
FigureBoneData::new(
self.knight_hand_l.compute_base_matrix() * shoulder_l_mat * upper_torso_mat,
),
FigureBoneData::new(
self.knight_hand_r.compute_base_matrix() * shoulder_r_mat * upper_torso_mat,
),
FigureBoneData::new(leg_l_mat),
FigureBoneData::new(leg_r_mat),
FigureBoneData::new(self.knight_foot_l.compute_base_matrix() * leg_l_mat),
@ -79,12 +76,13 @@ impl Skeleton for BipedLargeSkeleton {
}
fn interpolate(&mut self, target: &Self, dt: f32) {
self.knight_head
.interpolate(&target.knight_head, dt);
self.knight_upper_torso.interpolate(&target.knight_upper_torso, dt);
self.knight_head.interpolate(&target.knight_head, dt);
self.knight_upper_torso
.interpolate(&target.knight_upper_torso, dt);
self.knight_lower_torso
.interpolate(&target.knight_lower_torso, dt);
self.knight_shoulder_l.interpolate(&target.knight_shoulder_l, dt);
self.knight_shoulder_l
.interpolate(&target.knight_shoulder_l, dt);
self.knight_shoulder_r
.interpolate(&target.knight_shoulder_r, dt);
self.knight_hand_l.interpolate(&target.knight_hand_l, dt);
@ -93,7 +91,5 @@ impl Skeleton for BipedLargeSkeleton {
self.knight_leg_r.interpolate(&target.knight_leg_r, dt);
self.knight_foot_l.interpolate(&target.knight_foot_l, dt);
self.knight_foot_r.interpolate(&target.knight_foot_r, dt);
}
}

View File

@ -38,60 +38,48 @@ impl Animation for RunAnimation {
* 0.25,
);
next.knight_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_head.scale = Vec3::one() / 10.88;
next.knight_upper_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_upper_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_upper_torso.scale = Vec3::one() / 10.88;
next.knight_lower_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_lower_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_lower_torso.scale = Vec3::one() / 10.88;
next.knight_shoulder_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_shoulder_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_l.scale = Vec3::one() / 10.88;
next.knight_shoulder_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_shoulder_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_shoulder_r.scale = Vec3::one() / 10.88;
next.knight_hand_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_hand_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_l.scale = Vec3::one() / 10.88;
next.knight_hand_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_hand_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_hand_r.scale = Vec3::one() / 10.88;
next.knight_leg_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_leg_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_l.scale = Vec3::one() / 10.88;
next.knight_leg_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_leg_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_leg_r.scale = Vec3::one() / 10.88;
next.knight_foot_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_foot_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_l.scale = Vec3::one() / 10.88;
next.knight_foot_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.knight_foot_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.knight_foot_r.scale = Vec3::one() / 10.88;
next
}

View File

@ -38,14 +38,12 @@ impl Animation for IdleAnimation {
* 0.25,
);
next.duck_m_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.duck_m_head.ori =
Quaternion::rotation_z(duck_m_look.x) * Quaternion::rotation_x(duck_m_look.y);
next.duck_m_head.scale = Vec3::one() / 10.88;
next.duck_m_torso.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.duck_m_torso.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.duck_m_torso.ori = Quaternion::rotation_x(0.0);
next.duck_m_torso.scale = Vec3::one() * 1.01;
@ -54,8 +52,7 @@ impl Animation for IdleAnimation {
next.duck_m_tail.scale = Vec3::one() * 0.98;
next.duck_m_wing_l.offset = Vec3::new(0.0, -13.0, 8.0) / 11.0;
next.duck_m_wing_l.ori = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(0.0);
next.duck_m_wing_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.duck_m_wing_l.scale = Vec3::one() / 11.0;
next.duck_m_wing_r.offset = Vec3::new(0.0, -11.7, 11.0) / 11.0;

View File

@ -25,15 +25,11 @@ impl Animation for JumpAnimation {
let wave_slow = (anim_time as f32 * 3.5 + PI).sin();
let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos();
next.duck_m_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.duck_m_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.duck_m_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.duck_m_head.scale = Vec3::one() / 10.88;
next.duck_m_torso.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.duck_m_torso.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.duck_m_torso.ori = Quaternion::rotation_x(0.0);
next.duck_m_torso.scale = Vec3::one() * 1.01;
@ -42,8 +38,7 @@ impl Animation for JumpAnimation {
next.duck_m_tail.scale = Vec3::one() * 0.98;
next.duck_m_wing_l.offset = Vec3::new(0.0, -13.0, 8.0) / 11.0;
next.duck_m_wing_l.ori = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(0.0);
next.duck_m_wing_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.duck_m_wing_l.scale = Vec3::one() / 11.0;
next.duck_m_wing_r.offset = Vec3::new(0.0, -11.7, 11.0) / 11.0;
@ -59,4 +54,4 @@ impl Animation for JumpAnimation {
next.duck_m_leg_r.scale = Vec3::one() * 1.00;
next
}
}
}

View File

@ -19,7 +19,6 @@ pub struct BirdMediumSkeleton {
duck_m_wing_r: Bone,
duck_m_leg_l: Bone,
duck_m_leg_r: Bone,
}
impl BirdMediumSkeleton {
@ -32,8 +31,6 @@ impl BirdMediumSkeleton {
duck_m_wing_r: Bone::default(),
duck_m_leg_l: Bone::default(),
duck_m_leg_r: Bone::default(),
}
}
}
@ -42,12 +39,9 @@ impl Skeleton for BirdMediumSkeleton {
fn compute_matrices(&self) -> [FigureBoneData; 16] {
let torso_mat = self.duck_m_torso.compute_base_matrix();
[
FigureBoneData::new(self.duck_m_head.compute_base_matrix() * torso_mat),
FigureBoneData::new(
torso_mat,
),
FigureBoneData::new(torso_mat),
FigureBoneData::new(self.duck_m_tail.compute_base_matrix() * torso_mat),
FigureBoneData::new(self.duck_m_wing_l.compute_base_matrix() * torso_mat),
FigureBoneData::new(self.duck_m_wing_r.compute_base_matrix() * torso_mat),
@ -66,14 +60,11 @@ impl Skeleton for BirdMediumSkeleton {
}
fn interpolate(&mut self, target: &Self, dt: f32) {
self.duck_m_head
.interpolate(&target.duck_m_head, dt);
self.duck_m_head.interpolate(&target.duck_m_head, dt);
self.duck_m_torso.interpolate(&target.duck_m_torso, dt);
self.duck_m_tail
.interpolate(&target.duck_m_tail, dt);
self.duck_m_tail.interpolate(&target.duck_m_tail, dt);
self.duck_m_wing_l.interpolate(&target.duck_m_wing_l, dt);
self.duck_m_wing_r
.interpolate(&target.duck_m_wing_r, dt);
self.duck_m_wing_r.interpolate(&target.duck_m_wing_r, dt);
self.duck_m_leg_l.interpolate(&target.duck_m_leg_l, dt);
self.duck_m_leg_r.interpolate(&target.duck_m_leg_r, dt);
}

View File

@ -38,14 +38,11 @@ impl Animation for RunAnimation {
* 0.25,
);
next.duck_m_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.duck_m_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.duck_m_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.duck_m_head.scale = Vec3::one() / 10.88;
next.duck_m_torso.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.duck_m_torso.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.duck_m_torso.ori = Quaternion::rotation_x(0.0);
next.duck_m_torso.scale = Vec3::one() * 1.01;
@ -54,8 +51,7 @@ impl Animation for RunAnimation {
next.duck_m_tail.scale = Vec3::one() * 0.98;
next.duck_m_wing_l.offset = Vec3::new(0.0, -13.0, 8.0) / 11.0;
next.duck_m_wing_l.ori = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(0.0);
next.duck_m_wing_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.duck_m_wing_l.scale = Vec3::one() / 11.0;
next.duck_m_wing_r.offset = Vec3::new(0.0, -11.7, 11.0) / 11.0;
@ -71,4 +67,4 @@ impl Animation for RunAnimation {
next.duck_m_leg_r.scale = Vec3::one() * 1.00;
next
}
}
}

View File

@ -38,25 +38,20 @@ impl Animation for IdleAnimation {
* 0.25,
);
next.crow_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_head.scale = Vec3::one() / 10.88;
next.crow_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_torso.scale = Vec3::one() / 10.88;
next.crow_wing_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_wing_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_l.scale = Vec3::one() / 10.88;
next.crow_wing_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_wing_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_r.scale = Vec3::one() / 10.88;
next

View File

@ -25,26 +25,20 @@ impl Animation for JumpAnimation {
let wave_slow = (anim_time as f32 * 3.5 + PI).sin();
let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos();
next.crow_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_head.scale = Vec3::one() / 10.88;
next.crow_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_torso.scale = Vec3::one() / 10.88;
next.crow_wing_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_wing_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_l.scale = Vec3::one() / 10.88;
next.crow_wing_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_wing_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_r.scale = Vec3::one() / 10.88;
next

View File

@ -25,7 +25,6 @@ impl BirdSmallSkeleton {
crow_torso: Bone::default(),
crow_wing_l: Bone::default(),
crow_wing_r: Bone::default(),
}
}
}
@ -34,12 +33,9 @@ impl Skeleton for BirdSmallSkeleton {
fn compute_matrices(&self) -> [FigureBoneData; 16] {
let torso_mat = self.crow_torso.compute_base_matrix();
[
FigureBoneData::new(self.crow_head.compute_base_matrix() * torso_mat),
FigureBoneData::new(
torso_mat,
),
FigureBoneData::new(torso_mat),
FigureBoneData::new(self.crow_wing_l.compute_base_matrix() * torso_mat),
FigureBoneData::new(self.crow_wing_r.compute_base_matrix() * torso_mat),
FigureBoneData::default(),
@ -58,11 +54,9 @@ impl Skeleton for BirdSmallSkeleton {
}
fn interpolate(&mut self, target: &Self, dt: f32) {
self.crow_head
.interpolate(&target.crow_head, dt);
self.crow_head.interpolate(&target.crow_head, dt);
self.crow_torso.interpolate(&target.crow_torso, dt);
self.crow_wing_l.interpolate(&target.crow_wing_l, dt);
self.crow_wing_r
.interpolate(&target.crow_wing_r, dt);
self.crow_wing_r.interpolate(&target.crow_wing_r, dt);
}
}

View File

@ -38,25 +38,20 @@ impl Animation for RunAnimation {
* 0.25,
);
next.crow_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_head.scale = Vec3::one() / 10.88;
next.crow_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_torso.scale = Vec3::one() / 10.88;
next.crow_wing_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_wing_l.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_l.scale = Vec3::one() / 10.88;
next.crow_wing_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.crow_wing_r.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.crow_wing_r.scale = Vec3::one() / 10.88;
next

View File

@ -38,69 +38,55 @@ impl Animation for IdleAnimation {
* 0.25,
);
next.dragon_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.dragon_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.dragon_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.dragon_head.scale = Vec3::one() / 10.88;
next.dragon_chest_front.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_front.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_front.ori = Quaternion::rotation_x(0.0);
next.dragon_chest_front.scale = Vec3::one() * 1.01;
next.dragon_chest_rear.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_rear.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_rear.ori = Quaternion::rotation_x(0.0);
next.dragon_chest_rear.scale = Vec3::one() * 1.01;
next.dragon_tail_front.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_front.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_front.ori = Quaternion::rotation_x(0.0);
next.dragon_tail_front.scale = Vec3::one() * 1.01;
next.dragon_tail_rear.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_rear.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_rear.ori = Quaternion::rotation_x(0.0);
next.dragon_tail_rear.scale = Vec3::one() * 1.01;
next.dragon_wing_in_l.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_l.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_l.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_in_l.scale = Vec3::one() * 1.01;
next.dragon_wing_in_r.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_r.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_r.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_in_r.scale = Vec3::one() * 1.01;
next.dragon_wing_out_l.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_l.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_l.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_out_l.scale = Vec3::one() * 1.01;
next.dragon_wing_out_r.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_r.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_r.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_out_r.scale = Vec3::one() * 1.01;
next.dragon_foot_fl.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fl.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fl.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_fl.scale = Vec3::one() * 1.01;
next.dragon_foot_fr.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fr.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fr.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_fr.scale = Vec3::one() * 1.01;
next.dragon_foot_bl.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_bl.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_bl.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_bl.scale = Vec3::one() * 1.01;
next.dragon_foot_br.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_br.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_br.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_br.scale = Vec3::one() * 1.01;
next

View File

@ -25,70 +25,55 @@ impl Animation for JumpAnimation {
let wave_slow = (anim_time as f32 * 3.5 + PI).sin();
let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos();
next.dragon_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.dragon_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.dragon_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.dragon_head.scale = Vec3::one() / 10.88;
next.dragon_chest_front.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_front.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_front.ori = Quaternion::rotation_x(0.0);
next.dragon_chest_front.scale = Vec3::one() * 1.01;
next.dragon_chest_rear.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_rear.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_rear.ori = Quaternion::rotation_x(0.0);
next.dragon_chest_rear.scale = Vec3::one() * 1.01;
next.dragon_tail_front.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_front.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_front.ori = Quaternion::rotation_x(0.0);
next.dragon_tail_front.scale = Vec3::one() * 1.01;
next.dragon_tail_rear.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_rear.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_rear.ori = Quaternion::rotation_x(0.0);
next.dragon_tail_rear.scale = Vec3::one() * 1.01;
next.dragon_wing_in_l.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_l.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_l.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_in_l.scale = Vec3::one() * 1.01;
next.dragon_wing_in_r.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_r.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_r.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_in_r.scale = Vec3::one() * 1.01;
next.dragon_wing_out_l.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_l.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_l.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_out_l.scale = Vec3::one() * 1.01;
next.dragon_wing_out_r.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_r.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_r.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_out_r.scale = Vec3::one() * 1.01;
next.dragon_foot_fl.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fl.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fl.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_fl.scale = Vec3::one() * 1.01;
next.dragon_foot_fr.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fr.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fr.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_fr.scale = Vec3::one() * 1.01;
next.dragon_foot_bl.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_bl.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_bl.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_bl.scale = Vec3::one() * 1.01;
next.dragon_foot_br.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_br.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_br.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_br.scale = Vec3::one() * 1.01;
next

View File

@ -25,27 +25,24 @@ pub struct DragonSkeleton {
dragon_foot_fr: Bone,
dragon_foot_bl: Bone,
dragon_foot_br: Bone,
}
impl DragonSkeleton {
pub fn new() -> Self {
Self {
dragon_head: Bone::default(),
dragon_chest_front: Bone::default(),
dragon_chest_rear: Bone::default(),
dragon_tail_front: Bone::default(),
dragon_tail_rear: Bone::default(),
dragon_wing_in_l: Bone::default(),
dragon_wing_in_r: Bone::default(),
dragon_wing_out_l: Bone::default(),
dragon_wing_out_r: Bone::default(),
dragon_foot_fl: Bone::default(),
dragon_foot_fr: Bone::default(),
dragon_foot_bl: Bone::default(),
dragon_foot_br: Bone::default(),
dragon_head: Bone::default(),
dragon_chest_front: Bone::default(),
dragon_chest_rear: Bone::default(),
dragon_tail_front: Bone::default(),
dragon_tail_rear: Bone::default(),
dragon_wing_in_l: Bone::default(),
dragon_wing_in_r: Bone::default(),
dragon_wing_out_l: Bone::default(),
dragon_wing_out_r: Bone::default(),
dragon_foot_fl: Bone::default(),
dragon_foot_fr: Bone::default(),
dragon_foot_bl: Bone::default(),
dragon_foot_br: Bone::default(),
}
}
}
@ -57,12 +54,9 @@ impl Skeleton for DragonSkeleton {
let wing_in_r_mat = self.dragon_wing_in_r.compute_base_matrix();
let tail_front_mat = self.dragon_tail_front.compute_base_matrix();
[
FigureBoneData::new(self.dragon_head.compute_base_matrix() * chest_front_mat),
FigureBoneData::new(
chest_front_mat,
),
FigureBoneData::new(chest_front_mat),
FigureBoneData::new(self.dragon_chest_rear.compute_base_matrix() * chest_front_mat),
FigureBoneData::new(tail_front_mat),
FigureBoneData::new(self.dragon_tail_rear.compute_base_matrix() * tail_front_mat),
@ -82,19 +76,25 @@ impl Skeleton for DragonSkeleton {
fn interpolate(&mut self, target: &Self, dt: f32) {
self.dragon_head.interpolate(&target.dragon_head, dt);
self.dragon_chest_front.interpolate(&target.dragon_chest_front, dt);
self.dragon_chest_rear.interpolate(&target.dragon_chest_rear, dt);
self.dragon_tail_front.interpolate(&target.dragon_tail_front, dt);
self.dragon_tail_rear.interpolate(&target.dragon_tail_rear, dt);
self.dragon_wing_in_l.interpolate(&target.dragon_wing_in_l, dt);
self.dragon_wing_in_r.interpolate(&target.dragon_wing_in_r, dt);
self.dragon_wing_out_l.interpolate(&target.dragon_wing_out_l, dt);
self.dragon_wing_out_r.interpolate(&target.dragon_wing_out_r, dt);
self.dragon_chest_front
.interpolate(&target.dragon_chest_front, dt);
self.dragon_chest_rear
.interpolate(&target.dragon_chest_rear, dt);
self.dragon_tail_front
.interpolate(&target.dragon_tail_front, dt);
self.dragon_tail_rear
.interpolate(&target.dragon_tail_rear, dt);
self.dragon_wing_in_l
.interpolate(&target.dragon_wing_in_l, dt);
self.dragon_wing_in_r
.interpolate(&target.dragon_wing_in_r, dt);
self.dragon_wing_out_l
.interpolate(&target.dragon_wing_out_l, dt);
self.dragon_wing_out_r
.interpolate(&target.dragon_wing_out_r, dt);
self.dragon_foot_fl.interpolate(&target.dragon_foot_fl, dt);
self.dragon_foot_fr.interpolate(&target.dragon_foot_fr, dt);
self.dragon_foot_bl.interpolate(&target.dragon_foot_bl, dt);
self.dragon_foot_br.interpolate(&target.dragon_foot_br, dt);
}
}

View File

@ -38,69 +38,55 @@ impl Animation for RunAnimation {
* 0.25,
);
next.dragon_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.dragon_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.dragon_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.dragon_head.scale = Vec3::one() / 10.88;
next.dragon_chest_front.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_front.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_front.ori = Quaternion::rotation_x(0.0);
next.dragon_chest_front.scale = Vec3::one() * 1.01;
next.dragon_chest_rear.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_rear.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_chest_rear.ori = Quaternion::rotation_x(0.0);
next.dragon_chest_rear.scale = Vec3::one() * 1.01;
next.dragon_tail_front.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_front.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_front.ori = Quaternion::rotation_x(0.0);
next.dragon_tail_front.scale = Vec3::one() * 1.01;
next.dragon_tail_rear.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_rear.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_tail_rear.ori = Quaternion::rotation_x(0.0);
next.dragon_tail_rear.scale = Vec3::one() * 1.01;
next.dragon_wing_in_l.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_l.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_l.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_in_l.scale = Vec3::one() * 1.01;
next.dragon_wing_in_r.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_r.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_in_r.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_in_r.scale = Vec3::one() * 1.01;
next.dragon_wing_out_l.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_l.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_l.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_out_l.scale = Vec3::one() * 1.01;
next.dragon_wing_out_r.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_r.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_wing_out_r.ori = Quaternion::rotation_x(0.0);
next.dragon_wing_out_r.scale = Vec3::one() * 1.01;
next.dragon_foot_fl.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fl.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fl.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_fl.scale = Vec3::one() * 1.01;
next.dragon_foot_fr.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fr.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_fr.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_fr.scale = Vec3::one() * 1.01;
next.dragon_foot_bl.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_bl.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_bl.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_bl.scale = Vec3::one() * 1.01;
next.dragon_foot_br.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_br.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.dragon_foot_br.ori = Quaternion::rotation_x(0.0);
next.dragon_foot_br.scale = Vec3::one() * 1.01;
next

View File

@ -38,14 +38,12 @@ impl Animation for IdleAnimation {
* 0.25,
);
next.marlin_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.marlin_head.ori =
Quaternion::rotation_z(duck_m_look.x) * Quaternion::rotation_x(duck_m_look.y);
next.marlin_head.scale = Vec3::one() / 10.88;
next.marlin_torso.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.marlin_torso.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.marlin_torso.ori = Quaternion::rotation_x(0.0);
next.marlin_torso.scale = Vec3::one() * 1.01;
@ -54,8 +52,7 @@ impl Animation for IdleAnimation {
next.marlin_rear.scale = Vec3::one() * 0.98;
next.marlin_tail.offset = Vec3::new(0.0, -13.0, 8.0) / 11.0;
next.marlin_tail.ori = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(0.0);
next.marlin_tail.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.marlin_tail.scale = Vec3::one() / 11.0;
next.marlin_fin_l.offset = Vec3::new(0.0, -11.7, 11.0) / 11.0;

View File

@ -25,15 +25,11 @@ impl Animation for JumpAnimation {
let wave_slow = (anim_time as f32 * 3.5 + PI).sin();
let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos();
next.marlin_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.marlin_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.marlin_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.marlin_head.scale = Vec3::one() / 10.88;
next.marlin_torso.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.marlin_torso.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.marlin_torso.ori = Quaternion::rotation_x(0.0);
next.marlin_torso.scale = Vec3::one() * 1.01;
@ -42,8 +38,7 @@ impl Animation for JumpAnimation {
next.marlin_rear.scale = Vec3::one() * 0.98;
next.marlin_tail.offset = Vec3::new(0.0, -13.0, 8.0) / 11.0;
next.marlin_tail.ori = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(0.0);
next.marlin_tail.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.marlin_tail.scale = Vec3::one() / 11.0;
next.marlin_fin_l.offset = Vec3::new(0.0, -11.7, 11.0) / 11.0;

View File

@ -18,7 +18,6 @@ pub struct FishMediumSkeleton {
marlin_tail: Bone,
marlin_fin_l: Bone,
marlin_fin_r: Bone,
}
impl FishMediumSkeleton {
@ -30,7 +29,6 @@ impl FishMediumSkeleton {
marlin_tail: Bone::default(),
marlin_fin_l: Bone::default(),
marlin_fin_r: Bone::default(),
}
}
}
@ -40,12 +38,9 @@ impl Skeleton for FishMediumSkeleton {
let torso_mat = self.marlin_torso.compute_base_matrix();
let rear_mat = self.marlin_rear.compute_base_matrix();
[
FigureBoneData::new(self.marlin_head.compute_base_matrix() * torso_mat),
FigureBoneData::new(
torso_mat,
),
FigureBoneData::new(torso_mat),
FigureBoneData::new(rear_mat * torso_mat),
FigureBoneData::new(self.marlin_tail.compute_base_matrix() * rear_mat),
FigureBoneData::new(self.marlin_fin_l.compute_base_matrix() * rear_mat),
@ -64,14 +59,11 @@ impl Skeleton for FishMediumSkeleton {
}
fn interpolate(&mut self, target: &Self, dt: f32) {
self.marlin_head
.interpolate(&target.marlin_head, dt);
self.marlin_head.interpolate(&target.marlin_head, dt);
self.marlin_torso.interpolate(&target.marlin_torso, dt);
self.marlin_rear
.interpolate(&target.marlin_rear, dt);
self.marlin_rear.interpolate(&target.marlin_rear, dt);
self.marlin_tail.interpolate(&target.marlin_tail, dt);
self.marlin_fin_l
.interpolate(&target.marlin_fin_l, dt);
self.marlin_fin_l.interpolate(&target.marlin_fin_l, dt);
self.marlin_fin_r.interpolate(&target.marlin_fin_r, dt);
}
}

View File

@ -2,7 +2,7 @@ use super::{
super::{Animation, SkeletonAttr},
FishMediumSkeleton,
};
use std::{f32::consts::PI};
use std::f32::consts::PI;
use vek::*;
pub struct RunAnimation;
@ -25,15 +25,11 @@ impl Animation for RunAnimation {
let wave_slow = (anim_time as f32 * 3.5 + PI).sin();
let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos();
next.marlin_head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.marlin_head.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.marlin_head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.marlin_head.scale = Vec3::one() / 10.88;
next.marlin_torso.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.marlin_torso.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.marlin_torso.ori = Quaternion::rotation_x(0.0);
next.marlin_torso.scale = Vec3::one() * 1.01;
@ -42,8 +38,7 @@ impl Animation for RunAnimation {
next.marlin_rear.scale = Vec3::one() * 0.98;
next.marlin_tail.offset = Vec3::new(0.0, -13.0, 8.0) / 11.0;
next.marlin_tail.ori = Quaternion::rotation_z(0.0)
* Quaternion::rotation_x(0.0);
next.marlin_tail.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.marlin_tail.scale = Vec3::one() / 11.0;
next.marlin_fin_l.offset = Vec3::new(0.0, -11.7, 11.0) / 11.0;

View File

@ -38,14 +38,11 @@ impl Animation for IdleAnimation {
* 0.25,
);
next.cardinalfish_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.cardinalfish_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.cardinalfish_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.cardinalfish_torso.scale = Vec3::one() / 10.88;
next.cardinalfish_tail.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.cardinalfish_tail.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.cardinalfish_tail.ori = Quaternion::rotation_x(0.0);
next.cardinalfish_tail.scale = Vec3::one() * 1.01;

View File

@ -25,15 +25,11 @@ impl Animation for JumpAnimation {
let wave_slow = (anim_time as f32 * 3.5 + PI).sin();
let wave_slow_cos = (anim_time as f32 * 3.5 + PI).cos();
next.cardinalfish_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.cardinalfish_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.cardinalfish_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.cardinalfish_torso.scale = Vec3::one() / 10.88;
next.cardinalfish_tail.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.cardinalfish_tail.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.cardinalfish_tail.ori = Quaternion::rotation_x(0.0);
next.cardinalfish_tail.scale = Vec3::one() * 1.01;

View File

@ -14,7 +14,6 @@ use crate::render::FigureBoneData;
pub struct FishSmallSkeleton {
cardinalfish_torso: Bone,
cardinalfish_tail: Bone,
}
impl FishSmallSkeleton {
@ -30,7 +29,6 @@ impl Skeleton for FishSmallSkeleton {
fn compute_matrices(&self) -> [FigureBoneData; 16] {
let torso_mat = self.cardinalfish_torso.compute_base_matrix();
[
FigureBoneData::new(torso_mat),
FigureBoneData::new(self.cardinalfish_tail.compute_base_matrix() * torso_mat),
@ -54,6 +52,7 @@ impl Skeleton for FishSmallSkeleton {
fn interpolate(&mut self, target: &Self, dt: f32) {
self.cardinalfish_torso
.interpolate(&target.cardinalfish_torso, dt);
self.cardinalfish_tail.interpolate(&target.cardinalfish_tail, dt);
self.cardinalfish_tail
.interpolate(&target.cardinalfish_tail, dt);
}
}

View File

@ -38,14 +38,11 @@ impl Animation for RunAnimation {
* 0.25,
);
next.cardinalfish_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
next.cardinalfish_torso.ori =
Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.cardinalfish_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.cardinalfish_torso.scale = Vec3::one() / 10.88;
next.cardinalfish_tail.offset =
Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.cardinalfish_tail.offset = Vec3::new(0.0, 4.5 - wave_ultra_slow_cos * 0.12, 2.0);
next.cardinalfish_tail.ori = Quaternion::rotation_x(0.0);
next.cardinalfish_tail.scale = Vec3::one() * 1.01;

View File

@ -1,14 +1,14 @@
pub mod biped_large;
pub mod bird_medium;
pub mod bird_small;
pub mod character;
pub mod dragon;
pub mod fish_medium;
pub mod fish_small;
pub mod fixture;
pub mod object;
pub mod quadruped;
pub mod quadrupedmedium;
pub mod birdmedium;
pub mod fishmedium;
pub mod dragon;
pub mod bird_small;
pub mod fish_small;
pub mod biped_large;
pub mod quadruped_medium;
pub mod quadruped_small;
use crate::render::FigureBoneData;
use common::comp::{self, item::Tool};

View File

@ -1,6 +1,6 @@
use super::{
super::{Animation, SkeletonAttr},
QuadrupedSkeleton,
QuadrupedSmallSkeleton,
};
use std::{f32::consts::PI, ops::Mul};
use vek::*;
@ -8,7 +8,7 @@ use vek::*;
pub struct IdleAnimation;
impl Animation for IdleAnimation {
type Skeleton = QuadrupedSkeleton;
type Skeleton = QuadrupedSmallSkeleton;
type Dependency = (f64);
fn update_skeleton(

View File

@ -1,6 +1,6 @@
use super::{
super::{Animation, SkeletonAttr},
QuadrupedSkeleton,
QuadrupedSmallSkeleton,
};
use std::f32::consts::PI;
use vek::*;
@ -8,7 +8,7 @@ use vek::*;
pub struct JumpAnimation;
impl Animation for JumpAnimation {
type Skeleton = QuadrupedSkeleton;
type Skeleton = QuadrupedSmallSkeleton;
type Dependency = (f32, f64);
fn update_skeleton(

View File

@ -11,7 +11,7 @@ use super::{Bone, Skeleton};
use crate::render::FigureBoneData;
#[derive(Clone)]
pub struct QuadrupedSkeleton {
pub struct QuadrupedSmallSkeleton {
pig_head: Bone,
pig_chest: Bone,
pig_leg_lf: Bone,
@ -20,7 +20,7 @@ pub struct QuadrupedSkeleton {
pig_leg_rb: Bone,
}
impl QuadrupedSkeleton {
impl QuadrupedSmallSkeleton {
pub fn new() -> Self {
Self {
pig_head: Bone::default(),
@ -33,7 +33,7 @@ impl QuadrupedSkeleton {
}
}
impl Skeleton for QuadrupedSkeleton {
impl Skeleton for QuadrupedSmallSkeleton {
fn compute_matrices(&self) -> [FigureBoneData; 16] {
[
FigureBoneData::new(self.pig_head.compute_base_matrix()),

View File

@ -1,13 +1,13 @@
use super::{
super::{Animation, SkeletonAttr},
QuadrupedSkeleton,
QuadrupedSmallSkeleton,
};
use vek::*;
pub struct RunAnimation;
impl Animation for RunAnimation {
type Skeleton = QuadrupedSkeleton;
type Skeleton = QuadrupedSmallSkeleton;
type Dependency = (f32, f64);
fn update_skeleton(

Some files were not shown because too many files have changed in this diff Show More