Mouse events when FPS very low

Hi,



We have defined a mouse event that we use for picking objects in the simpleUpdate() method in a SimpleGame extending class. This works fine when FPS is high, but when we display a huge object and the FPS is very low (FPS < 5), the mouse events don't seem to be triggered. The user needs to keep the mouse button pressed a longer time. Is there a way to make sure the mouse events will be triggered even when the user does just a very fast mouse button click?



Thanks,



Dan

maybe you could create a simple thread which runs independently from the games main loop and thus poll the mouse inputs more frequently.

Core-Dump said:

maybe you could create a simple thread which runs independently from the games main loop and thus poll the mouse inputs more frequently.


Does it mean to override BaseGame.start()?

I think the following solution seems to work:



[pre]    MouseInput.get().addListener(new MouseInputListener() {

      public void onButton(final int button, final boolean pressed, final int x, final int y) {

        if (button == 1) {

        …

        }

      …

      }[/pre]



Dan

The event handling, the logic update and rendering update are all called in the same loop inside of BaseGame.start(). Then a FPS drop automatically affects input and logic. I think that the only solution is to put event handling on a different thread.

Or achieve to run the application at a bettere framerate.

ddanny, what method did you use to handle the events? the actions for separate input events should not suffer from low frame rates. Just don't use the command stuff (where you need command names etc.).

The full story is that I have a canvas embedded into an SWT view using the MonkeyWorld3d bundle. Right now I register a MouseInputListener in the following way:



    MouseInput.get().addListener(new MouseInputListener() {



      @Override

      public void onButton(final int button, final boolean pressed, final int x, final int y) {

        if (button == 1) {

        …

        }

      …

      }



Dan

ddanny said:

The full story is that I have a canvas embedded into an SWT view using the MonkeyWorld3d bundle.

Oh, ok, can't say anything about that setup, then.

It seems like the problem is not with the mouse event not being triggered.

The problem seems to be related to the mouse picking. The objects are really huge, so in order to be able to see them entirely, they need to be really far (10000+ units away from camera). In this case, the ray based picking doesn't always work. Any ideas?



Thanks,



Dan

rescale everything! float accuracy is too low for small differences with such large numbers.

Not sure what you mean by rescaling.



Dan

Rescaling your scene… making 1000.0 be 1.0 and 1.0 be 0.001 units.