feat: rotation is Good Enough I'd say
This commit is contained in:
parent
e522dfb364
commit
95375eae4a
5 changed files with 85 additions and 79 deletions
|
|
@ -62,11 +62,9 @@ void Player::process_rotate(double delta) {
|
|||
float const actual_speed{speed < gd::Math::abs(diff) ? gd::Math::sign(diff) * speed : diff};
|
||||
// rotate by max allowed or full difference, whichever has the smaller magnitude
|
||||
this->rotate_y(actual_speed);
|
||||
this->anim_tree->set("parameters/TurnDirection/blend_position", diff * M_PI_2f);
|
||||
this->anim_tree->set("parameters/TurnAnimation/blend_amount", this->fsm->get_current_node().contains("[turn_animated]") ? 1.f : 0.f);
|
||||
this->anim_tree->set("parameters/Actions/Stationary [turn]/Turn/blend_position", diff * M_PI_2f);
|
||||
} else {
|
||||
this->anim_tree->set("parameters/TurnAnimation/blend_amount", 0.f);
|
||||
this->anim_tree->set("parameters/TurnDirection/blend_position", 0.f);
|
||||
this->anim_tree->set("parameters/Actions/Stationary [turn_animated]/blend_position", 0.f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue