void write()

in src/gltf/Raw2Gltf.hpp [80:92]


  void write(uint8_t* buf, const mathfu::Matrix<T, d>& matrix) const {
    // three matrix types require special alignment considerations that we don't handle
    // https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#data-alignment
    assert(!(sizeof(T) == 1 && d == 2));
    assert(!(sizeof(T) == 1 && d == 3));
    assert(!(sizeof(T) == 2 && d == 2));
    for (int col = 0; col < d; col++) {
      for (int row = 0; row < d; row++) {
        // glTF matrices are column-major
        ((T*)buf)[col * d + row] = matrix(row, col);
      }
    }
  }