Page 1 of 1

Matrix not invertible

Posted: 26 Jul 2024, 19:32
by Xaron
Dear all,

we're using Noesis in our quite big Unity project and had exceptions with non invertible matrices.

We needed to change those lines
  public bool HasInverse {
    get { return Math.Abs(Determinant) >= 0.0001f; }
  }

  public void Invert() {
    float determinant = Determinant;
    if (Math.Abs(determinant) < 0.0001f) {
      throw new InvalidOperationException("Matrix is not Invertible");
    }
to
  public bool HasInverse {
    get { return Math.Abs(Determinant) >= float.Epsilon; }
  }

  public void Invert() {
    float determinant = Determinant;
    if (Math.Abs(determinant) < float.Epsilon) {
      throw new InvalidOperationException("Matrix is not Invertible");
    }
Our map needs to invert some close to singular matrices... We're doing matrix transforms from long/lat (world positions) in meters to screen space, which obviously have very large numbers. Works fine, could be change of course.

Is that a change you would see as potentially dangerous?

Re: Matrix not invertible

Posted: 29 Jul 2024, 15:01
by jsantos
Could you please create a ticket for this? Thank you!