This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
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
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine.InputGamePad Class

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

InputGamePad Class

Перечисления (Enums)

MODEL_TYPE#

ИмяОписание
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 gamepad.

int Number#

The gamepad number.

bool IsAvailable#

The value indicating if the gamepad is available.

InputGamePad.MODEL_TYPE ModelType#

The gamepad model type identifier.

Input.DEVICE DeviceType#

The device type. One of the Input.DEVICE_* 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).

int NumTouches#

The total number of the gamepad touch panels.

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 ( Input.GAMEPAD_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 ( Input.GAMEPAD_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 ( Input.GAMEPAD_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.

InputEventPadButton GetButtonEvent ( Input.GAMEPAD_BUTTON button ) #

Returns the currently processed gamepad button input event.

Arguments

Return value

Gamepad button input event, or null if there are no events for the specified gamepad button in the current frame.

int GetButtonEvents ( Input.GAMEPAD_BUTTON button, InputEventPadButton[] OUT_events ) #

Returns the number of input events for the specified gamepad button and puts the events to the specified output buffer.

Arguments

Return value

Number of input events for the specified gamepad button.

int GetNumTouches ( ) #

Returns the total number of the gamepad touch panels.

Return value

The total number of the gamepad touch panels.

int GetNumTouchFingers ( int touch ) #

Returns the total number of the fingers supported by the specified gamepad touch panel.

Arguments

  • int touch - The index of the gamepad touch panel, the number from 0 to the total number of touch panels.

Return value

The total number of the fingers supported by the gamepad touch panel.

bool IsTouchPressed ( int touch, int finger ) #

Returns the value indicating if the given touch panel has been pressed.

Arguments

  • int touch - The index of the gamepad touch panel, the number from 0 to the total number of touch panels.
  • int finger - The index of the finger, the number from 0 to the total number of supported fingers.

Return value

true if the touch panel is pressed, otherwise false.

bool IsTouchDown ( int touch, int finger ) #

Returns a value indicating if the given touch panel has been touched during the current frame.

Arguments

  • int touch - The index of the gamepad touch panel, the number from 0 to the total number of touch panels.
  • int finger - The index of the finger, the number from 0 to the total number of supported fingers.

Return value

true if the touch panel has been touched during the current frame, otherwise false.

bool IsTouchUp ( int touch, int finger ) #

Returns a value indicating if the given touch panel has been released during the current frame.

Arguments

  • int touch - The index of the gamepad touch panel, the number from 0 to the total number of touch panels.
  • int finger - The index of the finger, the number from 0 to the total number of supported fingers.

Return value

true if the touch panel has been released during the current frame, otherwise false.

vec2 GetTouchPosition ( int touch, int finger ) #

Returns the normalized position of the touch along the axes.

Arguments

  • int touch - The index of the gamepad touch panel, the number from 0 to the total number of touch panels.
  • int finger - The index of the finger, the number from 0 to the total number of supported fingers.

Return value

The normalized position of the touch along the axes from (0,0) to (1,1).

vec2 GetTouchDelta ( int touch, int finger ) #

Returns the delta of the touch position from the previous event.

Arguments

  • int touch - The index of the gamepad touch panel, the number from 0 to the total number of touch panels.
  • int finger - The index of the finger, the number from 0 to the total number of supported fingers.

Return value

The delta of the touch position from the previous event.

float GetTouchPressure ( int touch, int finger ) #

Returns the pressure with which the finger is currently pressed against the touch panel.

Arguments

  • int touch - The index of the gamepad touch panel, the number from 0 to the total number of touch panels.
  • int finger - The index of the finger, the number from 0 to the total number of supported fingers.

Return value

The pressure with which the finger is currently pressed, a value from 0 (not pressed) to 1 (fully pressed).
Last update: 19.04.2024
Build: ()