minor anim tweaks

This commit is contained in:
Justin Shipsey 2020-01-29 06:38:08 +00:00
parent 76060f5360
commit 908e099aa5
32 changed files with 653 additions and 299 deletions

BIN
assets/voxygen/voxel/armor/hand/assa_left.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/armor/hand/assa_right.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -9,7 +9,7 @@
center: ("npc.giant.male.torso_upper"), center: ("npc.giant.male.torso_upper"),
), ),
torso_lower: ( torso_lower: (
offset: (-5.0, 4.5, 4.5), offset: (-5.0, -4.5, -4.5),
center: ("npc.giant.male.torso_lower"), center: ("npc.giant.male.torso_lower"),
) )
), ),
@ -23,7 +23,7 @@
center: ("npc.giant.female.torso_upper"), center: ("npc.giant.female.torso_upper"),
), ),
torso_lower: ( torso_lower: (
offset: (-5.0, 4.5, 4.5), offset: (-5.0, -4.5, -4.5),
center: ("npc.giant.female.torso_lower"), center: ("npc.giant.female.torso_lower"),
) )
), ),

View File

@ -1,69 +1,69 @@
({ ({
(Giant, Male): ( (Giant, Male): (
shoulder_l: ( shoulder_l: (
offset: (-5.0, -5.5, -4.0), offset: (-4.0, -5.5, -4.0),
lateral: ("npc.giant.male.shoulder_l"), lateral: ("armor.empty"),
), ),
shoulder_r: ( shoulder_r: (
offset: (-5.0, -5.5, -4.0), offset: (-4.0, -5.5, -4.0),
lateral: ("npc.giant.male.shoulder_r"), lateral: ("npc.giant.male.shoulder_r"),
), ),
hand_l: ( hand_l: (
offset: (-3.0, -2.5, -3.0), offset: (-3.0, -2.5, -14.0),
lateral: ("npc.giant.male.hand_l"), lateral: ("npc.giant.male.hand_l"),
), ),
hand_r: ( hand_r: (
offset: (-3.0, -2.5, -3.0), offset: (-3.0, -2.5, -14.0),
lateral: ("npc.giant.male.hand_r"), lateral: ("npc.giant.male.hand_r"),
), ),
leg_l: ( leg_l: (
offset: (-3.0, -3.5, -2.0), offset: (-3.0, -3.5, -7.0),
lateral: ("npc.giant.male.leg_l"), lateral: ("npc.giant.male.leg_l"),
), ),
leg_r: ( leg_r: (
offset: (-3.0, -3.5, -2.0), offset: (-3.0, -3.5, -7.0),
lateral: ("npc.giant.male.leg_r"), lateral: ("npc.giant.male.leg_r"),
), ),
foot_l: ( foot_l: (
offset: (-3.0, -5.5, -2.5), offset: (-3.0, -5.5, -10.5),
lateral: ("npc.giant.male.foot_l"), lateral: ("npc.giant.male.foot_l"),
), ),
foot_r: ( foot_r: (
offset: (-3.0, -5.5, -2.5), offset: (-3.0, -5.5, -10.5),
lateral: ("npc.giant.male.foot_r"), lateral: ("npc.giant.male.foot_r"),
) )
), ),
(Giant, Female): ( (Giant, Female): (
shoulder_l: ( shoulder_l: (
offset: (-5.0, -5.5, -4.0), offset: (-4.0, -5.5, -4.0),
lateral: ("npc.giant.female.shoulder_l"), lateral: ("armor.empty"),
), ),
shoulder_r: ( shoulder_r: (
offset: (-5.0, -5.5, -4.0), offset: (-4.0, -5.5, -4.0),
lateral: ("npc.giant.female.shoulder_r"), lateral: ("npc.giant.female.shoulder_r"),
), ),
hand_l: ( hand_l: (
offset: (-3.0, -2.5, -3.0), offset: (-3.0, -2.5, -14.0),
lateral: ("npc.giant.female.hand_l"), lateral: ("npc.giant.female.hand_l"),
), ),
hand_r: ( hand_r: (
offset: (-3.0, -2.5, -3.0), offset: (-3.0, -2.5, -14.0),
lateral: ("npc.giant.female.hand_r"), lateral: ("npc.giant.female.hand_r"),
), ),
leg_l: ( leg_l: (
offset: (-3.0, -3.5, -2.0), offset: (-3.0, -3.5, -7.0),
lateral: ("npc.giant.female.leg_l"), lateral: ("npc.giant.female.leg_l"),
), ),
leg_r: ( leg_r: (
offset: (-3.0, -3.5, -2.0), offset: (-3.0, -3.5, -7.0),
lateral: ("npc.giant.female.leg_r"), lateral: ("npc.giant.female.leg_r"),
), ),
foot_l: ( foot_l: (
offset: (-3.0, -5.5, -2.5), offset: (-3.0, -5.5, -10.5),
lateral: ("npc.giant.female.foot_l"), lateral: ("npc.giant.female.foot_l"),
), ),
foot_r: ( foot_r: (
offset: (-3.0, -5.5, -2.5), offset: (-3.0, -5.5, -10.5),
lateral: ("npc.giant.female.foot_r"), lateral: ("npc.giant.female.foot_r"),
) )
), ),

View File

@ -37,7 +37,7 @@
center: ("npc.chicken.male.torso"), center: ("npc.chicken.male.torso"),
), ),
tail: ( tail: (
offset: (-1.5, -1.5, -3.5), offset: (-1.5, -2.5, -3.5),
center: ("npc.chicken.male.tail"), center: ("npc.chicken.male.tail"),
) )
), ),
@ -85,7 +85,7 @@
), ),
(Peacock, Male): ( (Peacock, Male): (
head: ( head: (
offset: (-2.0, -3.5, -3.0), offset: (-2.0, -1.5, -6.5),
center: ("npc.peacock.male.head"), center: ("npc.peacock.male.head"),
), ),
torso: ( torso: (
@ -99,7 +99,7 @@
), ),
(Peacock, Female): ( (Peacock, Female): (
head: ( head: (
offset: (-2.0, -3.5, -3.5), offset: (-2.0, -1.5, -6.5),
center: ("npc.peacock.female.head"), center: ("npc.peacock.female.head"),
), ),
torso: ( torso: (

View File

@ -1,145 +1,145 @@
({ ({
(Duck, Male): ( (Duck, Male): (
wing_l: ( wing_l: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -8.0),
lateral: ("npc.duck.male.wing"), lateral: ("npc.duck.male.wing"),
), ),
wing_r: ( wing_r: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -8.0),
lateral: ("npc.duck.male.wing"), lateral: ("npc.duck.male.wing"),
), ),
foot_l: ( foot_l: (
offset: (-1.0, -1.5, -3.5), offset: (-1.0, 0.0, -4.0),
lateral: ("npc.duck.male.leg_l"), lateral: ("npc.duck.male.leg_l"),
), ),
foot_r: ( foot_r: (
offset: (-1.0, -1.5, -3.5), offset: (-1.0, 0.0, -4.0),
lateral: ("npc.duck.male.leg_r"), lateral: ("npc.duck.male.leg_r"),
) )
), ),
(Duck, Female): ( (Duck, Female): (
wing_l: ( wing_l: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -8.0),
lateral: ("npc.duck.female.wing"), lateral: ("npc.duck.female.wing"),
), ),
wing_r: ( wing_r: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -8.0),
lateral: ("npc.duck.female.wing"), lateral: ("npc.duck.female.wing"),
), ),
foot_l: ( foot_l: (
offset: (-1.0, -1.5, -3.5), offset: (-1.0, 0.0, -4.0),
lateral: ("npc.duck.female.leg_l"), lateral: ("npc.duck.female.leg_l"),
), ),
foot_r: ( foot_r: (
offset: (-1.0, -1.5, -3.5), offset: (-1.0, 0.0, -4.0),
lateral: ("npc.duck.female.leg_r"), lateral: ("npc.duck.female.leg_r"),
) )
), ),
(Chicken, Male): ( (Chicken, Male): (
wing_l: ( wing_l: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -8.0),
lateral: ("npc.chicken.male.wing"), lateral: ("npc.chicken.male.wing"),
), ),
wing_r: ( wing_r: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -8.0),
lateral: ("npc.chicken.male.wing"), lateral: ("npc.chicken.male.wing"),
), ),
foot_l: ( foot_l: (
offset: (-1.0, -1.5, -1.5), offset: (-1.0, 0.0, -4.0),
lateral: ("npc.chicken.male.leg_l"), lateral: ("npc.chicken.male.leg_l"),
), ),
foot_r: ( foot_r: (
offset: (-1.0, -1.5, -1.5), offset: (-1.0, 0.0, -4.0),
lateral: ("npc.chicken.male.leg_r"), lateral: ("npc.chicken.male.leg_r"),
) )
), ),
(Chicken, Female): ( (Chicken, Female): (
wing_l: ( wing_l: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -8.0),
lateral: ("npc.chicken.female.wing"), lateral: ("npc.chicken.female.wing"),
), ),
wing_r: ( wing_r: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -8.0),
lateral: ("npc.chicken.female.wing"), lateral: ("npc.chicken.female.wing"),
), ),
foot_l: ( foot_l: (
offset: (-1.0, -1.5, -1.5), offset: (-1.0, 0.0, -4.0),
lateral: ("npc.chicken.female.leg_l"), lateral: ("npc.chicken.female.leg_l"),
), ),
foot_r: ( foot_r: (
offset: (-1.0, -1.5, -1.5), offset: (-1.0, 0.0, -4.0),
lateral: ("npc.chicken.female.leg_r"), lateral: ("npc.chicken.female.leg_r"),
) )
), ),
(Goose, Male): ( (Goose, Male): (
wing_l: ( wing_l: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -11.0),
lateral: ("npc.goose.male.wing"), lateral: ("npc.goose.male.wing"),
), ),
wing_r: ( wing_r: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -11.0),
lateral: ("npc.goose.male.wing"), lateral: ("npc.goose.male.wing"),
), ),
foot_l: ( foot_l: (
offset: (-1.0, -1.5, -1.5), offset: (-1.0, 0.0, -6.5),
lateral: ("npc.goose.male.leg_l"), lateral: ("npc.goose.male.leg_l"),
), ),
foot_r: ( foot_r: (
offset: (-1.0, -1.5, -1.5), offset: (-1.0, 0.0, -6.5),
lateral: ("npc.goose.male.leg_r"), lateral: ("npc.goose.male.leg_r"),
) )
), ),
(Goose, Female): ( (Goose, Female): (
wing_l: ( wing_l: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -11.0),
lateral: ("npc.goose.female.wing"), lateral: ("npc.goose.female.wing"),
), ),
wing_r: ( wing_r: (
offset: (-0.5, -2.5, -1.5), offset: (-0.5, -2.5, -11.0),
lateral: ("npc.goose.female.wing"), lateral: ("npc.goose.female.wing"),
), ),
foot_l: ( foot_l: (
offset: (-1.0, -1.5, -1.5), offset: (-1.0, 0.0, -6.5),
lateral: ("npc.goose.female.leg_l"), lateral: ("npc.goose.female.leg_l"),
), ),
foot_r: ( foot_r: (
offset: (-1.0, -1.5, -1.5), offset: (-1.0, 0.0, -6.5),
lateral: ("npc.goose.female.leg_r"), lateral: ("npc.goose.female.leg_r"),
) )
), ),
(Peacock, Male): ( (Peacock, Male): (
wing_l: ( wing_l: (
offset: (-1.0, -3.5, -2.5), offset: (-1.0, -3.5, -13.0),
lateral: ("npc.peacock.male.wing_l"), lateral: ("npc.peacock.male.wing_l"),
), ),
wing_r: ( wing_r: (
offset: (-1.0, -3.5, -2.5), offset: (-1.0, -3.5, -13.0),
lateral: ("npc.peacock.male.wing_r"), lateral: ("npc.peacock.male.wing_r"),
), ),
foot_l: ( foot_l: (
offset: (-1.0, -1.5, -3.5), offset: (-1.0, 0.0, -8.0),
lateral: ("npc.peacock.male.leg_l"), lateral: ("npc.peacock.male.leg_l"),
), ),
foot_r: ( foot_r: (
offset: (-1.0, -1.5, -3.5), offset: (-1.0, 0.0, -8.0),
lateral: ("npc.peacock.male.leg_r"), lateral: ("npc.peacock.male.leg_r"),
) )
), ),
(Peacock, Female): ( (Peacock, Female): (
wing_l: ( wing_l: (
offset: (-1.0, -3.5, -2.5), offset: (-1.0, -3.5, -13.0),
lateral: ("npc.peacock.female.wing_l"), lateral: ("npc.peacock.female.wing_l"),
), ),
wing_r: ( wing_r: (
offset: (-1.0, -3.5, -2.5), offset: (-1.0, -3.5, -13.0),
lateral: ("npc.peacock.female.wing_r"), lateral: ("npc.peacock.female.wing_r"),
), ),
foot_l: ( foot_l: (
offset: (-1.0, -1.5, -3.5), offset: (-1.0, 0.0, -8.0),
lateral: ("npc.peacock.female.leg_l"), lateral: ("npc.peacock.female.leg_l"),
), ),
foot_r: ( foot_r: (
offset: (-1.0, -1.5, -3.5), offset: (-1.0, 0.0, -8.0),
lateral: ("npc.peacock.female.leg_r"), lateral: ("npc.peacock.female.leg_r"),
) )
), ),

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,5 +1,5 @@
use super::{super::Animation, BipedLargeSkeleton, SkeletonAttr}; use super::{super::Animation, BipedLargeSkeleton, SkeletonAttr};
//use std::{f32::consts::PI, ops::Mul}; use std::{f32::consts::PI, ops::Mul};
use vek::*; use vek::*;
pub struct IdleAnimation; pub struct IdleAnimation;
@ -10,56 +10,120 @@ impl Animation for IdleAnimation {
fn update_skeleton( fn update_skeleton(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
_global_time: Self::Dependency, global_time: Self::Dependency,
_anim_time: f64, anim_time: f64,
_rate: &mut f32, _rate: &mut f32,
_skeleton_attr: &SkeletonAttr, skeleton_attr: &SkeletonAttr,
) -> Self::Skeleton { ) -> Self::Skeleton {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
next.head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; let lab = 1.0;
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); let torso = (anim_time as f32 * lab as f32 + 1.5 * PI).sin();
next.head.scale = Vec3::one() / 11.0;
next.upper_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; 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,
);
next.head.offset = Vec3::new(
0.0,
skeleton_attr.head.0,
skeleton_attr.head.1 + torso * 0.6,
) / 8.0;
next.head.ori = Quaternion::rotation_z(look.x * 0.6) * Quaternion::rotation_x(look.y * 0.6);
next.head.scale = Vec3::one() / 8.0;
next.upper_torso.offset = Vec3::new(
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.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.upper_torso.scale = Vec3::one() / 11.0; next.upper_torso.scale = Vec3::one() / 8.0;
next.lower_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.lower_torso.offset = Vec3::new(
0.0,
skeleton_attr.lower_torso.0,
skeleton_attr.lower_torso.1 + torso * 0.35,
);
next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.lower_torso.scale = Vec3::one(); next.lower_torso.scale = Vec3::one() * 1.02;
next.shoulder_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; 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.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.shoulder_l.scale = Vec3::one(); next.shoulder_l.scale = Vec3::one();
next.shoulder_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; 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.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.shoulder_r.scale = Vec3::one(); next.shoulder_r.scale = Vec3::one();
next.hand_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.hand_l.offset = Vec3::new(
-skeleton_attr.hand.0,
skeleton_attr.hand.1,
skeleton_attr.hand.2 + torso * 0.6,
);
next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.hand_l.scale = Vec3::one(); next.hand_l.scale = Vec3::one();
next.hand_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.hand_r.offset = Vec3::new(
skeleton_attr.hand.0,
skeleton_attr.hand.1,
skeleton_attr.hand.2 + torso * 0.6,
);
next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.hand_r.scale = Vec3::one(); next.hand_r.scale = Vec3::one();
next.leg_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.leg_l.offset = Vec3::new(
-skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2 + torso * 0.2,
) / 8.0;
next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.leg_l.scale = Vec3::one() / 11.0; next.leg_l.scale = Vec3::one() / 8.0;
next.leg_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.leg_r.offset = Vec3::new(
skeleton_attr.leg.0,
skeleton_attr.leg.1,
skeleton_attr.leg.2 + torso * 0.2,
) / 8.0;
next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.leg_r.scale = Vec3::one() / 10.88; next.leg_r.scale = Vec3::one() / 8.0;
next.foot_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; 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) * Quaternion::rotation_x(0.0); next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.foot_l.scale = Vec3::one(); next.foot_l.scale = Vec3::one() / 8.0;
next.foot_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.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) * Quaternion::rotation_x(0.0); next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.foot_r.scale = Vec3::one(); next.foot_r.scale = Vec3::one() / 8.0;
next.torso.offset = Vec3::new(0.0, 0.0, 0.0);
next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.torso.scale = Vec3::one();
next next
} }
} }

