public void IsValid() { Matrix44F inValidPose = new Matrix44F(new float[, ] { { 1, 2, 3, 0 }, { 4, 5, 6, 0 }, { 7, 8, 9, 0 }, { 0, 0, 0, 1 }, }); Assert.IsFalse(Pose.IsValid(inValidPose)); Assert.IsTrue(Pose.IsValid(Matrix44F.CreateRotationZ(0.3f))); inValidPose = new Matrix44F(new float[, ] { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 1, 0, 1 }, }); Assert.IsFalse(Pose.IsValid(inValidPose)); inValidPose = new Matrix44F(new float[, ] { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, -1, 0 }, { 0, 1, 0, 1 }, }); Assert.IsFalse(Pose.IsValid(inValidPose)); }
public void IsValidTest() { var m = Matrix44F.CreateTranslation(1, 2, 3) * Matrix44F.CreateRotationY(0.1f) * Matrix44F.CreateScale(-2, 3, 4); Assert.IsTrue(SrtTransform.IsValid(m)); // Concatenating to SRTs creates a skew. m = Matrix44F.CreateRotationZ(0.1f) * Matrix44F.CreateScale(-2, 3, 4) * m; Assert.IsFalse(SrtTransform.IsValid(m)); }