Erratic mouse dx/dy values

Started by plummew, January 07, 2007, 23:13:40

Previous topic - Next topic

plummew

Hi,

I have a grabbed(true) Mouse and I'm polling it once during each iteration of my game loop calling Mouse.poll(). I'm then using the getDX/DY accessors to retrieve the deltas.

The problem I'm having is that in amongst the small deltas, every now and then much larger delta values are being returned. (Making my mouse-look function erratic.)

I'm polling maybe 100 to 150 times per second.

Am I missing a trick here in the way in which I'm accessing the Mouse class?

A similar mouse-look demo written in C++ that's using deltas is silky smooth so I'm disinclined to blame the mouse itself.

Anyone got any ideas?

plummew

Well,

In the absence of any comment to the contrary, I'll assume the Mouse polling mechanism I'm using is correct.

... and that the best way forward is to ignore excessively large dx/dy values.

Cheers.

Matzon

have you tried using event based ?

plummew

Thanks for the response Matzon but problem solved, though a little embarrassing...

It had nothing to do with the Mouse, it was the JVM memory manager pausing the application to collect "garbage".

I was running the JVM with the default 1.5 -client settings, so the initial heap size was 2M, a quick update to 64M and everything is groovy again.

Cheers.