FlyCam and InputManager updates

I’ve added code to FlyCam to modify the up vector. This is nice for when your terrain is round Earth. I’ve also added an isCursorVisible() call to input manager that I now use in the Strategic handler & mouse handler.



[patch]

Index: src/core/com/jme3/input/InputManager.java

===================================================================

— src/core/com/jme3/input/InputManager.java (revision 6162)

+++ src/core/com/jme3/input/InputManager.java (working copy)

@@ -431,6 +431,13 @@

}

}


  • /**
  • * @param visible whether the mouse cursor should be visible or not.<br />
    
  • */<br />
    
  • public boolean isCursorVisible(){
  •    return mouseVisible;<br />
    
  • }

    +

    public Vector2f getCursorPosition(){

    return cursorPos;

    }

    Index: src/core/com/jme3/input/FlyByCamera.java

    ===================================================================

    — src/core/com/jme3/input/FlyByCamera.java (revision 6162)

    +++ src/core/com/jme3/input/FlyByCamera.java (working copy)

    @@ -76,6 +76,10 @@

    this.cam = cam;

    initialUpVec = cam.getUp().clone();

    }

    +
  • public void setUpVector(Vector3f upVec) {
  •   initialUpVec.set(upVec);<br />
    
  • }



    public void setMotionAllowedListener(MotionAllowedListener listener){

    this.motionAllowed = listener;

    [/patch]



    I’ll release another update to the StrategicHandler once I get it playing all nice nice with swingGUI & awt. I may have to do some java.awt.Robot trickery to keep the cursor position in sync w/ the system mouse AWT is using.
1 Like

Meant to post this in contributions. oops.

Thanks, committed.