|
FhSim
3.1.0
Marine systems simulation
|
Collaboration diagram for Generic gamepad input:Reads every joystick attached, through SDL (visualization builds only; without visualization the outputs stay zero). It opens the joysticks in RenderInit and polls them in RenderUpdate. Without a joystick it logs a warning and the outputs stay zero.
Mapping from OIS (until 3.0.0) to SDL. The SDL indices are the OIS indices (JoystickInput.h):
| Output | OIS | SDL |
|---|---|---|
| XAxis | axis 0 / MAX_AXIS, x Inv. | SDL_JoystickGetAxis(0) / 32767, x Inv. |
| YAxis | axis 1 / MAX_AXIS | SDL_JoystickGetAxis(1) / 32767 |
| XAxisrotation | axis 2 / MAX_AXIS, x Inv. | SDL_JoystickGetAxis(2) / 32767, x Inv. |
| YAxisrotation | axis 3 / MAX_AXIS | SDL_JoystickGetAxis(3) / 32767 |
| ZAxis | axis 4 / MAX_AXIS | SDL_JoystickGetAxis(4) / 32767 |
| Button1 to Button10 | buttons 0 to 9 | SDL_JoystickGetButton(0 to 9) |
| POVVertical/POVHorizontal | any POV | any hat (SDL_JoystickGetHat) |
"x Inv." is x -1 when InvertVertical is true. Other axes, and buttons from 10 on, are ignored. StickyButtons toggles a button output on each press. POVVertical/POVHorizontal: North (SDL_HAT_UP) 1/0, NorthEast (SDL_HAT_RIGHTUP) 1/1, East (SDL_HAT_RIGHT) 0/1, SouthEast (SDL_HAT_RIGHTDOWN) -1/1, South (SDL_HAT_DOWN) -1/0, SouthWest (SDL_HAT_LEFTDOWN) -1/-1, West (SDL_HAT_LEFT) 0/-1, NorthWest (SDL_HAT_LEFTUP) 1/-1, Centered 0/0.
Values are the axis values from -1 to 1 (see the table above), button values are 0 or 1.
| Name | Width | Description |
|---|---|---|
| XAxis | 1 | Vertical left analog stick |
| YAxis | 1 | Horizontal left analog stick |
| ZAxis | 1 | L2/R2 |
| XAxisrotation | 1 | Vertical right analog stick |
| YAxisrotation | 1 | Horizontal right analog stick |
| XIntAxis | 1 | Time integral of XAxis |
| YIntAxis | 1 | Time integral of YAxis |
| ZIntAxis | 1 | Time integral of ZAxis |
| XIntAxisrotation | 1 | Time integral of XAxisrotation |
| YIntAxisrotation | 1 | Time integral of YAxisrotation |
| Button1 | 1 | Cross |
| Button2 | 1 | Circle |
| Button3 | 1 | Square |
| Button4 | 1 | Triangle |
| Button5 | 1 | L1 |
| Button6 | 1 | R1 |
| Button7 | 1 | Select |
| Button8 | 1 | Start |
| Button9 | 1 | Left analog button |
| Button10 | 1 | Right analog button |
| POVHorizontal | 1 | Horizontal direction pad |
| POVVertical | 1 | Vertical direction pad |
| POVIntHorizontal | 1 | Time integral of POVHorizontal |
| POVIntVertical | 1 | Time integral of POVVertical |
| AxisVector | 3 | XAxis, YAxis and ZAxis |
| RotationVector | 2 | XAxisrotation and YAxisrotation |
| ButtonVector | 10 | Button1 to Button10 |
| Name | Width | Description |
|---|---|---|
| StickyButtons | 1 | Toggle a button output on each press. Default false |
| InvertVertical | 1 | Multiply XAxis and XAxisrotation by -1. Default false |
The integral outputs read these states; the object has no input ports.
| Name | Width | Description |
|---|---|---|
| Xaxis | 1 | Integral of XAxis. Initial value 0 |
| Yaxis | 1 | Integral of YAxis. Initial value 0 |
| Zaxis | 1 | Integral of ZAxis. Initial value 0 |
| rotXaxis | 1 | Integral of XAxisrotation. Initial value 0 |
| rotYaxis | 1 | Integral of YAxisrotation. Initial value 0 |
| povVertical | 1 | Integral of POVVertical. Initial value 0 |
| povHorizontal | 1 | Integral of POVHorizontal. Initial value 0 |