TestGenerateTerrain and camera weirdness

This is not really physics related, but jme-physics is a starting point. The problem is in com.jmetest.physics.TestGenerateTerrain and com.jmex.physics.util.PhysicsPicker. It runs fine, but the first click doesn't grab an object. You need a second click for that. All subsequent clicks work fine.

One doing some digging, I found out that somehow a wrong model-view-projection matrix was used inside AbstractCamera while getting world coordinates. That is to say, with the first click the default matrix seems to be used, but with every subsequent click it would be right. This is independent of any movement, or even clicking the right-mouse button.

If someone can shed some light on why the model-view-projection matrix only seems to work after clicking the mouse there, I'd be grateful. I see absolutely no reason for it.

mmm, seems to be the same problem as posted here.