Login  Register

Re: Capturing relative mouse input (for 1st person shooters etc)

Posted by GiGurra on Jul 19, 2012; 2:45pm
URL: https://forum.jogamp.org/Capturing-relative-mouse-input-for-1st-person-shooters-etc-tp4025593p4025598.html

I see that in your Tuer game (early version with own engine) you handled wraparound like this:

    /**
     * Contribution from Riven
     * @return
     */
    public final Point getDelta(){      
       Point pointer=MouseInfo.getPointerInfo().getLocation();
       int xDelta=pointer.x-centerx;
       int yDelta=pointer.y-centery;
       if(xDelta==0 && yDelta==0)
           {// robot caused this OR user did not do anything
            return(new Point(0,0));
           }
       else
           {robot.mouseMove(centerx, centery);
            return(new Point(xDelta, yDelta));
           }      
    }



I guess there is no native support to handle this with just JOGL? (like a mouse listener only reporting deltas?)
Would be cool if we could also set DPI :)

Hehe, I find myself posting a long feature request list..