Physics debug only to show collisions [SOLVED]

There is anyway to customize the debug ?
I have thousands of objects moving in screen and I am looking to see only the collisions.
The objects are moving in a nice 300 fps then for no reason it drops to 10 fps, and I have no idea why. I am suspecting there is some collision overload but I cant identify just it with the default debug.

Maybe use a collision listener to get more insight about what’s happening ?

Yes, that is actually what I am doing.
But I wander if is possible to implement some postPhysicsTick or to just make the debug to color the in collision objects, it would really help me here.

Maybe you could clarify what you mean by “customize the debug”.
Changing the material of what just collided shouldn’t be that hard in a collision listener, I think.
When that drop to 10 fps happens, how is you scene changing ? (debug window : triangles count, …)
What kind of actions are you triggering in your code when it happens ? Can’t you find any correlation ?
What about introducing some metrics in your code ?
That’s just guessing in the dark. More information is welcome.

Well, when you enable the debug it shows in blue the disable objects and in pink the active objects. I would like to have some red objects that actually is active and colliding with something.
My problem is that when it drops to 10 fps, there is no difference on the number of objects of meshes, or any player action, it just drops for no reason. That is why I suspect some object is colliding inside other object or something…
I am trying to remove from collision groups some types of objects and its improving the performance, so my suspect grows, but since I cant see what is going on in the debug …

That is why I suspect some object is colliding inside other object or something...

little but easy step : what happens when you “disable” or “pause” your physics subsystem ? Is your fps going up again ?
That would definitely give us the legitimity to incriminate physics.

That would help a lot… How do I disable the physics for a while ?


Something like that ?

or on an object level with some kind of setEnabled(false) … never did it on jME sorry

1 Like

Yes ! It helps ! Thanks friend.