API Migration
Major Changes#
- The ControlsXPad360 class has transformed into ControlsGamepad class.
- Removed the ControlsSixAxis class. Use ControlsGamepad instead.
- Added a new ControlsGamepad class.
- Added a new Ultraleap class.
- Added a new UltraleapDevice class.
- Added a new UltraleapBone class.
- Added a new UltraleapFinger class.
- Added a new UltraleapHand class.
- Added a new UltraleapArm class.
Breaking Changes#
Joystick and Gamepad Controls Changes#
Interaction is now implemented using SDL library. Joysticks and gamepads now work on Windows and Linux and support hot-plugging. So, you can connect your joystick or gamepad before or after creating an instance of the corresponding class.
You can now create multiple ControlsJoystick and ControlsGamepad having the same numbers. For both of these devices you can access device type (wheel, throttle, etc.) and model.
The ControlsXPad360 class has transformed into ControlsGamepad class, which is now responsible for all gamepads, so the ControlsSixAxis class has been removed.
The following updates were made to the ControlsGamepad class:
- Added new device types (wheel, throttle, etc.). See the DEVICE_TYPE_* enum and DeviceType.
- Added device model types (XBox 360, XBox One, PS3, etc.). See the MODEL_TYPE_* enum and ModelType.
- Some devices support connection of multiple players (e.g., XBox 360 supports up to four players connected through XBox 360 gamepads). Now you can get this index via PlayerIndex.
- Methods setLeftMotor() and setRightMotor() were removed. Vibration for low-frequency and high-frequency motors is now managed via the new setVibration() method enabling you to control vibration duration as well.
- The getName() now returns the user-friendly name of the gamepad, not the name of its type ("GamePad", "Wheel" etc.)
See the details for other affected classes:
AppVarjo Class#
Checksum Class#
Controls Class#
UNIGINE 2.15.1 | UNIGINE 2.16 |
---|---|
CONTROLS_SIX_AXIS | Removed. Use CONTROLS_GAMEPAD instead. |
CONTROLS_X_PAD360 | Removed. Use CONTROLS_GAMEPAD instead. |
New Functions
ControlsJoystick Class#
The following changes were made for this release:
- Joysticks now support hot-plugging. So, you can connect your joystick before or after create an instance of this class.
- Added new device types (wheel, throttle, etc.). See the DEVICE_TYPE_* enum and the DeviceType property.
- Some devices support connection of multiple players (e.g., XBox 360 supports up to four players connected through XBox 360 gamepads). Now you can get this index via the PlayerIndex property.
- Added an initial value for joystick axes (available via getAxisInitialValue(int) ).
- Added a new enum for the states of the POV (Point-of-View) switch or DPad (POV_*)
- Both GuidProduct and GuidInstance were removed. Now you should operate with Guid, Vendor, Product, and ProductVersion. The Guid is created on the basis of vendor and product identifiers and product version number. It enables you to identify device model (Controller XBox One, etc.), however, it will be the same for two identical models.
UNIGINE 2.15.1 | UNIGINE 2.16 |
---|---|
getGuidProduct( ) | Removed. |
getGuidInstance( ) | Removed. |
New Functions
- DEVICE_TYPE_UNKNOWN
- DEVICE_TYPE_GAME_CONTROLLER
- DEVICE_TYPE_WHEEL
- DEVICE_TYPE_ARCADE_STICK
- DEVICE_TYPE_FLIGHT_STICK
- DEVICE_TYPE_DANCE_PAD
- DEVICE_TYPE_GUITAR
- DEVICE_TYPE_DRUM_KIT
- DEVICE_TYPE_THROTTLE
- POV_NOT_PRESSED
- POV_UP
- POV_UP_RIGHT
- POV_RIGHT
- POV_DOWN_RIGHT
- POV_DOWN
- POV_DOWN_LEFT
- POV_LEFT
- POV_UP_LEFT
- getProductVersion( )
- getProduct( )
- getVendor( )
- getGuid( )
- getAxisInitialValue( int )
- getDeviceType( )
- getPlayerIndex( )
InputGamePad Class#
Description goes here2
UNIGINE 2.15.1 | UNIGINE 2.16 |
---|---|
setLeftMotor( float ) | Removed. Use setVibration( float, float, float ) instead. |
setRightMotor( float ) | Removed. Use setVibration( float, float, float ) instead. |