mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Make orientation not dependend on camera dir while wielded
This commit is contained in:
parent
1e1ce2adbf
commit
208245e82e
@ -55,7 +55,10 @@ impl CharacterState {
|
||||
match self {
|
||||
CharacterState::Wielding
|
||||
| CharacterState::BasicMelee(_)
|
||||
| CharacterState::BasicRanged(_)
|
||||
| CharacterState::DashMelee(_)
|
||||
| CharacterState::TimedCombo(_)
|
||||
| CharacterState::ChargeAttack(_)
|
||||
| CharacterState::BasicBlock => true,
|
||||
_ => false,
|
||||
}
|
||||
@ -66,6 +69,7 @@ impl CharacterState {
|
||||
CharacterState::BasicMelee(_)
|
||||
| CharacterState::BasicRanged(_)
|
||||
| CharacterState::TimedCombo(_)
|
||||
| CharacterState::DashMelee(_)
|
||||
| CharacterState::ChargeAttack(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ impl CharacterBehavior for Data {
|
||||
|
||||
if self.initialize {
|
||||
update.vel.0 = data.inputs.look_dir * 20.0;
|
||||
update.ori.0 = update.vel.0;
|
||||
}
|
||||
|
||||
if self.buildup_duration != Duration::default() && data.physics.touch_entity.is_none() {
|
||||
|
@ -54,10 +54,7 @@ fn basic_move(data: &JoinData, update: &mut StateUpdate) {
|
||||
}
|
||||
|
||||
// Set direction based on move direction
|
||||
let ori_dir = if update.character.is_wield()
|
||||
|| update.character.is_attack()
|
||||
|| update.character.is_block()
|
||||
{
|
||||
let ori_dir = if update.character.is_attack() || update.character.is_block() {
|
||||
Vec2::from(data.inputs.look_dir).normalized()
|
||||
} else {
|
||||
Vec2::from(data.inputs.move_dir)
|
||||
@ -84,10 +81,7 @@ fn swim_move(data: &JoinData, update: &mut StateUpdate) {
|
||||
};
|
||||
|
||||
// Set direction based on move direction when on the ground
|
||||
let ori_dir = if update.character.is_wield()
|
||||
|| update.character.is_attack()
|
||||
|| update.character.is_block()
|
||||
{
|
||||
let ori_dir = if update.character.is_attack() || update.character.is_block() {
|
||||
Vec2::from(data.inputs.look_dir).normalized()
|
||||
} else {
|
||||
Vec2::from(update.vel.0)
|
||||
|
Loading…
Reference in New Issue
Block a user