Xaron
Topic Author
Posts: 9
Joined: 27 Feb 2022, 19:23

Matrix not invertible

26 Jul 2024, 19:32

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?
 
User avatar
jsantos
Site Admin
Posts: 4042
Joined: 20 Jan 2012, 17:18
Contact:

Re: Matrix not invertible

29 Jul 2024, 15:01

Could you please create a ticket for this? Thank you!

Who is online

Users browsing this forum: Bing [Bot] and 5 guests