feat: rotation is Good Enough I'd say

This commit is contained in:
Sara 2024-12-02 23:18:08 +01:00
parent e522dfb364
commit 95375eae4a
5 changed files with 85 additions and 79 deletions

View file

@ -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);
}
}