Joystick Rumble?

I can't seem to get the Joystick.rumble (axis, intensity) method to do anything.

I am sure I am applying the force to the right input/axis.  I even tried a for loop through every axis but no luck:

for (int i = 0; i < input.getJoystickCount(); i++) {
   for (int o = 0; o < input.getJoystick(i).getAxisCount(); o++) {
      input.getJoystick(i).rumble(o, 100);
   }
}



The other methods detect my joystick and all its buttons/axises just fine.

Hi



What joystick do you have?, what OS/version are you using?, which version of jme are you using?.



Thanks



Endolf

The only controller with force feedback I have is a Logitech Wingman GT steering wheel, however I assume that it should work just like a joystick as I can get all the axis and buttons etc just as if it were a joystick.

I am using Windows XP.  I am not sure what version of JInput is being used, but I have a pretty recent (week or so) old version of JME from the cvs.

Thanks



PS, what range of numbers should be used for intensity?

Hi



Try the rumble test from the jinput distro here. It doesn’t open any windows, it just tries to rumble the device, then fade it out. It does that six times or so. If that works, then there is a jme issue, if that doesn’t, it’s a jinput issue.



It doesn’t solve the issue, but it gives as something to work from.



HTH



Endolf



edit: Does the joystick rumble in any other applications?

The JInput rumble test works perfectly.



Edit:

I decided to take a look at JInput itself, and wrote the following code:

package Input;

import net.java.games.input.Controller;
import net.java.games.input.Controller.Type;
import net.java.games.input.ControllerEnvironment;
import Error.Dialog;

public class InputTest {
   public static void main (String[] args) {
      ControllerEnvironment cEnvironment = ControllerEnvironment.getDefaultEnvironment();
      Controller[] cControllers = cEnvironment.getControllers();
      
      if (cControllers.length == 0)
         Dialog.showError ("Critical Error, No inputs availaible");
      
      System.out.println ("JInput has found: " + cControllers.length + " Controllers");
      
      for (int i = 0; i < cControllers.length; i++) {
         if (cControllers[i].getType() != Type.UNKNOWN) {
            System.out.println ("n Controller Name: " + cControllers[i].getName());
            System.out.println ("    Type: " + (cControllers[i].getType()));
            System.out.println ("    Rumble: " + ((cControllers[i].getRumblers().length > 0) ? "Yes" : "No"));
            
            for (int o = 0; o < cControllers[i].getRumblers().length; o++) {
               System.out.println ("        Rumbling Axis: " + cControllers[i].getRumblers()[o].getAxisName());
               cControllers[i].getRumblers()[o].rumble(0.5f);
               Thread.sleep(1000);
            }
         }
      }
   }
}


This code works fine, including the rumble, although all the rumble axis names return null.

Just another question, my wheel (which only has rumble on the steering wheel) returns 5 rumble axises, 1-3 of which shake the wheel with lowering intensity, and 4-5 rotate the wheel left with lowering intensity.  I can't seem to get it to rotate the wheel right no matter which values I put in.  Is there any way of telling what axises to rumble and which direction they go?

Glad it's up and running. I'd be interested in getting jme rumbling happily.



To turn the wheel right, I'm guessing that you just need to apply a negative rumble. As to the axis and the rumble, there is currently no way to tell. It's designed for rumblers, which typically don't have an axis or direction. Which rumblers turn the wheel?, the ones higher in the list, or at the start of it?



Endolf

I believe that JMEs implementation of rumble braeks because the rumble axes have no names.  On my wheel, axes 1-3 all make the wheel shake (1 being very strongly, 2 being moderate and 3 being softly), and 4-5 make the wheel turn left (4 very strongly, 5 softly).  Negative numbers have no effect.