arming the cyclops

This commit is contained in:
jshipsey 2020-07-31 02:30:54 -04:00
parent 1421517f84
commit aa3bdc42d7
10 changed files with 413 additions and 40 deletions

View File

@ -11,6 +11,10 @@
torso_lower: (
offset: (-5.0, -4.5, -4.5),
center: ("npc.ogre.male.torso_lower"),
),
main: (
offset: (-8.0, -4.5, -5.0),
center: ("npc.ogre.male.torso_upper"),
)
),
(Ogre, Female): (
@ -25,6 +29,10 @@
torso_lower: (
offset: (-5.0, -4.5, -4.5),
center: ("npc.ogre.male.torso_lower"),
),
main: (
offset: (-8.0, -4.5, -5.0),
center: ("npc.ogre.male.torso_upper"),
)
),
(Cyclops, Male): (
@ -39,6 +47,10 @@
torso_lower: (
offset: (-6.0, -5.5, -12.0),
center: ("npc.cyclops.male.torso_lower"),
),
main: (
offset: (-5.0, -6.5, -4.0),
center: ("npc.cyclops.male.hammer"),
)
),
(Cyclops, Female): (
@ -53,6 +65,10 @@
torso_lower: (
offset: (-6.0, -5.5, -12.0),
center: ("npc.cyclops.male.torso_lower"),
),
main: (
offset: (-5.0, -6.5, -4.0),
center: ("npc.cyclops.male.hammer"),
)
),
(Wendigo, Male): (
@ -67,6 +83,10 @@
torso_lower: (
offset: (-4.0, -2.0, -2.0),
center: ("npc.wendigo.male.torso_lower"),
),
main: (
offset: (-8.0, -4.5, -5.0),
center: ("npc.ogre.male.torso_upper"),
)
),
(Wendigo, Female): (
@ -81,6 +101,10 @@
torso_lower: (
offset: (-4.0, -2.0, -2.0),
center: ("npc.wendigo.male.torso_lower"),
),
main: (
offset: (-8.0, -4.5, -5.0),
center: ("npc.ogre.male.torso_upper"),
)
),
(Troll, Male): (
@ -95,6 +119,10 @@
torso_lower: (
offset: (-6.0, -3.5, -2.5),
center: ("npc.troll.male.torso_lower"),
),
main: (
offset: (-8.0, -4.5, -5.0),
center: ("npc.ogre.male.torso_upper"),
)
),
(Troll, Female): (
@ -109,6 +137,10 @@
torso_lower: (
offset: (-6.0, -3.5, -2.5),
center: ("npc.troll.male.torso_lower"),
),
main: (
offset: (-8.0, -4.5, -5.0),
center: ("npc.ogre.male.torso_upper"),
)
),
})

Binary file not shown.

View File

