| Virtual Reality Toolbox™ | ![]() |
Virtual Reality Toolbox

The Joystick Input block provides a convenient interaction between a Simulink model and the virtual world associated with a Virtual Reality Toolbox block.
The Joystick Input block uses axes, buttons, and the point-of-view selector, if present. You can use this block as you would use any other Simulink source block. Its output ports reflect the status of the joystick controls for axes and buttons.
The Joystick Input block also supports force-feedback devices.
When building a model using Real-Time Windows Target, the RTWin Joystick Input driver should be used instead of the Joystick Input block.

Joystick ID — The system ID assigned to the given joystick device. You can find the properties of the joystick connected to the system in the Game Controllers section of the system Control Panel.
Adjust I/O ports according to joystick capabilities — If you select this check box, the block ports do not have the full width provided by the Windows Game Controllers interface. Instead, the Virtual Reality Toolbox software dynamically adjusts the ports to correspond to the capabilities of the connected joystick each time the model is opened. If the connected device does not have force-feedback capability, selecting this check box causes the removal of the force-feedback input from the block, even if the Enable force-feedback input check box is selected.
Enable force-feedback input — If you select this check box, the Virtual Reality Toolbox software can support force-feedback joystick, steering wheel, and haptic (one that enables tactile feedback) devices. To use this feature, you must install DirectX® Version 8.0 or later.
Output Ports — Depending on the Adjust I/O ports according to joystick capabilities check box setting previously described, output ports either have fixed maximum width provided by the system Game Controllers interface or the output ports change to correspond to the actual capabilities of the connected joystick.
| Output Port | Value | Description |
|---|---|---|
Axes | Vector of doubles in the range < -1; 1 > | Outputs correspond to the current position of the joystick in the given axis. Values are normalized to the range from -1 to 1. |
Buttons | Vector of doubles | Outputs correspond to the current status of joystick buttons. |
Point of view | -1 — Selector inactive | Output corresponds to the current status of the joystick point-of-view selector. |
| Input Port | Value | Description |
|---|---|---|
Force | Vector of doubles | Port active only for force-feedback devices. Inputs correspond
to the desired force to be applied in the given axis. Usually not all of the device axes have force-feedback. The size of the Force vector is then smaller than the Axes vector size. |
![]() | Cross Product | Normalize Vector | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |