Skip to content

Commit 6c5d693

Browse files
committed
Add test to check rotation method with tiny scale.
1 parent 5d9b835 commit 6c5d693

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Tests/Tests/Shared/TestQuaternion.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,5 +460,17 @@ public static void quaternion_rotation_from_3x3_with_negative_nonuniform_scale()
460460
var actualQuaternion = rotation(m);
461461
TestUtils.AreEqual(0.0f, angle(actualQuaternion, expectedQuaternion) % PI * 2.0f, tolerance);
462462
}
463+
464+
[TestCompiler]
465+
public static void quaternion_rotation_from_3x3_with_tiny_scale()
466+
{
467+
const float tolerance = 1e-5f;
468+
var random = new Random(561887u);
469+
var expectedQuaternion = random.NextQuaternionRotation();
470+
var m = new float3x3(expectedQuaternion);
471+
m = mul(m, float3x3.Scale(1e-12f, 1e-12f, 1e-12f));
472+
var actualQuaternion = rotation(m);
473+
TestUtils.AreEqual(0.0f, angle(actualQuaternion, expectedQuaternion) % PI * 2.0f, tolerance);
474+
}
463475
}
464476
}

0 commit comments

Comments
 (0)