[jME2] StatCollector and number of tris/geometries

With jME2 there is no Renderer.getStatistics() anymore and as far as I can see, the StatCollector is the replacement.



I set System.setProperty("jme.stats","true) at the very beginning (before any other jME related call) and add a StatListener in which I just get the first historical sample. I try to get the average of triangles and geometries but it's always 0.

What else do I have to do to get statistics?

Oh my … I never called the update() function so the listener callback was never used.

Galun said:

With jME2 there is no Renderer.getStatistics() anymore and as far as I can see, the StatCollector is the replacement.

I set System.setProperty("jme.stats","true) at the very beginning (before any other jME related call) and add a StatListener in which I just get the first historical sample.


I am trying yo use StatCollector but I'm not sure where should I add the StatListener.  Right after this line? System.setProperty("jme.stats","true)

you can look how its used in BaseSimpleGame or StatisticsGameState