Strange AbsoluteMouse setSpeed behaviour

Hi everybody,



I've searched the forums and I've been unable to find anybody else complaining of this behaviour, so I figured I'd post.  It's not hard to reproduce:  Open TestAbsoluteMouse and add a single line to the end of simpleInitGame():



mouse.setSpeed(2f);



Run it in a window, and move the mouse cursor to (and past) the extreme right side or top of the window.  It exhibits strange wrapping behaviour.



Three questions:

  1. Does anybody else see this behaviour or is it just me?
  2. Is this the proper way to accelerate mouse movement?
  3. If this is the proper way to accelerate mouse movement and it's not just me, how is it that nobody else is having issues?  Or am I the only one that wants to allow a user to set their mouse speed in-game?



    Thanks in advance.

Test confirmed.



There definitely seems to be something wrong w/ the absolute mouse.



Lets give someone else a chance to test and confirm, then we will post an issue for it…

Has anyone else had a chance to test and confirm there is an issue?

hiya, i posted a patch for the problem here

http://www.jmonkeyengine.com/jmeforum/index.php?topic=10256.0

Yup, I see the problem too.

I think its because in AbsoluteMouse.java in update action it uses width/height instead of limitwidth/limitheight when recalculating the localTranslation when you hit the edge of the window.

e.g. change it like below in the relevant xUpdateAction  and yUpdateAction :-


Index: com/jme/input/AbsoluteMouse.java
===================================================================
--- com/jme/input/AbsoluteMouse.java   (revision 4081)
+++ com/jme/input/AbsoluteMouse.java   (working copy)
@@ -87,7 +87,7 @@
                 localTranslation.x = -hotSpotOffset.x;
             }
             else if ( localTranslation.x + hotSpotOffset.x > limitWidth ) {
-                localTranslation.x = width - hotSpotOffset.x;
+                localTranslation.x = limitWidth - hotSpotOffset.x;
             }
             worldTranslation.x = localTranslation.x;
             hotSpotLocation.x = localTranslation.x + hotSpotOffset.x;
@@ -105,7 +105,7 @@
                 localTranslation.y = 0/* - imageHeight*/ - hotSpotOffset.y;
             }
             else if ( localTranslation.y + hotSpotOffset.y > limitHeight ) {
-                localTranslation.y = height - hotSpotOffset.y;
+                localTranslation.y = limitHeight - hotSpotOffset.y;
             }
             worldTranslation.y = localTranslation.y;
             hotSpotLocation.y = localTranslation.y + hotSpotOffset.y;



The one thing I am not sure about is that the pointer will stop at x=0, y=0 - but doesn't stop at x=limitwidth, y=limitheight UNLESS you use setUsingDelta(true); on the mouse object. I don't know if this is desired/expected behaviour tho...

I'm just tooo damn slow :frowning: must type faster !!

Follow-up posted to Core-Dump's posting on the other forum – I don't believe this is the complete fix.