implement character limb swing animation

(cherry picked from commit 19c59e38feff562ccbaade8e38fdd303bba784a5)
This commit is contained in:
LabyStudio
2022-04-14 00:45:23 +02:00
parent 7df2806456
commit 62d7ba24b9
9 changed files with 211 additions and 70 deletions
+11
View File
@@ -33,6 +33,17 @@ window.MathHelper = class {
return angle;
}
static wrapAngleTo180(value) {
value = value % 360.0;
if (value >= 180.0) {
value -= 360.0;
}
if (value < -180.0) {
value += 360.0;
}
return value;
}
static hsbToRgb(hue, saturation, brightness) {
let r = 0, g = 0, b = 0;
if (saturation === 0) {