This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
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
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.ControlsSixAxis Class

Inherits: Controls

ControlsSixAxis Class

Properties

float Filter#

A filter value used to correct the current state of the analog axis of the sixaxis controller 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 sticks of the Sixaxis controller relative to the previous one. Axis states are interpolated for analog sticks.
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 sixaxis controller.

bool IsAvailable#

Checks if the Sixaxis controller is available.

int Number#

The number of sixaxis controllers.

bool IsStateEvent#

A value indicating if a sixaxis controller button is successfully assigned to a state.

float SensorG#

A state value of the g-sensor.

float SensorZ#

A state value of the of the controller position along the z axis.

float SensorY#

A state value of the of the controller position along the y axis.

float SensorX#

A state value of the of the controller position along the x axis.

float PressSquare#

A state value of the square button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressCross#

A state value of the cross button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressCircle#

A state value of the circle button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressTriangle#

A state value of the triangle button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressRight#

A state value of the right button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressLeft#

A state value of the left button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressDown#

A state value of the down button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressUp#

A state value of the up button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressR2#

A state value of the r2 button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressL2#

A state value of the l2 button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressR1#

A state value of the r1 button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float PressL1#

A state value of the l1 button. 0 value means the button is not pressed; 1 means the button is pressed to the maximum.

float RightY#

A state value of the right analog stick along the y-axis. when the stick is in the center position, this value is zero. negative values indicate down ; positive values indicate up.

float RightX#

A state value of the right analog stick along the x-axis. when the stick is in the center position, this value is zero. negative values indicate left ; positive values indicate right.

float LeftY#

A state value of the left analog stick along the y-axis. when the stick is in the center position, this value is zero. negative values indicate down ; positive values indicate up.

float LeftX#

A state value of the left analog stick along the x-axis. when the stick is in the center position, this value is zero. negative values indicate left ; positive values indicate right.

Members


static ControlsSixAxis ( int num ) #

Constructor. Creates a new Sixaxis controller.

Arguments

  • int num - Sixaxis controller number.

int GetButton ( int button ) #

Returns a button state (pressed or not pressed).

Arguments

  • int button - Button number.

Return value

1 if the button is pressed; otherwise, 0.

void SetLargeMotor ( float speed ) #

Sets the amount of vibration for the large motor.

Arguments

  • float speed - Speed of motor rotation in range [0; 1]

void SetSmallMotor ( float speed ) #

Sets the amount of vibration for the small motor.

Arguments

  • float speed - Speed of motor rotation in range [0; 1]

void SetStateButton ( int state, int button ) #

Sets a Sixaxis controller button that switches a given state on and off.

Arguments

  • int state - State (one of the CONTROLS_STATE_* variables).
  • int button - Button that switches the state (one of the BUTTON_* variables).

int GetStateButton ( int state ) #

Returns a Sixaxis controller button that switches a given state on and off.

Arguments

Return value

Button that switches the state (one of the BUTTON_* variables)

void GetStateEvent ( int state ) #

Lets the user assign a Sixaxis controller button to a given state.

Arguments

  • int state - State (one of the CONTROLS_STATE_*) to which a button is going to be assigned.

string GetStateName ( int state ) #

Returns the name of a given state.

Arguments

int ClearButton ( int button ) #

Returns a button state and clears it to 0 (not pressed).

Arguments

  • int button - Button that switches the state (one of the BUTTON_* variables)

Return value

1 if the button is pressed, and this function was not called previously in the current frame; otherwise, 0.

bool RestoreState ( Stream stream ) #

Restores Sixaxis controller settings from the stream.

Arguments

  • Stream stream - The stream to save controls data.

Return value

true if the Sixaxis controller settings are restored successfully; otherwise, false.

bool SaveState ( Stream stream ) #

Saves Sixaxis controller settings into the stream.

Arguments

  • Stream stream - The stream to save controls data.

Return value

true if the Sixaxis controller settings are saved successfully; otherwise, false.

int UpdateEvents ( ) #

Scans Sixaxis controller (synchronizes states of controller buttons with the controller). Should be called each frame

Return value

0 if a game pad is not found or updateEvents() already has been called for the frame; otherwise 1.
Last update: 2020-09-23
Build: ()