mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Smoother movement, Space for climbing
This commit is contained in:
parent
4bbc340f52
commit
707b79f2c8
@ -13,7 +13,7 @@ use vek::*;
|
||||
|
||||
pub const ROLL_DURATION: Duration = Duration::from_millis(600);
|
||||
|
||||
const HUMANOID_ACCEL: f32 = 70.0;
|
||||
const HUMANOID_ACCEL: f32 = 50.0;
|
||||
const HUMANOID_SPEED: f32 = 120.0;
|
||||
const HUMANOID_AIR_ACCEL: f32 = 10.0;
|
||||
const HUMANOID_AIR_SPEED: f32 = 100.0;
|
||||
@ -163,7 +163,7 @@ impl<'a> System<'a> for Sys {
|
||||
ori.0 = vek::ops::Slerp::slerp(
|
||||
ori.0,
|
||||
ori_dir.into(),
|
||||
if physics.on_ground { 12.0 } else { 2.0 } * dt.0,
|
||||
if physics.on_ground { 9.0 } else { 2.0 } * dt.0,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ const BOUYANCY: f32 = 0.0;
|
||||
// amount an object will slow down within 1/60th of a second. Eg. if the frction
|
||||
// is 0.01, and the speed is 1.0, then after 1/60th of a second the speed will
|
||||
// be 0.99. after 1 second the speed will be 0.54, which is 0.99 ^ 60.
|
||||
const FRIC_GROUND: f32 = 0.125;
|
||||
const FRIC_GROUND: f32 = 0.08;
|
||||
const FRIC_AIR: f32 = 0.0125;
|
||||
const FRIC_FLUID: f32 = 0.2;
|
||||
|
||||
|
@ -161,6 +161,7 @@ impl Scene {
|
||||
self.figure_state.update(
|
||||
renderer,
|
||||
Vec3::zero(),
|
||||
Vec3::zero(),
|
||||
Vec3::new(self.char_ori.sin(), -self.char_ori.cos(), 0.0),
|
||||
1.0,
|
||||
Rgba::broadcast(1.0),
|
||||
|
@ -257,6 +257,7 @@ impl FigureMgr {
|
||||
state.update(
|
||||
renderer,
|
||||
pos.0,
|
||||
vel.0,
|
||||
ori.0,
|
||||
scale,
|
||||
col,
|
||||
@ -311,6 +312,7 @@ impl FigureMgr {
|
||||
state.update(
|
||||
renderer,
|
||||
pos.0,
|
||||
vel.0,
|
||||
ori.0,
|
||||
scale,
|
||||
col,
|
||||
@ -367,6 +369,7 @@ impl FigureMgr {
|
||||
state.update(
|
||||
renderer,
|
||||
pos.0,
|
||||
vel.0,
|
||||
ori.0,
|
||||
scale,
|
||||
col,
|
||||
@ -385,6 +388,7 @@ impl FigureMgr {
|
||||
state.update(
|
||||
renderer,
|
||||
pos.0,
|
||||
vel.0,
|
||||
ori.0,
|
||||
scale,
|
||||
col,
|
||||
@ -524,6 +528,7 @@ impl<S: Skeleton> FigureState<S> {
|
||||
&mut self,
|
||||
renderer: &mut Renderer,
|
||||
pos: Vec3<f32>,
|
||||
vel: Vec3<f32>,
|
||||
ori: Vec3<f32>,
|
||||
scale: f32,
|
||||
col: Rgba<f32>,
|
||||
@ -535,8 +540,8 @@ impl<S: Skeleton> FigureState<S> {
|
||||
|
||||
// Update interpolation values
|
||||
if self.pos.distance_squared(pos) < 64.0 * 64.0 {
|
||||
self.pos = Lerp::lerp(self.pos, pos, 15.0 * dt);
|
||||
self.ori = Slerp::slerp(self.ori, ori, 7.5 * dt);
|
||||
self.pos = Lerp::lerp(self.pos, pos + vel * 0.03, 10.0 * dt);
|
||||
self.ori = Slerp::slerp(self.ori, ori, 5.0 * dt);
|
||||
} else {
|
||||
self.pos = pos;
|
||||
self.ori = ori;
|
||||
|
@ -65,7 +65,7 @@ impl Default for ControlSettings {
|
||||
jump: KeyMouse::Key(VirtualKeyCode::Space),
|
||||
sit: KeyMouse::Key(VirtualKeyCode::K),
|
||||
glide: KeyMouse::Key(VirtualKeyCode::LShift),
|
||||
climb: KeyMouse::Key(VirtualKeyCode::LShift),
|
||||
climb: KeyMouse::Key(VirtualKeyCode::Space),
|
||||
climb_down: KeyMouse::Key(VirtualKeyCode::LControl),
|
||||
wall_leap: KeyMouse::Mouse(MouseButton::Middle),
|
||||
mount: KeyMouse::Key(VirtualKeyCode::F),
|
||||
|
Loading…
Reference in New Issue
Block a user