Drag[en]gine Script Module DragonScript 1.32.1
Loading...
Searching...
No Matches
Dragengine.Commands.Binding Class Reference

Binding of command to input event on device. More...

Inheritance diagram for Dragengine.Commands.Binding:

Public Member Functions

bool equals (Object other)
 Bindings are equal.
 
Command getCommand ()
 Bound command.
 
float getDeadzone ()
 Deadzone as percentage of range (0..1).
 
String getDeviceID ()
 Input device identifier.
 
int getDeviceIndex ()
 Device index or -1 if not set.
 
InputDevice getInputDevice ()
 Device or null if not set.
 
InputDeviceAxis getInputDeviceAxis ()
 Device axis or null if not set.
 
InputDeviceButton getInputDeviceButton ()
 Device button or null if not set.
 
InputDeviceFeedback getInputDeviceFeedback ()
 Device feedback or null if not set.
 
bool getInverseAxis ()
 Inverse axis.
 
float getLinearity ()
 Linearity of input.
 
bool getSimulateAxisPressed ()
 Axis pressed simulation state.
 
String getSourceID ()
 Axis or button identifier.
 
int getSourceIndex ()
 Source index or -1 if not set.
 
InputEventSource getSystem ()
 System or null if not set.
 
bool getVRHandFacingUser ()
 VR hand has to face user.
 
float mapAxisValue (float value)
 Map axis value using deadzone and linearity.
 
Binding new (Binding binding)
 Create copy of binding.
 
Binding new (Binding binding, Command command)
 Create copy of binding with different command.
 
Binding new (String deviceID, String sourceID, Command command)
 Create binding.
 
Binding new (String deviceID, String sourceID, Command command, bool inverseAxis)
 Create binding.
 
void setDeadzone (float deadzone)
 Set deadzone as percentage of range (0..1).
 
void setDeviceIndex (int index)
 Set device index or -1 if not set.
 
void setInverseAxis (bool inverseAxis)
 Set inverse axis.
 
void setLinearity (float linearity)
 Set linearity of input.
 
void setSimulateAxisPressed (bool pressed)
 Set axis pressed simulation state.
 
void setSourceIndex (int index)
 Set source index or -1 if not set.
 
void setSystem (InputEventSource system)
 Set system or null if not set.
 
void setVRHandFacingUser (bool facingUser)
 Set VR hand has to face user.
 

Public Attributes

Command pCommand
 
float pDeadzone
 
String pDeviceID
 
int pDeviceIndex
 
bool pInverseAxis
 
InputEventSource pSystem
 

Detailed Description

Binding of command to input event on device.

Bindings are identified by device and either axis or button identifier. For quicker access the device and button index are used.

Member Function Documentation

◆ equals()

bool Dragengine.Commands.Binding.equals ( Object  other)

Bindings are equal.

◆ getCommand()

Command Dragengine.Commands.Binding.getCommand ( )

Bound command.

◆ getDeadzone()

float Dragengine.Commands.Binding.getDeadzone ( )

Deadzone as percentage of range (0..1).

Version
1.28

For use with absolute axis input in the range from -1 to 1 or 0 to 1.

◆ getDeviceID()

String Dragengine.Commands.Binding.getDeviceID ( )

Input device identifier.

◆ getDeviceIndex()

int Dragengine.Commands.Binding.getDeviceIndex ( )

Device index or -1 if not set.

◆ getInputDevice()

InputDevice Dragengine.Commands.Binding.getInputDevice ( )

Device or null if not set.

Version
1.6

◆ getInputDeviceAxis()

InputDeviceAxis Dragengine.Commands.Binding.getInputDeviceAxis ( )

Device axis or null if not set.

Version
1.6

◆ getInputDeviceButton()

InputDeviceButton Dragengine.Commands.Binding.getInputDeviceButton ( )

Device button or null if not set.

Version
1.6

◆ getInputDeviceFeedback()

InputDeviceFeedback Dragengine.Commands.Binding.getInputDeviceFeedback ( )

Device feedback or null if not set.

Version
1.6

◆ getInverseAxis()

bool Dragengine.Commands.Binding.getInverseAxis ( )

Inverse axis.

◆ getLinearity()

