JOGL Support (JOGL2 that is)

Found another bug, this time with the NewtMouseInput. There is some code in that class that forces the mouse cursor to the center of the screen when the cursor’s visibility is changed. This causes odd behavior with the FlyByCamera as can be observed with the following test class:

public class HelloJME3 extends SimpleApplication {

    public static void main(String[] args){
        AppSettings appSettings = new AppSettings(true);
        appSettings.setWidth(800);
        appSettings.setHeight(600);
        appSettings.setAudioRenderer(null);
        appSettings.setRenderer("JOGL");

        final HelloJME3 app = new HelloJME3();
        app.setSettings(appSettings);
        app.setShowSettings(false);
        app.start();
    }

    @Override
    public void simpleInitApp() {
        flyCam.setDragToRotate(true);

        Box b = new Box(1, 1, 1); // create cube shape
        Geometry geom = new Geometry("Box", b);  // create cube geometry from the shape
        Material mat = new Material(assetManager,
          "Common/MatDefs/Misc/Unshaded.j3md");  // create a simple material
        mat.setColor("Color", ColorRGBA.Blue);   // set color of material to blue
        geom.setMaterial(mat);                   // set the cube's material
        rootNode.attachChild(geom);              // make the cube appear in the scene
    }
}

In the test, the camera will rotate immediately to the bottom right corner of the screen when the left mouse button is pressed. The only way to avoid this initial rotation is to keep the cursor at the center of the screen before pressing the left mouse button.