View File

@ -24,6 +24,7 @@ pub struct BipedLargeSkeleton {
leg_r: Bone, leg_r: Bone,
foot_l: Bone, foot_l: Bone,
foot_r: Bone, foot_r: Bone,
torso: Bone,
} }
impl BipedLargeSkeleton { impl BipedLargeSkeleton {
@ -40,6 +41,7 @@ impl BipedLargeSkeleton {
leg_r: Bone::default(), leg_r: Bone::default(),
foot_l: Bone::default(), foot_l: Bone::default(),
foot_r: Bone::default(), foot_r: Bone::default(),
torso: Bone::default(),
} }
} }
} }
@ -52,23 +54,26 @@ impl Skeleton for BipedLargeSkeleton {
let shoulder_r_mat = self.shoulder_r.compute_base_matrix(); let shoulder_r_mat = self.shoulder_r.compute_base_matrix();
let leg_l_mat = self.leg_l.compute_base_matrix(); let leg_l_mat = self.leg_l.compute_base_matrix();
let leg_r_mat = self.leg_r.compute_base_matrix(); let leg_r_mat = self.leg_r.compute_base_matrix();
let torso_mat = self.torso.compute_base_matrix();
[ [
FigureBoneData::new(self.head.compute_base_matrix()), FigureBoneData::new(torso_mat * self.head.compute_base_matrix()),
FigureBoneData::new(upper_torso_mat), FigureBoneData::new(torso_mat * upper_torso_mat),
FigureBoneData::new(self.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( FigureBoneData::new(
self.hand_l.compute_base_matrix() * shoulder_l_mat * upper_torso_mat, torso_mat * upper_torso_mat * self.lower_torso.compute_base_matrix(),
),
FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_l_mat),
FigureBoneData::new(torso_mat * upper_torso_mat * shoulder_r_mat),
FigureBoneData::new(
torso_mat * upper_torso_mat * shoulder_l_mat * self.hand_l.compute_base_matrix(),
), ),
FigureBoneData::new( FigureBoneData::new(
self.hand_r.compute_base_matrix() * shoulder_r_mat * upper_torso_mat, torso_mat * upper_torso_mat * shoulder_r_mat * self.hand_r.compute_base_matrix(),
), ),
FigureBoneData::new(leg_l_mat), FigureBoneData::new(torso_mat * leg_l_mat),
FigureBoneData::new(leg_r_mat), FigureBoneData::new(torso_mat * leg_r_mat),
FigureBoneData::new(self.foot_l.compute_base_matrix() * leg_l_mat), FigureBoneData::new(torso_mat * self.foot_l.compute_base_matrix()),
FigureBoneData::new(self.foot_r.compute_base_matrix() * leg_r_mat), FigureBoneData::new(torso_mat * self.foot_r.compute_base_matrix()),
FigureBoneData::default(), FigureBoneData::default(),
FigureBoneData::default(), FigureBoneData::default(),
FigureBoneData::default(), FigureBoneData::default(),
@ -89,10 +94,19 @@ impl Skeleton for BipedLargeSkeleton {
self.leg_r.interpolate(&target.leg_r, dt); self.leg_r.interpolate(&target.leg_r, dt);
self.foot_l.interpolate(&target.foot_l, dt); self.foot_l.interpolate(&target.foot_l, dt);
self.foot_r.interpolate(&target.foot_r, dt); self.foot_r.interpolate(&target.foot_r, dt);
self.torso.interpolate(&target.torso, dt);
} }
} }
pub struct SkeletonAttr; pub struct SkeletonAttr {
head: (f32, f32),
upper_torso: (f32, f32),
lower_torso: (f32, f32),
shoulder: (f32, f32, f32),
hand: (f32, f32, f32),
leg: (f32, f32, f32),
foot: (f32, f32, f32),
}
impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr { impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr {
type Error = (); type Error = ();
@ -107,12 +121,43 @@ impl<'a> std::convert::TryFrom<&'a comp::Body> for SkeletonAttr {
impl Default for SkeletonAttr { impl Default for SkeletonAttr {
fn default() -> Self { fn default() -> Self {
Self Self {
head: (0.0, 0.0),
upper_torso: (0.0, 0.0),
lower_torso: (0.0, 0.0),
shoulder: (0.0, 0.0, 0.0),
hand: (0.0, 0.0, 0.0),
leg: (0.0, 0.0, 0.0),
foot: (0.0, 0.0, 0.0),
}
} }
} }
impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr { impl<'a> From<&'a comp::biped_large::Body> for SkeletonAttr {
fn from(_body: &'a comp::biped_large::Body) -> Self { fn from(body: &'a comp::biped_large::Body) -> Self {
Self use comp::biped_large::Species::*;
Self {
head: match (body.species, body.body_type) {
(Giant, _) => (0.0, 28.5),
},
upper_torso: match (body.species, body.body_type) {
(Giant, _) => (0.0, 18.5),
},
lower_torso: match (body.species, body.body_type) {
(Giant, _) => (1.0, -9.5),
},
shoulder: match (body.species, body.body_type) {
(Giant, _) => (6.0, 0.5, 2.5),
},
hand: match (body.species, body.body_type) {
(Giant, _) => (3.5, -1.0, 3.0),
},
leg: match (body.species, body.body_type) {
(Giant, _) => (3.5, 0.0, 14.0),
},
foot: match (body.species, body.body_type) {
(Giant, _) => (4.0, 0.5, 11.0),
},
}
} }
} }

View File

@ -1,5 +1,5 @@
use super::{super::Animation, BipedLargeSkeleton, SkeletonAttr}; use super::{super::Animation, BipedLargeSkeleton, SkeletonAttr};
//use std::{f32::consts::PI, ops::Mul}; use std::f32::consts::PI;
use vek::*; use vek::*;
pub struct RunAnimation; pub struct RunAnimation;
@ -11,55 +11,112 @@ impl Animation for RunAnimation {
fn update_skeleton( fn update_skeleton(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_velocity, _global_time): Self::Dependency, (_velocity, _global_time): Self::Dependency,
_anim_time: f64, anim_time: f64,
_rate: &mut f32, _rate: &mut f32,
_skeleton_attr: &SkeletonAttr, skeleton_attr: &SkeletonAttr,
) -> Self::Skeleton { ) -> Self::Skeleton {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
next.head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; let lab = 14.0;
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.head.scale = Vec3::one() / 10.88;
next.upper_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; let legl = (anim_time as f32 * lab as f32).sin();
next.upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); let legr = (anim_time as f32 * lab as f32 + PI).sin();
next.upper_torso.scale = Vec3::one() / 10.88; let belt = (anim_time as f32 * lab as f32 + 1.5 * PI).sin();
next.lower_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; let foothoril = (anim_time as f32 * lab as f32).sin();
let foothorir = (anim_time as f32 * lab as f32 + PI).sin();
let footvertl = (anim_time as f32 * lab as f32 + PI * 1.4).sin().max(0.0);
let footvertr = (anim_time as f32 * lab as f32 + PI * 0.4).sin().max(0.0);
next.head.offset =
Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + belt * 1.0) / 8.0;
next.head.ori = Quaternion::rotation_z(belt * 0.1) * Quaternion::rotation_x(0.3);
next.head.scale = Vec3::one() / 8.0;
next.upper_torso.offset = Vec3::new(
0.0,
skeleton_attr.upper_torso.0,
skeleton_attr.upper_torso.1 + belt * 1.0,
) / 8.0;
next.upper_torso.ori = Quaternion::rotation_z(belt * 0.3) * Quaternion::rotation_x(0.0);
next.upper_torso.scale = Vec3::one() / 8.0;
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(0.0) * Quaternion::rotation_x(0.0); next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
next.lower_torso.scale = Vec3::one() / 10.88; next.lower_torso.scale = Vec3::one() * 1.02;
next.shoulder_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.shoulder_l.offset = Vec3::new(
next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); -skeleton_attr.shoulder.0,
next.shoulder_l.scale = Vec3::one() / 10.88; skeleton_attr.shoulder.1,
skeleton_attr.shoulder.2,
);
next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(legr * 0.06);
next.shoulder_l.scale = Vec3::one();
next.shoulder_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.shoulder_r.offset = Vec3::new(
next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); skeleton_attr.shoulder.0,
next.shoulder_r.scale = Vec3::one() / 10.88; skeleton_attr.shoulder.1,
skeleton_attr.shoulder.2,
);
next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(legl * 0.1);
next.shoulder_r.scale = Vec3::one();
next.hand_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.hand_l.offset = Vec3::new(
next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); -skeleton_attr.hand.0,
next.hand_l.scale = Vec3::one() / 10.88; skeleton_attr.hand.1,
skeleton_attr.hand.2,
);
next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 + legr * 0.5);
next.hand_l.scale = Vec3::one();
next.hand_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.hand_r.offset = Vec3::new(
next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); skeleton_attr.hand.0,
next.hand_r.scale = Vec3::one() / 10.88; skeleton_attr.hand.1,
skeleton_attr.hand.2,
);
next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.3 - legr * 0.5);
next.hand_r.scale = Vec3::one();
next.leg_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.leg_l.offset = Vec3::new(
next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); -skeleton_attr.leg.0,
next.leg_l.scale = Vec3::one() / 10.88; skeleton_attr.leg.1,
skeleton_attr.leg.2 + belt * 0.4,
) / 8.0;
next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-legl * 0.3);
next.leg_l.scale = Vec3::one() / 8.0;
next.leg_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.leg_r.offset = Vec3::new(
next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); skeleton_attr.leg.0,
next.leg_r.scale = Vec3::one() / 10.88; skeleton_attr.leg.1,
skeleton_attr.leg.2 + belt * 0.4,
) / 8.0;
next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-legr * 0.3);
next.leg_r.scale = Vec3::one() / 8.0;
next.foot_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.foot_l.offset = Vec3::new(
next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); -skeleton_attr.foot.0,
next.foot_l.scale = Vec3::one() / 10.88; skeleton_attr.foot.1 - foothoril * 4.5 - 0.5,
skeleton_attr.foot.2 + footvertl * 6.0,
) / 8.0;
next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 - legl * 0.5);
next.foot_l.scale = Vec3::one() / 8.0 * 0.98;
next.foot_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0; next.foot_r.offset = Vec3::new(
next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0); skeleton_attr.foot.0,
next.foot_r.scale = Vec3::one() / 10.88; skeleton_attr.foot.1 - foothorir * 4.5 - 0.5,
skeleton_attr.foot.2 + footvertr * 6.0,
) / 8.0;
next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 - legr * 0.5);
next.foot_r.scale = Vec3::one() / 8.0 * 0.98;
next.torso.offset = Vec3::new(0.0, 0.0, 0.0);
next.torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(-0.3);
next.torso.scale = Vec3::one();
next next
} }
} }

