simplified scaling code

Former-commit-id: 3f85bf6aef1f3931570fafb8b2aa5b0dc26f8fad
This commit is contained in:
jshipsey 2019-04-23 20:36:33 -04:00
parent 4d0660affb
commit 97603120a2
2 changed files with 46 additions and 35 deletions

View File

@ -32,31 +32,38 @@ impl Animation for IdleAnimation {
let waveultracos_slow = (time as f32 * 1.0 + PI).cos();
let wave_dip = (wave_slow.abs() - 0.5).abs();
next.head.offset = Vec3::new(5.5, 0.0, 12.0 + waveultra_slow * 0.4) / SCALE;
next.head.offset = Vec3::new(5.5, 0.0, 12.0 + waveultra_slow * 0.4);
next.head.ori = Quaternion::rotation_y(waveultra_slow * 0.05);
next.head.scale = Vec3::one() / SCALE;
next.head.scale = Vec3::one();
next.chest.offset = Vec3::new(2.5, 0.0, 8.0 + waveultra_slow * 0.4) / SCALE;
next.chest.offset = Vec3::new(2.5, 0.0, 8.0 + waveultra_slow * 0.4);
next.chest.ori = Quaternion::rotation_y(0.0);
next.chest.scale = Vec3::one() / SCALE;
next.chest.scale = Vec3::one();
next.belt.offset = Vec3::new(2.5, 0.0, 6.0 + waveultra_slow * 0.4) / SCALE;
next.belt.offset = Vec3::new(2.5, 0.0, 6.0 + waveultra_slow * 0.4);
next.belt.ori = Quaternion::rotation_y(0.0);
next.belt.scale = Vec3::one() / SCALE;
next.belt.scale = Vec3::one();
next.shorts.offset = Vec3::new(2.5, 0.0, 3.0 + waveultra_slow * 0.4) / SCALE;
next.shorts.offset = Vec3::new(2.5, 0.0, 3.0 + waveultra_slow * 0.4);
next.shorts.ori = Quaternion::rotation_y(0.0);
next.shorts.scale = Vec3::one() / SCALE;
next.shorts.scale = Vec3::one();
next.l_hand.offset = Vec3::new(2.0 + waveultracos_slow * 0.3, 7.5, 12.5 + waveultra_slow * 1.1) / SCALE;
next.l_hand.offset = Vec3::new(2.0 + waveultracos_slow * 0.3, 7.5, 12.5 + waveultra_slow * 1.1);
next.l_hand.ori = Quaternion::rotation_y(0.0 + waveultra_slow * 0.06);
next.r_hand.offset = Vec3::new(2.0 + waveultracos_slow * 0.3 , - 7.5, 12.5 + waveultra_slow * 1.1) / SCALE;
next.r_hand.ori = Quaternion::rotation_y(0.0 + waveultra_slow * 0.06);
next.l_hand.scale = Vec3::one();
next.l_foot.offset = Vec3::new(5.0, 3.4, 8.0) / SCALE;
next.r_hand.offset = Vec3::new(2.0 + waveultracos_slow * 0.3 , - 7.5, 12.5 + waveultra_slow * 1.1);
next.r_hand.ori = Quaternion::rotation_y(0.0 + waveultra_slow * 0.06);
next.r_hand.scale = Vec3::one();
next.l_foot.offset = Vec3::new(5.0, 3.4, 8.0);
next.l_foot.ori = Quaternion::rotation_y(0.04 + waveultra_slow * 0.04);
next.r_foot.offset = Vec3::new(5.0, -3.4, 8.0) / SCALE;
next.l_foot.scale = Vec3::one();
next.r_foot.offset = Vec3::new(5.0, -3.4, 8.0);
next.r_foot.ori = Quaternion::rotation_y(0.04 + waveultra_slow * 0.04);
next.r_foot.scale = Vec3::one();
next.back.offset = Vec3::new(-4.5, 14.0, 13.0);
next.back.ori = Quaternion::rotation_x(2.5);
@ -65,15 +72,15 @@ impl Animation for IdleAnimation {
next.torso.offset = Vec3::new(0.0, 0.0, 0.0);
next.torso.ori = Quaternion::rotation_y(0.0);
next.torso.scale = Vec3::one();
next.torso.scale = Vec3::one() / 11.0;
next.l_shoulder.offset = Vec3::new(2.9, 6.0, 18.0) / SCALE;
next.l_shoulder.offset = Vec3::new(2.9, 6.0, 18.0);
next.l_shoulder.ori = Quaternion::rotation_y(0.0);
next.l_shoulder.scale = Vec3::one() / SCALE;
next.l_shoulder.scale = Vec3::one();
next.r_shoulder.offset = Vec3::new(2.9, -6.0, 18.0) / SCALE;
next.r_shoulder.offset = Vec3::new(2.9, -6.0, 18.0);
next.r_shoulder.ori = Quaternion::rotation_y(0.0);
next.r_shoulder.scale = Vec3::one() / SCALE;
next.r_shoulder.scale = Vec3::one();
next
}

View File

@ -32,32 +32,37 @@ impl Animation for RunAnimation {
let wave_dip = (wave_slow.abs() - 0.5).abs();
next.head.offset = Vec3::new(6.0, 0.0, 12.0 + wavecos * 1.3) / SCALE;
next.head.offset = Vec3::new(6.0, 0.0, 12.0 + wavecos * 1.3); // / SCALE;
next.head.ori = Quaternion::rotation_y(-0.15);
next.head.scale = Vec3::one(); // / SCALE;
next.chest.offset = Vec3::new(2.5, 0.0, 8.0 + wavecos * 1.1) / SCALE;
next.chest.offset = Vec3::new(2.5, 0.0, 8.0 + wavecos * 1.1);
next.chest.ori = Quaternion::rotation_z(wave * 0.1);
next.chest.scale = Vec3::one() / SCALE;
next.chest.scale = Vec3::one();
next.belt.offset = Vec3::new(2.5, 0.0, 6.0 + wavecos * 1.1) / SCALE;
next.belt.offset = Vec3::new(2.5, 0.0, 6.0 + wavecos * 1.1);
next.belt.ori = Quaternion::rotation_z(wave * 0.25);
next.belt.scale = Vec3::one() /SCALE;
next.belt.scale = Vec3::one();
next.shorts.offset = Vec3::new(2.5, 0.0, 3.0 + wavecos * 1.1) / SCALE;
next.shorts.offset = Vec3::new(2.5, 0.0, 3.0 + wavecos * 1.1);
next.shorts.ori = Quaternion::rotation_z(wave * 0.6);
next.shorts.scale = Vec3::one() /SCALE;
next.shorts.scale = Vec3::one();
next.l_hand.offset = Vec3::new(2.0 - wavecos * 2.5, 7.5, 12.0 + wave * 1.5) / SCALE;
next.l_hand.offset = Vec3::new(2.0 - wavecos * 2.5, 7.5, 12.0 + wave * 1.5);
next.l_hand.ori = Quaternion::rotation_y(wavecos * 0.9);
next.l_hand.scale = Vec3::one();
next.r_hand.offset = Vec3::new(2.0 + wavecos * 2.5, -7.5, 12.0 - wave * 1.5) / SCALE;
next.r_hand.offset = Vec3::new(2.0 + wavecos * 2.5, -7.5, 12.0 - wave * 1.5);
next.r_hand.ori = Quaternion::rotation_y(wavecos * -0.9);
next.r_hand.scale = Vec3::one();
next.l_foot.offset = Vec3::new(3.5 + wave * 1.0, 3.4, 6.0) / SCALE;
next.l_foot.offset = Vec3::new(3.5 + wave * 1.0, 3.4, 6.0);
next.l_foot.ori = Quaternion::rotation_y(-0.0 - wave * 1.5);
next.l_foot.scale = Vec3::one();
next.r_foot.offset = Vec3::new(3.5 - wave * 1.0, -3.4, 6.0) / SCALE;
next.r_foot.offset = Vec3::new(3.5 - wave * 1.0, -3.4, 6.0);
next.r_foot.ori = Quaternion::rotation_y(-0.0 + wave * 1.5);
next.r_foot.scale = Vec3::one();
next.back.offset = Vec3::new(-5.0, 14.0, 13.0);
next.back.ori = Quaternion::rotation_x(2.5);
@ -65,17 +70,16 @@ impl Animation for RunAnimation {
next.torso.offset = Vec3::new(0.0, 0.0, 0.0);
next.torso.ori = Quaternion::rotation_y(0.25 + wavecos * 0.1);
next.torso.scale = Vec3::one();
next.torso.scale = Vec3::one() / 11.0;
next.l_shoulder.offset = Vec3::new(3.0, 6.0, 18.0) / SCALE;
next.l_shoulder.offset = Vec3::new(3.0, 6.0, 18.0);
next.l_shoulder.ori = Quaternion::rotation_y(0.0);
next.l_shoulder.scale = Vec3::one() / SCALE;
next.l_shoulder.scale = Vec3::one();
next.r_shoulder.offset = Vec3::new(3.0, -6.0, 18.0) / SCALE;
next.r_shoulder.offset = Vec3::new(3.0, -6.0, 18.0);
next.r_shoulder.ori = Quaternion::rotation_y(0.0);
next.r_shoulder.scale = Vec3::one() / SCALE; //???why are shoulder scales like this
next.r_shoulder.scale = Vec3::one();
next