Drag[en]gine Script Module DragonScript 1.35
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()

◆ getCommand()

Command Dragengine.Commands.Binding.getCommand ( )

Bound command.

References pCommand, and pDeviceID.

Referenced by getDeadzone().

◆ 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.

References getCommand(), getSourceID(), and pCommand.

Referenced by setLinearity().

◆ getDeviceID()

String Dragengine.Commands.Binding.getDeviceID ( )

Input device identifier.

References pInverseAxis.

Referenced by setVRHandFacingUser().

◆ getDeviceIndex()

int Dragengine.Commands.Binding.getDeviceIndex ( )

Device index or -1 if not set.

Referenced by equals().

◆ getInputDevice()

InputDevice Dragengine.Commands.Binding.getInputDevice ( )

Device or null if not set.

Version
1.6

Referenced by equals().

◆ getInputDeviceAxis()

InputDeviceAxis Dragengine.Commands.Binding.getInputDeviceAxis ( )

Device axis or null if not set.

Version
1.6

References setLinearity().

Referenced by equals().

◆ getInputDeviceButton()

InputDeviceButton Dragengine.Commands.Binding.getInputDeviceButton ( )

Device button or null if not set.

Version
1.6

Referenced by equals().

◆ getInputDeviceFeedback()

InputDeviceFeedback Dragengine.Commands.Binding.getInputDeviceFeedback ( )

Device feedback or null if not set.

Version
1.6

Referenced by equals().

◆ getInverseAxis()

bool Dragengine.Commands.Binding.getInverseAxis ( )

Inverse axis.

References pDeviceIndex, pInverseAxis, and pSystem.

Referenced by setDeadzone().

◆ 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.

References setVRHandFacingUser().

Referenced by setSourceIndex().

◆ getSimulateAxisPressed()

bool Dragengine.Commands.Binding.getSimulateAxisPressed ( )

Axis pressed simulation state.

Referenced by equals().

◆ getSourceID()

String Dragengine.Commands.Binding.getSourceID ( )

Axis or button identifier.

Referenced by getDeadzone().

◆ getSourceIndex()

int Dragengine.Commands.Binding.getSourceIndex ( )

Source index or -1 if not set.

Referenced by equals().

◆ getSystem()

InputEventSource Dragengine.Commands.Binding.getSystem ( )

System or null if not set.

Version
1.6

Referenced by equals().

◆ getVRHandFacingUser()

bool Dragengine.Commands.Binding.getVRHandFacingUser ( )

VR hand has to face user.

Version
1.28

References pCommand.

Referenced by setDeadzone().

◆ 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.

References pDeadzone, and setDeadzone().

Referenced by equals().

◆ new() [1/4]

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

Create copy of binding.

References pCommand, and pDeviceIndex.

◆ 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

References new().

Referenced by new().

◆ new() [4/4]

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

Create binding.

References pDeviceID.

◆ 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.

References getInverseAxis(), getVRHandFacingUser(), pInverseAxis, and setInverseAxis().

Referenced by mapAxisValue().

◆ setDeviceIndex()

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

Set device index or -1 if not set.

Referenced by equals().

◆ setInverseAxis()

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

Set inverse axis.

Version
1.28

References pDeadzone.

Referenced by setDeadzone().

◆ 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.

References getDeadzone(), and pDeadzone.

Referenced by getInputDeviceAxis().

◆ setSimulateAxisPressed()

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

Set axis pressed simulation state.

Referenced by equals().

◆ setSourceIndex()

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

Set source index or -1 if not set.

References getLinearity().

Referenced by equals().

◆ setSystem()

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

Set system or null if not set.

Version
1.6

Referenced by equals().

◆ setVRHandFacingUser()

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

Set VR hand has to face user.

Version
1.28

References getDeviceID(), and pDeviceID.

Referenced by getLinearity().

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

Referenced by equals(), getInverseAxis(), and new().

◆ pInverseAxis

bool Dragengine.Commands.Binding.pInverseAxis

◆ pSystem

InputEventSource Dragengine.Commands.Binding.pSystem

Referenced by equals(), and getInverseAxis().


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