Former-commit-id: 6acf43d8e4c446b3f50a673179b8df20d6da648c
This commit is contained in:
Forest Anderson 2019-05-09 17:30:44 -04:00
parent 30c2972852
commit cf22cb99e7
3 changed files with 12 additions and 7 deletions

View File

@ -12,10 +12,7 @@ use crate::{
pub struct Sys;
impl<'a> System<'a> for Sys {
type SystemData = (
Read<'a, DeltaTime>,
WriteStorage<'a, AnimationHistory>,
);
type SystemData = (Read<'a, DeltaTime>, WriteStorage<'a, AnimationHistory>);
fn run(&mut self, (dt, mut anim_history): Self::SystemData) {
for (mut anim_history) in (&mut anim_history).join() {

View File

@ -1,7 +1,7 @@
pub mod agent;
pub mod anim;
pub mod control;
pub mod phys;
pub mod anim;
// External
use specs::DispatcherBuilder;

View File

@ -29,8 +29,16 @@ impl Animation for IdleAnimation {
let wave_dip = (wave_slow.abs() - 0.5).abs();
let head_look = Vec2::new(
((global_time + anim_time) as f32 / 5.0).floor().mul(7331.0).sin() * 0.5,
((global_time + anim_time) as f32 / 5.0).floor().mul(1337.0).sin() * 0.25,
((global_time + anim_time) as f32 / 5.0)
.floor()
.mul(7331.0)
.sin()
* 0.5,
((global_time + anim_time) as f32 / 5.0)
.floor()
.mul(1337.0)
.sin()
* 0.25,
);
next.head.offset = Vec3::new(5.5, 2.0, 11.5 + waveultra_slow * 0.4);
next.head.ori = Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y);