@ -49,9 +49,9 @@ impl Animation for IdleAnimation {
0.0,
skeleton_attr.upper_torso.0,
skeleton_attr.upper_torso.1 + torso * 0.5,
) / 8.0;
next.upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.upper_torso.scale = Vec3::one() / 8.0;
);
next.upper_torso.ori = Quaternion::rotation_z(0.0);
next.upper_torso.scale = Vec3::one();
next.lower_torso.offset = Vec3::new(
0.0,
@ -61,6 +61,15 @@ impl Animation for IdleAnimation {
next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.lower_torso.scale = Vec3::one() * 1.02;
next.control.offset = Vec3::new(0.0, 0.0, 0.0);
next.control.ori = Quaternion::rotation_z(0.0);
next.control.scale = Vec3::one();
next.main.offset = Vec3::new(-5.0, -7.0, 7.0);
next.main.ori =
Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
next.main.scale = Vec3::one() * 1.02;
next.shoulder_l.offset = Vec3::new(
-skeleton_attr.shoulder.0,
skeleton_attr.shoulder.1,
@ -125,9 +134,10 @@ impl Animation for IdleAnimation {
next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.foot_r.scale = Vec3::one() / 8.0;
next.torso.offset = Vec3::new(0.0, 0.0, 0.0);
next.torso.offset = Vec3::new(0.0, 0.0, 0.0) / 8.0;
next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.torso.scale = Vec3::one();
next.torso.scale = Vec3::one() / 8.0;
next
}
}

View File

@ -1,9 +1,12 @@
pub mod idle;
pub mod jump;
pub mod run;
pub mod wield;
// Reexports
pub use self::{idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation};
pub use self::{
idle::IdleAnimation, jump::JumpAnimation, run::RunAnimation, wield::WieldAnimation,
};
use super::{Bone, FigureBoneData, Skeleton};
use common::comp::{self};
@ -14,6 +17,7 @@ pub struct BipedLargeSkeleton {
head: Bone,
upper_torso: Bone,
lower_torso: Bone,
main: Bone,
shoulder_l: Bone,
shoulder_r: Bone,
hand_l: Bone,
@ -23,6 +27,7 @@ pub struct BipedLargeSkeleton {
foot_l: Bone,
foot_r: Bone,
torso: Bone,
control: Bone,
}
impl BipedLargeSkeleton {
@ -35,36 +40,32 @@ impl Skeleton for BipedLargeSkeleton {
#[cfg(feature = "use-dyn-lib")]
const COMPUTE_FN: &'static [u8] = b"biped_large_compute_mats\0";
fn bone_count(&self) -> usize { 11 }
fn bone_count(&self) -> usize { 12 }
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_compute_mats")]
fn compute_matrices_inner(&self) -> ([FigureBoneData; 16], Vec3<f32>) {
let upper_torso_mat = self.upper_torso.compute_base_matrix();
let lower_torso_mat = self.lower_torso.compute_base_matrix();
let main_mat = self.main.compute_base_matrix();
let shoulder_l_mat = self.shoulder_l.compute_base_matrix();
let shoulder_r_mat = self.shoulder_r.compute_base_matrix();
let hand_l_mat = self.hand_l.compute_base_matrix();
let hand_r_mat = self.hand_r.compute_base_matrix();
let leg_l_mat = self.leg_l.compute_base_matrix();
let leg_r_mat = self.leg_r.compute_base_matrix();
let torso_mat = self.torso.compute_base_matrix();
let control_mat = self.control.compute_base_matrix();
(
[
FigureBoneData::new(torso_mat * upper_torso_mat * self.head.compute_base_matrix()),
FigureBoneData::new(torso_mat * upper_torso_mat),
FigureBoneData::new(torso_mat * upper_torso_mat * lower_torso_mat),
FigureBoneData::new(torso_mat * control_mat * upper_torso_mat * main_mat),
FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_l_mat),
FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_r_mat),
FigureBoneData::new(
torso_mat
* upper_torso_mat
* shoulder_l_mat
* self.hand_l.compute_base_matrix(),
),
FigureBoneData::new(
torso_mat
* upper_torso_mat
* shoulder_r_mat
* self.hand_r.compute_base_matrix(),
),
FigureBoneData::new(torso_mat * control_mat * upper_torso_mat * hand_l_mat),
FigureBoneData::new(torso_mat * control_mat * upper_torso_mat * hand_r_mat),
FigureBoneData::new(torso_mat * upper_torso_mat * lower_torso_mat * leg_l_mat),
FigureBoneData::new(torso_mat * upper_torso_mat * lower_torso_mat * leg_r_mat),
FigureBoneData::new(self.foot_l.compute_base_matrix()),
@ -73,7 +74,6 @@ impl Skeleton for BipedLargeSkeleton {
FigureBoneData::default(),
FigureBoneData::default(),
FigureBoneData::default(),
FigureBoneData::default(),
],
Vec3::default(),
)
@ -83,6 +83,7 @@ impl Skeleton for BipedLargeSkeleton {
self.head.interpolate(&target.head, dt);
self.upper_torso.interpolate(&target.upper_torso, dt);
self.lower_torso.interpolate(&target.lower_torso, dt);
self.main.interpolate(&target.main, dt);
self.shoulder_l.interpolate(&target.shoulder_l, dt);
self.shoulder_r.interpolate(&target.shoulder_r, dt);
self.hand_l.interpolate(&target.hand_l, dt);
@ -92,6 +93,7 @@ impl Skeleton for BipedLargeSkeleton {
self.foot_l.interpolate(&target.foot_l, dt);
self.foot_r.interpolate(&target.foot_r, dt);
self.torso.interpolate(&target.torso, dt);
self.control.interpolate(&target.control, dt);
}
}
@ -142,7 +144,7 @@ impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr {
},
upper_torso: match (body.species, body.body_type) {
(Ogre, _) => (0.0, 19.0),
(Cyclops, _) => (-1.0, 27.0),
(Cyclops, _) => (-2.0, 27.0),
(Wendigo, _) => (-1.0, 27.0),
(Troll, _) => (-1.0, 25.5),
},
@ -160,7 +162,7 @@ impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr {
},
hand: match (body.species, body.body_type) {
(Ogre, _) => (10.5, -1.0, -0.5),
(Cyclops, _) => (0.0, 0.0, -3.5),
(Cyclops, _) => (10.0, 2.0, -0.5),
(Wendigo, _) => (12.0, 0.0, -0.5),
(Troll, _) => (11.5, 0.0, -1.5),
},

View File

@ -65,9 +65,9 @@ impl Animation for RunAnimation {
0.0,
skeleton_attr.upper_torso.0,
skeleton_attr.upper_torso.1 + shortalt * -1.5,
) / 8.0;
);
next.upper_torso.ori = Quaternion::rotation_z(short * 0.18);
next.upper_torso.scale = Vec3::one() / 8.0;
next.upper_torso.scale = Vec3::one();
next.lower_torso.offset = Vec3::new(
0.0,
@ -77,6 +77,15 @@ impl Animation for RunAnimation {
next.lower_torso.ori = Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14);
next.lower_torso.scale = Vec3::one() * 1.02;
next.control.offset = Vec3::new(0.0, 0.0, 0.0);
next.control.ori = Quaternion::rotation_z(0.0);
next.control.scale = Vec3::one();
next.main.offset = Vec3::new(-5.0, -7.0, 7.0);
next.main.ori =
Quaternion::rotation_x(PI) * Quaternion::rotation_y(0.6) * Quaternion::rotation_z(1.57);
next.main.scale = Vec3::one() * 1.02;
next.shoulder_l.offset = Vec3::new(
-skeleton_attr.shoulder.0,
skeleton_attr.shoulder.1 + foothoril * -3.0,
@ -98,20 +107,20 @@ impl Animation for RunAnimation {
next.shoulder_r.scale = Vec3::one();
next.hand_l.offset = Vec3::new(
-skeleton_attr.hand.0,
skeleton_attr.hand.1,
skeleton_attr.hand.2,
-1.0 + -skeleton_attr.hand.0,
skeleton_attr.hand.1 + foothoril * -4.0,
skeleton_attr.hand.2 + foothoril * 1.0,
);
next.hand_l.ori = Quaternion::rotation_x(0.3 + (handhoril * -0.6).max(0.0))
next.hand_l.ori = Quaternion::rotation_x(0.15 + (handhoril * -1.2).max(-0.3))
* Quaternion::rotation_y(handhoril * -0.1);
next.hand_l.scale = Vec3::one() * 1.02;
next.hand_r.offset = Vec3::new(
skeleton_attr.hand.0,
skeleton_attr.hand.1,
skeleton_attr.hand.2,
1.0 + skeleton_attr.hand.0,
skeleton_attr.hand.1 + foothorir * -4.0,
skeleton_attr.hand.2 + foothorir * 1.0,
);
next.hand_r.ori = Quaternion::rotation_x(0.3 + (handhorir * -0.6).max(0.0))
next.hand_r.ori = Quaternion::rotation_x(0.15 + (handhorir * -1.2).max(-0.3))
* Quaternion::rotation_y(handhorir * 0.1);
next.hand_r.scale = Vec3::one() * 1.02;
@ -152,9 +161,9 @@ impl Animation for RunAnimation {
Quaternion::rotation_x(-0.5 + footrotr * 0.85) * Quaternion::rotation_y(0.0);
next.foot_r.scale = Vec3::one() / 8.0;
next.torso.offset = Vec3::new(0.0, 0.0, 0.0);
next.torso.offset = Vec3::new(0.0, 0.0, 0.0) / 8.0;
next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25);
next.torso.scale = Vec3::one();
next.torso.scale = Vec3::one() / 8.0;
next
}
}

View File

@ -0,0 +1,273 @@
use super::{super::Animation, BipedLargeSkeleton, SkeletonAttr};
use std::{f32::consts::PI, ops::Mul};
use vek::*;
pub struct WieldAnimation;
impl Animation for WieldAnimation {
type Dependency = (f32, f64);
type Skeleton = BipedLargeSkeleton;
#[cfg(feature = "use-dyn-lib")]
const UPDATE_FN: &'static [u8] = b"biped_large_wield\0";
#[cfg_attr(feature = "be-dyn-lib", export_name = "biped_large_wield")]
fn update_skeleton_inner(
skeleton: &Self::Skeleton,
(velocity, global_time): Self::Dependency,
anim_time: f64,
_rate: &mut f32,
skeleton_attr: &SkeletonAttr,
) -> Self::Skeleton {
let mut next = (*skeleton).clone();
let lab = 0.55;
let breathe = (anim_time as f32 + 1.5 * PI).sin();
let test = (anim_time as f32 + 36.0 * PI).sin();
let look = Vec2::new(
((global_time + anim_time) as f32 / 8.0)
.floor()
.mul(7331.0)
.sin()
* 0.5,
((global_time + anim_time) as f32 / 8.0)
.floor()
.mul(1337.0)
.sin()
* 0.25,
);
let foothoril = (((1.0)
/ (0.4
+ (0.6)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin());
let foothorir = (((1.0)
/ (0.4
+ (0.6)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin());
let footvertl = (anim_time as f32 * 16.0 * lab as f32).sin();
let footvertr = (anim_time as f32 * 16.0 * lab as f32 + PI).sin();
let handhoril = (anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin();
let handhorir = (anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin();
let footrotl = (((5.0)
/ (2.5
+ (2.5)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 1.4).sin());
let footrotr = (((5.0)
/ (1.0
+ (4.0)
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin()).powf(2.0 as f32)))
.sqrt())
* ((anim_time as f32 * 16.0 * lab as f32 + PI * 0.4).sin());
let short = (anim_time as f32 * lab as f32 * 16.0).sin();
let shortalt = (anim_time as f32 * lab as f32 * 16.0 + PI / 2.0).sin();
next.main.offset = Vec3::new(0.0, 0.0, 0.0);
next.main.ori = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(-1.57)
* Quaternion::rotation_z(1.0);
next.main.scale = Vec3::one() * 1.02;
next.hand_l.offset = Vec3::new(
-skeleton_attr.hand.0 - 7.0,
skeleton_attr.hand.1 - 7.0,
skeleton_attr.hand.2 + 10.0,
);
next.hand_l.ori = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
next.hand_l.scale = Vec3::one() * 1.02;
next.hand_r.offset = Vec3::new(
skeleton_attr.hand.0 - 7.0,
skeleton_attr.hand.1 - 7.0,
skeleton_attr.hand.2 + 10.0,
);
next.hand_r.ori = Quaternion::rotation_x(0.57) * Quaternion::rotation_z(1.57);
next.hand_r.scale = Vec3::one() * 1.02;
if velocity < 0.5 {
next.head.offset = Vec3::new(
0.0,
skeleton_attr.head.0,
skeleton_attr.head.1 + breathe * 0.2,
) * 1.02;
next.head.ori =
Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6);
next.head.scale = Vec3::one() * 1.02;
next.upper_torso.offset = Vec3::new(
0.0,
skeleton_attr.upper_torso.0,
skeleton_attr.upper_torso.1 + breathe * 0.5,
);
next.upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.upper_torso.scale = Vec3::one();
next.lower_torso.offset = Vec3::new(
0.0,
skeleton_attr.lower_torso.0,
skeleton_attr.lower_torso.1 + breathe * 0.15,
);
next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.lower_torso.scale = Vec3::one() * 1.02;
next.shoulder_l.offset = Vec3::new(
-skeleton_attr.shoulder.0,
skeleton_attr.shoulder.1,
skeleton_attr.shoulder.2,
);
next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.shoulder_l.scale = Vec3::one();
next.shoulder_r.offset = Vec3::new(
skeleton_attr.shoulder.0,
skeleton_attr.shoulder.1,
skeleton_attr.shoulder.2,
);
next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.shoulder_r.scale = Vec3::one();
next.leg_l.offset = Vec3::new(
-skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2 + breathe * 0.2,
) * 1.02;
next.leg_l.ori = Quaternion::rotation_z(0.0);
next.leg_l.scale = Vec3::one() * 1.02;
next.leg_r.offset = Vec3::new(
skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2 + breathe * 0.2,
) * 1.02;
next.leg_r.ori = Quaternion::rotation_z(0.0);
next.leg_r.scale = Vec3::one() * 1.02;
next.foot_l.offset = Vec3::new(
-skeleton_attr.foot.0,
skeleton_attr.foot.1,
skeleton_attr.foot.2,
) / 8.0;
next.foot_l.ori = Quaternion::rotation_z(0.0);
next.foot_l.scale = Vec3::one() / 8.0;
next.foot_r.offset = Vec3::new(
skeleton_attr.foot.0,
skeleton_attr.foot.1,
skeleton_attr.foot.2,
) / 8.0;
next.foot_r.ori = Quaternion::rotation_z(0.0);
next.foot_r.scale = Vec3::one() / 8.0;
next.torso.offset = Vec3::new(0.0, 0.0, 0.0) / 8.0;
next.torso.ori = Quaternion::rotation_z(test * 0.0);
next.torso.scale = Vec3::one() / 8.0;
next.control.offset = Vec3::new(7.0, 9.0, -10.0);
next.control.ori = Quaternion::rotation_x(test * 0.02)
* Quaternion::rotation_y(test * 0.02)
* Quaternion::rotation_z(test * 0.02);
next.control.scale = Vec3::one();
} else {
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) * 1.02;
next.head.ori = Quaternion::rotation_z(short * -0.18) * Quaternion::rotation_x(-0.05);
next.head.scale = Vec3::one() * 1.02;
next.upper_torso.offset = Vec3::new(
0.0,
skeleton_attr.upper_torso.0,
skeleton_attr.upper_torso.1 + shortalt * -1.5,
);
next.upper_torso.ori = Quaternion::rotation_z(short * 0.18);
next.upper_torso.scale = Vec3::one();
next.lower_torso.offset = Vec3::new(
0.0,
skeleton_attr.lower_torso.0,
skeleton_attr.lower_torso.1,
);
next.lower_torso.ori =
Quaternion::rotation_z(short * 0.15) * Quaternion::rotation_x(0.14);
next.lower_torso.scale = Vec3::one() * 1.02;
next.shoulder_l.offset = Vec3::new(
-skeleton_attr.shoulder.0,
skeleton_attr.shoulder.1 + foothoril * -1.0,
skeleton_attr.shoulder.2,
);
next.shoulder_l.ori = Quaternion::rotation_x(0.5 + footrotl * -0.16)
* Quaternion::rotation_y(0.1)
* Quaternion::rotation_z(footrotl * 0.1);
next.shoulder_l.scale = Vec3::one();
next.shoulder_r.offset = Vec3::new(
skeleton_attr.shoulder.0,
skeleton_attr.shoulder.1 + foothorir * -1.0,
skeleton_attr.shoulder.2,
);
next.shoulder_r.ori = Quaternion::rotation_x(0.5 + footrotr * -0.16)
* Quaternion::rotation_y(-0.1)
* Quaternion::rotation_z(footrotr * -0.1);
next.shoulder_r.scale = Vec3::one();
next.leg_l.offset = Vec3::new(
-skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2,
) * 0.98;
next.leg_l.ori =
Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothoril * 0.3);
next.leg_l.scale = Vec3::one() * 0.98;
next.leg_r.offset = Vec3::new(
skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2,
) * 0.98;
next.leg_r.ori =
Quaternion::rotation_z(short * 0.18) * Quaternion::rotation_x(foothorir * 0.3);
next.leg_r.scale = Vec3::one() * 0.98;
next.foot_l.offset = Vec3::new(
-skeleton_attr.foot.0,
4.0 + skeleton_attr.foot.1 + foothoril * 8.5,
skeleton_attr.foot.2 + ((footvertl * 6.5).max(0.0)),
) / 8.0;
next.foot_l.ori =
Quaternion::rotation_x(-0.5 + footrotl * 0.85) * Quaternion::rotation_y(0.0);
next.foot_l.scale = Vec3::one() / 8.0;
next.foot_r.offset = Vec3::new(
skeleton_attr.foot.0,
4.0 + skeleton_attr.foot.1 + foothorir * 8.5,
skeleton_attr.foot.2 + ((footvertr * 6.5).max(0.0)),
) / 8.0;
next.foot_r.ori =
Quaternion::rotation_x(-0.5 + footrotr * 0.85) * Quaternion::rotation_y(0.0);
next.foot_r.scale = Vec3::one() / 8.0;
next.torso.offset = Vec3::new(0.0, 0.0, 0.0) / 8.0;
next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.25);
next.torso.scale = Vec3::one() / 8.0;
next.control.offset = Vec3::new(7.0, 9.0, -10.0);
next.control.ori = Quaternion::rotation_x(test * 0.02)
* Quaternion::rotation_y(test * 0.02)
* Quaternion::rotation_z(test * 0.02);
next.control.scale = Vec3::one();
}
next
}
}

View File

@ -346,6 +346,10 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_y(-1.27)
* Quaternion::rotation_z(0.0);
next.main.scale = Vec3::one();
next.control.offset = Vec3::new(0.0, 6.0, 6.0);
next.control.ori =
Quaternion::rotation_x(u_slow * 0.2) * Quaternion::rotation_z(u_slowalt * 0.1);
next.control.scale = Vec3::one();
},
Some(ToolKind::Farming(_)) => {
if velocity < 0.5 {

View File

@ -586,6 +586,11 @@ impl<Skel: Skeleton> FigureModelCache<Skel> {
body.body_type,
generate_mesh,
)),
Some(biped_large_center_spec.mesh_main(
body.species,
body.body_type,
generate_mesh,
)),
Some(biped_large_lateral_spec.mesh_shoulder_l(
body.species,
body.body_type,
@ -630,7 +635,6 @@ impl<Skel: Skeleton> FigureModelCache<Skel> {
None,
None,
None,
None,
]
},
Body::Golem(body) => {

View File

@ -2485,6 +2485,7 @@ struct SidedBLCenterVoxSpec {
head: BipedLargeCenterSubSpec,
torso_upper: BipedLargeCenterSubSpec,
torso_lower: BipedLargeCenterSubSpec,
main: BipedLargeCenterSubSpec,
}
#[derive(Serialize, Deserialize)]
struct BipedLargeCenterSubSpec {
@ -2596,6 +2597,27 @@ impl BipedLargeCenterSpec {
generate_mesh(&center, Vec3::from(spec.torso_lower.offset))
}
pub fn mesh_main(
&self,
species: BLSpecies,
body_type: BLBodyType,
generate_mesh: impl FnOnce(&Segment, Vec3<f32>) -> Mesh<FigurePipeline>,
) -> Mesh<FigurePipeline> {
let spec = match self.0.get(&(species, body_type)) {
Some(spec) => spec,
None => {
error!(
"No main weapon specification exists for the combination of {:?} and {:?}",
species, body_type
);
return load_mesh("not_found", Vec3::new(-5.0, -5.0, -2.5), generate_mesh);
},
};
let center = graceful_load_segment(&spec.main.center.0);
generate_mesh(&center, Vec3::from(spec.main.offset))
}
}
impl BipedLargeLateralSpec {
pub fn load_watched(indicator: &mut ReloadIndicator) -> Arc<Self> {

View File

@ -1680,12 +1680,29 @@ impl FigureMgr {
&mut state_animation_rate,
skeleton_attr,
),
_ => anim::biped_large::IdleAnimation::update_skeleton(
&BipedLargeSkeleton::new(),
time,
state.state_time,
&mut state_animation_rate,
skeleton_attr,
),
};
let target_bones = match &character {
CharacterState::Wielding { .. } => {
anim::biped_large::WieldAnimation::update_skeleton(
&target_base,
(vel.0.magnitude(), time),
state.state_time,
&mut state_animation_rate,
skeleton_attr,
)
},
// TODO!
_ => state.skeleton_mut().clone(),
_ => target_base,
};
state.skeleton.interpolate(&target_base, dt);
state.skeleton.interpolate(&target_bones, dt);
state.update(
renderer,
pos.0,