View File

@ -17,8 +17,8 @@ impl Animation for IdleAnimation {
) -> Self::Skeleton { ) -> Self::Skeleton {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let wave_slow = (anim_time as f32 * 3.5).sin(); let wave_slow = (anim_time as f32 * 4.5).sin();
let wave_slow_cos = (anim_time as f32 * 3.5).cos(); let wave_slow_cos = (anim_time as f32 * 4.5).cos();
let duck_head_look = Vec2::new( let duck_head_look = Vec2::new(
((global_time + anim_time) as f32 / 8.0) ((global_time + anim_time) as f32 / 8.0)
@ -35,7 +35,7 @@ impl Animation for IdleAnimation {
next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) / 11.0; next.head.offset = Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1) / 11.0;
next.head.ori = Quaternion::rotation_z(duck_head_look.x) next.head.ori = Quaternion::rotation_z(duck_head_look.x)
* Quaternion::rotation_x(duck_head_look.y + wave_slow_cos * 0.03); * Quaternion::rotation_x(-duck_head_look.y.abs() + wave_slow_cos * 0.03);
next.head.scale = Vec3::one(); next.head.scale = Vec3::one();
next.torso.offset = Vec3::new( next.torso.offset = Vec3::new(

View File

@ -100,34 +100,34 @@ impl<'a> From<&'a comp::bird_medium::Body> for SkeletonAttr {
use comp::bird_medium::Species::*; use comp::bird_medium::Species::*;
Self { Self {
head: match (body.species, body.body_type) { head: match (body.species, body.body_type) {
(Duck, _) => (4.0, 4.0), (Duck, _) => (4.0, 3.0),
(Chicken, _) => (4.0, 4.0), (Chicken, _) => (4.0, 3.0),
(Goose, _) => (5.0, 5.0), (Goose, _) => (5.0, 5.0),
(Peacock, _) => (5.0, 6.0), (Peacock, _) => (4.0, 7.0),
}, },
chest: match (body.species, body.body_type) { chest: match (body.species, body.body_type) {
(Duck, _) => (0.0, 6.0), (Duck, _) => (0.0, 5.0),
(Chicken, _) => (0.0, 6.0), (Chicken, _) => (0.0, 5.0),
(Goose, _) => (0.0, 8.0), (Goose, _) => (0.0, 8.0),
(Peacock, _) => (0.0, 9.0), (Peacock, _) => (0.0, 10.0),
}, },
tail: match (body.species, body.body_type) { tail: match (body.species, body.body_type) {
(Duck, _) => (-3.5, 3.0), (Duck, _) => (-3.0, 1.5),
(Chicken, _) => (-3.5, 3.0), (Chicken, _) => (-3.0, 1.5),
(Goose, _) => (-5.0, 3.0), (Goose, _) => (-5.0, 3.0),
(Peacock, _) => (-5.0, 2.0), (Peacock, _) => (-5.5, 2.0),
}, },
wing: match (body.species, body.body_type) { wing: match (body.species, body.body_type) {
(Duck, _) => (2.75, 0.0, 0.0), (Duck, _) => (2.75, 0.0, 6.0),
(Chicken, _) => (2.75, 0.0, 0.0), (Chicken, _) => (2.75, 0.0, 6.0),
(Goose, _) => (3.75, 0.0, 0.0), (Goose, _) => (3.75, -1.0, 9.0),
(Peacock, _) => (3.0, 0.0, 0.0), (Peacock, _) => (3.0, 0.0, 9.0),
}, },
foot: match (body.species, body.body_type) { foot: match (body.species, body.body_type) {
(Duck, _) => (2.0, 0.0, 4.0), (Duck, _) => (2.0, -1.5, 4.0),
(Chicken, _) => (2.0, 0.0, 4.0), (Chicken, _) => (2.0, -1.5, 4.0),
(Goose, _) => (2.0, 0.0, 3.0), (Goose, _) => (2.0, -1.5, 7.0),
(Peacock, _) => (2.0, 0.5, 3.0), (Peacock, _) => (2.0, -2.5, 8.0),
}, },
} }
} }

View File

@ -1,5 +1,5 @@
use super::{super::Animation, BirdMediumSkeleton, SkeletonAttr}; use super::{super::Animation, BirdMediumSkeleton, SkeletonAttr};
//use std::{f32::consts::PI, ops::Mul}; use std::f32::consts::PI;
use vek::*; use vek::*;
pub struct RunAnimation; pub struct RunAnimation;
@ -17,24 +17,35 @@ impl Animation for RunAnimation {
) -> Self::Skeleton { ) -> Self::Skeleton {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let wave = (anim_time as f32 * 18.0).sin(); let lab = 16.0; //14.0
let wave_cos = (anim_time as f32 * 18.0).cos();
next.head.offset = let footl = (anim_time as f32 * lab as f32 + PI).sin();
Vec3::new(0.0, skeleton_attr.head.0, skeleton_attr.head.1 + wave * 0.5) / 11.0; let footr = (anim_time as f32 * lab as f32).sin();
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + wave_cos * 0.03); let center = (anim_time as f32 * lab as f32 + PI / 2.0).sin();
let centeroffset = (anim_time as f32 * lab as f32 + PI * 1.5).sin();
next.head.offset = Vec3::new(
0.0,
skeleton_attr.head.0,
skeleton_attr.head.1 + center * 0.5,
) / 11.0;
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0 + center * 0.03);
next.head.scale = Vec3::one(); next.head.scale = Vec3::one();
next.torso.offset = Vec3::new( next.torso.offset = Vec3::new(
0.0, 0.0,
skeleton_attr.chest.0, skeleton_attr.chest.0 + centeroffset * 0.6,
wave * 0.3 + skeleton_attr.chest.1, center * 0.6 + skeleton_attr.chest.1,
) / 11.0; ) / 11.0;
next.torso.ori = Quaternion::rotation_y(wave * 0.03); next.torso.ori = Quaternion::rotation_y(center * 0.05);
next.torso.scale = Vec3::one() / 11.0; next.torso.scale = Vec3::one() / 11.0;
next.tail.offset = Vec3::new(0.0, skeleton_attr.tail.0, skeleton_attr.tail.1) / 11.0; next.tail.offset = Vec3::new(
next.tail.ori = Quaternion::rotation_x(wave_cos * 0.03); 0.0,
skeleton_attr.tail.0,
skeleton_attr.tail.1 + centeroffset * 0.6,
) / 11.0;
next.tail.ori = Quaternion::rotation_x(center * 0.03);
next.tail.scale = Vec3::one(); next.tail.scale = Vec3::one();
next.wing_l.offset = Vec3::new( next.wing_l.offset = Vec3::new(
@ -42,7 +53,7 @@ impl Animation for RunAnimation {
skeleton_attr.wing.1, skeleton_attr.wing.1,
skeleton_attr.wing.2, skeleton_attr.wing.2,
) / 11.0; ) / 11.0;
next.wing_l.ori = Quaternion::rotation_z(0.0); next.wing_l.ori = Quaternion::rotation_y(footl * 0.3);
next.wing_l.scale = Vec3::one() * 1.05; next.wing_l.scale = Vec3::one() * 1.05;
next.wing_r.offset = Vec3::new( next.wing_r.offset = Vec3::new(
@ -50,23 +61,23 @@ impl Animation for RunAnimation {
skeleton_attr.wing.1, skeleton_attr.wing.1,
skeleton_attr.wing.2, skeleton_attr.wing.2,
) / 11.0; ) / 11.0;
next.wing_r.ori = Quaternion::rotation_y(0.0); next.wing_r.ori = Quaternion::rotation_y(footr * 0.3);
next.wing_r.scale = Vec3::one() * 1.05; next.wing_r.scale = Vec3::one() * 1.05;
next.leg_l.offset = Vec3::new( next.leg_l.offset = Vec3::new(
-skeleton_attr.foot.0, -skeleton_attr.foot.0,
skeleton_attr.foot.1, skeleton_attr.foot.1 + footl * 1.0,
skeleton_attr.foot.2, skeleton_attr.foot.2,
) / 11.0; ) / 11.0;
next.leg_l.ori = Quaternion::rotation_x(wave_cos * 1.0); next.leg_l.ori = Quaternion::rotation_x(footl * 0.5);
next.leg_l.scale = Vec3::one() / 11.0; next.leg_l.scale = Vec3::one() / 11.0;
next.leg_r.offset = Vec3::new( next.leg_r.offset = Vec3::new(
skeleton_attr.foot.0, skeleton_attr.foot.0,
skeleton_attr.foot.1, skeleton_attr.foot.1 + footr * 1.0,
skeleton_attr.foot.2, skeleton_attr.foot.2,
) / 11.0; ) / 11.0;
next.leg_r.ori = Quaternion::rotation_x(wave * 1.0); next.leg_r.ori = Quaternion::rotation_x(footr * 0.5);
next.leg_r.scale = Vec3::one() / 11.0; next.leg_r.scale = Vec3::one() / 11.0;
next next
} }

View File

@ -14,26 +14,27 @@ impl Animation for AttackAnimation {
fn update_skeleton( fn update_skeleton(
skeleton: &Self::Skeleton, skeleton: &Self::Skeleton,
(_active_tool_kind, _global_time): Self::Dependency, (active_tool_kind, _global_time): Self::Dependency,
anim_time: f64, anim_time: f64,
_rate: &mut f32, _rate: &mut f32,
skeleton_attr: &SkeletonAttr, skeleton_attr: &SkeletonAttr,
) -> Self::Skeleton { ) -> Self::Skeleton {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let wave_quicken = 1.0 - (anim_time as f32 * 16.0).cos(); let slow = (anim_time as f32 * 9.0).sin();
let wave_quicken_slow = 1.0 - (anim_time as f32 * 12.0).cos(); let accel_med = 1.0 - (anim_time as f32 * 16.0).cos();
let wave_quicken_double = 1.0 - (anim_time as f32 * 24.0).cos(); let accel_slow = 1.0 - (anim_time as f32 * 12.0).cos();
let wave_stop_quick = (anim_time as f32 * 16.0).min(PI / 2.0).sin(); let accel_fast = 1.0 - (anim_time as f32 * 24.0).cos();
let decel = (anim_time as f32 * 16.0).min(PI / 2.0).sin();
next.head.offset = Vec3::new( next.head.offset = Vec3::new(
0.0 + skeleton_attr.neck_right, 0.0 + skeleton_attr.neck_right,
-2.0 + skeleton_attr.neck_forward, -2.0 + skeleton_attr.neck_forward,
skeleton_attr.neck_height + 21.0, skeleton_attr.neck_height + 21.0,
); );
next.head.ori = Quaternion::rotation_z(wave_stop_quick * -0.25) next.head.ori = Quaternion::rotation_z(decel * -0.25)
* Quaternion::rotation_x(0.0 + wave_stop_quick * -0.1) * Quaternion::rotation_x(0.0 + decel * -0.1)
* Quaternion::rotation_y(wave_stop_quick * 0.1); * Quaternion::rotation_y(decel * 0.1);
next.head.scale = Vec3::one() * skeleton_attr.head_scale; next.head.scale = Vec3::one() * skeleton_attr.head_scale;
next.chest.offset = Vec3::new(0.0, 0.0, 7.0); next.chest.offset = Vec3::new(0.0, 0.0, 7.0);
@ -48,52 +49,206 @@ impl Animation for AttackAnimation {
next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.ori = Quaternion::rotation_x(0.0);
next.shorts.scale = Vec3::one(); next.shorts.scale = Vec3::one();
next.l_hand.offset = Vec3::new( match active_tool_kind {
-8.0 + wave_quicken_slow * 10.0, //TODO: Inventory
8.0 + wave_quicken_double * 3.0, Some(Tool::Sword) => {
0.0, next.l_hand.offset =
); Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0);
next.l_hand.ori = Quaternion::rotation_z(-0.8) next.l_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + wave_quicken * -0.8) * Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + wave_quicken * -0.4); * Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.l_hand.scale = Vec3::one() * 1.01; next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new( next.r_hand.offset =
-8.0 + wave_quicken_slow * 10.0, Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0);
8.0 + wave_quicken_double * 3.0, next.r_hand.ori = Quaternion::rotation_z(-0.8)
-2.0, * Quaternion::rotation_x(0.0 + accel_med * -0.8)
); * Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.r_hand.ori = Quaternion::rotation_z(-0.8) next.r_hand.scale = Vec3::one() * 1.01;
* Quaternion::rotation_x(0.0 + wave_quicken * -0.8)
* Quaternion::rotation_y(0.0 + wave_quicken * -0.4);
next.r_hand.scale = Vec3::one() * 1.01;
//next.l_foot.offset = Vec3::new( next.main.offset = Vec3::new(
// -3.4, -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x,
// -0.1 + wave_stop_quick * 2.0, 8.0 + accel_fast * 3.0,
// 8.0 + wave_stop_quick * -4.0, 0.0,
//); );
//next.l_foot.ori = Quaternion::rotation_x(wave_stop_quick * -1.2); next.main.ori = Quaternion::rotation_z(-0.8)
//next.l_foot.scale = Vec3::one(); * Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.main.scale = Vec3::one();
}
Some(Tool::Axe) => {
next.l_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0);
next.l_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.l_hand.scale = Vec3::one() * 1.01;
//next.r_foot.offset = Vec3::new( next.r_hand.offset =
// 3.4, Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0);
// -0.1 - wave_stop_quick * -2.0, next.r_hand.ori = Quaternion::rotation_z(-0.8)
// 8.0 + wave_stop_quick * -2.0, * Quaternion::rotation_x(0.0 + accel_med * -0.8)
//); * Quaternion::rotation_y(0.0 + accel_med * -0.4);
//next.r_foot.ori = Quaternion::rotation_x(wave_stop_quick * 1.2); next.r_hand.scale = Vec3::one() * 1.01;
//next.r_foot.scale = Vec3::one();
next.main.offset = Vec3::new( next.main.offset = Vec3::new(
-8.0 + wave_quicken_slow * 10.0 + skeleton_attr.weapon_x, -8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x,
8.0 + wave_quicken_double * 3.0, 8.0 + accel_fast * 3.0,
0.0, 0.0,
); );
next.main.ori = Quaternion::rotation_z(-0.8) next.main.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + wave_quicken * -0.8) * Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + wave_quicken * -0.4); * Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.main.scale = Vec3::one(); next.main.scale = Vec3::one();
}
Some(Tool::Hammer) => {
next.l_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0);
next.l_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0);
next.r_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x,
8.0 + accel_fast * 3.0,
0.0,
);
next.main.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.main.scale = Vec3::one();
}
Some(Tool::Staff) => {
next.l_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0);
next.l_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0);
next.r_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x,
8.0 + accel_fast * 3.0,
0.0,
);
next.main.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.main.scale = Vec3::one();
}
Some(Tool::Shield) => {
next.l_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0);
next.l_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0);
next.r_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x,
8.0 + accel_fast * 3.0,
0.0,
);
next.main.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.main.scale = Vec3::one();
}
Some(Tool::Bow) => {
next.l_hand.offset = Vec3::new(-7.0, -2.0 + slow * 5.0, -1.0);
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(-0.3)
* Quaternion::rotation_z(0.3);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(1.0, 8.0, 2.5);
next.r_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(0.3)
* Quaternion::rotation_z(0.3);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-4.0 + skeleton_attr.weapon_x,
15.0 + skeleton_attr.weapon_y,
-4.0,
);
next.main.ori = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(0.4)
* Quaternion::rotation_z(0.0);
next.main.scale = Vec3::one();
}
Some(Tool::Dagger) => {
next.l_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0);
next.l_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0);
next.r_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x,
8.0 + accel_fast * 3.0,
0.0,
);
next.main.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.main.scale = Vec3::one();
}
Some(Tool::Debug(_)) => {
next.l_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, 0.0);
next.l_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset =
Vec3::new(-8.0 + accel_slow * 10.0, 8.0 + accel_fast * 3.0, -2.0);
next.r_hand.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new(
-8.0 + accel_slow * 10.0 + skeleton_attr.weapon_x,
8.0 + accel_fast * 3.0,
0.0,
);
next.main.ori = Quaternion::rotation_z(-0.8)
* Quaternion::rotation_x(0.0 + accel_med * -0.8)
* Quaternion::rotation_y(0.0 + accel_med * -0.4);
next.main.scale = Vec3::one();
}
_ => {}
}
next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7);
next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.ori = Quaternion::rotation_x(0.0);
next.l_shoulder.scale = Vec3::one() * 1.1; next.l_shoulder.scale = Vec3::one() * 1.1;
@ -111,9 +266,9 @@ impl Animation for AttackAnimation {
next.lantern.scale = Vec3::one() * 0.0; next.lantern.scale = Vec3::one() * 0.0;
next.torso.offset = Vec3::new(0.0, -0.2, 0.1) * skeleton_attr.scaler; next.torso.offset = Vec3::new(0.0, -0.2, 0.1) * skeleton_attr.scaler;
next.torso.ori = Quaternion::rotation_z(wave_stop_quick * -0.2) next.torso.ori = Quaternion::rotation_z(decel * -0.2)
* Quaternion::rotation_x(0.0 + wave_stop_quick * -0.2) * Quaternion::rotation_x(0.0 + decel * -0.2)
* Quaternion::rotation_y(wave_stop_quick * 0.2); * Quaternion::rotation_y(decel * 0.2);
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
next next
} }

