diff --git a/compression_anim.py b/compression_anim.py index 283a21f..1451d9d 100644 --- a/compression_anim.py +++ b/compression_anim.py @@ -26,12 +26,12 @@ def compressQuaternion_5Byte(quat): for i in range(4): if i == missing: continue - v = int(math.round(q[i] / MAX_5_BYTE_QUATERNION * 2048)) + v = int(math.floor(0.5 + q[i] / MAX_5_BYTE_QUATERNION * 2048)) if v < -2048: v = -2048 elif v > 2047: v = 2047 - d.append(q[i] * 2048) + d.append(v + 2048) v = ( (missing << 36) | (d[0] << 24) | @@ -40,7 +40,7 @@ def compressQuaternion_5Byte(quat): ) s = struct.pack("