2020-01-26 00:22:48 +00:00
|
|
|
use super::{super::Animation, BipedLargeSkeleton, SkeletonAttr};
|
2019-10-25 23:18:34 +00:00
|
|
|
//use std::{f32::consts::PI, ops::Mul};
|
2019-10-24 01:10:26 +00:00
|
|
|
use vek::*;
|
|
|
|
|
|
|
|
pub struct IdleAnimation;
|
|
|
|
|
|
|
|
impl Animation for IdleAnimation {
|
|
|
|
type Skeleton = BipedLargeSkeleton;
|
2019-11-04 17:26:32 +00:00
|
|
|
type Dependency = f64;
|
2019-10-24 01:10:26 +00:00
|
|
|
|
|
|
|
fn update_skeleton(
|
|
|
|
skeleton: &Self::Skeleton,
|
2019-10-25 23:18:34 +00:00
|
|
|
_global_time: Self::Dependency,
|
|
|
|
_anim_time: f64,
|
2019-10-24 01:10:26 +00:00
|
|
|
_rate: &mut f32,
|
|
|
|
_skeleton_attr: &SkeletonAttr,
|
|
|
|
) -> Self::Skeleton {
|
|
|
|
let mut next = (*skeleton).clone();
|
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.head.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.head.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.head.scale = Vec3::one() / 11.0;
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.upper_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.upper_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.upper_torso.scale = Vec3::one() / 11.0;
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.lower_torso.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.lower_torso.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.lower_torso.scale = Vec3::one();
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.shoulder_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.shoulder_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.shoulder_l.scale = Vec3::one();
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.shoulder_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.shoulder_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.shoulder_r.scale = Vec3::one();
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.hand_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.hand_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.hand_l.scale = Vec3::one();
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.hand_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.hand_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.hand_r.scale = Vec3::one();
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.leg_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.leg_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.leg_l.scale = Vec3::one() / 11.0;
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.leg_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.leg_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
|
|
|
next.leg_r.scale = Vec3::one() / 10.88;
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.foot_l.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.foot_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.foot_l.scale = Vec3::one();
|
2019-10-24 01:10:26 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.foot_r.offset = Vec3::new(0.0, 7.5, 15.0) / 11.0;
|
|
|
|
next.foot_r.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
2020-01-26 00:22:48 +00:00
|
|
|
next.foot_r.scale = Vec3::one();
|
2019-10-24 01:10:26 +00:00
|
|
|
next
|
|
|
|
}
|
|
|
|
}
|