View File

@ -138,24 +138,24 @@ impl Animation for CidleAnimation {
Some(Tool::Staff) => { Some(Tool::Staff) => {
next.l_hand.offset = Vec3::new( next.l_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0, -6.0 + wave_ultra_slow_cos * 1.0,
3.5 + wave_ultra_slow_cos * 0.5, 1.0 + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0, 5.0 + wave_ultra_slow * 1.0,
); );
next.l_hand.ori = Quaternion::rotation_x(-0.3); next.l_hand.ori = Quaternion::rotation_x(1.27);
next.l_hand.scale = Vec3::one() * 1.01; next.l_hand.scale = Vec3::one() * 1.0;
next.r_hand.offset = Vec3::new( next.r_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0, -6.0 + wave_ultra_slow_cos * 1.0,
3.0 + wave_ultra_slow_cos * 0.5, -1.5 + wave_ultra_slow_cos * 0.5,
-2.0 + wave_ultra_slow * 1.0, -2.0 + wave_ultra_slow * 1.0,
); );
next.r_hand.ori = Quaternion::rotation_x(-0.3); next.r_hand.ori = Quaternion::rotation_x(1.27);
next.r_hand.scale = Vec3::one() * 1.01; next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new( next.main.offset = Vec3::new(
-6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0,
4.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, 8.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0, 17.0 + wave_ultra_slow * 1.0,
); );
next.main.ori = Quaternion::rotation_x(-0.3) next.main.ori = Quaternion::rotation_x(-0.3 + PI)
* Quaternion::rotation_y(0.0) * Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0); * Quaternion::rotation_z(0.0);
next.main.scale = Vec3::one(); next.main.scale = Vec3::one();
@ -187,31 +187,31 @@ impl Animation for CidleAnimation {
} }
Some(Tool::Bow) => { Some(Tool::Bow) => {
next.l_hand.offset = Vec3::new( next.l_hand.offset = Vec3::new(
-4.0 + wave_ultra_slow_cos * 1.0, -1.0 + wave_ultra_slow_cos * 1.0,
5.0 + wave_ultra_slow_cos * 0.5, 3.0 + wave_ultra_slow_cos * 0.5,
0.0 + wave_ultra_slow * 1.0, 5.0 + wave_ultra_slow * 1.0,
); );
next.l_hand.ori = Quaternion::rotation_x(0.0) next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(-1.9) * Quaternion::rotation_y(-0.3)
* Quaternion::rotation_z(0.85); * Quaternion::rotation_z(0.3);
next.l_hand.scale = Vec3::one() * 1.01; next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new( next.r_hand.offset = Vec3::new(
2.0 + wave_ultra_slow_cos * 1.0, 1.0 + wave_ultra_slow_cos * 1.0,
8.0 + wave_ultra_slow_cos * 0.5, 8.0 + wave_ultra_slow_cos * 0.5,
-3.5 + wave_ultra_slow * 1.0, 2.5 + wave_ultra_slow * 1.0,
); );
next.r_hand.ori = Quaternion::rotation_x(0.0) next.r_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(-1.7) * Quaternion::rotation_y(0.3)
* Quaternion::rotation_z(0.85); * Quaternion::rotation_z(0.3);
next.r_hand.scale = Vec3::one() * 1.01; next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new( next.main.offset = Vec3::new(
9.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0, -4.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0,
10.0 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5, 15.0 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5,
-3.0 + wave_ultra_slow * 1.0, -4.0 + wave_ultra_slow * 1.0,
); );
next.main.ori = Quaternion::rotation_x(0.0) next.main.ori = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(-1.7) * Quaternion::rotation_y(0.4)
* Quaternion::rotation_z(0.85); * Quaternion::rotation_z(0.0);
next.main.scale = Vec3::one(); next.main.scale = Vec3::one();
} }
Some(Tool::Dagger) => { Some(Tool::Dagger) => {

View File

@ -41,7 +41,7 @@ impl Animation for RollAnimation {
next.head.offset = Vec3::new( next.head.offset = Vec3::new(
0.0 + skeleton_attr.neck_right, 0.0 + skeleton_attr.neck_right,
-2.0 + skeleton_attr.neck_forward, -2.0 + skeleton_attr.neck_forward,
skeleton_attr.neck_height + 21.0 + wave_dub * -8.0, skeleton_attr.neck_height + 17.0 + wave_dub * -8.0,
); );
next.head.ori = Quaternion::rotation_x(wave_dub * 0.4); next.head.ori = Quaternion::rotation_x(wave_dub * 0.4);
next.head.scale = Vec3::one(); next.head.scale = Vec3::one();
@ -77,11 +77,11 @@ impl Animation for RollAnimation {
Quaternion::rotation_x(wave_slow * 6.5) * Quaternion::rotation_y(wave * 0.3); Quaternion::rotation_x(wave_slow * 6.5) * Quaternion::rotation_y(wave * 0.3);
next.r_hand.scale = Vec3::one(); next.r_hand.scale = Vec3::one();
next.l_foot.offset = Vec3::new(-3.4, -0.1, 9.0 - 0.0 + wave_dub * -1.2 + wave_slow * 4.0); next.l_foot.offset = Vec3::new(-3.4, -0.1, 10.0 - 0.0 + wave_dub * -1.2 + wave_slow * 4.0);
next.l_foot.ori = Quaternion::rotation_x(wave * 0.6); next.l_foot.ori = Quaternion::rotation_x(wave * 0.6);
next.l_foot.scale = Vec3::one(); next.l_foot.scale = Vec3::one();
next.r_foot.offset = Vec3::new(3.4, -0.1, 9.0 - 0.0 + wave_dub * -1.0 + wave_slow * 4.0); next.r_foot.offset = Vec3::new(3.4, -0.1, 10.0 - 0.0 + wave_dub * -1.0 + wave_slow * 4.0);
next.r_foot.ori = Quaternion::rotation_x(wave * -0.4); next.r_foot.ori = Quaternion::rotation_x(wave * -0.4);
next.r_foot.scale = Vec3::one(); next.r_foot.scale = Vec3::one();
@ -112,7 +112,7 @@ impl Animation for RollAnimation {
next.lantern.scale = Vec3::one() * 0.0; next.lantern.scale = Vec3::one() * 0.0;
next.torso.offset = next.torso.offset =
Vec3::new(0.0, 11.0, 0.1 + wave_dub * 16.0) / 11.0 * skeleton_attr.scaler; Vec3::new(0.0, 0.0, 0.1 + wave_dub * 16.0) / 11.0 * skeleton_attr.scaler;
next.torso.ori = Quaternion::rotation_x(wave_slow * 6.5) * Quaternion::rotation_y(tilt); next.torso.ori = Quaternion::rotation_x(wave_slow * 6.5) * Quaternion::rotation_y(tilt);
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler; next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
next next

View File

@ -22,6 +22,9 @@ impl Animation for WieldAnimation {
let speed = Vec2::<f32>::from(velocity).magnitude(); let speed = Vec2::<f32>::from(velocity).magnitude();
*rate = speed; *rate = speed;
let wave_ultra_slow = (anim_time as f32 * 3.0 + PI).sin();
let wave_ultra_slow_cos = (anim_time as f32 * 3.0 + PI).cos();
let wave = (anim_time as f32 * 1.0).sin(); let wave = (anim_time as f32 * 1.0).sin();
let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0).sin(); let wave_stop = (anim_time as f32 * 2.6).min(PI / 2.0).sin();
match active_tool_kind { match active_tool_kind {
@ -84,18 +87,26 @@ impl Animation for WieldAnimation {
next.main.scale = Vec3::one(); next.main.scale = Vec3::one();
} }
Some(Tool::Staff) => { Some(Tool::Staff) => {
next.l_hand.offset = Vec3::new(-6.0, 3.5, 0.0); next.l_hand.offset = Vec3::new(
next.l_hand.ori = Quaternion::rotation_x(-0.3); -6.0 + wave_ultra_slow_cos * 1.0,
next.l_hand.scale = Vec3::one() * 1.01; 1.0 + wave_ultra_slow_cos * 0.5,
next.r_hand.offset = Vec3::new(-6.0, 3.0, -2.0); 5.0 + wave_ultra_slow * 1.0,
next.r_hand.ori = Quaternion::rotation_x(-0.3); );
next.l_hand.ori = Quaternion::rotation_x(1.27);
next.l_hand.scale = Vec3::one() * 1.0;
next.r_hand.offset = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
-1.5 + wave_ultra_slow_cos * 0.5,
-2.0 + wave_ultra_slow * 1.0,
);
next.r_hand.ori = Quaternion::rotation_x(1.27);
next.r_hand.scale = Vec3::one() * 1.01; next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new( next.main.offset = Vec3::new(
-6.0 + skeleton_attr.weapon_x, -6.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0,
4.5 + skeleton_attr.weapon_y, 8.5 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5,
0.0, 17.0 + wave_ultra_slow * 1.0,
); );
next.main.ori = Quaternion::rotation_x(-0.3) next.main.ori = Quaternion::rotation_x(-0.3 + PI)
* Quaternion::rotation_y(0.0) * Quaternion::rotation_y(0.0)
* Quaternion::rotation_z(0.0); * Quaternion::rotation_z(0.0);
next.main.scale = Vec3::one(); next.main.scale = Vec3::one();
@ -118,24 +129,32 @@ impl Animation for WieldAnimation {
next.main.scale = Vec3::one(); next.main.scale = Vec3::one();
} }
Some(Tool::Bow) => { Some(Tool::Bow) => {
next.l_hand.offset = Vec3::new(-4.0, 5.0, 0.0); next.l_hand.offset = Vec3::new(
next.l_hand.ori = Quaternion::rotation_x(0.0) -1.0 - wave_ultra_slow_cos * 1.0,
* Quaternion::rotation_y(-1.9) 3.0 + wave_ultra_slow_cos * 0.5,
* Quaternion::rotation_z(0.85); 5.0 + wave_ultra_slow * 1.0,
);
next.l_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(-0.3)
* Quaternion::rotation_z(0.3);
next.l_hand.scale = Vec3::one() * 1.01; next.l_hand.scale = Vec3::one() * 1.01;
next.r_hand.offset = Vec3::new(2.0, 8.0, -3.5); next.r_hand.offset = Vec3::new(
next.r_hand.ori = Quaternion::rotation_x(0.0) 1.0 + wave_ultra_slow_cos * 1.0,
* Quaternion::rotation_y(-1.7) 8.0 + wave_ultra_slow_cos * 0.5,
* Quaternion::rotation_z(0.85); 2.5 + wave_ultra_slow * 1.0,
);
next.r_hand.ori = Quaternion::rotation_x(PI / 2.0)
* Quaternion::rotation_y(0.3)
* Quaternion::rotation_z(0.3);
next.r_hand.scale = Vec3::one() * 1.01; next.r_hand.scale = Vec3::one() * 1.01;
next.main.offset = Vec3::new( next.main.offset = Vec3::new(
9.0 + skeleton_attr.weapon_x, -4.0 + skeleton_attr.weapon_x + wave_ultra_slow_cos * 1.0,
10.0 + skeleton_attr.weapon_y, 15.0 + skeleton_attr.weapon_y + wave_ultra_slow_cos * 0.5,
-3.0, -4.0 + wave_ultra_slow * 1.0,
); );
next.main.ori = Quaternion::rotation_x(0.0) next.main.ori = Quaternion::rotation_x(0.0)
* Quaternion::rotation_y(-1.7) * Quaternion::rotation_y(0.4)
* Quaternion::rotation_z(0.85); * Quaternion::rotation_z(0.0);
next.main.scale = Vec3::one(); next.main.scale = Vec3::one();
} }
Some(Tool::Dagger) => { Some(Tool::Dagger) => {

View File

@ -151,12 +151,12 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
}, },
tail: match (body.species, body.body_type) { tail: match (body.species, body.body_type) {
(Wolf, _) => (-6.0, -2.0), (Wolf, _) => (-6.0, -2.0),
(Saber, _) => (-5.0, -2.0), (Saber, _) => (-4.0, -2.0),
(Viper, _) => (-6.0, -1.0), (Viper, _) => (-6.0, -1.0),
(Tuskram, _) => (-6.0, -2.0), (Tuskram, _) => (-6.0, -2.0),
(Alligator, _) => (-7.0, -1.0), (Alligator, _) => (-7.0, -1.0),
(Monitor, _) => (-7.0, -1.0), (Monitor, _) => (-7.0, -1.0),
(Lion, _) => (-6.0, -4.0), (Lion, _) => (-8.0, -6.0),
(Tarasque, _) => (-7.0, -2.0), (Tarasque, _) => (-7.0, -2.0),
}, },
torso_back: match (body.species, body.body_type) { torso_back: match (body.species, body.body_type) {
@ -171,12 +171,12 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
}, },
torso_mid: match (body.species, body.body_type) { torso_mid: match (body.species, body.body_type) {
(Wolf, _) => (-7.0, 10.5), (Wolf, _) => (-7.0, 10.5),
(Saber, _) => (-8.0, 9.5), (Saber, _) => (-7.0, 9.5),
(Viper, _) => (-7.0, 7.0), (Viper, _) => (-7.0, 7.0),
(Tuskram, _) => (-7.0, 9.0), (Tuskram, _) => (-7.0, 9.0),
(Alligator, _) => (-7.0, 6.0), (Alligator, _) => (-7.0, 6.0),
(Monitor, _) => (-7.0, 4.0), (Monitor, _) => (-7.0, 4.0),
(Lion, _) => (-7.0, 9.0), (Lion, _) => (-9.0, 9.0),
(Tarasque, _) => (-7.0, 8.0), (Tarasque, _) => (-7.0, 8.0),
}, },
ears: match (body.species, body.body_type) { ears: match (body.species, body.body_type) {
@ -190,7 +190,7 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Tarasque, _) => (1.5, -2.0), (Tarasque, _) => (1.5, -2.0),
}, },
feet_f: match (body.species, body.body_type) { feet_f: match (body.species, body.body_type) {
(Wolf, _) => (5.0, 6.0, 3.0), (Wolf, _) => (5.0, 6.0, 2.0),
(Saber, _) => (4.0, 6.0, 3.0), (Saber, _) => (4.0, 6.0, 3.0),
(Viper, _) => (4.0, 6.0, 3.0), (Viper, _) => (4.0, 6.0, 3.0),
(Tuskram, _) => (4.0, 6.0, 4.5), (Tuskram, _) => (4.0, 6.0, 4.5),
@ -200,8 +200,8 @@ impl<'a> From<&'a comp::quadruped_medium::Body> for SkeletonAttr {
(Tarasque, _) => (4.0, 6.0, 3.0), (Tarasque, _) => (4.0, 6.0, 3.0),
}, },
feet_b: match (body.species, body.body_type) { feet_b: match (body.species, body.body_type) {
(Wolf, _) => (5.0, -4.0, 3.5), (Wolf, _) => (5.0, -4.0, 3.0),
(Saber, _) => (4.0, -4.0, 3.5), (Saber, _) => (4.0, -6.0, 3.5),
(Viper, _) => (4.0, -4.0, 3.5), (Viper, _) => (4.0, -4.0, 3.5),
(Tuskram, _) => (4.0, -8.0, 5.5), (Tuskram, _) => (4.0, -8.0, 5.5),
(Alligator, _) => (4.0, -4.0, 3.5), (Alligator, _) => (4.0, -4.0, 3.5),

View File

@ -17,7 +17,7 @@ impl Animation for RunAnimation {
) -> Self::Skeleton { ) -> Self::Skeleton {
let mut next = (*skeleton).clone(); let mut next = (*skeleton).clone();
let lab = 14; //14.0 let lab = 14;
let vertlf = (anim_time as f32 * lab as f32 + PI * 1.8).sin().max(0.15); let vertlf = (anim_time as f32 * lab as f32 + PI * 1.8).sin().max(0.15);
let vertrfoffset = (anim_time as f32 * lab as f32 + PI * 0.80).sin().max(0.15); let vertrfoffset = (anim_time as f32 * lab as f32 + PI * 0.80).sin().max(0.15);
let vertlboffset = (anim_time as f32 * lab as f32).sin().max(0.15); let vertlboffset = (anim_time as f32 * lab as f32).sin().max(0.15);

View File

@ -146,7 +146,7 @@ impl<'a> From<&'a comp::quadruped_small::Body> for SkeletonAttr {
(Raccoon, _) => (3.0, -2.0, 3.0), (Raccoon, _) => (3.0, -2.0, 3.0),
(Quokka, _) => (3.0, -4.0, 3.0), (Quokka, _) => (3.0, -4.0, 3.0),
(Dodarock, _) => (4.5, -3.0, 4.0), (Dodarock, _) => (4.5, -3.0, 4.0),
(Holladon, _) => (4.0, -4.0, 0.0), (Holladon, _) => (4.0, -4.0, 3.0),
}, },
} }
} }