fix pingpong in math

This commit is contained in:
Silc 'Tokage' Renew 2021-11-10 13:04:19 +09:00
parent 284b50cf30
commit 571ea72f35
1 changed files with 1 additions and 1 deletions

View File

@ -709,7 +709,7 @@ namespace Godot
/// <returns>The ping-ponged value.</returns>
public static real_t PingPong(real_t value, real_t length)
{
return (length != 0.0) ? Math.Abs(Mathf.Fract((value - length) / (length * 2.0)) * length * 2.0 - length) : 0.0;
return (length != (real_t)0.0) ? Abs(Fract((value - length) / (length * (real_t)2.0)) * length * (real_t)2.0 - length) : (real_t)0.0;
}
}
}