Merge branch 'physics-fix' into 'master'

fixing character movement to no longer fail normalization then get a zero vec...

See merge request veloren/veloren!631
This commit is contained in:
Marcel 2019-10-26 22:56:21 +00:00
commit c8e45c2f5a

View File

@ -102,12 +102,9 @@ impl<'a> System<'a> for Sys {
if character.movement.is_roll() {
vel.0 = Vec3::new(0.0, 0.0, vel.0.z)
+ (vel.0 * Vec3::new(1.0, 1.0, 0.0)
+ 1.5
* inputs
.move_dir
.try_normalized()
.unwrap_or(Vec2::from(vel.0).try_normalized().unwrap_or_default()))
.normalized()
+ 1.5 * inputs.move_dir.try_normalized().unwrap_or_default())
.try_normalized()
.unwrap_or_default()
* ROLL_SPEED;
}
if character.action.is_block() || character.action.is_attack() {