mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fixing character movement to no longer fail normalization then get a zero vec and then normalize again
may this can be further simplyfied
This commit is contained in:
parent
e804282169
commit
242a0d35bd
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user