trongsang93 / javascript-joystick

Automatically exported from code.google.com/p/javascript-joystick
0 stars 0 forks source link

Y-axis Values Running Out of Bounds #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Calls to getY() return numbers much larger than 64K.
Often the readings are taken by JavaScript as floats.
This behavior seems to start at a random time.

Running FF 3.6.3, Joystick plugin 0.6.0.1, under Vista SP2; 64 bit.
Laptop is a Lenovo X200 tablet.
Device is a Logitech G27 racing wheel with 3 pedals.

The right pedal normally ranges from 32K (not pressed) to 0 (pressed
all the way down). Once the error condition begins, the 
32K-at-rest is still reliable. Only when pressing the pedal do
the numbers go bad.

Unplugging and replugging the device does not help. Nor does
creating a new Joystick object.

Thanks!

Andreas 

Original issue reported on code.google.com by Paep...@gmail.com on 26 May 2010 at 3:51

GoogleCodeExporter commented 9 years ago
I don't see where I can mark this issue 'resolved.' It looks like in my own
javascript code I squared the Y value to get a parabolic shape for the 
acceleration
(the gas pedal being pushed). I'm new to JavaScript. But I suspect that the 
language
does not protect against overflow. My theory is that the result of the 
computation
leaked into the plugin memory space, because once I stop the multiplying, 
things are
much better. 

I'll add another comment if this hypothesis proves wrong.

Andreas

Original comment by Paep...@gmail.com on 26 May 2010 at 4:41

GoogleCodeExporter commented 9 years ago
Keep me informed; I'll not mark it as closed for now. I tested with a Microsoft 
wheel and pedal combo and I'd not 
seen this behaviour. Feel free to attach the script you use - I'll try to take 
a look.

Regards,

Carl

Original comment by cwoffen...@gmail.com on 26 May 2010 at 4:58

GoogleCodeExporter commented 9 years ago

Original comment by cwoffen...@gmail.com on 17 Jun 2010 at 8:43