@@ -4,21 +4,21 @@ Retrieves the state of the position, rotation, buttons, sticks and triggers of t
44С++
55``` c
66DWORD GetControllersData (
7- __out TController *MyController ,
8- __out TController *MyController2
7+ __out TController *FirstController ,
8+ __out TController *SecondController
99);
1010```
1111
1212Delphi
1313``` pascal
1414function GetControllersData(
15- out myController, myController2 : TController
15+ out FirstController, SecondController : TController
1616): DWORD;
1717```
1818
1919#### Parameters
20- MyController [ out] - Pointer to an TController structure that receives the state of first controller.
21- MyController2 [ out] - Pointer to an TController structure that receives the state of second controller.
20+ FirstController [ out] - Pointer to an TController structure that receives the state of first controller.
21+ SecondController [ out] - Pointer to an TController structure that receives the state of second controller.
2222
2323#### Structure TController
2424C++
@@ -31,47 +31,51 @@ typedef struct _Controller
3131 double Yaw;
3232 double Pitch;
3333 double Roll;
34- WORD Buttons;
35- BYTE Trigger;
36- SHORT ThumbX ;
37- SHORT ThumbY ;
34+ unsigned short Buttons;
35+ float Trigger;
36+ float AxisX ;
37+ float AxisY ;
3838} TController, *PController;
3939```
4040
4141Delphi
4242``` pascal
43- PController = ^TController;
44- _Controller = record
45- X: double;
43+ PController = ^TController;
44+ _Controller = record
45+ X: double;
4646 Y: double;
4747 Z: double;
4848 Yaw: double;
4949 Pitch: double;
5050 Roll: double;
51- Buttons: dword ;
52- Trigger: byte ;
53- ThumbX: smallint ;
54- ThumbY: smallint ;
51+ Buttons: word ;
52+ Trigger: single ;
53+ AxisX: single ;
54+ AxisY: single ;
5555end;
56+ Controller = _Controller;
57+ TController = Controller;
5658```
5759
5860| Type | Description | Values |
5961| ------------- | ------------- | ------------- |
6062| X, Y, Z | Position tracking | 0.000 (in meters) |
6163| Yaw, Pitch, Roll | Rotation tracking | Between -180 and 180 (in degrees) |
62- | Trigger | Analog trigger | Between 0 and 255 |
63- | ThumbX | Thumbstick x-axis | Between -32768 and 32767 |
64- | ThumbX | Thumbstick y-axis | Between -32768 and 32767 |
64+ | Trigger | Analog trigger | Between 0 and 1 |
65+ | AxisX | Thumbstick x-axis | Between -1 and 1 |
66+ | AxisY | Thumbstick y-axis | Between -1 and 1 |
6567
6668#### Buttons
67- Bitmask of the buttons controllers. A set bit indicates that the corresponding button is pressed.
69+ Bitmask of the buttons controllers. Set bit indicates that the corresponding button is pressed.
6870
6971| Button | Bitmask |
7072| ------------- | ------------- |
71- | GRIPBTN | 0x0001 |
72- | THUMBSTICKBTN | 0x0002 |
73- | MENUBTN | 0x0004 |
74- | SYSTEMBTN | 0x0008 |
73+ | GRIP_BTN | 0x0001 |
74+ | THUMB_BTN | 0x0002 |
75+ | A_BTN | 0x0004 |
76+ | B_BTN | 0x0008 |
77+ | MENU_BTN | 0x0010 |
78+ | SYS_BTN | 0x0020 |
7579
7680#### Return value
77- If the controllers are connected and the function succeeded, the return value is 1 , otherwise 0 .
81+ If the controllers are connected and the function succeeded, the return value is 0 , otherwise 1 .
0 commit comments