Core: Use Math namespace for constants

This commit is contained in:
Thaddeus Crews
2025-04-10 11:21:05 -05:00
parent 06c71fbf40
commit 94282d88f9
181 changed files with 812 additions and 818 deletions

View File

@ -1589,17 +1589,17 @@ void AnimationMixer::_blend_process(double p_delta, bool p_update_only) {
float rot_a = t->value;
float rot_b = value;
float rot_init = t->init_value;
rot_a = Math::fposmod(rot_a, (float)Math_TAU);
rot_b = Math::fposmod(rot_b, (float)Math_TAU);
rot_init = Math::fposmod(rot_init, (float)Math_TAU);
if (rot_init < Math_PI) {
rot_a = rot_a > rot_init + Math_PI ? rot_a - Math_TAU : rot_a;
rot_b = rot_b > rot_init + Math_PI ? rot_b - Math_TAU : rot_b;
rot_a = Math::fposmod(rot_a, (float)Math::TAU);
rot_b = Math::fposmod(rot_b, (float)Math::TAU);
rot_init = Math::fposmod(rot_init, (float)Math::TAU);
if (rot_init < Math::PI) {
rot_a = rot_a > rot_init + Math::PI ? rot_a - Math::TAU : rot_a;
rot_b = rot_b > rot_init + Math::PI ? rot_b - Math::TAU : rot_b;
} else {
rot_a = rot_a < rot_init - Math_PI ? rot_a + Math_TAU : rot_a;
rot_b = rot_b < rot_init - Math_PI ? rot_b + Math_TAU : rot_b;
rot_a = rot_a < rot_init - Math::PI ? rot_a + Math::TAU : rot_a;
rot_b = rot_b < rot_init - Math::PI ? rot_b + Math::TAU : rot_b;
}
t->value = Math::fposmod(rot_a + (rot_b - rot_init) * (float)blend, (float)Math_TAU);
t->value = Math::fposmod(rot_a + (rot_b - rot_init) * (float)blend, (float)Math::TAU);
} else {
value = Animation::cast_to_blendwise(value);
if (t->init_value.is_array()) {