This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine.InputGamePad Class

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

InputGamePad Class

Enums

BUTTON#

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.

Properties

float TriggerRightDelta#

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

float TriggerRight#

An 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#

An 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#

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

vec2 AxesRight#

A 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#

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

vec2 AxesLeft#

A 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#

A 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.
set
Sets a filter value used to correct the current state of the analog axis relative to the previous one. Axis states are interpolated for thumbsticks and triggers.
set value - Filter value for interpolation between axis states. The provided value is clamped to a range [0;1].
  • 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 name of the game pad.

int Number#

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

bool IsAvailable#

Checks if the game pad is available.

Members


void SetLeftMotor ( float speed ) #

Sets the amount of vibration for the left motor (a low-frequency motor).

Arguments

  • float speed - value in the [0.0f; 1.0f] range.

void SetRightMotor ( float speed ) #

Sets the amount of vibration for the right motor (a high-frequency motor).

Arguments

  • float speed - value in the [0.0f; 1.0f] range.

bool IsAvailable ( ) #

Checks if the game pad is available.

Return value

1 if the game pad is available; otherwise, 0.

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: 2020-11-24
Build: ()