fix: incorrect wrapping angles at 2PI, now PI
parent
2d7555fb6d
commit
dc1e09d425
|
@ -28,7 +28,7 @@ void Enemy::_ready() {
|
|||
|
||||
void Enemy::_process(double delta) {
|
||||
this->set_current_state_name(this->current_state_name);
|
||||
float const angle_left{gd::Math::wrapf(this->target_rotation - this->get_rotation().y, -M_2_PIf, M_2_PIf)};
|
||||
float const angle_left{gd::Math::wrapf(this->target_rotation - this->get_rotation().y, -M_PIf, M_PIf)};
|
||||
float const step(gd::Math::sign(angle_left) * delta * (this->anim_tree->get_current_state().begins_with("Run") ? this->TURN_SPEED : this->AIM_SPEED));
|
||||
if(gd::Math::abs(angle_left) <= gd::Math::abs(step)) {
|
||||
this->rotate_y(angle_left);
|
||||
|
|
Loading…
Reference in New Issue