isIdentity method

bool isIdentity (
  1. Matrix4 a
)

Whether the given matrix is the identity matrix.

Implementation

static bool isIdentity(Matrix4 a) {
  assert(a != null);
  return a.storage[0] == 1.0 // col 1
      && a.storage[1] == 0.0
      && a.storage[2] == 0.0
      && a.storage[3] == 0.0
      && a.storage[4] == 0.0 // col 2
      && a.storage[5] == 1.0
      && a.storage[6] == 0.0
      && a.storage[7] == 0.0
      && a.storage[8] == 0.0 // col 3
      && a.storage[9] == 0.0
      && a.storage[10] == 1.0
      && a.storage[11] == 0.0
      && a.storage[12] == 0.0 // col 4
      && a.storage[13] == 0.0
      && a.storage[14] == 0.0
      && a.storage[15] == 1.0;
}