2019-10-23 02:56:45 +00:00
|
|
|
use super::{
|
|
|
|
super::{Animation, SkeletonAttr},
|
|
|
|
BirdMediumSkeleton,
|
|
|
|
};
|
2019-10-25 23:18:34 +00:00
|
|
|
//use std::{f32::consts::PI, ops::Mul};
|
2019-10-23 02:56:45 +00:00
|
|
|
use vek::*;
|
|
|
|
|
|
|
|
pub struct IdleAnimation;
|
|
|
|
|
|
|
|
impl Animation for IdleAnimation {
|
|
|
|
type Skeleton = BirdMediumSkeleton;
|
|
|
|
type Dependency = (f64);
|
|
|
|
|
|
|
|
fn update_skeleton(
|
|
|
|
skeleton: &Self::Skeleton,
|
2019-10-25 23:18:34 +00:00
|
|
|
_global_time: Self::Dependency,
|
|
|
|
_anim_time: f64,
|
2019-10-23 02:56:45 +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);
|
|
|
|
next.head.scale = Vec3::one() / 10.88;
|
2019-10-23 02:56:45 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.torso.offset = Vec3::new(0.0, 4.5, 2.0);
|
|
|
|
next.torso.ori = Quaternion::rotation_x(0.0);
|
|
|
|
next.torso.scale = Vec3::one() * 1.01;
|
2019-10-23 02:56:45 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.tail.offset = Vec3::new(0.0, 3.1, -4.5);
|
|
|
|
next.tail.ori = Quaternion::rotation_z(0.0);
|
|
|
|
next.tail.scale = Vec3::one() * 0.98;
|
2019-10-23 02:56:45 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.wing_l.offset = Vec3::new(0.0, -13.0, 8.0) / 11.0;
|
|
|
|
next.wing_l.ori = Quaternion::rotation_z(0.0) * Quaternion::rotation_x(0.0);
|
|
|
|
next.wing_l.scale = Vec3::one() / 11.0;
|
2019-10-23 02:56:45 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.wing_r.offset = Vec3::new(0.0, -11.7, 11.0) / 11.0;
|
|
|
|
next.wing_r.ori = Quaternion::rotation_y(0.0);
|
|
|
|
next.wing_r.scale = Vec3::one() / 11.0;
|
2019-10-23 02:56:45 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.leg_l.offset = Vec3::new(0.0, 0.0, 12.0) / 11.0;
|
|
|
|
next.leg_l.ori = Quaternion::rotation_y(0.0);
|
|
|
|
next.leg_l.scale = Vec3::one() / 10.5;
|
2019-10-23 02:56:45 +00:00
|
|
|
|
2019-10-25 23:18:34 +00:00
|
|
|
next.leg_r.offset = Vec3::new(0.0, 0.75, 5.25);
|
|
|
|
next.leg_r.ori = Quaternion::rotation_x(0.0);
|
|
|
|
next.leg_r.scale = Vec3::one() * 1.00;
|
2019-10-23 02:56:45 +00:00
|
|
|
next
|
|
|
|
}
|
|
|
|
}
|