mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
fix leaning
This commit is contained in:
parent
3450bfabfd
commit
81227b917f
@ -28,7 +28,7 @@ impl CharacterBehavior for Data {
|
||||
* ROLL_SPEED;
|
||||
|
||||
// Smooth orientation
|
||||
update.ori.0 = Dir::slerp_to_vec3(update.ori.0, update.vel.0, 9.0 * data.dt.0);
|
||||
update.ori.0 = Dir::slerp_to_vec3(update.ori.0, update.vel.0.xy().into(), 9.0 * data.dt.0);
|
||||
|
||||
if self.remaining_duration == Duration::default() {
|
||||
// Roll duration has expired
|
||||
|
@ -63,9 +63,11 @@ fn basic_move(data: &JoinData, update: &mut StateUpdate, efficiency: f32) {
|
||||
pub fn handle_orientation(data: &JoinData, update: &mut StateUpdate, strength: f32) {
|
||||
// Set direction based on move direction
|
||||
let ori_dir = if update.character.is_attack() || update.character.is_block() {
|
||||
Vec2::from(*data.inputs.look_dir)
|
||||
data.inputs.look_dir.xy()
|
||||
} else if !data.inputs.move_dir.is_approx_zero() {
|
||||
data.inputs.move_dir
|
||||
} else {
|
||||
Vec2::from(data.inputs.move_dir)
|
||||
update.ori.0.xy()
|
||||
};
|
||||
|
||||
// Smooth orientation
|
||||
|
Loading…
Reference in New Issue
Block a user