diff --git a/assets/voxygen/voxel/belt.vox b/assets/voxygen/voxel/belt.vox index 41b283b6ea..c3f6db572d 100644 --- a/assets/voxygen/voxel/belt.vox +++ b/assets/voxygen/voxel/belt.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c2e5445d2f4338b00ad1a69fafab99c5ad13edc26de817cc1b6ce3c615a44635 +oid sha256:9a321c80f87a239ce9a4de743a889b31ebb57831acfcb6fc77928c9b26700df2 size 1544 diff --git a/assets/voxygen/voxel/chest.vox b/assets/voxygen/voxel/chest.vox index 86794fabaf..9af67e7cbc 100644 --- a/assets/voxygen/voxel/chest.vox +++ b/assets/voxygen/voxel/chest.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9c7c93fd3a28611bc93ba532d39fbbec594c21ab2f91a9925e11f15bb13a5371 -size 45499 +oid sha256:200cdedef555fa03b7761e0a3a4209de76851f007b6b137bd77925a49051e560 +size 2392 diff --git a/assets/voxygen/voxel/foot.vox b/assets/voxygen/voxel/foot.vox index e2478167a1..c2e2dce585 100644 --- a/assets/voxygen/voxel/foot.vox +++ b/assets/voxygen/voxel/foot.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e9e0a34b70a5d4a1bddb306dfac354a95f3ce924f74484ebec4c8599c9caf70 +oid sha256:dcf8aa1a237dba07f8e078a71612d7ab44412a12950964a1d92856eaf5f2db62 size 44523 diff --git a/assets/voxygen/voxel/head.vox b/assets/voxygen/voxel/head.vox index 04e2fe94a3..0ebfea4bf0 100644 --- a/assets/voxygen/voxel/head.vox +++ b/assets/voxygen/voxel/head.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:479fcf40c20598bf284dca6fab690a351abc5a9b47d841f604667799f5c76c31 -size 48059 +oid sha256:57c31358507b87f7c88e18a54466f97e4f2603427dcd4892e14bfa38a4fa3dda +size 4608 diff --git a/assets/voxygen/voxel/pants.vox b/assets/voxygen/voxel/pants.vox index eb492cc6c8..0913ab44b5 100644 --- a/assets/voxygen/voxel/pants.vox +++ b/assets/voxygen/voxel/pants.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:365dbba45692d85df10dd9fb0d89b318f6f63bb3f713767ae0f75b63110164fe -size 44891 +oid sha256:d73f412dc1f75af7cb0fcd7a46d02c464d1bcde6fc6143827c3bfec4276f61ad +size 1784 diff --git a/assets/voxygen/voxel/sword.vox b/assets/voxygen/voxel/sword.vox index b203a5e297..3cc01d1cbc 100644 --- a/assets/voxygen/voxel/sword.vox +++ b/assets/voxygen/voxel/sword.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2eab472ba789f881e5abe85f5a5bf55a2bb178fdcbebbb735453621f16a63b55 +oid sha256:e458a391915d1381c5c8f995da96310e521a441d0e14e67bcacad423ffc68857 size 1568 diff --git a/voxygen/src/anim/character/idle.rs b/voxygen/src/anim/character/idle.rs index 38eebbd4d5..fe793d736d 100644 --- a/voxygen/src/anim/character/idle.rs +++ b/voxygen/src/anim/character/idle.rs @@ -24,62 +24,62 @@ impl Animation for IdleAnimation { let waveultracos_slow = (anim_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); - next.head.ori = Quaternion::rotation_y(waveultra_slow * 0.05); + next.head.offset = Vec3::new(5.5, 2.0, 11.5 + waveultra_slow * 0.4); + next.head.ori = Quaternion::rotation_x(waveultra_slow * 0.05); next.head.scale = Vec3::one(); - 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.offset = Vec3::new(5.5, 0.0, 7.5 + waveultra_slow * 0.4); + next.chest.ori = Quaternion::rotation_x(0.0); next.chest.scale = Vec3::one(); - 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.offset = Vec3::new(5.5, 0.0, 5.5 + waveultra_slow * 0.4); + next.belt.ori = Quaternion::rotation_x(0.0); next.belt.scale = Vec3::one(); - 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.offset = Vec3::new(5.5, 0.0, 2.5 + waveultra_slow * 0.4); + next.shorts.ori = Quaternion::rotation_x(0.0); 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, + -7.5, -2.0 + waveultracos_slow * 0.3, + + 12.0 + waveultra_slow * 1.1, ); - next.l_hand.ori = Quaternion::rotation_y(0.0 + waveultra_slow * 0.06); + next.l_hand.ori = Quaternion::rotation_x(0.0 + waveultra_slow * 0.06); next.l_hand.scale = Vec3::one(); next.r_hand.offset = Vec3::new( - 2.0 + waveultracos_slow * 0.3, - -7.5, - 12.5 + waveultra_slow * 1.1, + 7.5, -2.0 + waveultracos_slow * 0.3, + + 12.0 + waveultra_slow * 1.1, ); - next.r_hand.ori = Quaternion::rotation_y(0.0 + waveultra_slow * 0.06); + next.r_hand.ori = Quaternion::rotation_x(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.l_foot.offset = Vec3::new(-3.4, 0.0, 8.0); + next.l_foot.ori = Quaternion::rotation_x(-0.04 - waveultra_slow * 0.04); 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.offset = Vec3::new(3.4, 0.0, 8.0); + next.r_foot.ori = Quaternion::rotation_x(-0.04 - waveultra_slow * 0.04); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-4.5, 14.0, 13.0); - next.weapon.ori = Quaternion::rotation_x(2.5); + next.weapon.offset = Vec3::new(-5.0, -6.0, 18.5); + next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.scale = Vec3::one(); - next.torso.offset = Vec3::new(-0.5, 0.0, 0.0); - next.torso.ori = Quaternion::rotation_y(0.0); + next.torso.offset = Vec3::new(-0.5, 0.0, 0.1); + next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0; next.l_shoulder.offset = Vec3::new(2.9, 6.0, 18.0); - next.l_shoulder.ori = Quaternion::rotation_y(0.0); + next.l_shoulder.ori = Quaternion::rotation_x(0.0); next.l_shoulder.scale = Vec3::one(); next.r_shoulder.offset = Vec3::new(2.9, -6.0, 18.0); - next.r_shoulder.ori = Quaternion::rotation_y(0.0); + next.r_shoulder.ori = Quaternion::rotation_x(0.0); next.r_shoulder.scale = Vec3::one(); next } -} +} \ No newline at end of file diff --git a/voxygen/src/anim/character/jump.rs b/voxygen/src/anim/character/jump.rs new file mode 100644 index 0000000000..eb51a583a7 --- /dev/null +++ b/voxygen/src/anim/character/jump.rs @@ -0,0 +1,80 @@ +// Standard +use std::f32::consts::PI; + +// Library +use vek::*; + +// Local +use super::{super::Animation, CharacterSkeleton, SCALE}; +// + +pub struct JumpAnimation; + +impl Animation for JumpAnimation { + type Skeleton = CharacterSkeleton; + type Dependency = f64; + + fn update_skeleton(skeleton: &Self::Skeleton, global_time: f64, anim_time: f64) -> Self::Skeleton { + let mut next = (*skeleton).clone(); + let wave = (anim_time as f32 * 14.0).sin(); + let arcwave = (1.0f32.ln_1p() - 1.0).abs(); + let wavetest = (wave.cbrt()); + let fuzzwave = (anim_time as f32 * 12.0).sin(); + let wavecos = (anim_time as f32 * 14.0).cos(); + let wave_slow = (anim_time as f32 * 5.0 + PI).sin(); + let wave_slowtest = (anim_time as f32).min(PI/2.0).sin(); + let wavecos_slow = (anim_time as f32 * 8.0 + PI).cos(); + let wave_dip = (wave_slow.abs() - 0.5).abs(); + let mult = wave_slow / (wave_slow.abs()); + + next.head.offset = Vec3::new(5.5, 2.0, 12.0); + next.head.ori = Quaternion::rotation_x(0.15); + next.head.scale = Vec3::one(); + + next.chest.offset = Vec3::new(5.5, 0.0, 8.0); + next.chest.ori = Quaternion::rotation_z(0.0); + next.chest.scale = Vec3::one(); + + next.belt.offset = Vec3::new(5.5, 0.0, 6.0); + next.belt.ori = Quaternion::rotation_z(0.0); + next.belt.scale = Vec3::one(); + + next.shorts.offset = Vec3::new(5.5, 0.0, 3.0); + next.shorts.ori = Quaternion::rotation_z(0.0); + next.shorts.scale = Vec3::one(); + + next.l_hand.offset = Vec3::new(-7.5, -2.0, 12.0); + next.l_hand.ori = Quaternion::rotation_x(0.8); + next.l_hand.scale = Vec3::one(); + + next.r_hand.offset = Vec3::new(7.5, -2.0, 12.0); + next.r_hand.ori = Quaternion::rotation_x(-0.8); + next.r_hand.scale = Vec3::one(); + + next.l_foot.offset = Vec3::new(-3.4, 1.0, 6.0); + next.l_foot.ori = Quaternion::rotation_x(wave_slow * -1.2); + next.l_foot.scale = Vec3::one(); + + next.r_foot.offset = Vec3::new(3.4, -1.0, 6.0); + next.r_foot.ori = Quaternion::rotation_x(wave_slow * 1.2); + next.r_foot.scale = Vec3::one(); + + next.weapon.offset = Vec3::new(-5.0, -6.0, 19.0); + next.weapon.ori = Quaternion::rotation_y(2.5); + next.weapon.scale = Vec3::one(); + + next.torso.offset = Vec3::new(-0.5, 0.0, 0.2); + next.torso.ori = Quaternion::rotation_x(0.0); + next.torso.scale = Vec3::one() / 11.0; + + 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(); + + 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(); + + next + } +} diff --git a/voxygen/src/anim/character/mod.rs b/voxygen/src/anim/character/mod.rs index c0f15f1da3..26083a4184 100644 --- a/voxygen/src/anim/character/mod.rs +++ b/voxygen/src/anim/character/mod.rs @@ -1,10 +1,11 @@ pub mod idle; pub mod run; +pub mod jump; // Reexports pub use self::idle::IdleAnimation; pub use self::run::RunAnimation; - +pub use self::jump::JumpAnimation; // Crate use crate::render::FigureBoneData; diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index 52f83127d4..07bb32737f 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -24,44 +24,44 @@ impl Animation for RunAnimation { let wavecos_slow = (anim_time as f32 * 8.0 + PI).cos(); let wave_dip = (wave_slow.abs() - 0.5).abs(); - next.head.offset = Vec3::new(6.0, 0.0, 12.0 + wavecos * 1.3); - next.head.ori = Quaternion::rotation_y(-0.15); + next.head.offset = Vec3::new(5.5, 2.0, 12.0 + wavecos * 1.3); + next.head.ori = Quaternion::rotation_x(0.15); next.head.scale = Vec3::one(); - next.chest.offset = Vec3::new(2.5, 0.0, 8.0 + wavecos * 1.1); + next.chest.offset = Vec3::new(5.5, 0.0, 8.0 + wavecos * 1.1); next.chest.ori = Quaternion::rotation_z(wave * 0.1); next.chest.scale = Vec3::one(); - next.belt.offset = Vec3::new(2.5, 0.0, 6.0 + wavecos * 1.1); + next.belt.offset = Vec3::new(5.5, 0.0, 6.0 + wavecos * 1.1); next.belt.ori = Quaternion::rotation_z(wave * 0.25); next.belt.scale = Vec3::one(); - next.shorts.offset = Vec3::new(2.5, 0.0, 3.0 + wavecos * 1.1); + next.shorts.offset = Vec3::new(5.5, 0.0, 3.0 + wavecos * 1.1); next.shorts.ori = Quaternion::rotation_z(wave * 0.6); next.shorts.scale = Vec3::one(); - 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.offset = Vec3::new(-7.5, -2.0 + wavecos * 2.5, 12.0 - wave * 1.5); + next.l_hand.ori = Quaternion::rotation_x(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); - next.r_hand.ori = Quaternion::rotation_y(wavecos * -0.9); + next.r_hand.offset = Vec3::new(7.5, -2.0 - wavecos * 2.5, 12.0 + wave * 1.5); + next.r_hand.ori = Quaternion::rotation_x(wavecos * -0.9); next.r_hand.scale = Vec3::one(); - 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.offset = Vec3::new(-3.4, 0.0 + wave * 1.0, 6.0); + next.l_foot.ori = Quaternion::rotation_x(-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); - next.r_foot.ori = Quaternion::rotation_y(-0.0 + wave * 1.5); + next.r_foot.offset = Vec3::new(3.4, 0.0 - wave * 1.0, 6.0); + next.r_foot.ori = Quaternion::rotation_x(-0.0 + wave * 1.5); next.r_foot.scale = Vec3::one(); - next.weapon.offset = Vec3::new(-5.0, 14.0, 13.0); - next.weapon.ori = Quaternion::rotation_x(2.5); + next.weapon.offset = Vec3::new(-5.0, -6.0, 19.0); + next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.scale = Vec3::one(); - next.torso.offset = Vec3::new(-0.5, 0.0, 0.0); - next.torso.ori = Quaternion::rotation_y(0.25 + wavecos * 0.1); + next.torso.offset = Vec3::new(-0.5, 0.0, 0.2); + next.torso.ori = Quaternion::rotation_x(-0.25 - wavecos * 0.1); next.torso.scale = Vec3::one() / 11.0; next.l_shoulder.offset = Vec3::new(3.0, 6.0, 18.0); diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 4e600e3ff6..f5e74cf124 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -1,6 +1,6 @@ use crate::{ anim::{ - character::{CharacterSkeleton, IdleAnimation, RunAnimation}, + character::{CharacterSkeleton, IdleAnimation, RunAnimation, JumpAnimation}, Animation, Skeleton, }, mesh::Meshable, @@ -110,7 +110,7 @@ impl FigureCache { match head { Head::DefaultHead => "head.vox", }, - Vec3::new(-7.5, -8.0, 0.0), + Vec3::new(-7.0, -5.5, -6.0), ) } @@ -119,7 +119,7 @@ impl FigureCache { match chest { Chest::DefaultChest => "chest.vox", }, - Vec3::new(-2.5, -6.0, 0.0), + Vec3::new(-6.0, -3.5, 0.0), ) } @@ -128,7 +128,7 @@ impl FigureCache { match belt { Belt::DefaultBelt => "belt.vox", }, - Vec3::new(-2.5, -5.0, 0.0), + Vec3::new(-5.0, -3.5, 0.0), ) } @@ -137,7 +137,7 @@ impl FigureCache { match pants { Pants::DefaultPants => "pants.vox", }, - Vec3::new(-2.5, -5.0, 0.0), + Vec3::new(-5.0, -3.5, 0.0), ) } @@ -146,7 +146,7 @@ impl FigureCache { match hand { Hand::DefaultHand => "hand.vox", }, - Vec3::new(0.0, -2.0, -7.0), + Vec3::new(3.5, 0.0, -7.0), ) } @@ -155,7 +155,7 @@ impl FigureCache { match hand { Hand::DefaultHand => "hand.vox", }, - Vec3::new(0.0, -2.0, -7.0), + Vec3::new(3.5, 0.0, -7.0), ) } @@ -164,7 +164,7 @@ impl FigureCache { match foot { Foot::DefaultFoot => "foot.vox", }, - Vec3::new(-3.5, -2.5, -8.0), + Vec3::new(2.5, -3.5, -9.0), ) } @@ -173,7 +173,7 @@ impl FigureCache { match foot { Foot::DefaultFoot => "foot.vox", }, - Vec3::new(-3.5, -2.5, -8.0), + Vec3::new(2.5, -3.5, -9.0), ) } @@ -213,10 +213,10 @@ impl FigureCache { RunAnimation::update_skeleton(&mut state.skeleton, time, animation_history.time) }, comp::character::Animation::Jump => { + JumpAnimation::update_skeleton(&mut state.skeleton, time, animation_history.time) + }, // TODO // JumpAnimation::update_skeleton(&mut state.skeleton, time) - state.skeleton.clone() - }, }; state.skeleton.interpolate(&target_skeleton); @@ -267,7 +267,7 @@ impl FigureState { fn update(&mut self, renderer: &mut Renderer, pos: Vec3, dir: Vec3) { let mat = Mat4::::identity() * Mat4::translation_3d(pos) - * Mat4::rotation_z(-dir.x.atan2(dir.y) + f32::consts::PI / 2.0); + * Mat4::rotation_z(-dir.x.atan2(dir.y));// + f32::consts::PI / 2.0); let locals = FigureLocals::new(mat); renderer.update_consts(&mut self.locals, &[locals]).unwrap(); diff --git a/voxygen/src/singleplayer.rs b/voxygen/src/singleplayer.rs index 364646ac24..ee958bb86c 100644 --- a/voxygen/src/singleplayer.rs +++ b/voxygen/src/singleplayer.rs @@ -26,7 +26,7 @@ impl Singleplayer { pub fn new() -> (Self, SocketAddr) { let (sender, reciever) = channel(); - let sock = SocketAddr::from(([0; 4], pick_unused_port() + let sock = SocketAddr::from(([127,0,0,1], pick_unused_port() .expect("Failed to find unused port"))); let sock2 = sock.clone();