Immersion Logo
spacer
what's new?
getting started
technology
community
community FAQ
community effects
community tips
how to buy
login
developer | community | tips and tricks | coding tips | coding for devices

Coding for different devices
Multiple Device Consideration
  Consider using two different IFR files when designing for multiple device types. One can handle Full Force Feedback Joysticks, Mice, Gamepads, Rumblepads, or Wheels, and the other can handle Tactile Feedback Mice, Gamepads, and Trackballs.

When designing for a full force feedback mouse and a tactile feedback mouse, make sure you try your effects on both. A slow square wave on a Tactile Feedback mouse will feel like a steady tapping, but on a full force feedback mouse it will actually push the mouse from side to side.
 
Detecting Device-type
  There really isn't a good way to do it. Calling GetDeviceType or GetProductType will give you some information, but IFC simply passes the info it gets from lower APIs on to the application. Often, this info is erroneous (Gravis Xterminator Force gamepad says it's a stick, some sticks say they are gamepads). The only 100% reliable way of determining what device is attached is to get the device's name.
 
Full Force Feedback vs. Tactile Feedback mouse considerations
  Input:
The full force feedback mouse defaults to reporting it's position in absolute screen coordinates. If your app uses relative mouse coordinates, you must make an API call to put the Full Force Feedback in relative mode. Use the following method call after initializing the mouse:
pImmMouse->UsesWin32MouseServices(FALSE);
All Tactile Feedback mice operate in the same manner as non-tactile feedback mice, always reporting position in relative coordinates.
 
Full Force Feedback
  Logitech Wingman Force and caching
The Wingman Force joystick may have problems if you create more than 10 effects. The problems may manifest themselves in several ways including effects playing with incorrect parameters, parameters changing randomly, and/or effects not playing at all. To avoid these problems, do not initialize more than 10 effects at a time if this stick is attached. The problem has to do with telling the driver to swap effects in and out of device memory (done by IFC's effect caching mechanism). There are several techniques you can employ to avoid the problem. The first is to simply not create more than 10 effects if you detect a Wingman Force stick is attached. A second possibility is to create your own effect caching scheme. When the 11th effect needs to be initialized, destroy on of the effects that already been created. To destroy a compound effect, call CImmProject::DestroyEffect (not documented, find it's prototype in ImmProject.h). A third technique would be to cache the parameters of the effects. This way you could create exactly 10 effects when the app starts. When you need to play an effect, change the parameters of one of these effects and start it up. This method has TONS of extra considerations� In either caching scheme, you may find the GetIsPlaying method helpful in deciding which effect do delete.

NOTE: On the Wingman Force stick, there is a brief amount of time after calling Start on an effect before the effect actually begins playing. During this time (about 10 - 20 ms) GetIsPlaying will return FALSE.

This type of input device can push or pull on your hand or resist movement

In general, effects such as springs, slow periodics and vector forces are very compelling on these types of devices. High frequency periodics are often less compelling due to the size of the devices.

The Gravis Xterminator Force gamepad does a great job with high frequency periodics and springs. Vector forces, however, can easily get lost.

 
Tactile Feedback
  In a tactile feedback mouse the motor wiggles up and down, which makes it good for periodics and textures

The Logitech iFeel Mouse plays 1 effect at a time. If you start 2 or more effects, the driver will use the magnitude of the effect and other parameters to determine which to play at any given time. You can create up to 128 effects. If you have two periodics, one with a frequency greater than 10 Hz and another less than 10 Hz, the fast one will be played in the "dead time" between the edges of the slow one. All periodics are interpreted as square waves. Enclosures, springs and grids are supported, but only periodics and textures are recommended.

All others (Orbit3D, Saitek's mouse�) can play several effects simultaneously .If 2 or more effects are started at the same time, they will be mixed in firmware. If you create more than the maximum allowed effects, IFC will cache the extra, giving you an unlimited number. All waveforms are supported, so you can get stronger sensations with a square wave, softer with sine. Only periodics and textures are supported.

Be aware or resonant frequencies when designing effects for tactile feedback mouse.

 
Rumble Feedback
  This type of device consists of 1 or 2 spinning motors� The motors in these devices take time to "rev up". The amount of time it takes is different for each manufacturer.

For devices with 2 motors, one is usually larger and heavier than the other. The heavier motor has a stronger vibration and takes longer to spin up.

These motors also take time to spin down.

The driver uses an algorithm to determine which motor to use. Each manufacturer does this differently.

Logitech's Wingman Rumble Pad maps the x-axis to the large motor and the y-axis to the small one. This gives the programmer the decision of which motor to play an effect on.

The Gravis Aftershock determines which motor to use based on other unknown things.

The Gravis Aftershock also seems to impose a minimum duration that is somehow related to the amount of time needed to get the motors up to speed. For example, a 100ms vibration and a 500ms vibration feel exactly the same. Due to the above problem, short "tap" effects are not possible.

On devices where you have control of which motor to use, play the shorter duration and high frequency effects on the small motor and larger less accurate effects on the large motor.


Corporate Home | Corporate | Solutions | Products | Corporate Contact | Legal | Privacy


© 2003 Immersion Corporation.
Immersion, the Immersion Logo and TouchSense are trademarks of Immersion Corporation.
All other trademarks are the property of their respective owners.
All rights reserved.