diff --git a/common/src/sys/control.rs b/common/src/sys/control.rs index f0ae77a610..e29b1827d1 100644 --- a/common/src/sys/control.rs +++ b/common/src/sys/control.rs @@ -40,7 +40,7 @@ impl<'a> System<'a> for Sys { if on_ground { // TODO: Don't hard-code this // Apply physics to the player: acceleration and non-linear decceleration - vel.0 += control.move_dir * 2.0 - vel.0.map(|e| e * e.abs() + e) * 0.03; + vel.0 += control.move_dir * 4.0 - vel.0.map(|e| e * e.abs() + e) * 0.05; if control.jumping { vel.0.z += 16.0; @@ -48,7 +48,7 @@ impl<'a> System<'a> for Sys { } else { // TODO: Don't hard-code this // Apply physics to the player: acceleration and non-linear decceleration - vel.0 += control.move_dir * 0.2; + vel.0 += control.move_dir * 0.2 - vel.0.map(|e| e * e.abs() + e) * 0.002; } let animation = if on_ground { diff --git a/common/src/sys/phys.rs b/common/src/sys/phys.rs index 377b7c59b9..0de3578576 100644 --- a/common/src/sys/phys.rs +++ b/common/src/sys/phys.rs @@ -34,9 +34,9 @@ impl<'a> System<'a> for Sys { .get(pos.0.map(|e| e.floor() as i32)) .map(|vox| !vox.is_empty()) .unwrap_or(false) - && i < 80 + && i < 100 { - pos.0.z += 0.005; + pos.0.z += 0.0025; vel.0.z = 0.0; i += 1; } diff --git a/voxygen/src/anim/character/idle.rs b/voxygen/src/anim/character/idle.rs index fe793d736d..1792447ecc 100644 --- a/voxygen/src/anim/character/idle.rs +++ b/voxygen/src/anim/character/idle.rs @@ -42,7 +42,7 @@ impl Animation for IdleAnimation { next.l_hand.offset = Vec3::new( -7.5, -2.0 + waveultracos_slow * 0.3, - + 12.0 + waveultra_slow * 1.1, ); next.l_hand.ori = Quaternion::rotation_x(0.0 + waveultra_slow * 0.06); @@ -50,7 +50,7 @@ impl Animation for IdleAnimation { next.r_hand.offset = Vec3::new( 7.5, -2.0 + waveultracos_slow * 0.3, - + 12.0 + waveultra_slow * 1.1, ); next.r_hand.ori = Quaternion::rotation_x(0.0 + waveultra_slow * 0.06); @@ -68,7 +68,7 @@ impl Animation for IdleAnimation { next.weapon.ori = Quaternion::rotation_y(2.5); next.weapon.scale = Vec3::one(); - next.torso.offset = Vec3::new(-0.5, 0.0, 0.1); + next.torso.offset = Vec3::new(-0.5, -0.2, 0.1); next.torso.ori = Quaternion::rotation_x(0.0); next.torso.scale = Vec3::one() / 11.0; @@ -82,4 +82,4 @@ impl Animation for IdleAnimation { next } -} \ No newline at end of file +} diff --git a/voxygen/src/anim/character/jump.rs b/voxygen/src/anim/character/jump.rs index eb51a583a7..139c26c662 100644 --- a/voxygen/src/anim/character/jump.rs +++ b/voxygen/src/anim/character/jump.rs @@ -16,12 +16,12 @@ impl Animation for JumpAnimation { 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 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_slow = (anim_time as f32 * 5.0 + PI).min(PI / 2.0).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(); diff --git a/voxygen/src/anim/character/run.rs b/voxygen/src/anim/character/run.rs index 07bb32737f..66d2e3e763 100644 --- a/voxygen/src/anim/character/run.rs +++ b/voxygen/src/anim/character/run.rs @@ -11,9 +11,9 @@ pub struct RunAnimation; impl Animation for RunAnimation { type Skeleton = CharacterSkeleton; - type Dependency = f64; + type Dependency = (f32, f64); - fn update_skeleton(skeleton: &Self::Skeleton, global_time: f64, anim_time: f64) -> Self::Skeleton { + fn update_skeleton(skeleton: &Self::Skeleton, (velocity, global_time): Self::Dependency, anim_time: f64) -> Self::Skeleton { let mut next = (*skeleton).clone(); let wave = (anim_time as f32 * 14.0).sin(); @@ -60,8 +60,8 @@ impl Animation for RunAnimation { 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.25 - wavecos * 0.1); + next.torso.offset = Vec3::new(-0.5, -0.2, 0.2); + next.torso.ori = Quaternion::rotation_x( - velocity * 0.05 - 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 f5e74cf124..56188598c7 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -191,9 +191,10 @@ impl FigureCache { pub fn maintain(&mut self, renderer: &mut Renderer, client: &mut Client) { let time = client.state().get_time(); let ecs = client.state_mut().ecs_mut(); - for (entity, pos, dir, character, animation_history) in ( + for (entity, pos, vel, dir, character, animation_history) in ( &ecs.entities(), &ecs.read_storage::(), + &ecs.read_storage::(), &ecs.read_storage::(), &ecs.read_storage::(), &ecs.read_storage::(), @@ -210,13 +211,11 @@ impl FigureCache { IdleAnimation::update_skeleton(&mut state.skeleton, time, animation_history.time) }, comp::character::Animation::Run => { - RunAnimation::update_skeleton(&mut state.skeleton, time, animation_history.time) + RunAnimation::update_skeleton(&mut state.skeleton, (vel.0.magnitude(), 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.interpolate(&target_skeleton); diff --git a/world/src/lib.rs b/world/src/lib.rs index a4ea59cfaa..745da01485 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -53,7 +53,7 @@ impl World { let chaos = chaos_nz.get(Vec2::from(wposf * chaos_freq).into_array()).max(0.0) + 0.5; let height = perlin_nz.get(Vec2::from(wposf * freq).into_array()) * ampl * chaos - + perlin_nz.get(Vec2::from(wposf * small_freq).into_array()) * small_ampl * chaos + + perlin_nz.get((wposf * small_freq).into_array()) * small_ampl * chaos + offs; let temp = (temp_nz.get(Vec2::from(wposf * (1.0 / 64.0)).into_array()) + 1.0) * 0.5;