GLKMatrix4Multiply 坏了

GLKMatrix4Multiply is broken

我有以下方法:

func printMatrix(m: GLKMatrix4) {
    var s = ""
    for i in 0...15 {
        s += "\(m[i]), "

        if (i + 1) % 4 == 0 {
            print(s)
            s = ""
        }
    }
    print("")
}

和下面的一些代码:

let a = GLKMatrix4Identity
self.printMatrix(a)

let b = GLKMatrix4MakeTranslation(3.0, 0.0, 0.0)
self.printMatrix(b)

let m = GLKMatrix4Multiply(a, b)
self.printMatrix(m)

终于看到结果了:

1.0, 0.0, 0.0, 0.0, 
0.0, 1.0, 0.0, 0.0, 
0.0, 0.0, 1.0, 0.0, 
0.0, 0.0, 0.0, 1.0, 

1.0, 0.0, 0.0, 0.0, 
0.0, 1.0, 0.0, 0.0, 
0.0, 0.0, 1.0, 0.0, 
3.0, 0.0, 0.0, 1.0, 

1.0, 1.0, 0.0, 0.0, 
0.0, 0.0, 0.0, 0.0, 
0.0, 0.0, 0.0, 1.0, 
0.0, 3.0, 0.0, 0.0, 

乘法好像不能正常工作。有没有人可以解释它或建议任何类似的矩阵库?

问题仅在使用 iOS 模拟器进行测试时出现(我是使用模拟器测试上面的代码)。在真实设备上 GLKMatrix4Multiply 工作正常。