j3d.org Code

org.j3d.device.input.jinput
Class Gamepad

java.lang.Object
  extended by org.j3d.device.input.jinput.Gamepad
All Implemented Interfaces:
ControllerDevice, GamepadDevice, InputDevice, TrackerDevice

public class Gamepad
extends java.lang.Object
implements GamepadDevice, TrackerDevice

A gamepad device implemented using the JInput library.

Version:
$Revision: 1.1 $
Author:
Alan Hudson

Field Summary
 
Fields inherited from interface org.j3d.device.input.InputDevice
FUNC_BUTTON_1, FUNC_BUTTON_2, FUNC_BUTTON_3, FUNC_BUTTON_4, FUNC_L1_BUTTON, FUNC_LEFT_HAT, FUNC_LEFT_STICK_X, FUNC_LEFT_STICK_Y, FUNC_LEFT_STICK_Z, FUNC_NAV_X, FUNC_NAV_Y, FUNC_NAV_Y_CENTERED, FUNC_NONE, FUNC_ORIENT_X, FUNC_ORIENT_Y, FUNC_R1_BUTTON, FUNC_RIGHT_STICK_X, FUNC_RIGHT_STICK_Y, FUNC_START_BUTTON, FUNC_THROTTLE, FUNC_VIEWPOINT_NEXT, FUNC_WHEEL_X
 
Constructor Summary
Gamepad(net.java.games.input.Controller c, java.lang.String name)
          Constructor.
 
Method Summary
 java.lang.String getName()
          Get the name of this device.
 void getState(GamepadState state)
          Get the current state of this device.
 int getTrackerCount()
          Get the number of trackers.
 Tracker[] getTrackers()
          Get the trackers of this device.
 void setRumblerX(float val)
          Set the rumblerX axis.
 void setRumblerY(float val)
          Set the rumblerY axis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gamepad

public Gamepad(net.java.games.input.Controller c,
               java.lang.String name)
Constructor.

Method Detail

getName

public java.lang.String getName()
Get the name of this device. Names are of the form class-#. Valid classes are Gamepad, Joystick, Wheel, Midi, GenericHID.

Specified by:
getName in interface InputDevice
Returns:
The name

getState

public void getState(GamepadState state)
Get the current state of this device. Any arrays too small will be resized.

Specified by:
getState in interface GamepadDevice
Parameters:
state - The state structure to fill in.

setRumblerX

public void setRumblerX(float val)
Set the rumblerX axis.

Specified by:
setRumblerX in interface GamepadDevice
Parameters:
val - The rumbler strength, from -1 to 1.

setRumblerY

public void setRumblerY(float val)
Set the rumblerY axis.

Specified by:
setRumblerY in interface GamepadDevice
Parameters:
val - The rumbler strength, from -1 to 1.

getTrackerCount

public int getTrackerCount()
Get the number of trackers.

Specified by:
getTrackerCount in interface TrackerDevice
Returns:
The number of trackers. This cannot change after startup.

getTrackers

public Tracker[] getTrackers()
Get the trackers of this device.

Specified by:
getTrackers in interface TrackerDevice
Returns:
The trackers. This cannot changed after startup.

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org