I've been wondering if anyone has some knowledge about
android.opengl.Matrix.multiplyMM
that they could share.
.
Reason for asking is, when learning through OpenGL ES, the method is widely used for all sorts of calculations. However, there is the android.renderscript.Matrix4f which I find working with more natural than with primitive float[] arrays. Problem is, the Matrix4f's multiply function is using a temporary matrix to perform the operation, which results in being memory-inefficient.
One way to solve this is to create my own Matrix4f and write the multiply() myself. I was basing it around the following example. It may look horrible but saves me all the set()'s, get()'s and looping, which gives a performance increase.
But then, I still didn't feel like letting the multiplyMM go. In the source you can read that the method is native, therefore should evaluate faster (yes?). And that made me wonder once again.
.
Therefore, does anyone know:
- What is the underlying algorithm in multiplyMM ? Does it use temporaries?
- Would it be quicker to use than self-written multiply?