float Dragengine.Commands.Binding.getLinearity ( )

Linearity of input.

Version
1.28

Value of 0 is linear input. Values up to 1 map larger input range to small movement. Values down to -1 map larger input range to larger movement. 0 is the default.

Linearity is calculated like this:

Linearity Mapped value (x=input)
0 x
1/3 pow(x, 2)
2/3 pow(x, 4)
1 pow(x, 8)
-1/3 pow(x, 1/2)
-2/3 pow(x, 1/4)
-1 pow(x, 1/8)

For use with absolute axis input in the range from -1 to 1 or 0 to 1.

◆ getSimulateAxisPressed()

bool Dragengine.Commands.Binding.getSimulateAxisPressed ( )

Axis pressed simulation state.

◆ getSourceID()

String Dragengine.Commands.Binding.getSourceID ( )

Axis or button identifier.

◆ getSourceIndex()

int Dragengine.Commands.Binding.getSourceIndex ( )

Source index or -1 if not set.

◆ getSystem()

InputEventSource Dragengine.Commands.Binding.getSystem ( )

System or null if not set.

Version
1.6

◆ getVRHandFacingUser()

bool Dragengine.Commands.Binding.getVRHandFacingUser ( )

VR hand has to face user.

Version
1.28

◆ mapAxisValue()

float Dragengine.Commands.Binding.mapAxisValue ( float  value)

Map axis value using deadzone and linearity.

Version
1.28
Parameters
valueValue in the range from -1 to 1.
Returns
Mapped value in the range from -1 to 1.

For use with absolute axis input in the range from -1 to 1 or 0 to 1.

◆ new() [1/4]

Binding Dragengine.Commands.Binding.new ( Binding  binding)

Create copy of binding.

◆ new() [2/4]

Binding Dragengine.Commands.Binding.new ( Binding  binding,
Command  command 
)

Create copy of binding with different command.

◆ new() [3/4]

Binding Dragengine.Commands.Binding.new ( String  deviceID,
String  sourceID,
Command  command 
)

Create binding.

Version
1.28

◆ new() [4/4]

Binding Dragengine.Commands.Binding.new ( String  deviceID,
String  sourceID,
Command  command,
bool  inverseAxis 
)

Create binding.

◆ setDeadzone()

void Dragengine.Commands.Binding.setDeadzone ( float  deadzone)

Set deadzone as percentage of range (0..1).

Version
1.28

For use with absolute axis input in the range from -1 to 1 or 0 to 1.

◆ setDeviceIndex()

void Dragengine.Commands.Binding.setDeviceIndex ( int  index)

Set device index or -1 if not set.

◆ setInverseAxis()

void Dragengine.Commands.Binding.setInverseAxis ( bool  inverseAxis)

Set inverse axis.

Version
1.28

◆ setLinearity()

void Dragengine.Commands.Binding.setLinearity ( float  linearity)

Set linearity of input.

Version
1.28
See also
#getLinearity()

For use with absolute axis input in the range from -1 to 1 or 0 to 1.

◆ setSimulateAxisPressed()

void Dragengine.Commands.Binding.setSimulateAxisPressed ( bool  pressed)

Set axis pressed simulation state.

◆ setSourceIndex()

void Dragengine.Commands.Binding.setSourceIndex ( int  index)

Set source index or -1 if not set.

◆ setSystem()

void Dragengine.Commands.Binding.setSystem ( InputEventSource  system)

Set system or null if not set.

Version
1.6

◆ setVRHandFacingUser()

void Dragengine.Commands.Binding.setVRHandFacingUser ( bool  facingUser)

Set VR hand has to face user.

Version
1.28

Member Data Documentation

◆ pCommand

Command Dragengine.Commands.Binding.pCommand

◆ pDeadzone

float Dragengine.Commands.Binding.pDeadzone

◆ pDeviceID

String Dragengine.Commands.Binding.pDeviceID

◆ pDeviceIndex

int Dragengine.Commands.Binding.pDeviceIndex

◆ pInverseAxis

bool Dragengine.Commands.Binding.pInverseAxis

◆ pSystem

InputEventSource Dragengine.Commands.Binding.pSystem

The documentation for this class was generated from the following file: