This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.InputGamePad Class

The InputGamePad class represents a game pad and contains a set of functions for handling user inputs.

InputGamePad Class

Enums

BUTTON#

Buttons of the game pad.
NameDescription
A = 0Button A.
B = 1Button B.
X = 2Button X.
Y = 3Button Y.
BACK = 4Button "Back".
START = 5Button "Start".
DPAD_UP = 6Button "Up".
DPAD_DOWN = 7Button "Down".
DPAD_LEFT = 8Button "Left".
DPAD_RIGHT = 9Button "Right".
THUMB_LEFT = 10Left thumbstick button.
THUMB_RIGHT = 11Right thumbstick button.
SHOULDER_LEFT = 12Left shoulder (bumper) button.
SHOULDER_RIGHT = 13Right shoulder (bumper) button.
NUM_BUTTONS = 14Number of buttons on a game pad.

AXIS#

NameDescription
LEFT_X = 0X axis of the left stick.
LEFT_Y = 1Y axis of the left stick.
RIGHT_X = 2X axis of the right stick.
RIGHT_Y = 3Y axis of the right stick.
LEFT_TRIGGER = 4Left trigger.
RIGHT_TRIGGER = 5Right trigger.
NUM_AXES = 6Number of axes on a game pad.

MODEL_TYPE#

NameDescription
UNKNOWN = 0Unknown model.
XBOX_360 = 1Xbox 360.
XBOX_ONE = 2Xbox One.
PS3 = 3PlayStation 3.
PS4 = 4PlayStation 4.
PS5 = 5PlayStation 5.

Properties

float TriggerRightDelta#

The delta value of the right trigger — the difference between the values in the previous and the current frame.

float TriggerRight#

The axis state value (the position) of the right trigger. 0 means the trigger is not pressed; 1 means the trigger is pressed to the maximum.

float TriggerLeftDelta#

The delta value of the left trigger — the difference between the values in the previous and the current frame.

float TriggerLeft#

The axis state value (the position) of the left trigger. 0 means the trigger is not pressed; 1 means the trigger is pressed to the maximum.

vec2 AxesRightDelta#

The vector of delta values of the right thumbstick axes — the difference between the values in the previous and the current frames.

vec2 AxesRight#

The vector of axes of the right thumbstick. when a thumbstick is in the center position, this value is [0,0]. The values correspond to the following thumbstick positions:
  • First value corresponds to the X axis. Negative values indicate the left position; positive values indicate right.
  • Second value corresponds to the Y axis. Negative values indicate the down position; positive values indicate up.

vec2 AxesLeftDelta#

The vector of delta values of the left thumbstick axes — the difference between the values in the previous and the current frames.

vec2 AxesLeft#

The vector of axes of the left thumbstick. when a thumbstick is in the center position, this value is [0,0]. The values correspond to the following thumbstick positions:
  • First value corresponds to the X axis. Negative values indicate the left position; positive values indicate right.
  • Second value corresponds to the Y axis. Negative values indicate the down position; positive values indicate up.

float Filter#

The filter value used to correct the current state of the analog axis (thumbsticks and triggers) relative to the previous one:
  • Filter value of 0 means there is no interpolation and the current value is not corrected.
  • Filter value of 1 means the previous state is used instead of the current one.

string Name#

The user-friendly name of the game pad.

int Number#

The game pad number (up to four game pads are supported).

bool IsAvailable#

The value indicating if the game pad is available.

InputGamePad.MODEL_TYPE ModelType#

The game pad model type identifier.

Input.DEVICE_TYPE DeviceType#

The device type. One of the Input.DEVICE_TYPE_* values indicating whether it is a wheel, throttle, or other device.

int PlayerIndex#

The index of player for the gamepad. Some devices support connection of multiple players (e.g., XBox 360 supports up to four players connected through XBox 360 gamepads).

Members


void SetVibration ( float low_frequency, float high_frequency, float duration_ms = 100.0f ) #

Sets the amount of vibration for the right (high-frequency) and left (low-frequency) motors for the time period specified in milliseconds.

Arguments

  • float low_frequency - Vibration value in the [0.0f; 1.0f] range for the left (low-frequency) motor.
  • float high_frequency - Vibration value in the [0.0f; 1.0f] range for the right (high-frequency) motor.
  • float duration_ms - Vibration period duration, in milliseconds.

bool IsButtonPressed ( InputGamePad.BUTTON button ) #

Returns a value indicating if the given button is pressed.

Arguments

Return value

true if the button is pressed; otherwise, false.

bool IsButtonDown ( InputGamePad.BUTTON button ) #

Returns a value indicating if the given button was pressed during the current frame.

Arguments

Return value

true if the button was pressed during the current frame; otherwise, false.

bool IsButtonUp ( InputGamePad.BUTTON button ) #

Returns a value indicating if the given button was released during the current frame.

Arguments

Return value

true if the button was released during the current frame; otherwise, false.
Last update: 2022-12-14
Build: ()