Re: [android-developers] Matrix.rotateM does heap allocations - should I care?

2010-09-25 Thread Kostya Vasilyev
Leigh, You could just use local variables to hold the temporaries, declared as a primitive type (float). -- Kostya 25.09.2010 3:22, Romain Guy пишет: On 9/24/2010 6:32 PM, Romain Guy wrote: rotateM() just does the following: float[] r = new float[16];

[android-developers] Matrix.rotateM does heap allocations - should I care?

2010-09-24 Thread A Curious Developer
Are you meticulous in removing all per-frame heap allocations from your game? (At least the allocations that you can control and that have practical alternatives.) While trying to reduce per-frame heap allocations from my running game, I found that method android.opengl.Matrix

Re: [android-developers] Matrix.rotateM does heap allocations - should I care?

2010-09-24 Thread Romain Guy
rotateM() just does the following: float[] r = new float[16]; setRotateM(r, 0, a, x, y, z); multiplyMM(rm, rmOffset, m, mOffset, r, 0); You can create your own rotateM() method and use your own float[16] do not allocate every time. On Fri, Sep 24, 2010 at 3:30 PM, A

Re: [android-developers] Matrix.rotateM does heap allocations - should I care?

2010-09-24 Thread Leigh McRae
I would have thought this stuff would be in native code. Having an allocation in a matrix operation is basically unacceptable. On 9/24/2010 6:32 PM, Romain Guy wrote: rotateM() just does the following: float[] r = new float[16]; setRotateM(r, 0, a, x, y, z);

Re: [android-developers] Matrix.rotateM does heap allocations - should I care?

2010-09-24 Thread Romain Guy
You are correct, at least with the current GC. On Fri, Sep 24, 2010 at 3:44 PM, Leigh McRae leigh.mc...@lonedwarfgames.com wrote:  I would have thought this stuff would be in native code.  Having an allocation in a matrix operation is basically unacceptable. On 9/24/2010 6:32 PM, Romain Guy