BatchNode bounding box recalculation


I was developing a game for android, and to improve performance I batched a vehicile model and the 4 wheels into one node, the resulting fps was slower than before batching (from 38 to 17). It seems that every time child nodes of a BatchNode moves (change location/rotation) the bounding box of the BatchNode is recalculated, so in my case it was recalculated every frame. :S

So is there anyway to disable bounding box recalculation. In my case the bounding box will not really change when wheels are rotating.


There is no way to get around the bounding box calculation.
Are you completely sure that’s what’s causing the slowdown?
From my experience, Batch Node is not really more performant on android because it uses a lot of buffer writing, which is slow on android.

I have done many tests and when i disable the updates (no translation & no rotation) on all child nodes I get a normal fps. I get low fps only when i change position/rotation of child nodes of the batch.

Yeah,but when you don’t move anything the Batch nodes basically acts as a single geometry, there is no mesh update, no buffer writing at all, so I’m not surprised that it yields correct fps.
I really doubt that disabling bound computations will help you with performance.

Maybe you should try another batching strategy, like batching (with geometryBatchFactory) the whole car except the wheels, and keep wheels as separate objects. Also if you’re using physics with android you should consider using native bullet.

Ok, i will try different approaches.
When I tested with geometryBatchFactory I can’t move the node do I have to attach the batched node with geometryBatchFactory to another node and move that new node ?
For physics I’m using box 2d (top view) so I dont think it will be a problem.

Merci :slight_smile: