Skip to content

Commit f6ad63f

Browse files
fix
Quaternion approximation calculation was wrong.
1 parent bcadba7 commit f6ad63f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

com.unity.netcode.gameobjects/Runtime/Components/Interpolator/BufferedLinearInterpolatorQuaternion.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ private protected override Quaternion SmoothDamp(Quaternion current, Quaternion
6363
/// <inheritdoc />
6464
private protected override bool IsAproximately(Quaternion first, Quaternion second, float precision)
6565
{
66-
return (1.0f - Quaternion.Dot(first, second)) <= precision;
66+
return Mathf.Abs(first.x - second.x) <= precision &&
67+
Mathf.Abs(first.y - second.y) <= precision &&
68+
Mathf.Abs(first.z - second.z) <= precision &&
69+
Mathf.Abs(first.w - second.w) <= precision;
6770
}
6871

6972
/// <inheritdoc />

0 commit comments

Comments
 (0)