|
Drag[en]gine Script Module DragonScript 1.35
|
Binding of command to input event on device. More...
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 |
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.
| bool Dragengine.Commands.Binding.equals | ( | Object | other | ) |
Bindings are equal.
References equals(), getDeviceIndex(), getInputDevice(), getInputDeviceAxis(), getInputDeviceButton(), getInputDeviceFeedback(), getSimulateAxisPressed(), getSourceIndex(), getSystem(), mapAxisValue(), pDeadzone, pDeviceID, pDeviceIndex, pInverseAxis, pSystem, setDeviceIndex(), setSimulateAxisPressed(), setSourceIndex(), and setSystem().
Referenced by equals().
| Command Dragengine.Commands.Binding.getCommand | ( | ) |
| float Dragengine.Commands.Binding.getDeadzone | ( | ) |
Deadzone as percentage of range (0..1).
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().
| String Dragengine.Commands.Binding.getDeviceID | ( | ) |
| int Dragengine.Commands.Binding.getDeviceIndex | ( | ) |
Device index or -1 if not set.
Referenced by equals().
| InputDevice Dragengine.Commands.Binding.getInputDevice | ( | ) |
| InputDeviceAxis Dragengine.Commands.Binding.getInputDeviceAxis | ( | ) |
| InputDeviceButton Dragengine.Commands.Binding.getInputDeviceButton | ( | ) |
| InputDeviceFeedback Dragengine.Commands.Binding.getInputDeviceFeedback | ( | ) |
| bool Dragengine.Commands.Binding.getInverseAxis | ( | ) |
| float Dragengine.Commands.Binding.getLinearity | ( | ) |
Linearity of input.
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().
| bool Dragengine.Commands.Binding.getSimulateAxisPressed | ( | ) |
Axis pressed simulation state.
Referenced by equals().
| String Dragengine.Commands.Binding.getSourceID | ( | ) |
Axis or button identifier.
Referenced by getDeadzone().
| int Dragengine.Commands.Binding.getSourceIndex | ( | ) |
Source index or -1 if not set.
Referenced by equals().
| InputEventSource Dragengine.Commands.Binding.getSystem | ( | ) |
| bool Dragengine.Commands.Binding.getVRHandFacingUser | ( | ) |
| float Dragengine.Commands.Binding.mapAxisValue | ( | float | value | ) |
Map axis value using deadzone and linearity.
| value | 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().
Create copy of binding.
References pCommand, and pDeviceIndex.
Create copy of binding with different command.
| Binding Dragengine.Commands.Binding.new | ( | String | deviceID, |
| String | sourceID, | ||
| Command | command, | ||
| bool | inverseAxis ) |
Create binding.
References pDeviceID.
| void Dragengine.Commands.Binding.setDeadzone | ( | float | deadzone | ) |
Set deadzone as percentage of range (0..1).
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().
| void Dragengine.Commands.Binding.setDeviceIndex | ( | int | index | ) |
Set device index or -1 if not set.
Referenced by equals().
| void Dragengine.Commands.Binding.setInverseAxis | ( | bool | inverseAxis | ) |
| void Dragengine.Commands.Binding.setLinearity | ( | float | linearity | ) |
Set linearity of input.
For use with absolute axis input in the range from -1 to 1 or 0 to 1.
References getDeadzone(), and pDeadzone.
Referenced by getInputDeviceAxis().
| void Dragengine.Commands.Binding.setSimulateAxisPressed | ( | bool | pressed | ) |
Set axis pressed simulation state.
Referenced by equals().
| void Dragengine.Commands.Binding.setSourceIndex | ( | int | index | ) |
| void Dragengine.Commands.Binding.setSystem | ( | InputEventSource | system | ) |
| void Dragengine.Commands.Binding.setVRHandFacingUser | ( | bool | facingUser | ) |
Set VR hand has to face user.
References getDeviceID(), and pDeviceID.
Referenced by getLinearity().
| Command Dragengine.Commands.Binding.pCommand |
Referenced by getCommand(), getDeadzone(), getVRHandFacingUser(), and new().
| float Dragengine.Commands.Binding.pDeadzone |
Referenced by equals(), mapAxisValue(), setInverseAxis(), and setLinearity().
| String Dragengine.Commands.Binding.pDeviceID |
Referenced by equals(), getCommand(), new(), and setVRHandFacingUser().
| int Dragengine.Commands.Binding.pDeviceIndex |
Referenced by equals(), getInverseAxis(), and new().
| bool Dragengine.Commands.Binding.pInverseAxis |
Referenced by equals(), getDeviceID(), getInverseAxis(), and setDeadzone().
| InputEventSource Dragengine.Commands.Binding.pSystem |
Referenced by equals(), and getInverseAxis().